예제 #1
0
        public static WinForms.Panel    create_WinForms_Window(this string title, VSFRAMEMODE frameMode)
        {
            var visualStudio = new VisualStudio_2010();
            var _panel       = visualStudio.invokeOnThread(
                () =>
            {
                var type   = typeof(O2.FluentSharp.VisualStudio.WindowPane_WinForms);
                var window = (ToolWindowPane)visualStudio.package().invoke("CreateToolWindow", type, 64000.random());

                window.Caption             = title;
                IVsWindowFrame windowFrame = (IVsWindowFrame)window.Frame;
                //if(floating)
                //    windowFrame.SetProperty((int)__VSFPROPID.VSFPROPID_FrameMode, VSFRAMEMODE.VSFM_Float);
                windowFrame.SetProperty((int)__VSFPROPID.VSFPROPID_FrameMode, frameMode);
                windowFrame.Show();
                var content         = (Control_WinForms)window.Content;
                var windowsFormHost = (System.Windows.Forms.Integration.WindowsFormsHost)content.Content;
                var panel           = new WinForms.Panel();
                panel.backColor("Control");
                windowsFormHost.Child = panel;
                return(panel);
            });

            return(_panel);
        }
예제 #2
0
        public static Grid create_WPF_Window(this string title, ref ToolWindowPane toolWindow)
        {
            var            visualStudio = new VisualStudio_2010();
            ToolWindowPane window       = null;
            var            grid         = visualStudio.invokeOnThread(
                () => {
                var type                   = typeof(O2.FluentSharp.VisualStudio.WindowPane_WPF);
                window                     = (ToolWindowPane)visualStudio.package().invoke("CreateToolWindow", type, ++lastWindowId);
                window.Caption             = title;
                IVsWindowFrame windowFrame = (IVsWindowFrame)window.Frame;
                windowFrame.Show();
                var content = (Control_WPF)window.Content;

                return((Grid)content.Content);
            });

            toolWindow = window;
            return(grid);
        }