public static void Main(string[] args) { var chilCollection = new ChildrenCollection(); var listOfElelement = new List <ChildrenElements>() { new ChildrenElements() { CityName = "Lahore", SchoolName = "City School Lahore" }, new ChildrenElements() { CityName = "Karachi", SchoolName = "City School Karachi" } }; listOfElelement.ForEach(r => chilCollection.Add(r)); chilCollection.DefaultValue = -2; chilCollection.FullName = "Children Name 2"; chilCollection.Enabled = true; IChildren children1 = new Children() { Name = "Fahad", FatherName = "Anwar UL Haq", childrenCollection = chilCollection }; Children children2 = new Children(children1, true); Children children3 = new Children(children1, false); Console.WriteLine("Source Object Values are... "); ///////////////////////////////////////////////////////////////////// //// Children 1 /// ///////////////////////////////////////////////////////////////////// PrintProperties(children1, 1); Console.WriteLine("/////////////////////////////////////////////////"); ///////////////////////////////////////////////////////////////////// //// Children 2 After Generic Map /// ///////////////////////////////////////////////////////////////////// PrintProperties(children2, 1); Console.WriteLine("/////////////////////////////////////////////////"); ///////////////////////////////////////////////////////////////////// //// Children 3 After Assembly Map /// ///////////////////////////////////////////////////////////////////// PrintProperties(children3, 1); Console.ReadLine(); }
static void Main(string[] args) { var listOfElelement = new List <ChildrenConfigElement>() { new ChildrenConfigElement() { CityName = "Lahore", SchoolName = "City School Lahore" }, new ChildrenConfigElement() { CityName = "Karachi", SchoolName = "City School Karachi" } }; var chilCollection = new ChildrenCollection() { DefaultValue = -2, FullName = "Children Name 2", Enabled = true }; listOfElelement.ForEach(r => chilCollection.Add(r)); IChildren setting = new Children() { Name = "Fahad", FatherName = "Anwar UL Haq", childrenCollection = chilCollection }; //Setting setting2 = new Setting(setting); IChildren setting3 = Children.MapProfile(setting); Console.WriteLine("Source Object Values are... "); ///////////////////////////////////////////////////////////////////// //// Setting 1 /// ///////////////////////////////////////////////////////////////////// //PrintProperties(setting, 1); //Console.WriteLine("/////////////////////////////////////////////////"); /////////////////////////////////////////////////////////////////////// ////// Setting 2 After Generic Map /// /////////////////////////////////////////////////////////////////////// //PrintProperties(setting2, 1); Console.WriteLine("/////////////////////////////////////////////////"); ///////////////////////////////////////////////////////////////////// //// Setting 3 After Assembly Map /// ///////////////////////////////////////////////////////////////////// PrintProperties(setting3, 1); Console.ReadLine(); }
protected internal override void AddChild(GroupChild child) { ChildrenCollection.Add(new RelationalGroupChild { GroupID = this.ID, ChildGroupID = child.ChildGroupID }); }