Ejemplo n.º 1
0
        protected virtual bool TryCreateEditor(
            CreateEditorCallback createEditor,
            out IEditor editor)
        {
            if (createEditor is null)
            {
                editor = null;
                return(false);
            }

            try
            {
                editor = createEditor();
            }
            catch (Exception ex)
            {
                if (ExceptionHandler is null)
                {
                    throw ex;
                }

                ExceptionHandler.ShowException(ex);
                editor = null;
                return(false);
            }

            return(true);
        }
Ejemplo n.º 2
0
 public void AddAssociation(
     Image fileIcon,
     string fileType,
     string description,
     Image previewImage,
     CreateEditorCallback createEditorCallback)
 {
     CreateEditorForm.AddAssociation(
         fileIcon,
         fileType,
         description,
         previewImage,
         createEditorCallback);
 }
Ejemplo n.º 3
0
        public void AddAssociation(
            Image fileIcon,
            string fileType,
            string description,
            Image previewImage,
            CreateEditorCallback createEditorCallback)
        {
            var entry = new NewFileIconAssociation()
            {
                FileIcon             = fileIcon,
                FileType             = fileType,
                Description          = description,
                PreviewImage         = previewImage,
                CreateEditorCallback = createEditorCallback,
            };

            AddAssociation(entry);
        }
Ejemplo n.º 4
0
        public EditorList(int minIndex, int maxIndex, CreateEditorCallback createEditor, LoadEditorCallback loadEditor)
        {
            mMinIndex          = minIndex;
            mMaxIndex          = maxIndex;
            mCreateEditor      = createEditor;
            mLoadEditor        = loadEditor;
            mFirstVisibleIndex = 0;

            IsReloading            = false;
            mReadOnly              = false;
            mResizeInProgress      = false;
            mSizeAdaptationPending = false;

            mEditorsSyncRoot = new object();
            mEditors         = new List <T>();

            InitializeComponent();
        }
Ejemplo n.º 5
0
        public void NewFile(CreateEditorCallback createEditor)
        {
            if (createEditor is null)
            {
                throw new ArgumentNullException(nameof(createEditor));
            }

            if (!TryCreateEditor(createEditor, out var editor))
            {
                return;
            }

            if (editor is null)
            {
                return;
            }

            OnEditorCreated(new EditorEventArgs(editor));
        }
Ejemplo n.º 6
0
 public MixByteCollectionEditorList(int maxWordCount, CreateEditorCallback createEditor, LoadEditorCallback loadEditor)
     : base(0, maxWordCount - 1, createEditor, loadEditor)
 {
 }
Ejemplo n.º 7
0
 public WordEditorList(int minIndex, int maxIndex, CreateEditorCallback createEditor, LoadEditorCallback loadEditor)
     : base(minIndex, maxIndex, createEditor, loadEditor)
 {
 }