Example #1
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 webLayoutEditorCtrl = new WebLayoutEditorCtrl();

            webLayoutEditorCtrl.Dock = DockStyle.Fill;
            panelBody.Controls.Add(webLayoutEditorCtrl);

            webLayoutEditorCtrl.Bind(service);
        }
Example #2
0
        private void LoadWebLayoutEditor(string webLayoutId)
        {
            //Tear down existing editor service if needed
            if (_edSvc != null)
            {
                _edSvc.DirtyStateChanged -= OnDirtyStateChanged;
            }

            _edSvc = new MyResourceEditorService(webLayoutId, _conn);
            _edSvc.DirtyStateChanged += OnDirtyStateChanged;
            //Each resource editor is named in the form: [Resource Type]EditorCtrl
            var ed = new WebLayoutEditorCtrl();

            ed.Dock = DockStyle.Fill;

            panel1.Controls.Clear();
            panel1.Controls.Add(ed);

            //Bind() performs all the setup work. Do this after adding the control to whatever parent container
            ed.Bind(_edSvc);
        }