コード例 #1
0
        /// <summary>
        /// Let the editor to update the modified values to the underlying object.
        /// </summary>
        public void UpdateValues()
        {
            if (classobj == null)
            {
                return;
            }
            if (dirtyFlag)
            {
                // general tab
                classobj.name  = this.textBoxName.Text;
                classobj.title = this.textBoxTitle.Text;
                classobj.setExpression(this.textBoxExpression.Text);
                classobj.setText(this.textBoxText.Text);
                // display tab
                if (checkBoxVisible.CheckState == CheckState.Checked)
                {
                    classobj.status = mapscript.MS_ON;
                }
                else
                {
                    classobj.status = mapscript.MS_OFF;
                }

                if (checkBoxQueryable.CheckState == CheckState.Checked)
                {
                    classobj.template = "query";
                }
                else
                {
                    classobj.template = null;
                }

                classobj.maxscaledenom = -1;
                classobj.minscaledenom = -1;
                if (textBoxMaxZoom.Text == "")
                {
                    classobj.maxscaledenom = -1;
                }
                else
                {
                    classobj.maxscaledenom = double.Parse(textBoxMaxZoom.Text);
                }

                if (textBoxMinZoom.Text == "")
                {
                    classobj.minscaledenom = -1;
                }
                else
                {
                    classobj.minscaledenom = double.Parse(textBoxMinZoom.Text);
                }

                if (target != null)
                {
                    target.RaisePropertyChanged(this);
                }
                SetDirty(false);
            }
        }
コード例 #2
0
ファイル: NewClassForm.cs プロジェクト: adsort/mfeditor
        private void buttonOK_Click(object sender, EventArgs e)
        {
            if(m_pCurrentLayer != null)
            {
                classObj pClass = new classObj(m_pCurrentLayer);
                if (textBoxClassName.Text.Trim().Length > 0)
                    pClass.name = textBoxClassName.Text;

                if (textBoxGroup.Text.Trim().Length > 0)
                    pClass.group = textBoxGroup.Text;

                if (textBoxExpression.Text.Trim().Length > 0)
                    pClass.setExpression(textBoxExpression.Text);
            }
            else if (m_pCurrentClass != null)
            {
                if (textBoxClassName.Text.Trim().Length > 0)
                    m_pCurrentClass.name = textBoxClassName.Text;
                else
                    m_pCurrentClass.name = null;

                if (textBoxGroup.Text.Trim().Length > 0)
                    m_pCurrentClass.group = textBoxGroup.Text;
                else
                    m_pCurrentClass.group = null;

                if (textBoxExpression.Text.Trim().Length > 0)
                    m_pCurrentClass.setExpression(textBoxExpression.Text);
                else
                    m_pCurrentClass.setExpression(null);
            }

            this.DialogResult = DialogResult.Yes;
            this.Close();
        }