Exemplo n.º 1
0
        private IValueEditor CallOnEditorRequiredEvent(Type editorType)
        {
            EditorRequiredEventArgs editorRequiredEventArgs = new EditorRequiredEventArgs(editorType);

            if (this.tabStrip != null)
            {
                this.tabStrip.TabStripElement.CallEditorRequired(this.tab, editorRequiredEventArgs);
            }
            return(editorRequiredEventArgs.Editor);
        }
Exemplo n.º 2
0
        public virtual IInputEditor GetDefaultEditor(IEditorProvider provider)
        {
            if (provider == null)
            {
                return((IInputEditor)null);
            }
            EditorRequiredEventArgs args = new EditorRequiredEventArgs(provider.GetDefaultEditorType());

            this.gridViewElement.Template.EventDispatcher.RaiseEvent <EditorRequiredEventArgs>(EventDispatcher.EditorRequired, (object)this, args);
            bool flag = this.IsPermanentEditor(args.EditorType);

            if ((object)args.EditorType == null || flag)
            {
                return((IInputEditor)null);
            }
            if (args.Editor is IInputEditor)
            {
                IInputEditor editor = args.Editor as IInputEditor;
                editor.EditorManager = (IEditorManager)this;
                return(editor);
            }
            IInputEditor editor1 = (IInputEditor)null;

            if (!this.cachedEditors.TryGetValue(args.EditorType, out editor1))
            {
                editor1 = Activator.CreateInstance(args.EditorType) as IInputEditor;
            }
            else
            {
                RadItem editorElement = this.GetEditorElement(editor1);
                if (editorElement != null && editorElement.IsDisposed)
                {
                    this.cachedEditors.Remove(args.EditorType);
                    editor1 = Activator.CreateInstance(args.EditorType) as IInputEditor;
                }
            }
            if (editor1 != null && !this.cachedEditors.ContainsValue(editor1))
            {
                this.cachedEditors.Add(args.EditorType, editor1);
            }
            editor1.EditorManager = (IEditorManager)this;
            return(editor1);
        }