public void AddToParent(PreferenceReportItem pri) { if (pri.Name == "Properties") { foreach (RootNodePreferenceReportHolder item in Items) { if (item.XMLNodeID == pri.ParentID && item.Type == pri.Type) { item.Properties.Add(pri); if (pri.PropName.Equals("NameGuid", StringComparison.CurrentCultureIgnoreCase) || pri.PropName.Equals("Name", StringComparison.CurrentCultureIgnoreCase)) { if (item.AddedBy.Length == 0) { item.AddedBy = pri.UserName; item.Comment = pri.Comments; } } break; } } } }
public bool Exists(PreferenceReportItem pri) { bool found = false; foreach (RootNodePreferenceReportHolder item in Items) { if (item.ID == pri.ID) { found = true; break; } } return(found); }
public void AddRootNode(PreferenceReportItem pri) { if (pri.ClsidProperty.Equals("{9CD4B2F4-923D-47f5-A062-E897DD1DAD50}") || //Regitry Item pri.ClsidProperty.Equals("{78570023-8373-4a19-BA80-2F150738EA19}") || //EnvironmentVariable pri.ClsidProperty.Equals("{2B130A62-fc14-4572-91C3-5435C6A0C3FC}")) //Power Option { if (!Exists(pri)) { RootNodePreferenceReportHolder rnprh = new RootNodePreferenceReportHolder(); rnprh.CLSID = pri.ClsidProperty; rnprh.ID = pri.ID; rnprh.Name = pri.Name; rnprh.NameProperty = pri.NameProperty; rnprh.Type = pri.Type; rnprh.XMLNodeID = pri.XMLNodeID; Items.Add(rnprh); } } }