private void btnStyleSelector_Click(object sender, EventArgs e)
 {
     try
     {
         frmSymbolSelector selector = new frmSymbolSelector();
         if (selector != null)
         {
             selector.SetStyleGallery(this.m_pSG);
             if (m_pScaleText != null)
             {
                 selector.SetSymbol(m_pScaleText);
             }
             else
             {
                 selector.SetSymbol(new ScaleTextClass());
             }
             if (selector.ShowDialog() == DialogResult.OK)
             {
                 m_pScaleText = selector.GetSymbol() as IScaleText;
                 this.Init();
                 IStyleGalleryItem styleGalleryItemAt =
                     this.cboStyle.GetStyleGalleryItemAt(this.cboStyle.Items.Count - 1);
                 if (styleGalleryItemAt != null)
                 {
                     if (styleGalleryItemAt.Name == "<定制>")
                     {
                         styleGalleryItemAt.Item = m_pScaleText;
                     }
                     else
                     {
                         styleGalleryItemAt = new MyStyleGalleryItem
                         {
                             Name = "<定制>",
                             Item = m_pScaleText
                         };
                         this.cboStyle.Add(styleGalleryItemAt);
                         this.cboStyle.SelectedIndex = this.cboStyle.Items.Count - 1;
                     }
                 }
                 else
                 {
                     styleGalleryItemAt = new MyStyleGalleryItem
                     {
                         Name = "<定制>",
                         Item = m_pScaleText
                     };
                     this.cboStyle.Add(styleGalleryItemAt);
                     this.cboStyle.SelectedIndex = this.cboStyle.Items.Count - 1;
                 }
                 this.ValueChanged();
                 ScaleTextEventsClass.ScaleTextChage(this);
             }
         }
     }
     catch
     {
     }
 }
 private void colorTextSymbol_EditValueChanged(object sender, EventArgs e)
 {
     if (this.m_CanDo)
     {
         ITextSymbol symbol = m_pScaleText.Symbol;
         IColor pColor = symbol.Color;
         this.UpdateColorFromColorEdit(this.colorTextSymbol, pColor);
         symbol.Color = pColor;
         m_pScaleText.Symbol = symbol;
         ScaleTextEventsClass.ScaleTextChage(this);
         this.ValueChanged();
     }
 }
 private void chkUnderline_Click(object sender, EventArgs e)
 {
     if (this.m_CanDo)
     {
         ITextSymbol symbol = m_pScaleText.Symbol;
         stdole.IFontDisp font = symbol.Font;
         if (font.Underline != this.chkUnderline.Checked)
         {
             font.Underline = this.chkUnderline.Checked;
             symbol.Font = font;
             m_pScaleText.Symbol = symbol;
             ScaleTextEventsClass.ScaleTextChage(this);
             this.ValueChanged();
         }
     }
 }
 private void cboFontName_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (this.m_CanDo)
     {
         ITextSymbol symbol = m_pScaleText.Symbol;
         stdole.IFontDisp font = symbol.Font;
         if (font.Name != this.cboFontName.Name)
         {
             font.Name = this.cboFontName.Name;
             symbol.Font = font;
             m_pScaleText.Symbol = symbol;
             ScaleTextEventsClass.ScaleTextChage(this);
             this.ValueChanged();
         }
     }
 }
 private void cboStyle_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (this.m_CanDo)
     {
         IStyleGalleryItem selectStyleGalleryItem = this.cboStyle.GetSelectStyleGalleryItem();
         if (selectStyleGalleryItem == null)
         {
             m_pScaleText = null;
         }
         else
         {
             m_pScaleText = (selectStyleGalleryItem.Item as IClone).Clone() as IScaleText;
         }
         this.m_CanDo = false;
         this.Init();
         this.m_CanDo = true;
         this.ValueChanged();
         ScaleTextEventsClass.ScaleTextChage(this);
     }
 }
 private void cboFontSize_EditValueChanging(object sender, ChangingEventArgs e)
 {
     if (this.m_CanDo)
     {
         try
         {
             double num = double.Parse(this.cboFontSize.Text);
             ITextSymbol symbol = m_pScaleText.Symbol;
             if (symbol.Size != num)
             {
                 symbol.Size = double.Parse(this.cboFontSize.Text);
                 m_pScaleText.Symbol = symbol;
                 ScaleTextEventsClass.ScaleTextChage(this);
                 this.ValueChanged();
             }
         }
         catch
         {
         }
     }
 }
 private void btnSymbolSelector_Click(object sender, EventArgs e)
 {
     try
     {
         ITextSymbol pSym = m_pScaleText.Symbol;
         frmSymbolSelector selector = new frmSymbolSelector();
         if (selector != null)
         {
             selector.SetStyleGallery(this.m_pSG);
             selector.SetSymbol(pSym);
             if (selector.ShowDialog() == DialogResult.OK)
             {
                 pSym = selector.GetSymbol() as ITextSymbol;
                 m_pScaleText.Symbol = pSym;
                 this.SetTextSymbol(pSym);
                 ScaleTextEventsClass.ScaleTextChage(this);
                 this.ValueChanged();
             }
         }
     }
     catch
     {
     }
 }