Exemplo n.º 1
0
        public RootEntity()
        {
            this.Contacts = new AdvisableCollection<Contact>();
            this.countries = new AdvisableCollection<Country>();

            foreach (string country in Populate.GetCountries())
            {
                this.countries.Add(new Country(country));
            }

            Country russia = this.countries.Single(c => c.Name == "Russia");

            foreach (string contactName in Populate.GetContacts())
            {
                string[] names = contactName.Split(' ');
                Contact contact = new Contact(names[0], names[1]);
                Address address = new Address
                {
                    AddressLine1 = "23, Ilyinka Street",
                    Town = "Moscow",
                    Zip = "103132",
                    Country = russia
                };
                contact.Addresses.Add(address);
                contact.PrincipalAddress = address;
                this.Contacts.Add(contact);
            }

            RecordingServices.DefaultRecorder.Clear();
        }
Exemplo n.º 2
0
        public RootEntity()
        {
            this.Contacts  = new AdvisableCollection <Contact>();
            this.countries = new AdvisableCollection <Country>();

            foreach (string country in Populate.GetCountries())
            {
                this.countries.Add(new Country(country));
            }

            Country russia = this.countries.Single(c => c.Name == "Russia");

            foreach (string contactName in Populate.GetContacts())
            {
                string[] names   = contactName.Split(' ');
                Contact  contact = new Contact(names[0], names[1]);
                Address  address = new Address
                {
                    AddressLine1 = "23, Ilyinka Street",
                    Town         = "Moscow",
                    Zip          = "103132",
                    Country      = russia
                };
                contact.Addresses.Add(address);
                contact.PrincipalAddress = address;
                this.Contacts.Add(contact);
            }

            RecordingServices.DefaultRecorder.Clear();
        }
        public static void MySort <TSource, TKey>(this AdvisableCollection <TSource> observableCollection, Func <TSource, TKey> keySelector)
        {
            var a = observableCollection.OrderBy(keySelector).ToList();

            observableCollection.Clear();
            foreach (var b in a)
            {
                observableCollection.Add(b);
            }
        }
 public Person()
 {
     Addresses = new AdvisableCollection<Address>();
 }
Exemplo n.º 5
0
        protected ViewModelKeyedCollection([Required] AdvisableCollection <TModel> model)
        {
            this.Model = model;

            model.CollectionChanged += this.OnModelCollectionChanged;
        }
Exemplo n.º 6
0
 public Invoice()
 {
     Lines = new AdvisableCollection <InvoiceLine>();
 }
Exemplo n.º 7
0
 public Invoice(long id) : base(id)
 {
     Items = new AdvisableCollection <Item> {
         new Item("widget")
     };
 }
Exemplo n.º 8
0
 public SubDatabase()
 {
     Collection = new DataCollection <SubInstance>();
     Dictionary = new DataDictionary <string, SubInstance>();
     NotRecordableCollection = new AdvisableCollection <string>();
 }
        public CreatureViewModelCollection([Required] AdvisableCollection <Creature> model, [Required] BoardViewModel board) : base(model)
        {
            this.board = board;

            this.AddFromModel();
        }