コード例 #1
0
ファイル: ModelingEditor.xaml.cs プロジェクト: 569550384/Rafy
        public ModelingEditor(EditorPane owner)
        {
            _owner = owner;
            _dte = owner.DTE;

            InitializeComponent();

            designer.Blocks.CollectionChanged += Blocks_CollectionChanged;

            AddChangedHandler();
            AllowDropFile();
        }
コード例 #2
0
ファイル: EditorProperties.cs プロジェクト: 569550384/Rafy
 public EditorProperties(EditorPane editor)
 {
     _editor = editor;
     _designer = editor.Designer;
 }
コード例 #3
0
ファイル: EditorFactory.cs プロジェクト: 569550384/Rafy
        public int CreateEditorInstance(
            uint grfCreateDoc,
            string pszMkDocument,
            string pszPhysicalView,
            IVsHierarchy pvHier,
            uint itemid,
            System.IntPtr punkDocDataExisting,
            out System.IntPtr ppunkDocView,
            out System.IntPtr ppunkDocData,
            out string pbstrEditorCaption,
            out Guid pguidCmdUI,
            out int pgrfCDW)
        {
            Debug.WriteLine(string.Format(CultureInfo.CurrentCulture, "Entering {0} CreateEditorInstace()", this.ToString()));

            // Initialize to null
            ppunkDocView = IntPtr.Zero;
            ppunkDocData = IntPtr.Zero;
            pguidCmdUI = GuidList.guidVSPackageEditorFactory;
            pgrfCDW = 0;
            pbstrEditorCaption = null;

            // Validate inputs
            if ((grfCreateDoc & (VSConstants.CEF_OPENFILE | VSConstants.CEF_SILENT)) == 0)
            {
                return VSConstants.E_INVALIDARG;
            }
            if (punkDocDataExisting != IntPtr.Zero)
            {
                return VSConstants.VS_E_INCOMPATIBLEDOCDATA;
            }

            // Create the Document (editor)
            EditorPane newEditor = new EditorPane(editorPackage);
            ppunkDocView = Marshal.GetIUnknownForObject(newEditor);
            ppunkDocData = Marshal.GetIUnknownForObject(newEditor);
            pbstrEditorCaption = "";
            return VSConstants.S_OK;
        }