Inheritance: Eto.Forms.Splitter
示例#1
0
文件: EditorView.cs 项目: picoe/Eto
		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}");
			}
		}
示例#2
0
文件: EditorView.cs 项目: mhusen/Eto
		public EditorView(IViewContent content)
		{
			this.content = content;
			preview = new PreviewEditorView(content.Control.ToEto(), () => content?.WorkbenchWindow?.Document?.Editor?.Text);
			content.ContentChanged += content_ContentChanged;
			content.DirtyChanged += content_DirtyChanged;
			var commandRouterContainer = new CommandRouterContainer(preview.ToNative(true), content, true);
			commandRouterContainer.Show();
			control = commandRouterContainer;
			IdeApp.Workbench.ActiveDocumentChanged += Workbench_ActiveDocumentChanged;

			base.ContentName = content.ContentName;
		}
示例#3
0
        public PreviewEditorViewSplitter(Control editor, string mainAssembly, IEnumerable<string> references, Func<string> getCode)
        {
            //Size = new Size (200, 200);
            Preview = new PreviewEditorView(mainAssembly, references, getCode);
            Editor = editor;

            Orientation = Orientation.Vertical;
            FixedPanel = SplitterFixedPanel.None;

            Panel1 = Preview;
            Panel2 = editor;
            RelativePosition = lastPosition;
        }