private void TestPropertyClassEqControl(Pair pair) { string partOfConfig = pair.ConfigItem; string control = pair.Control; var propertiesControl = CUtilReflex.GetPropertiesList(GetControlTypeSt(control)); var fieldsControl = CUtilReflex.GetFiedsList(GetControlTypeSt(control)); var propertiesConfig = CUtilReflex.GetPropertiesList(GetPropertyTypeSt(partOfConfig)); propertiesConfig.ForEach(property => { string propertyName = property.Name; string dependencyPropName = propertyName + "Property"; if (propertiesControl.FirstOrDefault(a => a.Name == propertyName) == null) { Error(String.Format("Control {0} doesn't contain property {1} ", control, propertyName)); } if (fieldsControl.FirstOrDefault(a => a.Name == dependencyPropName) == null) { Error(String.Format("Control {0} doesn't contain dependency property {1} ", control, dependencyPropName)); } } ); }
private void TestConfigFileEqPropertyClass(XmlNode xmlNode, string partOfConfigFile) { var properties = CUtilReflex.GetPropertiesList(GetPropertyTypeSt(partOfConfigFile)); //if element in config doesn't exists in property foreach (XmlNode node in xmlNode.ChildNodes) { var res = properties.FirstOrDefault(el => el.Name == node.Name); if (res == null) { Error(String.Format("Element {0} doesn't exist in property class {1}", node.Name, GetPropertyTypeSt(partOfConfigFile))); } } }
private void TestPropertClassEqViewModel(Pair pair) { string partOfConfig = pair.ConfigItem; //string stType = "Terminal.Controls.Market.Contri"; var propertiesViewModel = CUtilReflex.GetPropertiesList(_stMarketViewModelType); if (propertiesViewModel != null) { Thread.Sleep(0); } var propertiesConfig = CUtilReflex.GetPropertiesList(GetPropertyTypeSt(partOfConfig)); propertiesConfig.ForEach(propertyConfig => { if (propertiesViewModel.FirstOrDefault(a => a.Name == propertyConfig.Name) == null) { Error(String.Format("ViewModel doesn't contain property {0}", propertyConfig.Name)); } } ); }