HotDocs.Server.AssemblyCollection Class
An AssemblyCollection represents a group of Assembly objects (templates) that HotDocs Server is either waiting to assemble, or has already assembled. In desktop HotDocs, this object would be analogous to the assembly queue. Using this object, your application can first add any number of templates to the queue and then let HotDocs Server assemble each document in turn.
The AssemblyCollection is used by Session.Assemblies, Session.CompletedAssemblies, and Assembly.PendingAssemblies.
Namespace: HotDocs.Server
Assembly: HotDocs.Server in HotDocs.Server.dll
This class implements the following interfaces:
-
IDisposable: The class can be disposed.
-
IList: The class is a list of Assembly objects.
Methods
Method | Description |
Add | This method adds a new Assembly to the AssemblyCollection. |
AddNew | This method adds a new Assembly object to the AssemblyCollection. |
Clear | This method removes all assemblies from the AssemblyCollection. |
Contains | This method determines whether or not the AssemblyCollection contains a specific Assembly. |
CopyTo | Copies the elements of the AssemblyCollection to an Array, starting at a particular index. |
Dispose | This method is an implementation of the IDisposable.Dispose method that releases unmanaged resources held by an instance of the AssemblyCollection class. |
FromStringCollection | Add a list of assemblies to the AssemblyCollection. |
GetEnumerator | This method returns an enumerator that iterates through the AssemblyCollection. |
IndexOf | This method determines the index of a specific Assembly in the AssemblyCollection. |
Insert | This method inserts an Assembly to the AssemblyCollection at the specified index. |
Remove | This method removes the first occurrence of a specific Assembly from the AssemblyCollection. |
RemoveAt | This method removes the Assembly at the specified index. |
ToStringCollection | Get the list of assemblies as a list of template paths. |
Properties
Property | Description |
Count | [Read-only] This property returns the number of Assembly objects in the collection. |
Item | This property returns the specified Assembly from the AssemblyCollection. |
Example
This is some sample code from a disposition page. The document has been assembled and the page is going to show or hide some user interface telling the user that there are additional assemblies left to do.
// numberOfAssemblies needs to take into account any assemblies that are going to be added because of // ASSEMBLE instructions in the template just finished. These assemblies are stored in Assembly.PendingAssemblies // until Assemby.Completed = true, at which time they are moved to Session.Assemblies. long numberOfAssemblies = _session.Assemblies.Count + _session.CurrentAssembly.PendingAssemblies.Count; if(numberOfAssemblies > 1) { pnlNextAsm.Visible = true; // pnlNextAsm is the panel that shows the assembly queue message lblContinue.Text = String.Format("You have completed {0} of {1} interviews required for this document set. There {2} {3} follow-up interview{4} still to be done. Click here to proceed to the next interview.", _session.CompletedAssemblies.Count + 1, numberOfAssemblies + _session.CompletedAssemblies.Count, ((numberOfAssemblies - 1) == 1) ? "is" : "are", (numberOfAssemblies - 1).ToString(), ((numberOfAssemblies - 1) == 1) ? "" : "s"); } else pnlNextAsm.Visible = false;