public CustomPanelInstanceData CreateObjectPanel(CustomPanelType type, IObjectContainer container) { PanelState state; if (!m_panelStates.TryGetValue(type, out state)) { state = new PanelState(); m_panelStates[type] = state; } var createdCount = state.CreatedPanels.Where(p => Object.ReferenceEquals(p.BoundObjectContainer, container)).Count(); if (createdCount == 0 || type.AllowMultipleInstances) { var panel = new CustomPanelInstanceData(type, container); if (panel != null) { state.CreatedPanels.Add(panel); panel.Disposed += Panel_Disposed; } return(panel); } else { return(null); } }
public CustomPanelInstanceData CreateObjectPanel(CustomPanelType type, string objectReference) { var foundObject = m_dynamicObjectManager.TryFindObject(objectReference); if (foundObject == null) { PanelState state; if (!m_panelStates.TryGetValue(type, out state)) { state = new PanelState(); m_panelStates[type] = state; } var createdCount = state.CreatedPanels.Where(p => p.TargetObjectReference.Equals(objectReference)).Count(); if (createdCount == 0 || type.AllowMultipleInstances) { var panel = new CustomPanelInstanceData(type); panel.SetObjectReference(objectReference); // Who's resolving this, then? if (panel != null) { state.CreatedPanels.Add(panel); panel.Disposed += Panel_Disposed; } return(panel); } else { return(null); } } else { return(CreateObjectPanel(type, foundObject)); } }
public PanelCreationOption GetPanelCreationOption(CustomPanelType type, object @object = null) { return(PanelCreationOption.Possible); }
public CustomPanelInstanceData CreateStaticPanel(CustomPanelType type) { throw new NotImplementedException(); }
internal CustomPanelInstanceData(CustomPanelType type, IObjectContainer container) { m_type = type; m_objectContainer = container; m_state = (container.Object != null) ? CustomPanelBindingState.Bound : CustomPanelBindingState.BoundWithoutObject; }
internal CustomPanelInstanceData(CustomPanelType type, string target) { m_type = type; m_targetObject = target; m_state = CustomPanelBindingState.BoundWithoutObject; }
internal CustomPanelInstanceData(CustomPanelType type) { m_type = type; m_state = type.IsObjectPanel ? CustomPanelBindingState.NotBound : CustomPanelBindingState.NotBindable; }