Ejemplo n.º 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;
		}
Ejemplo n.º 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;
		}
Ejemplo n.º 3
0
		private void OnBaseStudioControlChanged(BaseStudioControl control)
		{
			_changedControls.Add(control);
			Flush();
		}
Ejemplo n.º 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();
		}
Ejemplo n.º 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;
		}
Ejemplo n.º 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;
		}
Ejemplo n.º 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;
		}