public InputItemCollection Copy() 
		{
			InputItemCollection copy = new InputItemCollection();
			foreach (string key in this.Keys) 
			{
				copy.Add(this[key]);
			}
			return copy;
		}
Пример #2
0
        public InputItemCollection Copy()
        {
            InputItemCollection copy = new InputItemCollection();

            foreach (string key in this.Keys)
            {
                copy.Add(this[key]);
            }
            return(copy);
        }
Пример #3
0
		public bool Collect(ZeusTemplate template, IZeusContext context, int timeout, InputItemCollection collectedinput, ShowGUIEventHandler eventhandler) 
		{
			IZeusExecutionHelper execHelper = null;
			bool exceptionOccurred = false;
			bool result = false;
			try 
			{
				//Initialize Context for collection 
				collectedinput.CopyTo(context.Gui.Defaults);
				context.Gui.ForceDisplay = true;
				collectedinput.Clear();

				execHelper = template.GuiSegment.ZeusScriptingEngine.ExecutionHelper;
				execHelper.Timeout = timeout;

				if (eventhandler == null) 
				{
					execHelper.SetShowGuiHandler(new ShowGUIEventHandler(DynamicGUI_Display));
				}
				else 
				{
					execHelper.SetShowGuiHandler(new ShowGUIEventHandler(eventhandler));
				}

				result = template.GuiSegment.Execute(context); 
				execHelper.Cleanup();

				if (collectedinput != null)
				{
					collectedinput.Add(context.Input);
				}
			}
			catch (Exception ex)
			{
				context.Log.Write(ex);
				exceptionOccurred = true;
			}

			if (!exceptionOccurred && result)
			{
				context.Log.Write("Successfully collected input for Template: " + template.Title);
			}
			else 
			{
				context.Log.Write("Canceled Template execution: " + template.Title);
			}

			return result;
		}
Пример #4
0
        /// <summary>
        /// Adds all of the items from the passed in collection.
        /// Supported collection types are, for example, HashTable, GuiController, and NameValueCollection
        /// </summary>
        /// <param name="collection"></param>
        public void AddItems(object collection)
        {
            if (collection is GuiController)
            {
                GuiController controller = collection as GuiController;
                foreach (GuiControl control in controller)
                {
                    if (control.IsDataControl)
                    {
                        this._invars[control.ID] = control.Value;
                    }
                }
            }
            else if (collection is Hashtable)
            {
                Hashtable hash = collection as Hashtable;
                foreach (object key in hash.Keys)
                {
                    this._invars[key] = hash[key];
                }
            }
            else if (collection is NameValueCollection)
            {
                NameValueCollection nvc = collection as NameValueCollection;
                foreach (string key in nvc.Keys)
                {
                    this._invars[key] = nvc[key];
                }
            }
#if !HTML_HELP
            else if (collection is InputItemCollection)
            {
                InputItemCollection iic = collection as InputItemCollection;
                foreach (InputItem item in iic)
                {
                    this._invars[item.VariableName] = item.DataObject;
                }
            }
#endif
        }
		public SavedTemplateInput(string objectName, IZeusTemplate template, IZeusInput input) : this(objectName, template)
		{
			_inputItems = new InputItemCollection(input);
		}
Пример #6
0
        //public bool Collect(IZeusContext context, int timeout, InputItemCollection inputitems, ILog log)
        public bool Collect(IZeusContext context, int timeout, InputItemCollection inputitems)
        {
            ZeusExecutioner exec = new ZeusExecutioner(context.Log);

            return(exec.Collect(this, context, timeout, inputitems));
        }
Пример #7
0
		//public bool Collect(IZeusContext context, int timeout, InputItemCollection inputitems, ILog log) 
		public bool Collect(IZeusContext context, int timeout, InputItemCollection inputitems) 
		{
			ZeusExecutioner exec = new ZeusExecutioner(context.Log);
			return exec.Collect(this, context, timeout, inputitems);
		}
Пример #8
0
        public IZeusContext Execute(ZeusTemplate template, IZeusContext context, int timeout, InputItemCollection collectedinput, ShowGUIEventHandler eventhandler, bool skipGui)
        {
            IZeusExecutionHelper execHelper = null;
            bool exceptionOccurred          = false;
            bool result = false;

            try
            {
                if (skipGui)
                {
                    PopulateContextObjects(context);
                    foreach (IZeusContextProcessor processor in ZeusFactory.Preprocessors)
                    {
                        processor.Process(context);
                    }
                    result = true;
                }
                else
                {
                    execHelper         = template.GuiSegment.ZeusScriptingEngine.ExecutionHelper;
                    execHelper.Timeout = timeout;

                    if (eventhandler == null)
                    {
                        execHelper.SetShowGuiHandler(new ShowGUIEventHandler(DynamicGUI_Display));
                    }
                    else
                    {
                        execHelper.SetShowGuiHandler(new ShowGUIEventHandler(eventhandler));
                    }

                    result = template.GuiSegment.Execute(context);
                    execHelper.Cleanup();

                    if (collectedinput != null)
                    {
                        collectedinput.Add(context.Input);
                    }
                }
                if (result)
                {
                    execHelper         = template.BodySegment.ZeusScriptingEngine.ExecutionHelper;
                    execHelper.Timeout = timeout;
                    result             = template.BodySegment.Execute(context);
                }
            }
            catch (Exception ex)
            {
                context.Log.Write(ex);
                exceptionOccurred = true;
            }

            if (!exceptionOccurred && result)
            {
                context.Log.Write("Successfully rendered Template: " + template.Title);
            }
            else
            {
                context.Log.Write("Canceled Template execution: " + template.Title);
            }

            return(context);
        }
Пример #9
0
        public bool Collect(ZeusTemplate template, IZeusContext context, int timeout, InputItemCollection collectedinput, ShowGUIEventHandler eventhandler)
        {
            IZeusExecutionHelper execHelper = null;
            bool exceptionOccurred          = false;
            bool result = false;

            try
            {
                //Initialize Context for collection
                collectedinput.CopyTo(context.Gui.Defaults);
                context.Gui.ForceDisplay = true;
                collectedinput.Clear();

                execHelper         = template.GuiSegment.ZeusScriptingEngine.ExecutionHelper;
                execHelper.Timeout = timeout;

                if (eventhandler == null)
                {
                    execHelper.SetShowGuiHandler(new ShowGUIEventHandler(DynamicGUI_Display));
                }
                else
                {
                    execHelper.SetShowGuiHandler(new ShowGUIEventHandler(eventhandler));
                }

                result = template.GuiSegment.Execute(context);
                execHelper.Cleanup();

                if (collectedinput != null)
                {
                    collectedinput.Add(context.Input);
                }
            }
            catch (Exception ex)
            {
                context.Log.Write(ex);
                exceptionOccurred = true;
            }

            if (!exceptionOccurred && result)
            {
                context.Log.Write("Successfully collected input for Template: " + template.Title);
            }
            else
            {
                context.Log.Write("Canceled Template execution: " + template.Title);
            }

            return(result);
        }
Пример #10
0
 public bool Collect(ZeusTemplate template, IZeusContext context, int timeout, InputItemCollection inputitems)
 {
     return(this.Collect(template, context, timeout, inputitems, null));
 }
Пример #11
0
 public IZeusContext ExecuteAndCollect(ZeusTemplate template, IZeusContext context, int timeout, InputItemCollection inputitems)
 {
     return(this.Execute(template, context, timeout, inputitems, null, false));
 }
Пример #12
0
		public IZeusContext Execute(ZeusTemplate template, IZeusContext context, int timeout, InputItemCollection collectedinput, ShowGUIEventHandler eventhandler, bool skipGui) 
		{
			IZeusExecutionHelper execHelper = null;
			bool exceptionOccurred = false;
			bool result = false;
			try 
			{
				if (skipGui)
				{
					PopulateContextObjects(context);
					foreach (IZeusContextProcessor processor in ZeusFactory.Preprocessors) 
					{
						processor.Process(context);
					}
					result = true;
				}
				else 
				{
					execHelper = template.GuiSegment.ZeusScriptingEngine.ExecutionHelper;
					execHelper.Timeout = timeout;

					if (eventhandler == null) 
					{
						execHelper.SetShowGuiHandler(new ShowGUIEventHandler(DynamicGUI_Display));
					}
					else 
					{
						execHelper.SetShowGuiHandler(new ShowGUIEventHandler(eventhandler));
					}

					result = template.GuiSegment.Execute(context); 
					execHelper.Cleanup();

					if (collectedinput != null)
					{
						collectedinput.Add(context.Input);
					}
				}
				if (result) 
				{
					execHelper = template.BodySegment.ZeusScriptingEngine.ExecutionHelper;
					execHelper.Timeout = timeout;
					result = template.BodySegment.Execute(context);
				}
			}
			catch (Exception ex)
			{
				context.Log.Write(ex);
				exceptionOccurred = true;
			}

			if (!exceptionOccurred && result)
			{
				context.Log.Write("Successfully rendered Template: " + template.Title);
			}
			else 
			{
				context.Log.Write("Canceled Template execution: " + template.Title);
			}

			return context;
		}
Пример #13
0
		public bool Collect(ZeusTemplate template, IZeusContext context, int timeout, InputItemCollection inputitems) 
		{
			return this.Collect(template, context, timeout, inputitems, null);
		}
Пример #14
0
		public IZeusContext ExecuteAndCollect(ZeusTemplate template, IZeusContext context, int timeout, InputItemCollection inputitems) 
		{
			return this.Execute(template, context, timeout, inputitems, null, false);
		}
Пример #15
0
 public SavedTemplateInput(string objectName, IZeusTemplate template, IZeusInput input) : this(objectName, template)
 {
     _inputItems = new InputItemCollection(input);
 }