コード例 #1
0
        public void addFilterControl(XmlNode dataNode)
        {
            string name = "";

            try
            {
                name += dataNode.Attributes.GetNamedItem("name").InnerText.Trim();
            }
            catch {}

            string descr = "";

            try
            {
                descr += dataNode.Attributes.GetNamedItem("descr").InnerText.Trim();
            }
            catch {}

            bool used = false;

            try
            {
                used = "true".Equals("" + dataNode.Attributes.GetNamedItem("used").InnerText.Trim());
            }
            catch {}

            FilterControl control = new FilterControl();

            control.FilterName = name;
            control.Descr      = descr;
            control.filterNode = dataNode;
            control.Used       = used;

            this.Width = Math.Max(this.Width, control.Width);

            Point location = new Point(0, m_pos);

            control.Location = location;
            control.Width    = this.Width;
            m_pos           += control.Height + 5;

            control.selectionChanged += new EventHandler(onControlSelectionChanged);

            this.Controls.Add(control);
        }
コード例 #2
0
        private string getGeneratedText()
        {
            StringBuilder ret = new StringBuilder();

            foreach (Control control in this.Controls)
            {
                if (control is FilterControl)
                {
                    FilterControl filterControl = control as FilterControl;
                    if (filterControl.Used)
                    {
                        ret.Append(filterControl.getGeneratedText());
                        ret.Append(" ");
                    }
                }
            }
            string sRet = ret.ToString();

            if (sRet.EndsWith(","))
            {
                sRet = sRet.Substring(0, sRet.Length - 1);
            }
            return(sRet);
        }
コード例 #3
0
ファイル: FiltersPane.cs プロジェクト: slgrobotics/QuakeMap
        public void addFilterControl(XmlNode dataNode)
        {
            string name = "";
            try
            {
                name += dataNode.Attributes.GetNamedItem("name").InnerText.Trim();
            }
            catch {}

            string descr = "";
            try
            {
                descr += dataNode.Attributes.GetNamedItem("descr").InnerText.Trim();
            }
            catch {}

            bool used = false;
            try
            {
                used = "true".Equals("" + dataNode.Attributes.GetNamedItem("used").InnerText.Trim());
            }
            catch {}

            FilterControl control = new FilterControl();
            control.FilterName = name;
            control.Descr = descr;
            control.filterNode = dataNode;
            control.Used = used;

            this.Width = Math.Max(this.Width, control.Width);

            Point location = new Point(0, m_pos);
            control.Location = location;
            control.Width = this.Width;
            m_pos += control.Height + 5;

            control.selectionChanged += new EventHandler(onControlSelectionChanged);

            this.Controls.Add(control);
        }