Esempio n. 1
0
 public void Add(ZeusModule module)
 {
     module.SetParentModule(this._parentModule);
     this._hash[module.Name] = module;
 }
		public void Add(ZeusModule module) 
		{
			module.SetParentModule(this._parentModule);
			this._hash[module.Name] = module;
		}
Esempio n. 3
0
        public string ReadXML(XmlTextReader xr)
        {
            string tagName = string.Empty;
            bool   inStartElement, inEmptyElement, skipread = false;

            this.Name        = xr.GetAttribute("name");
            this.Description = xr.GetAttribute("description");
            string tmp = xr.GetAttribute("defaultSettingsOverride");

            if (!string.IsNullOrEmpty(tmp))
            {
                this.DefaultSettingsOverride = Convert.ToBoolean(tmp);
            }

            inEmptyElement = xr.IsEmptyElement;

            if (!inEmptyElement)
            {
                while ((skipread) || (xr.Read()))
                {
                    inStartElement = xr.IsStartElement();
                    inEmptyElement = xr.IsEmptyElement;

                    if (skipread)
                    {
                        skipread = false;
                    }
                    else
                    {
                        tagName = xr.LocalName;
                    }

                    if (inStartElement)
                    {
                        // a module start
                        if (tagName == "module")
                        {
                            ZeusModule module = new ZeusModule();
                            tagName  = module.ReadXML(xr);
                            skipread = true;

                            module.SetParentModule(this);
                            this.ChildModules.Add(module);
                        }
                        // a saved item start
                        else if (tagName == "item")
                        {
                            InputItem item = new InputItem();
                            item.ReadXML(xr);

                            this.SavedItems.Add(item);
                        }
                        // a saved object start
                        else if (tagName == "obj")
                        {
                            SavedTemplateInput input = new SavedTemplateInput();
                            tagName  = input.ReadXML(xr);
                            skipread = true;

                            this.SavedObjects.Add(input);
                        }
                    }
                    else
                    {
                        // if not in a sub module and this is an end module tag, break!
                        if (tagName == "module")
                        {
                            break;
                        }
                    }
                }
            }

            xr.Read();
            inStartElement = xr.IsStartElement();
            tagName        = xr.LocalName;

            return(tagName);
        }
Esempio n. 4
0
		public string ReadXML(XmlTextReader xr) 
		{
			string tagName = string.Empty;
			bool inStartElement, inEmptyElement, skipread = false;

			this.Name = xr.GetAttribute("name");
            this.Description = xr.GetAttribute("description");
            string tmp = xr.GetAttribute("defaultSettingsOverride");
            if (!string.IsNullOrEmpty(tmp))
            {
                this.DefaultSettingsOverride = Convert.ToBoolean(tmp);
            }

			inEmptyElement = xr.IsEmptyElement;

			if (!inEmptyElement) 
			{
				while ( (skipread) || (xr.Read()) ) 
				{
					inStartElement = xr.IsStartElement();
					inEmptyElement = xr.IsEmptyElement;
				
					if (skipread) 
					{
						skipread = false;
					}
					else
					{
						tagName = xr.LocalName;
					}

					if (inStartElement) 
					{
						// a module start
						if (tagName == "module") 
						{
							ZeusModule module = new ZeusModule();
							tagName = module.ReadXML(xr);
							skipread = true;
						
							module.SetParentModule(this);
							this.ChildModules.Add(module);

						}
							// a saved item start
						else if (tagName == "item") 
						{
							InputItem item = new InputItem();
							item.ReadXML(xr);
						
							this.SavedItems.Add(item);

						}
							// a saved object start
						else if (tagName == "obj") 
						{
							SavedTemplateInput input = new SavedTemplateInput();
							tagName = input.ReadXML(xr);
							skipread = true;
						
							this.SavedObjects.Add(input);
						}
					}
					else
					{
						// if not in a sub module and this is an end module tag, break!
						if (tagName == "module") 
						{
							break;
						}
					}				 
				}
			}

			xr.Read();
			inStartElement = xr.IsStartElement();
			tagName = xr.LocalName;

			return tagName;
		}