- Timestamp:
- May 9, 2013, 12:37:17 PM (12 years ago)
- Location:
- xmlTools/trunk/posUpdate
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
xmlTools/trunk/posUpdate/ParametersParser.cs
r861 r867 107 107 foreach (string currentFile in filesToProcess) 108 108 { 109 if ( valPositions != null)109 if (!String.IsNullOrEmpty(valPositions)) 110 110 { 111 111 myTools.replaceAll(currentFile, value, valPositions); … … 130 130 XmlPatch myPatch; 131 131 132 if ( forceInFiles != "")132 if (!String.IsNullOrEmpty(forceInFiles)) 133 133 { 134 134 myPatch = new XmlPatch(globalFileName, forceInFiles, globalNoBackups); … … 196 196 List<String> filesToProccess = new List<String>(); 197 197 198 if ( filename == "") // No filename? Process everything xml file found.198 if (String.IsNullOrEmpty(filename)) // No filename? Process everything xml file found. 199 199 { 200 200 List<string> allXmlFiles = Util.getAllXmlFiles(); -
xmlTools/trunk/posUpdate/Program.cs
r861 r867 11 11 class Program 12 12 { 13 public static readonly string toolsVersion = "0.8 e";13 public static readonly string toolsVersion = "0.8f"; 14 14 private static appErrors lastError = appErrors.NO_ERROR; 15 15 -
xmlTools/trunk/posUpdate/XmlPatch.cs
r746 r867 96 96 try 97 97 { 98 if ( forceFiles == null)98 if (String.IsNullOrEmpty(forceFiles)) 99 99 { 100 100 File = getPatchParameter(operation, "File"); … … 115 115 } 116 116 117 if ( Element == "")117 if (String.IsNullOrEmpty(Element)) 118 118 { 119 119 return false; … … 122 122 //---------------------------------------------------Parse Operation command (end) 123 123 List<String> filesToProcess = new List<String>(); 124 if ( File == "")124 if (String.IsNullOrEmpty(File)) 125 125 { 126 126 filesToProcess = Util.getAllXmlFiles(); //no file specified, use all xml files found in same folder … … 188 188 try 189 189 { 190 if ( forceFiles == null)190 if (String.IsNullOrEmpty(forceFiles)) 191 191 { 192 192 File = getPatchParameter(operation, "File"); … … 207 207 } 208 208 209 if ( Element == "")209 if (String.IsNullOrEmpty(Element)) 210 210 { 211 211 return false; … … 215 215 216 216 List<String> filesToProcess = new List<String>(); 217 if ( File == "")217 if (String.IsNullOrEmpty(File)) 218 218 { 219 219 filesToProcess = Util.getAllXmlFiles(); //no file specified, use all xml files found in same folder … … 272 272 command = command.Replace("@COMMAND ", ""); //get only the command to process 273 273 274 if ( command.Trim() == "")274 if (String.IsNullOrEmpty(command.Trim())) 275 275 { 276 276 Program.printAppError(Program.appErrors.PATCH_COMMAND_NOT_FOUND, "Error parsing commandOperation in Patch file: Command is empty."); … … 299 299 } 300 300 301 if ( paramType != "")301 if (!String.IsNullOrEmpty(paramType)) 302 302 { 303 303 int startIdx = command.IndexOf(paramType) + paramType.Length; -
xmlTools/trunk/posUpdate/XmlTools.cs
r861 r867 41 41 Util.getAllSpecificElements(xdoc.DocumentElement, ref myElements, this.posElement, this.posParentElement); //Returns all after "Oni" element 42 42 43 if ( valuePositions != "")43 if (!String.IsNullOrEmpty(valuePositions)) 44 44 { 45 45 checkValidSpecificPositions(valuePositions, value, myElements[0].InnerText); … … 50 50 if (element.Name == posElement) 51 51 { 52 if ( posParentElement != ""&& element.ParentNode.Name != posParentElement)52 if (!String.IsNullOrEmpty(posParentElement) && element.ParentNode.Name != posParentElement) 53 53 { 54 54 continue; 55 55 } 56 if ( valuePositions == "") //replace every value for the new56 if (String.IsNullOrEmpty(valuePositions)) //replace every value for the new 57 57 { 58 58 element.InnerText = value; … … 91 91 if (element.Name == posElement) 92 92 { 93 if ( posParentElement != ""&& element.ParentNode.Name != posParentElement)93 if (!String.IsNullOrEmpty(posParentElement) && element.ParentNode.Name != posParentElement) 94 94 { 95 95 continue; … … 141 141 if (element.Name == posElement) 142 142 { 143 if ( posParentElement != ""&& element.ParentNode.Name != posParentElement)143 if (!String.IsNullOrEmpty(posParentElement) && element.ParentNode.Name != posParentElement) 144 144 { 145 145 continue; … … 185 185 if (element.Name == posElement) 186 186 { 187 if ( posParentElement != ""&& element.ParentNode.Name != posParentElement)187 if (!String.IsNullOrEmpty(posParentElement) && element.ParentNode.Name != posParentElement) 188 188 { 189 189 continue; … … 230 230 Util.getAllSpecificElements(xdoc.DocumentElement, ref myElements, this.posElement, this.posParentElement); //Returns all after "Oni" element 231 231 232 if ( valuePositions == null)232 if (String.IsNullOrEmpty(valuePositions)) 233 233 { 234 234 newXmlLastPos = new XmlNumberValue(newValue); … … 239 239 } 240 240 241 if ( valuePositions != null)241 if (!String.IsNullOrEmpty(valuePositions)) 242 242 { 243 243 checkValidSpecificPositions(valuePositions, newValue, myElements[0].InnerText); … … 246 246 foreach (XmlNode element in myElements) 247 247 { 248 if (element.Name == this.posElement && ( this.posParentElement == ""|| this.posParentElement == element.ParentNode.Name))248 if (element.Name == this.posElement && (String.IsNullOrEmpty(this.posParentElement) || this.posParentElement == element.ParentNode.Name)) 249 249 { 250 250 XmlNumberValue xmlCurrValue = new XmlNumberValue(element.InnerText); 251 251 252 if (xmlLastPos !=null)252 if (xmlLastPos!=null) 253 253 { 254 254 newXmlLastPos = XmlNumberValue.sum(newXmlLastPos, XmlNumberValue.difference(xmlCurrValue, xmlLastPos)); … … 258 258 else 259 259 { // first time just assign to last value 260 if ( valueRelation != null)260 if (!String.IsNullOrEmpty(valueRelation)) 261 261 { 262 262 newXmlLastPos = XmlNumberValue.difference(newXmlLastPos, XmlNumberValue.difference(new XmlNumberValue(valueRelation), xmlCurrValue));
Note:
See TracChangeset
for help on using the changeset viewer.