예제 #1
0
		internal static void UpdateSelectableIfActive(PropertyContainer container)
		{
			if (instance == null) return;
			if (instance.activeContainer != container)
				return;
			LoggingService.Debug("UpdateSelectableIfActive");
			instance.SetSelectableObjects(container.SelectableObjects);
		}
예제 #2
0
		internal static void UpdateSelectedObjectIfActive(PropertyContainer container)
		{
			if (instance == null) return;
			if (instance.activeContainer != container)
				return;
			LoggingService.Debug("UpdateSelectedObjectIfActive");
			if (container.SelectedObjects != null)
				instance.SetDesignableObjects(container.SelectedObjects);
			else
				instance.SetDesignableObject(container.SelectedObject);
		}
예제 #3
0
		void SetActiveContainer(PropertyContainer pc)
		{
			if (activeContainer == pc)
				return;
			if (pc == null)
				return;
			activeContainer = pc;
			UpdateHostIfActive(pc);
			UpdateSelectedObjectIfActive(pc);
			UpdateSelectableIfActive(pc);
		}
예제 #4
0
		internal static void UpdatePropertyGridReplacementContent(PropertyContainer container)
		{
			if (instance == null) return;
			if (instance.activeContainer != container)
				return;
			//LoggingService.Debug("UpdatePropertyGridReplacementControl");
			if (container.PropertyGridReplacementContent != null) {
				instance.contentControl.SetContent(container.PropertyGridReplacementContent);
			} else {
				instance.contentControl.SetContent(instance.panel);
			}
		}
예제 #5
0
		internal static void UpdateHostIfActive(PropertyContainer container)
		{
			if (instance == null) return;
			if (instance.activeContainer != container)
				return;
			LoggingService.Debug("UpdateHostIfActive");
			if (instance.host == container.Host)
				return;
			if (instance.host != null)
				instance.RemoveHost(instance.host);
			if (container.Host != null)
				instance.SetDesignerHost(container.Host);
		}
예제 #6
0
		void SetActiveContainer(PropertyContainer pc)
		{
			if (activeContainer == pc)
				return;
			if (pc == null)
				pc = emptyContainer;
			activeContainer = pc;
			
			UpdateHostIfActive(pc);
			UpdateSelectedObjectIfActive(pc);
			UpdateSelectableIfActive(pc);
			UpdatePropertyGridReplacementContent(pc);
		}
예제 #7
0
		internal static void UpdatePropertyGridReplacementControl(PropertyContainer container)
		{
			if (instance == null) return;
			if (instance.activeContainer != container)
				return;
			//LoggingService.Debug("UpdatePropertyGridReplacementControl");
			if (container.PropertyGridReplacementControl != null) {
				if (!instance.panel.Controls.Contains(container.PropertyGridReplacementControl)) {
					instance.panel.Controls.Clear();
					container.PropertyGridReplacementControl.Dock = DockStyle.Fill;
					instance.panel.Controls.Add(container.PropertyGridReplacementControl);
				}
			} else {
				if (!instance.panel.Controls.Contains(instance.grid)) {
					instance.panel.Controls.Clear();
					instance.panel.Controls.Add(instance.grid);
					instance.panel.Controls.Add(instance.comboBox);
				}
			}
		}