コード例 #1
0
 protected override void Bind(Maestro.Editors.IEditorService service)
 {
     panelBody.Controls.Clear();
     var ssym = service.GetEditedResource() as ISimpleSymbolDefinition;
     var csym = service.GetEditedResource() as ICompoundSymbolDefinition;
     if (ssym != null)
     {
         var ssymCtrl = new SimpleSymbolDefinitionEditorCtrl();
         ssymCtrl.Dock = DockStyle.Fill;
         panelBody.Controls.Add(ssymCtrl);
         ssymCtrl.Bind(service);
     }
     else if (csym != null)
     {
         var csymCtrl = new CompoundSymbolDefinitionEditorCtrl();
         csymCtrl.Dock = DockStyle.Fill;
         panelBody.Controls.Add(csymCtrl);
         csymCtrl.Bind(service);
     }
 }
コード例 #2
0
ファイル: LayerDefinitionEditor.cs プロジェクト: kanbang/Colt
        protected override void Bind(Maestro.Editors.IEditorService service)
        {
            if (!_init)
            {
                _edsvc = service;
                _res = service.GetEditedResource() as ILayerDefinition;
                Debug.Assert(_res != null);
                _init = true;
            }

            panelBody.Controls.Clear();

            var vl = _res.SubLayer as IVectorLayerDefinition;
            var gl = _res.SubLayer as IRasterLayerDefinition;
            var dl = _res.SubLayer as IDrawingLayerDefinition;
            if (vl != null)
            {
                var ed = new VectorLayerEditorCtrl();
                ed.Bind(service);
                ed.Dock = DockStyle.Fill;
                panelBody.Controls.Add(ed);
            }
            else if (gl != null)
            {
                var ed = new RasterLayerEditorCtrl();
                ed.Bind(service);
                ed.Dock = DockStyle.Fill;
                panelBody.Controls.Add(ed);
            }
            else if (dl != null)
            {
                var ed = new DrawingLayerEditorCtrl();
                ed.Bind(service);
                ed.Dock = DockStyle.Fill;
                panelBody.Controls.Add(ed);
            }
            else
            {
                throw new NotSupportedException(Strings.LayerSubTypeNotSupported);
            }
        }
コード例 #3
0
ファイル: LoadProcedureEditor.cs プロジェクト: kanbang/Colt
        protected override void Bind(Maestro.Editors.IEditorService service)
        {
            panelBody.Controls.Clear();
            var lp = (ILoadProcedure)service.GetEditedResource();
            //DWG and Raster load procedures cannot be edited with this editor so load placeholder
            if (lp.SubType.Type == LoadType.Dwg ||
                lp.SubType.Type == LoadType.Raster)
            {
                var ctrl = new UnsupportedEditorControl();
                ctrl.Dock = DockStyle.Fill;
                panelBody.Controls.Add(ctrl);
            }
            else
            {
                var lpEditor = new LoadProcedureEditorCtrl();
                lpEditor.Dock = DockStyle.Fill;
                panelBody.Controls.Add(lpEditor);

                lpEditor.Bind(service);
            }
        }