Ejemplo n.º 1
0
        private bool CollectProjectItem(ZeusModule parent, string projectPath, string templatePath)
        {
            bool complete    = false;
            int  moduleIndex = projectPath.LastIndexOf('/');

            if (moduleIndex >= 0)
            {
                string modulePath = projectPath.Substring(0, moduleIndex),
                       objectName = projectPath.Substring(moduleIndex + 1);

                ZeusModule m = FindModule(parent, modulePath);
                if (m != null)
                {
                    ZeusTemplate    template = new ZeusTemplate(templatePath);
                    DefaultSettings settings = DefaultSettings.Instance;

                    SavedTemplateInput savedInput = null;
                    if (m.SavedObjects.Contains(objectName))
                    {
                        savedInput = m.SavedObjects[objectName];
                    }
                    else
                    {
                        savedInput = new SavedTemplateInput();
                        savedInput.SavedObjectName = objectName;
                    }


                    ZeusContext context = new ZeusContext();
                    context.Log = this._log;

                    savedInput.TemplateUniqueID = template.UniqueID;
                    savedInput.TemplatePath     = template.FilePath + template.FileName;

                    settings.PopulateZeusContext(context);
                    if (m != null)
                    {
                        m.PopulateZeusContext(context);
                        m.OverrideSavedData(savedInput.InputItems);
                    }

                    if (template.Collect(context, settings.ScriptTimeout, savedInput.InputItems))
                    {
                        //this._lastRecordedSelectedNode = this.SelectedTemplate;
                    }


                    if (this._argmgr.InternalUseOnly)
                    {
                        this._log.Write("[BEGIN_RECORDING]");

                        this._log.Write(savedInput.XML);

                        this._log.Write("[END_RECORDING]");
                    }
                    complete = true;
                }
            }
            return(complete);
        }
Ejemplo n.º 2
0
        public IZeusSavedTemplateInput CopyI()
        {
            SavedTemplateInput copy = new SavedTemplateInput("Copy of " + this.SavedObjectName, this.TemplateUniqueID, this.TemplatePath);

            copy.InputItems = this.InputItems.Copy();
            return(copy);
        }
Ejemplo n.º 3
0
        void System.Collections.IDictionary.Add(object key, object value)
        {
            SavedTemplateInput item = value as SavedTemplateInput;

            item.ApplyOverrideDataDelegate = this._applyOverrideDataDelegate;

            _hash.Add(key, item);
        }
Ejemplo n.º 4
0
 object System.Collections.IDictionary.this[object key]
 {
     get
     {
         SavedTemplateInput item = _hash[key] as SavedTemplateInput;
         item.ApplyOverrideDataDelegate = this._applyOverrideDataDelegate;
         return(item);
     }
     set
     {
         SavedTemplateInput item = value as SavedTemplateInput;
         item.ApplyOverrideDataDelegate = this._applyOverrideDataDelegate;
         _hash[key] = item;
     }
 }
Ejemplo n.º 5
0
 public SavedTemplateInput this[string objectName]
 {
     get
     {
         if (_hash.ContainsKey(objectName))
         {
             SavedTemplateInput item = _hash[objectName] as SavedTemplateInput;
             item.ApplyOverrideDataDelegate = this._applyOverrideDataDelegate;
             return(item);
         }
         else
         {
             return(null);
         }
     }
     set
     {
         value.ApplyOverrideDataDelegate = this._applyOverrideDataDelegate;
         _hash[objectName] = value;
     }
 }
Ejemplo n.º 6
0
		public SavedObjectTreeNode(SavedTemplateInput templateInput)
		{
			this.Tag = templateInput;

			this.ForeColor = Color.Blue;
			this.Text = templateInput.SavedObjectName;
			this.ImageIndex = 6;
			this.SelectedImageIndex = 6;
		}
        private void contextItemAddSavedObject_Click(object sender, System.EventArgs e)
        {
            SortedProjectTreeNode node = this.treeViewProject.SelectedNode as SortedProjectTreeNode;
            if ((node is ModuleTreeNode) || (node is ProjectTreeNode))
            {
                ZeusModule module = node.Tag as ZeusModule;

                SavedTemplateInput savedInput = new SavedTemplateInput();
                this._formEditSavedObject.Module = module;
                this._formEditSavedObject.SavedObject = savedInput;
                if (this._formEditSavedObject.ShowDialog() == DialogResult.OK)
                {
                    this._isDirty = true;
                    module.SavedObjects.Add(savedInput);

                    SavedObjectTreeNode newNode = new SavedObjectTreeNode(savedInput);
                    node.AddSorted(newNode);
                    node.Expand();
                    this.treeViewProject.SelectedNode = newNode;
                }
            }
        }
 public IZeusSavedTemplateInput CopyI()
 {
     SavedTemplateInput copy = new SavedTemplateInput("Copy of " + this.SavedObjectName, this.TemplateUniqueID, this.TemplatePath);
     copy.InputItems = this.InputItems.Copy();
     return copy;
 }
Ejemplo n.º 9
0
 public void Remove(SavedTemplateInput item)
 {
     Remove(item.SavedObjectName);
 }
Ejemplo n.º 10
0
 public void Add(SavedTemplateInput item)
 {
     item.ApplyOverrideDataDelegate   = this._applyOverrideDataDelegate;
     this._hash[item.SavedObjectName] = item;
 }
Ejemplo n.º 11
0
        private bool CollectProjectItem(ZeusModule parent, string projectPath, string templatePath)
        {
            bool complete = false;
            int moduleIndex = projectPath.LastIndexOf('/');
            if (moduleIndex >= 0)
            {
                string modulePath = projectPath.Substring(0, moduleIndex),
                    objectName = projectPath.Substring(moduleIndex + 1);

                ZeusModule m = FindModule(parent, modulePath);
                if (m != null)
                {
                    ZeusTemplate template = new ZeusTemplate(templatePath);
                    DefaultSettings settings = DefaultSettings.Instance;

                    SavedTemplateInput savedInput = null;
                    if (m.SavedObjects.Contains(objectName))
                    {
                        savedInput = m.SavedObjects[objectName];
                    }
                    else
                    {
                        savedInput = new SavedTemplateInput();
                        savedInput.SavedObjectName = objectName;
                    }


                    ZeusContext context = new ZeusContext();
                    context.Log = this._log;

                    savedInput.TemplateUniqueID = template.UniqueID;
                    savedInput.TemplatePath = template.FilePath + template.FileName;

                    settings.PopulateZeusContext(context);
                    if (m != null)
                    {
                        m.PopulateZeusContext(context);
                        m.OverrideSavedData(savedInput.InputItems);
                    }

                    if (template.Collect(context, settings.ScriptTimeout, savedInput.InputItems))
                    {
                        //this._lastRecordedSelectedNode = this.SelectedTemplate;
                    }


                    if (this._argmgr.InternalUseOnly)
                    {
                        this._log.Write("[BEGIN_RECORDING]");

                        this._log.Write(savedInput.XML);

                        this._log.Write("[END_RECORDING]");
                    }
                    complete = true;
                }
            }
            return complete;
        }
		public void Remove(SavedTemplateInput item) 
		{
			Remove(item.SavedObjectName);
		}
		public void Add(SavedTemplateInput item) 
		{
            item.ApplyOverrideDataDelegate = this._applyOverrideDataDelegate;
			this._hash[item.SavedObjectName] = item;
		}