ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/xmlTools/trunk/posUpdate/XmlPatch.cs
(Generate patch)

Comparing xmlTools/trunk/posUpdate/XmlPatch.cs (file contents):
Revision 746 by s10k, Tue Mar 26 15:23:42 2013 UTC vs.
Revision 867 by s10k, Thu May 9 10:37:17 2013 UTC

# Line 95 | Line 95 | namespace xmlTools
95              //---------------------------------------------------Parse Operation command (start)
96              try
97              {
98 <                if (forceFiles == null)
98 >                if (String.IsNullOrEmpty(forceFiles))
99                  {
100                      File = getPatchParameter(operation, "File");
101                  }
# Line 114 | Line 114 | namespace xmlTools
114                  return false;
115              }
116  
117 <            if (Element == "")
117 >            if (String.IsNullOrEmpty(Element))
118              {
119                  return false;
120              }
121  
122              //---------------------------------------------------Parse Operation command (end)
123              List<String> filesToProcess = new List<String>();
124 <            if (File == "")
124 >            if (String.IsNullOrEmpty(File))
125              {
126                  filesToProcess = Util.getAllXmlFiles(); //no file specified, use all xml files found in same folder
127              }
# Line 187 | Line 187 | namespace xmlTools
187              //---------------------------------------------------Parse Operation command (start)
188              try
189              {
190 <                if (forceFiles == null)
190 >                if (String.IsNullOrEmpty(forceFiles))
191                  {
192                      File = getPatchParameter(operation, "File");
193                  }
# Line 206 | Line 206 | namespace xmlTools
206                  return false;
207              }
208  
209 <            if (Element == "")
209 >            if (String.IsNullOrEmpty(Element))
210              {
211                  return false;
212              }
# Line 214 | Line 214 | namespace xmlTools
214              //---------------------------------------------------Parse Operation command (end)
215  
216              List<String> filesToProcess = new List<String>();
217 <            if (File == "")
217 >            if (String.IsNullOrEmpty(File))
218              {
219                  filesToProcess = Util.getAllXmlFiles(); //no file specified, use all xml files found in same folder
220              }
# Line 271 | Line 271 | namespace xmlTools
271  
272              command = command.Replace("@COMMAND ", ""); //get only the command to process
273  
274 <            if (command.Trim() == "")
274 >            if (String.IsNullOrEmpty(command.Trim()))
275              {
276                  Program.printAppError(Program.appErrors.PATCH_COMMAND_NOT_FOUND, "Error parsing commandOperation in Patch file: Command is empty.");
277                  return false;
# Line 298 | Line 298 | namespace xmlTools
298                          command = command.Insert(command.Length," -filename:" + this.forceFiles);
299                      }
300  
301 <                    if (paramType != "")
301 >                    if (!String.IsNullOrEmpty(paramType))
302                      {
303                          int startIdx = command.IndexOf(paramType) + paramType.Length;
304                          int endIdx = command.IndexOf(" ", startIdx); // it may end with space

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)