Exemplo n.º 1
0
        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);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Binds the specified resource to this control. This effectively initializes
        /// all the fields in this control and sets up databinding on all fields. All
        /// subclasses *must* override this method.
        ///
        /// Also note that this method may be called more than once (e.g. Returning from
        /// and XML edit of this resource). Thus subclasses must take this scenario into
        /// account when implementing
        /// </summary>
        /// <param name="service">The editor service</param>
        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);
            }
        }