示例#1
0
		public void OpenToolWindow(BaseStudioControl content, bool canClose = true)
		{
			if (content == null)
				throw new ArgumentNullException(nameof(content));

			var item = _panels.TryGetValue(content.Key);

			if (item == null)
			{
				item = CreatePanel(content.Key, string.Empty, content, canClose);
				item.SetBindings(BaseLayoutItem.CaptionProperty, content, "Title");

				_panels.Add(content.Key, item);
			}

			DockCtl.ActiveLayoutItem = item;
		}
示例#2
0
		public void OpenToolWindow(BaseStudioControl content, bool canClose = true)
		{
			if (content == null)
				throw new ArgumentNullException(nameof(content));

			var anchorable = _anchorables.TryGetValue(content.Key);

			if (anchorable == null)
			{
				anchorable = CreateAnchorable(content.Key, string.Empty, content, canClose);
				anchorable.SetBindings(LayoutContent.TitleProperty, content, "Title");

				_anchorables.Add(content.Key, anchorable);
				_controlsDict[content.Key] = content;
			
				RootGroup.Children.Add(new LayoutAnchorablePane((LayoutAnchorable) anchorable));

				anchorable.Float();
			}

			DockingManager.ActiveContent = anchorable.Content;
		}
示例#3
0
		private void OnBaseStudioControlChanged(BaseStudioControl control)
		{
			_changedControls.Add(control);
			Flush();
		}
示例#4
0
		public void CloseDocumentWindow(BaseStudioControl content)
		{
			if (content == null)
				throw new ArgumentNullException(nameof(content));

			var document = _documents.TryGetValue(content.Key);

			if (document == null)
				return;

			document.Close();
		}
示例#5
0
		public void OpenDocumentWindow(BaseStudioControl content, bool canClose = true)
		{
			if (content == null)
				throw new ArgumentNullException(nameof(content));

			var document = _documents.TryGetValue(content.Key);

			if (document == null)
			{
				content.Changed += OnBaseStudioControlChanged;

				document = new LayoutDocument
				{
					ContentId = content.Key,
					Content = content,
					CanClose = canClose
				};

				document.SetBindings(LayoutContent.TitleProperty, content, "Title");

				_documents.Add(content.Key, document);

				TabGroups.First().Children.Add(document);
				OnBaseStudioControlChanged(content);
			}

			DockingManager.ActiveContent = document.Content;
		}
示例#6
0
		public void OpenToolWindow(BaseStudioControl content, bool canClose = true)
		{
			if (content == null)
				throw new ArgumentNullException(nameof(content));

			var anchorable = _anchorables.TryGetValue(content.Key);

			if (anchorable == null)
			{
				content.Changed += OnBaseStudioControlChanged;

				anchorable = new LayoutAnchorable
				{
					ContentId = content.Key,
					Content = content,
					CanClose = canClose
				};

				anchorable.SetBindings(LayoutContent.TitleProperty, content, "Title");

				_anchorables.Add(content.Key, anchorable);
			
				RootGroup.Children.Add(new LayoutAnchorablePane(anchorable));
				OnBaseStudioControlChanged(content);
			}

			DockingManager.ActiveContent = anchorable.Content;
		}
示例#7
0
		private SettingsStorage SaveControl(BaseStudioControl control)
		{
			var storage = new SettingsStorage();

			CultureInfo.InvariantCulture.DoInCulture(() =>
			{
				storage.SetValue("ControlType", control.GetType().GetTypeName(false));
				control.Save(storage);
			});

			return storage;
		}