Пример #1
0
 public void SetUp()
 {
     baseCollection           = new PublicSafetyPerson(Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid());
     baseCollection.LastName  = "data";
     baseCollection.FirstName = "data1";
     lst = new List <PublicSafetyPerson>();
     lst.Add(baseCollection);
     derivedCollectionObj = new DerivedCollection <FieldInterviewSource, PublicSafetyPerson>(lst);
 }
Пример #2
0
    public static void Main()
    {
        // <Snippet2>
        // Create a collection derived from NameObjectCollectionBase
        ICollection myCollection = new DerivedCollection();

        lock (myCollection.SyncRoot)
        {
            foreach (object item in myCollection)
            {
                // Insert your code here.
            }
        }
        // </Snippet2>
    }
Пример #3
0
    public static void Main()
    {
        // <Snippet1>
        // Create a collection derived from NameObjectCollectionBase
        NameObjectCollectionBase myBaseCollection = new DerivedCollection();
        // Get the ICollection from NameObjectCollectionBase.KeysCollection
        ICollection myKeysCollection = myBaseCollection.Keys;

        lock (myKeysCollection.SyncRoot)
        {
            foreach (object item in myKeysCollection)
            {
                // Insert your code here.
            }
        }
        // </Snippet1>
    }