combit List & Label 25 - .NET Online Web Help
CopyFrom Method (DomCollectionBase)
Example 


combit.ListLabel25.Dom Namespace > DomCollectionBase Class : CopyFrom Method
Source collection.
Copies all cloneable objects from one collection to another. If the target collection contains some items already, they will be removed first. Make sure to call ResetInformation on the modified project in order to rebuild the object model afterwards.
Syntax
'Declaration
 
Public Overridable Sub CopyFrom( _
   ByVal source As DomCollectionBase _
) 
public virtual void CopyFrom( 
   DomCollectionBase source
)
public:
virtual void CopyFrom( 
   DomCollectionBase^ source
) 

Parameters

source
Source collection.
Example
ListLabel LL = new ListLabel();
ProjectList newProj = new ProjectList(LL);
newProj.Open(@"c:\users\public\copy.lst", LlDomFileMode.Create, LlDomAccessMode.ReadWrite);

ListLabel LL2 = new ListLabel();
ProjectList sourceProj = new ProjectList(LL2);
sourceProj.Open(@"c:\users\public\original.lst", LlDomFileMode.Open, LlDomAccessMode.ReadOnly);

newProj.CopyFrom(sourceProj);
newProj.ResetInformation();
newProj.Save();
newProj.Close();
sourceProj.Close();

LL2.Dispose();
LL.Dispose();
Requirements

Platforms: Windows 7 SP1 - Windows 10 Version 1909, Windows Server 2008 R2 - 2019

See Also

Reference

DomCollectionBase Class
DomCollectionBase Members