Exemplo n.º 1
0
        // replaces tags and text when writing settings to the files
        private static void RemoveFromSettings(string tag, string outputFileName)
        {
            var location = RobotFileHandler.LocationInSettings(outputFileName, tag);

            if (location[0] != -1)
            {
                RobotFileHandler.FileLineRemove(outputFileName
                                                , location);
            }
        }
Exemplo n.º 2
0
        // replaces tags and text when writing settings to the files
        private static void ReplaceInSettings(string replacementText, string tag, string outputFileName)
        {
            var location = RobotFileHandler.LocationInSettings(outputFileName, tag);

            //Add settings tag if not present in the file
            if (RobotFileHandler.HasTag(outputFileName, FormType.Settings) == -1)
            {
                RobotFileHandler.FileLineAdd("*** Settings ***", outputFileName, 0);
                RobotFileHandler.FileLineAdd("", outputFileName, 1);
            }

            if (location[0] == -1)
            {
                RobotFileHandler.FileLineAdd(replacementText
                                             , outputFileName
                                             , 1);
            }
            else
            {
                RobotFileHandler.FileLineReplace(replacementText
                                                 , outputFileName
                                                 , location);
            }
        }