public void EditObjectParamsInXml(string classN, string par, string attr, string val, string vregexp) { foreach (string strF in _allValidXmlFiles) { ParserXml parseXml = new ParserXml(strF); parseXml.ReWritePropertyParamInObject("object", classN,par, attr, val, vregexp); parseXml.Dispose(); } }
public ProjectParserXml(string pathToXmlf) { string[] allXmlFiles = Directory.GetFiles(pathToXmlf, "*.xml", SearchOption.AllDirectories); _allValidXmlFiles = new List<string>(); ParserXml parItm; foreach (string strF in allXmlFiles) { parItm = new ParserXml(strF); if (parItm.IsSchemaFile()) _allValidXmlFiles.Add(strF); parItm.Dispose(); } _assocFiles = new string[_allValidXmlFiles.Count][]; }
public string GetInfoParamsFromFiles(IEnumerable<TbParamsXml> allParams) { /*fileName ClassName property property1 property2 property3 property4 */ string result = ""; IEnumerable<TbParamsXml> sortParams = allParams.OrderBy(param => param.ClassName); foreach (string strF in _allValidXmlFiles) { ParserXml parseXml = new ParserXml(strF); string fileParams = strF; string className = ""; foreach (TbParamsXml rowData in sortParams) { if (rowData.ClassName != className) { className = rowData.ClassName; // fileParams += "\r\n\t" + className; } string paramInfo = parseXml.GetRowInfoParam("object", rowData); if (paramInfo != null && paramInfo != "") { fileParams += paramInfo; } } parseXml.Dispose(); fileParams += "\r\n"; result += fileParams; } return result; }
public string[] GetAllUsedParams() { string[] result; StringCollection strColl = new StringCollection(); ParserXml parseXml; Console.WriteLine("Всего файлов на сканировании: " + _allValidXmlFiles.Count); for (int i = 0; i < _allValidXmlFiles.Count; i++) { parseXml = new ParserXml(_allValidXmlFiles[i]); string[] strToAdd = parseXml.GetParams("object", "className"); _assocFiles[i] = new string[strToAdd.Length]; for (int j = 0; j < strToAdd.Length;j++) { _assocFiles[i][j] = strToAdd[j]; if (!strColl.Contains(strToAdd[j])) strColl.Add(strToAdd[j]); } parseXml.Dispose(); } result = SortStringCollection(strColl); return result; }
public void EditObjectParamsInXmlEx(TbParamsXml rowData/*string classN, string par, string par2, string template*/) { foreach (string strF in _allValidXmlFiles) { ParserXml parseXml = new ParserXml(strF); parseXml.ReWritePropertyFromRowData("object", rowData); parseXml.Dispose(); } }
public string[] GetPropertiesObjectInFile(string className, string filePath) { string[] result; ParserXml parseXml; parseXml = new ParserXml(filePath); result = parseXml.GetInnerParams("object", className, "property", "textValue"); parseXml.Dispose(); return result; }