示例#1
0
 private void btnSymbol_Click(object sender, EventArgs e)
 {
     try
     {
         frmSymbolSelector selector = new frmSymbolSelector();
         if (selector != null)
         {
             selector.SetStyleGallery(this.m_pSG);
             selector.SetSymbol(this.m_RealTimeDestination.DestinationSymbol);
             if (selector.ShowDialog() == DialogResult.OK)
             {
                 this.btnSymbol.Style = selector.GetSymbol();
                 this.ValueChange();
             }
         }
     }
     catch
     {
     }
 }
 private void btnStyle_Click(object sender, EventArgs e)
 {
     try
     {
         frmSymbolSelector selector = new frmSymbolSelector();
         if (selector != null)
         {
             selector.SetStyleGallery(this.istyleGallery_0);
             selector.SetSymbol(this.btnStyle.Style);
             if (selector.ShowDialog() == DialogResult.OK)
             {
                 this.btnStyle.Style = selector.GetSymbol();
                 this.idataExclusion_0.ExclusionSymbol = this.btnStyle.Style as ISymbol;
             }
         }
     }
     catch
     {
     }
 }
示例#3
0
 private void btnMinSymbol_Click(object sender, EventArgs e)
 {
     try
     {
         frmSymbolSelector selector = new frmSymbolSelector();
         if (selector != null)
         {
             selector.SetStyleGallery(this.istyleGallery_0);
             selector.SetSymbol(this.btnMinSymbol.Style);
             if (selector.ShowDialog() == DialogResult.OK)
             {
                 this.btnMinSymbol.Style = selector.GetSymbol();
                 this.iproportionalSymbolRenderer_0.MinSymbol = this.btnMinSymbol.Style as ISymbol;
                 this.GetMinMaxValue();
             }
         }
     }
     catch
     {
     }
 }
        private void btnSimpleBorderLineSymbol_Click(object sender, EventArgs e)
        {
            frmSymbolSelector selector = new frmSymbolSelector();
            ILineSymbol       style    = this.btnSimpleBorderLineSymbol.Style as ILineSymbol;

            if (style == null)
            {
                style = new SimpleLineSymbolClass();
            }
            selector.SetSymbol(style);
            selector.SetStyleGallery(ApplicationBase.StyleGallery);
            if (selector.ShowDialog() == DialogResult.OK)
            {
                this.btnSimpleBorderLineSymbol.Style = selector.GetSymbol();
                if (this.imapGrid_0.Border is ISimpleMapGridBorder)
                {
                    (this.imapGrid_0.Border as ISimpleMapGridBorder).LineSymbol =
                        this.btnSimpleBorderLineSymbol.Style as ILineSymbol;
                }
            }
        }
示例#5
0
 private void btnPointSymbol_Click(object sender, EventArgs e)
 {
     try
     {
         IMarkerSymbol     style    = this.btnPointSymbol.Style as IMarkerSymbol;
         frmSymbolSelector selector = new frmSymbolSelector();
         if (selector != null)
         {
             selector.SetStyleGallery(this.m_pSG);
             selector.SetSymbol(style);
             if (selector.ShowDialog() == DialogResult.OK)
             {
                 style = selector.GetSymbol() as IMarkerSymbol;
                 this.btnPointSymbol.Style = style;
                 this.ValueChange();
             }
         }
     }
     catch
     {
     }
 }
示例#6
0
 private void btnSymbolSelector_Click(object sender, EventArgs e)
 {
     try
     {
         ITextSymbol       unitLabelSymbol = ScaleBarFormatPropertyPage.m_pScaleBar.UnitLabelSymbol;
         frmSymbolSelector selector        = new frmSymbolSelector();
         if (selector != null)
         {
             selector.SetStyleGallery(this.istyleGallery_0);
             selector.SetSymbol(unitLabelSymbol);
             if (selector.ShowDialog() == DialogResult.OK)
             {
                 unitLabelSymbol = selector.GetSymbol() as ITextSymbol;
                 ScaleBarFormatPropertyPage.m_pScaleBar.UnitLabelSymbol = unitLabelSymbol;
                 this.method_1();
             }
         }
     }
     catch
     {
     }
 }
示例#7
0
 private void btnStyle_Click(object sender, EventArgs e)
 {
     try
     {
         //MessageBox.Show("Click Style Button");
         frmSymbolSelector selector = new frmSymbolSelector();
         if (selector != null)
         {
             selector.SetStyleGallery(this.istyleGallery_0);
             selector.SetSymbol(this.btnStyle.Style);
             if (selector.ShowDialog() == DialogResult.OK)
             {
                 this.btnStyle.Style           = selector.GetSymbol();
                 this.isimpleRenderer_0.Symbol = this.btnStyle.Style as ISymbol;
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
 private void btnLabelSymbolSelector_Click(object sender, EventArgs e)
 {
     try
     {
         ITextSymbol       labelSymbol = MapCartoTemplateLib.ScaleBarFormatPropertyPage.m_pScaleBar.LabelSymbol;
         frmSymbolSelector selector    = new frmSymbolSelector();
         if (selector != null)
         {
             selector.SetStyleGallery(ApplicationBase.StyleGallery);
             selector.SetSymbol(labelSymbol);
             if (selector.ShowDialog() == DialogResult.OK)
             {
                 labelSymbol = selector.GetSymbol() as ITextSymbol;
                 MapCartoTemplateLib.ScaleBarFormatPropertyPage.m_pScaleBar.LabelSymbol = labelSymbol;
                 this.method_2();
             }
         }
     }
     catch
     {
     }
 }
示例#9
0
 private void styleButton1_Click(object sender, EventArgs e)
 {
     try
     {
         frmSymbolSelector selector = new frmSymbolSelector();
         selector.SetStyleGallery(this.istyleGallery_0);
         selector.SetSymbol(this.itextSymbol_0);
         if (selector.ShowDialog() == DialogResult.OK)
         {
             object symbol = selector.GetSymbol();
             this.itextSymbol_0 = symbol as ITextSymbol;
             IGridLabel labelFormat = this.imapGrid_0.LabelFormat;
             labelFormat.Font            = this.itextSymbol_0.Font;
             labelFormat.Color           = this.itextSymbol_0.Color;
             this.imapGrid_0.LabelFormat = labelFormat;
             this.styleButton1.Style     = this.itextSymbol_0;
         }
     }
     catch
     {
     }
 }
 private void btnSubdivisionMarkSymbol_Click(object sender, EventArgs e)
 {
     try
     {
         IScaleMarks       pScaleBar             = MapCartoTemplateLib.ScaleBarFormatPropertyPage.m_pScaleBar as IScaleMarks;
         ILineSymbol       subdivisionMarkSymbol = pScaleBar.SubdivisionMarkSymbol;
         frmSymbolSelector selector = new frmSymbolSelector();
         if (selector != null)
         {
             selector.SetStyleGallery(ApplicationBase.StyleGallery);
             selector.SetSymbol(subdivisionMarkSymbol);
             if (selector.ShowDialog() == DialogResult.OK)
             {
                 subdivisionMarkSymbol           = selector.GetSymbol() as ILineSymbol;
                 pScaleBar.SubdivisionMarkSymbol = subdivisionMarkSymbol;
                 this.method_2();
             }
         }
     }
     catch
     {
     }
 }
示例#11
0
 private void btnNorthMarkerSymbolSelector_Click(object sender, EventArgs e)
 {
     try
     {
         frmSymbolSelector selector = new frmSymbolSelector();
         if (selector != null)
         {
             selector.SetStyleGallery(this.istyleGallery_0);
             selector.SetSymbol((this.inorthArrow_0 as IMarkerNorthArrow).MarkerSymbol);
             if (selector.ShowDialog() == DialogResult.OK)
             {
                 (this.inorthArrow_0 as IMarkerNorthArrow).MarkerSymbol = selector.GetSymbol() as IMarkerSymbol;
                 this.bool_0 = false;
                 this.method_1();
                 this.bool_0 = true;
                 this.method_0();
             }
         }
     }
     catch
     {
     }
 }
示例#12
0
        private void btnStyle_Click(object sender, EventArgs e)
        {
            frmSymbolSelector selector = new frmSymbolSelector();

            selector.SetStyleGallery(ApplicationBase.StyleGallery);
            selector.SetSymbol(this.btnStyle.Style);
            if (selector.ShowDialog() == DialogResult.OK)
            {
                this.btnStyle.Style = selector.GetSymbol();
                if (this.rdoPointSymbol.Checked)
                {
                    this.imarkerSymbol_0 = this.btnStyle.Style as IMarkerSymbol;
                }
                else if (this.rdoLineSymbol.Checked)
                {
                    this.ilineSymbol_0 = this.btnStyle.Style as ILineSymbol;
                }
                else
                {
                    this.ifillSymbol_0 = this.btnStyle.Style as IFillSymbol;
                }
            }
        }
 private void btnDivisionMarkSymbol_Click(object sender, EventArgs e)
 {
     try
     {
         IScaleMarks       pScaleBar          = ScaleBarFormatPropertyPage.m_pScaleBar as IScaleMarks;
         ILineSymbol       divisionMarkSymbol = pScaleBar.DivisionMarkSymbol;
         frmSymbolSelector selector           = new frmSymbolSelector();
         if (selector != null)
         {
             selector.SetStyleGallery(this.istyleGallery_0);
             selector.SetSymbol(divisionMarkSymbol);
             if (selector.ShowDialog() == DialogResult.OK)
             {
                 divisionMarkSymbol           = selector.GetSymbol() as ILineSymbol;
                 pScaleBar.DivisionMarkSymbol = divisionMarkSymbol;
                 this.method_2();
             }
         }
     }
     catch
     {
     }
 }
示例#14
0
 private void btnNorthArrorSelector_Click(object sender, EventArgs e)
 {
     try
     {
         frmSymbolSelector selector = new frmSymbolSelector();
         if (selector != null)
         {
             selector.SetStyleGallery(ApplicationBase.StyleGallery);
             selector.SetSymbol(this.inorthArrow_0);
             if (selector.ShowDialog() == DialogResult.OK)
             {
                 this.inorthArrow_0 = selector.GetSymbol() as INorthArrow;
                 this.bool_0        = false;
                 this.method_1();
                 this.bool_0 = true;
                 this.method_0();
             }
         }
     }
     catch
     {
     }
 }
 private void btnSymbol2Selector_Click(object sender, EventArgs e)
 {
     try
     {
         if (m_pScaleBar is IDoubleFillScaleBar)
         {
             ISymbol           pSym     = (m_pScaleBar as IDoubleFillScaleBar).FillSymbol2 as ISymbol;
             frmSymbolSelector selector = new frmSymbolSelector();
             if (selector != null)
             {
                 selector.SetStyleGallery(this.istyleGallery_0);
                 selector.SetSymbol(pSym);
                 if (selector.ShowDialog() == DialogResult.OK)
                 {
                     (m_pScaleBar as IDoubleFillScaleBar).FillSymbol2 = selector.GetSymbol() as IFillSymbol;
                     this.method_4();
                 }
             }
         }
     }
     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.istyleGallery_0);
             selector.SetSymbol(pSym);
             if (selector.ShowDialog() == DialogResult.OK)
             {
                 pSym = selector.GetSymbol() as ITextSymbol;
                 m_pScaleText.Symbol = pSym;
                 this.method_1(pSym);
                 ScaleTextEventsClass.ScaleTextChage(this);
                 this.method_4();
             }
         }
     }
     catch
     {
     }
 }
示例#17
0
 private void btnBackgroundSelector_Click(object sender, EventArgs e)
 {
     try
     {
         frmSymbolSelector selector = new frmSymbolSelector();
         if (selector != null)
         {
             IStyleGalleryItem selectStyleGalleryItem = this.cboBackground.GetSelectStyleGalleryItem();
             IBackground       pSym = null;
             if (selectStyleGalleryItem != null)
             {
                 pSym = selectStyleGalleryItem.Item as IBackground;
             }
             selector.SetStyleGallery(this.istyleGallery_0);
             if (pSym != null)
             {
                 selector.SetSymbol(pSym);
             }
             else
             {
                 selector.SetSymbol(new SymbolBackgroundClass());
             }
             if (selector.ShowDialog() == DialogResult.OK)
             {
                 pSym                   = selector.GetSymbol() as IBackground;
                 this.bool_0            = false;
                 selectStyleGalleryItem =
                     this.cboBackground.GetStyleGalleryItemAt(this.cboBackground.Items.Count - 1);
                 if (selectStyleGalleryItem != null)
                 {
                     if (selectStyleGalleryItem.Name == "<定制>")
                     {
                         selectStyleGalleryItem.Item = pSym;
                     }
                     else
                     {
                         selectStyleGalleryItem = new MyStyleGalleryItem
                         {
                             Name = "<定制>",
                             Item = pSym
                         };
                         this.cboBackground.Add(selectStyleGalleryItem);
                         this.cboBackground.SelectedIndex = this.cboBackground.Items.Count - 1;
                     }
                 }
                 else
                 {
                     selectStyleGalleryItem = new MyStyleGalleryItem
                     {
                         Name = "<定制>",
                         Item = pSym
                     };
                     this.cboBackground.Add(selectStyleGalleryItem);
                     this.cboBackground.SelectedIndex = this.cboBackground.Items.Count - 1;
                 }
                 this.bool_0 = true;
             }
         }
     }
     catch
     {
     }
 }
示例#18
0
 private void RenderInfoListView_DoubleClick(object sender, EventArgs e)
 {
     if (base.SelectedItems.Count > 0)
     {
         Rectangle itemRect = base.GetItemRect(base.SelectedIndices[0]);
         int       nX       = this.m_nX;
         int       left     = itemRect.Left;
         int       num3     = itemRect.Left;
         int       index    = 0;
         while (index < base.Columns.Count)
         {
             left  = num3;
             num3 += base.Columns[index].Width;
             if ((nX > left) && (nX < num3))
             {
                 break;
             }
             index++;
         }
         if (index != 0)
         {
             if (((base.SelectedItems.Count == 1) && (this.ColumnEditables != null)) &&
                 this.ColumnEditables[index])
             {
                 this.m_EditColumIndex  = index;
                 this.m_preListViewItem = base.SelectedItems[0];
                 this.textBox.Size      = new Size(num3 - left, this.m_preListViewItem.Bounds.Height);
                 this.textBox.Location  = new System.Drawing.Point(left, this.m_preListViewItem.Bounds.Y);
                 this.textBox.Show();
                 this.textBox.Text = this.m_preListViewItem.SubItems[this.m_EditColumIndex].Text;
                 this.textBox.SelectAll();
                 this.textBox.Focus();
             }
         }
         else
         {
             try
             {
                 frmSymbolSelector selector = new frmSymbolSelector();
                 selector.SetStyleGallery(this.m_pSG);
                 ListViewItemEx ex = base.Items[base.SelectedIndices[0]] as ListViewItemEx;
                 selector.SetSymbol(ex.Style);
                 if (selector.ShowDialog() == DialogResult.OK)
                 {
                     ex.Style = selector.SelectedStyleGalleryItem;
                     if (this.m_pSG != null)
                     {
                         ex.StyleFileName = (this.m_pSG as IStyleGalleryStorage).TargetFile;
                     }
                     this.ResetItemHeight();
                     base.Invalidate();
                     if (this.OnValueChanged != null)
                     {
                         this.OnValueChanged(base.SelectedIndices[0], ex.Style);
                     }
                 }
             }
             catch
             {
             }
         }
     }
 }
示例#19
0
        private bool method_0()
        {
            IActiveView        activeView        = this._context.ActiveView;
            IGraphicsContainer graphicsContainer = activeView.GraphicsContainer;
            bool result;

            if (graphicsContainer == null)
            {
                result = false;
            }
            else
            {
                try
                {
                    frmSymbolSelector frmSymbolSelector = new frmSymbolSelector();
                    if (frmSymbolSelector == null)
                    {
                        result = false;
                        return(result);
                    }
                    IScaleText scaleText = new ScaleText();
                    frmSymbolSelector.SetSymbol(scaleText);
                    frmSymbolSelector.SetStyleGallery(this._context.StyleGallery);
                    if (frmSymbolSelector.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                    {
                        scaleText = (frmSymbolSelector.GetSymbol() as IScaleText);
                        if (scaleText == null)
                        {
                            result = false;
                            return(result);
                        }
                        UID clsid = new UID
                        {
                            Value = "esriCarto.ScaleText"
                        };
                        IMapFrame mapFrame = graphicsContainer.FindFrame(activeView.FocusMap) as IMapFrame;
                        scaleText.MapUnits = mapFrame.Map.MapUnits;
                        IMapSurroundFrame mapSurroundFrame = mapFrame.CreateSurroundFrame(clsid, scaleText);
                        IElement          element          = mapSurroundFrame as IElement;
                        IEnvelope         envelope         = new Envelope() as IEnvelope;
                        envelope.PutCoords(5.0, 13.0, 8.0, 14.0);
                        IEnvelope envelope2 = new Envelope() as IEnvelope;
                        scaleText.QueryBounds(this._context.ActiveView.ScreenDisplay, envelope, envelope2);
                        element.Geometry = envelope2;
                        INewElementOperation operation = new NewElementOperation
                        {
                            ActiveView = this._context.ActiveView,
                            Element    = element
                        };
                        this._context.OperationStack.Do(operation);
                        result = true;
                        return(result);
                    }
                }
                catch
                {
                }
                result = false;
            }
            return(result);
        }