Ejemplo n.º 1
0
        public void ImportFromTsVariable(TsVariable var)
        {
            this.VariableName = var.Name;
            ValueOnlyQuery newvoquery = new ValueOnlyQuery(var.Value);

            this._querylist.AddQuery(newvoquery);
            this.ID = var.Name;
            this.RefreshValue();
        }
Ejemplo n.º 2
0
        protected void LoadXml(XElement inputxml)
        {
            if (inputxml == null)
            {
                return;
            }

            IEnumerable <XElement> xlist = inputxml.Elements();

            if (xlist.Count() > 0)
            {
                this._querylist.LoadXml(inputxml);
            }
            else
            {
                ValueOnlyQuery v = new ValueOnlyQuery(inputxml.Value);
                this._querylist.AddQuery(v);
            }

            this.IsCaseSensitive = XmlHandler.GetBoolFromXAttribute(inputxml, "CaseSensitive", this.IsCaseSensitive);
            this.Not             = XmlHandler.GetBoolFromXAttribute(inputxml, "Not", this.Not);
        }
Ejemplo n.º 3
0
        //public methods
        public new void LoadXml(XElement InputXml)
        {
            base.LoadXml(InputXml);
            this.VariableName = XmlHandler.GetStringFromXElement(InputXml, "Variable", this.VariableName);

            this.VariableName = XmlHandler.GetStringFromXAttribute(InputXml, "Variable", this.VariableName);


            this.InactiveValue = XmlHandler.GetStringFromXElement(InputXml, "InactiveValue", this.InactiveValue);
            this._usecurrent   = XmlHandler.GetBoolFromXAttribute(InputXml, "UseCurrent", this._usecurrent);

            XElement   x;
            XAttribute xa;

            xa = InputXml.Attribute("Value");
            if (xa != null)
            {
                ValueOnlyQuery newvalue = new ValueOnlyQuery(InputXml);
                newvalue.Value = xa.Value;
                this._querylist.AddQuery(newvalue);
            }


            x = InputXml.Element("SetValue");
            if (x != null)
            {
                if (this._usecurrent == true)
                {
                    //default behaviour is to NOT check if the ts variable is already set. If it is, set that as the default i.e. add a query for
                    //an environment variable to the start of the query list.
                    XElement xcurrentquery = new XElement("Query", new XElement("Variable", this.VariableName));
                    xcurrentquery.Add(new XAttribute("Type", "EnvironmentVariable"));
                    x.AddFirst(xcurrentquery);
                }

                this._querylist.LoadXml(x);
            }


            xa = InputXml.Attribute("ID");
            if (xa != null)
            {
                this.ID = xa.Value;
            }

            IEnumerable <XElement> xlist = InputXml.Elements("Toggle");

            if (xlist != null)
            {
                Director.Instance.AddToggleControl(this);

                foreach (XElement subx in xlist)
                {
                    new Toggle(this, subx);
                    this.IsToggle = true;
                }
            }

            if (this.IsToggle == true)
            {
                Director.Instance.AddToggleControl(this);
            }
        }