protected void RegisterControl(object control) { if (_activityContainer != null) { _activityContainer.RegisterControl(control); } }
protected void RegisterControl(object control) { if (_parent != null) { if (control is IServerBoundControlContainer) { _parent.RegisterControlContainer((IServerBoundControlContainer)control); } else if (control is IServerBoundControl) { _parent.RegisterControl((IServerBoundControl)control); } if (control is IDataControl) { _parent.RegisterDataControl((IDataControl)control); } else if (control is IGraphControl) { _parent.RegisterGraphControl((IGraphControl)control); } else if (control is ICustomContentPublisher) { _parent.RegisterCustomControl((ICustomContentPublisher)control); } else if (control is IServerBoundButton) { _parent.RegisterServerBoundButton((IMethodCaller)control); } else if (control is IMethodCaller) { _parent.RegisterServerBoundButton((IMethodCaller)control); } if (control is ButtonEx && ((ButtonEx)control).IsDirtyButton) { _parent.RegisterDirtyButton((ButtonEx)control); } } }
/// <summary> /// Auto register myself with parent IActivityContainer. /// Might need to traverse the display list upwards until found one /// </summary> private void RegisterWithParentActivityContainer() { FrameworkElement parent = this.Parent as FrameworkElement; IActivityContainer parentContainer = null; while (parentContainer == null && parent != null) { if (parent is IActivityContainer) { parentContainer = parent as IActivityContainer; } else { parent = parent.Parent as FrameworkElement; } } if (parentContainer != null) { parentContainer.RegisterControl(this); } }