コード例 #1
0
        private void listViewStyle_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            if (listViewStyle.SelectedIndices.Count > 0)
            {
                tabControl1.TabPages.Clear();
                GSOStyle         oldStyle   = null;
                EnumAltitudeMode oldAltMode = m_Geometry.AltitudeMode;
                // 先复制一个原来的哦,以便在对话框取消的时候恢复
                if (m_Geometry.Style != null)
                {
                    oldStyle = m_Geometry.Style.Clone();
                }
                if (listViewStyle.SelectedIndices[0] == 0)
                {
                    GSOSimpleLineStyle3D simpleLineStyle = m_Geometry.Style as GSOSimpleLineStyle3D;
                    if (simpleLineStyle == null)
                    {
                        m_Geometry.Style = new GSOSimpleLineStyle3D();
                    }

                    FrmSetLineStyle dlg = new FrmSetLineStyle(m_Geometry.Style, mfeature, mlayer, m_GlobeControl);
                    if (dlg.ShowDialog(this) == DialogResult.Cancel)
                    {
                        m_Geometry.Style = oldStyle;
                    }
                }
                else if (listViewStyle.SelectedIndices[0] == 1)
                {
                    GSOPipeLineStyle3D pipeLineStyle = m_Geometry.Style as GSOPipeLineStyle3D;

                    // 管线暂不支持依地模式
                    if (m_Geometry.AltitudeMode == EnumAltitudeMode.ClampToGround)
                    {
                        m_Geometry.AltitudeMode = EnumAltitudeMode.RelativeToGround;
                    }
                    if (pipeLineStyle == null)
                    {
                        m_Geometry.Style = new GSOPipeLineStyle3D();
                    }

                    FrmSetPipelineStyle dlg = new FrmSetPipelineStyle(m_Geometry.Style, mfeature, mlayer, m_GlobeControl);

                    // 恢复一下
                    if (dlg.ShowDialog(this) == DialogResult.Cancel)
                    {
                        m_Geometry.Style        = oldStyle;
                        m_Geometry.AltitudeMode = oldAltMode;
                    }
                }
            }
        }
コード例 #2
0
ファイル: CtrlLineStylePage.cs プロジェクト: StarU/qkKL6Dgf12
        private void listViewStyle_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            if(listViewStyle.SelectedIndices.Count>0)
            {
                tabControl1.TabPages.Clear();
                GSOStyle oldStyle = null;
                EnumAltitudeMode oldAltMode = m_Geometry.AltitudeMode;
                // 先复制一个原来的哦,以便在对话框取消的时候恢复
                if (m_Geometry.Style != null)
                {
                    oldStyle = m_Geometry.Style.Clone();
                }
                if (listViewStyle.SelectedIndices[0]==0)
                {
                    GSOSimpleLineStyle3D simpleLineStyle =m_Geometry.Style as GSOSimpleLineStyle3D;
                    if(simpleLineStyle == null )
                    {
                        m_Geometry.Style = new GSOSimpleLineStyle3D();
                    }

                    FrmSetLineStyle dlg = new FrmSetLineStyle(m_Geometry.Style,mfeature,mlayer,m_GlobeControl);
                    if (dlg.ShowDialog(this)==DialogResult.Cancel)
                    {
                        m_Geometry.Style = oldStyle;
                    }
                }
                else if (listViewStyle.SelectedIndices[0]==1)
                {
                    GSOPipeLineStyle3D pipeLineStyle = m_Geometry.Style as GSOPipeLineStyle3D;

                    // 管线暂不支持依地模式
                    if (m_Geometry.AltitudeMode==EnumAltitudeMode.ClampToGround)
                    {
                        m_Geometry.AltitudeMode = EnumAltitudeMode.RelativeToGround;
                    }
                    if (pipeLineStyle == null)
                    {
                        m_Geometry.Style = new GSOPipeLineStyle3D();
                    }

                    FrmSetPipelineStyle dlg = new FrmSetPipelineStyle(m_Geometry.Style,mfeature,mlayer, m_GlobeControl);

                    // 恢复一下
                    if (dlg.ShowDialog(this) == DialogResult.Cancel)
                    {
                        m_Geometry.Style = oldStyle;
                        m_Geometry.AltitudeMode = oldAltMode;

                    }
                }
            }
        }