Beispiel #1
0
        public bool TryGetCreator(
            Type type,
            out Func <IEditor, Form> createEditorForm)
        {
            if (type.GetInterface(nameof(IEditor)) is null)
            {
                throw new InvalidCastException();
            }

            return(EditorFormCreator.TryGetValue(
                       type,
                       out createEditorForm));
        }
Beispiel #2
0
        public bool TryGetCreator(
            IEditor editor,
            out Func <IEditor, Form> createEditorForm)
        {
            if (editor is null)
            {
                throw new ArgumentNullException(nameof(editor));
            }

            return(EditorFormCreator.TryGetValue(
                       editor.GetType(),
                       out createEditorForm));
        }