Exemplo n.º 1
0
		public EditorView(ViewContent content)
		{
			try {
				this.content = content;
				
				var editorWidget = content.Control.GetNativeWidget<Gtk.Widget> ();
				editorWidget.ShowAll ();
				MonoDevelop.Components.Control previewNative;
				if (Platform.Instance.IsMac)
				{
					var editor = new GtkEmbed2(editorWidget);
					var editorEto = editor.ToEto();
					preview = new PreviewEditorView(editorEto, null, null, () => content?.WorkbenchWindow?.Document?.Editor?.Text);
					var nspreview = XamMac2Helpers.ToNative(preview, true);
					var nsviewContainer = new NSViewContainer2(nspreview);
					previewNative = nsviewContainer;
				}
				else
				{
					preview = new PreviewEditorView(editorWidget.ToEto(), null, null, () => content?.WorkbenchWindow?.Document?.Editor?.Text);
					previewNative = Gtk2Helpers.ToNative(preview, true);
				}

				var commandRouterContainer = new CommandRouterContainer (previewNative, content, true);
				commandRouterContainer.ShowAll ();
				control = commandRouterContainer;

				content.DirtyChanged += content_DirtyChanged;
				IdeApp.Workbench.ActiveDocumentChanged += Workbench_ActiveDocumentChanged;
				ContentName = content.ContentName;

			} catch (Exception ex) {
				Debug.WriteLine ($"{ex}");
			}
		}
Exemplo n.º 2
0
        public EditorView(ViewContent content)
        {
            try {
                this.content = content;

                var editorWidget = content.Control.GetNativeWidget <Gtk.Widget> ();
                editorWidget.ShowAll();
                MonoDevelop.Components.Control previewNative;
                if (Platform.Instance.IsMac)
                {
                    var editor    = new GtkEmbed2(editorWidget);
                    var editorEto = editor.ToEto();
                    preview = new PreviewEditorView(editorEto, null, null, () => content?.WorkbenchWindow?.Document?.Editor?.Text);
                    var nspreview       = XamMac2Helpers.ToNative(preview, true);
                    var nsviewContainer = new NSViewContainer2(nspreview);
                    previewNative = nsviewContainer;
                }
                else
                {
                    preview       = new PreviewEditorView(editorWidget.ToEto(), null, null, () => content?.WorkbenchWindow?.Document?.Editor?.Text);
                    previewNative = Gtk2Helpers.ToNative(preview, true);
                }

                var commandRouterContainer = new CommandRouterContainer(previewNative, content, true);
                commandRouterContainer.ShowAll();
                control = commandRouterContainer;

                content.DirtyChanged += content_DirtyChanged;
                IdeApp.Workbench.ActiveDocumentChanged += Workbench_ActiveDocumentChanged;
                ContentName = content.ContentName;
            } catch (Exception ex) {
                Debug.WriteLine($"{ex}");
            }
        }
Exemplo n.º 3
0
 // Constructors
 public WidgetWithNativeWindow2(GtkEmbed2 embed)
 {
     embedParent = embed;
 }
Exemplo n.º 4
0
		// Constructors
		public WidgetWithNativeWindow2 (GtkEmbed2 embed)
		{
			embedParent = embed;
		}