public override bool Apply()
        {
            double val = 0.0;

            try
            {
                val = double.Parse(this.textBox1.Text);
            }
            catch
            {
                MessageBox.Show("请出入数字型数据!");
                return(false);
            }
            if ((this.comboBox1.SelectedIndex == -1) || (this.comboBox2.SelectedIndex == -1))
            {
                return(false);
            }
            IGraphicAttributes stroke = (base.m_pGeometricEffect as IBasicLineSymbol).Stroke as IGraphicAttributes;

            stroke.set_Value((int)this.textBox1.Tag, val);
            stroke.set_Value((int)this.comboBox1.Tag, this.comboBox1.SelectedIndex);
            stroke.set_Value((int)this.comboBox2.Tag, this.comboBox2.SelectedIndex);
            stroke.set_Value((int)this.symbolItem1.Tag, this.symbolItem1.Symbol);
            return(true);
        }
Example #2
0
        public override bool Apply()
        {
            IGraphicAttributes fillPattern =
                (base.m_pGeometricEffect as IBasicFillSymbol).FillPattern as IGraphicAttributes;

            if (fillPattern.ClassName == "1")
            {
                fillPattern.set_Value((int)this.symbolItem1.Tag, this.symbolItem1.Symbol);
            }
            else
            {
                double num;
                double num2;
                if (fillPattern.ClassName == "2")
                {
                    num  = 0.0;
                    num2 = 0.0;
                    double val  = 0.0;
                    double num4 = 0.0;
                    try
                    {
                        num = double.Parse(this.txtWidth.Text);
                    }
                    catch
                    {
                        MessageBox.Show("请出入数字型数据!");
                        return(false);
                    }
                    try
                    {
                        num2 = double.Parse(this.txtAngle.Text);
                    }
                    catch
                    {
                        MessageBox.Show("请出入数字型数据!");
                        return(false);
                    }
                    try
                    {
                        val = double.Parse(this.txtStep.Text);
                    }
                    catch
                    {
                        MessageBox.Show("请出入数字型数据!");
                        return(false);
                    }
                    try
                    {
                        num4 = double.Parse(this.txtOffset.Text);
                    }
                    catch
                    {
                        MessageBox.Show("请出入数字型数据!");
                        return(false);
                    }
                    fillPattern.set_Value((int)this.HatchsymbolItem.Tag, this.HatchsymbolItem.Symbol);
                    fillPattern.set_Value((int)this.txtWidth.Tag, num);
                    fillPattern.set_Value((int)this.txtAngle.Tag, num2);
                    fillPattern.set_Value((int)this.txtStep.Tag, val);
                    fillPattern.set_Value((int)this.txtOffset.Tag, num4);
                }
                else if (fillPattern.ClassName == "3")
                {
                    num = 0.0;
                    double num5 = 0.0;
                    num2 = 0.0;
                    try
                    {
                        num = double.Parse(this.txtInterval.Text);
                    }
                    catch
                    {
                        MessageBox.Show("请出入数字型数据!");
                        return(false);
                    }
                    try
                    {
                        num5 = double.Parse(this.txtInterval.Text);
                    }
                    catch
                    {
                        MessageBox.Show("请出入数字型数据!");
                        return(false);
                    }
                    try
                    {
                        num2 = double.Parse(this.txtAngle.Text);
                    }
                    catch
                    {
                        MessageBox.Show("请出入数字型数据!");
                        return(false);
                    }
                    if ((this.comboBox1.SelectedIndex == -1) || (this.comboBox2.SelectedIndex == -1))
                    {
                        return(false);
                    }
                    fillPattern.set_Value((int)this.symbolItemColor1.Tag, this.symbolItemColor1.Symbol);
                    fillPattern.set_Value((int)this.symbolItemColor2.Tag, this.symbolItemColor2.Symbol);
                    fillPattern.set_Value((int)this.comboBox1.Tag, this.comboBox1.SelectedIndex);
                    fillPattern.set_Value((int)this.comboBox2.Tag, this.comboBox2.SelectedIndex);
                    fillPattern.set_Value((int)this.txtInterval.Tag, num);
                    fillPattern.set_Value((int)this.txtAngleGrad.Tag, num2);
                    fillPattern.set_Value((int)this.txtPercent.Tag, num5);
                }
            }
            return(true);
        }