예제 #1
0
 public DrawEventArgs(TreeNodeAdv node, EditableControl control, DrawContext context, string text)
     : base(node)
 {
     _control = control;
     _context = context;
     _text    = text;
 }
		public DrawEventArgs(TreeNodeAdv node, EditableControl control, DrawContext context, string text)
			: base(node)
		{
			_control = control;
			_context = context;
			_text = text;
		}
		internal void DisplayEditor(Control editor, EditableControl owner)
		{
			if (editor == null || owner == null || CurrentNode == null)
				throw new ArgumentNullException();

			HideEditor(false);

			CurrentEditor = editor;
			CurrentEditorOwner = owner;
			_editingNode = CurrentNode;

			editor.Validating += EditorValidating;
			UpdateEditorBounds();
			UpdateView();
			editor.Parent = this;
			editor.Focus();
			owner.UpdateEditor(editor);
		}
예제 #4
0
 public void HideEditor()
 {
     if (_currentEditorOwner != null)
        {
     _currentEditorOwner.HideEditor(_currentEditor);
     _currentEditor = null;
     _currentEditorOwner = null;
        }
 }
예제 #5
0
        public void DisplayEditor(Control control, EditableControl owner)
        {
            if (control == null || owner == null)
            throw new ArgumentNullException();

               if (CurrentNode != null)
               {
            HideEditor();
            _currentEditor = control;
            _currentEditorOwner = owner;
            UpdateEditorBounds();

            UpdateView();
            control.Parent = this;
            control.Focus();
            owner.UpdateEditor(control);
               }
        }
예제 #6
0
        internal bool HideEditor(bool applyChanges)
        {
            if (CurrentEditor != null)
            {
                if (applyChanges)
                {
                    if (!ApplyChanges())
                        return false;
                }

                //Check once more if editor was closed in ApplyChanges
                if (CurrentEditor != null)
                {
                    CurrentEditor.Validating -= EditorValidating;
                    CurrentEditor.Leave -= EditorLeave;
                    CurrentEditor.LostFocus -= EditorLeave;
                    CurrentEditorOwner.DoDisposeEditor(CurrentEditor);

                    CurrentEditor.Parent = null;
                    CurrentEditor.Dispose();

                    CurrentEditor = null;
                    CurrentEditorOwner = null;
                    _editingNode = null;
                }
            }
            return true;
        }
예제 #7
0
        public void DisplayEditor(Control control, EditableControl owner)
        {
            if (control == null || owner == null)
                throw new ArgumentNullException();

            if (CurrentNode != null)
            {
                DisposeEditor();
                EditorContext context = new EditorContext();
                context.Owner = owner;
                context.CurrentNode = CurrentNode;
                context.Editor = control;

                SetEditorBounds(context);

                _currentEditor = control;
                _currentEditorOwner = owner;
                UpdateView();
                control.Parent = this;
                control.Focus();
                owner.UpdateEditor(control);
            }
        }
예제 #8
0
 private void DisposeEditor()
 {
     if (_currentEditor != null)
         _currentEditor.Parent = null;
     if (_currentEditor != null)
         _currentEditor.Dispose();
     _currentEditor = null;
     _currentEditorOwner = null;
 }