public static void ReplaceVariables(this TaskInfo task, ToolsVariables variables)
 {
     foreach (var parameter in task.Parameters.Items)
     {
         foreach (var variable in variables.Items)
         {
             if (parameter.Value.Contains(variable.Key))
             {
                 parameter.Value = parameter.Value.Replace(variable.Key, variable.Value);
             }
         }
     }
 }
        public void SaveChanges()
        {
            var variables = new ToolsVariables();

            foreach (var property in this.Properties)
            {
                variables.Items.Add(new ToolsVariable()
                {
                    Key = property.Key, Value = property.Value.ToString()
                });
            }

            Serializer.Serialize <ToolsVariables>(variables, @"Config\ToolsVariables.xml");
        }
Beispiel #3
0
        private void LoadData()
        {
            Logger.AddTrace("Loading Data");

            this.Views          = Serializer.Deserialize <ViewTemplates>(_templatePath);
            this.ToolsVariables = Serializer.Deserialize <ToolsVariables>(_variablesPath);

            if (this.Views == null)
            {
                this.Views = new ViewTemplates();
            }

            if (this.ToolsVariables == null)
            {
                this.ToolsVariables = new ToolsVariables();
            }
        }