private void WebFormView_Load(object sender, System.EventArgs e) { _sessionMoniker = GetSessionMoniker(); Navigator navigator = GetNavigator(_sessionMoniker.NavGraphName, _sessionMoniker.TaskId); _controller = navigator.GetController(this); }
private void ActivateControl(WindowsFormControlView control, ViewSettings viewSettings, Navigator navigator, Guid taskId, TaskArgumentsHolder args) { control.InternalViewName = viewSettings.Name; control.InternalTaskId = taskId; ControllerBase controller = navigator.GetController(control); control.InternalNavigator = navigator; control.InternalController = controller; control.Initialize(args, viewSettings); }
/// <summary> /// Occurs when the WinFormControl is loaded. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The arguments for the event.</param> protected virtual void WinFormControlLoad(object sender, EventArgs e) { if (DesignMode) { _controller = null; } else { _controller = _navigator.GetController(this); } }
private WindowsFormView ActivateForm(WindowsFormView winFormView, ViewSettings viewSettings, Navigator navigator, Guid taskId, string previousView, TaskArgumentsHolder args) { winFormView.InternalTaskId = taskId; winFormView.InternalNavigationGraph = navigator.Name; winFormView.InternalViewName = viewSettings.Name; winFormView.InternalNavigator = navigator; ControllerBase controller = navigator.GetController(winFormView); winFormView.InternalController = controller; InitializeChildren(winFormView, navigator, taskId); winFormView.Initialize(args, viewSettings); AddActiveForm(taskId, viewSettings.Name, winFormView); AddActiveView(taskId, winFormView, viewSettings.Name); LayoutControlsIfRequired(viewSettings, winFormView); winFormView.Activated += new EventHandler(Form_Activated); winFormView.Closed += new EventHandler(Form_Closed); //Get the parent form Form parentForm = (Form)GetProperty(taskId, ParentFormKey); if (winFormView.IsMdiContainer || viewSettings.CanHaveFloatingWindows) { StoreProperty(taskId, ParentFormKey, winFormView); } else if (parentForm != null) { if (parentForm.IsMdiContainer) { winFormView.MdiParent = parentForm; } else if (viewSettings.IsFloatable) { winFormView.TopLevel = true; parentForm.AddOwnedForm(winFormView); winFormView.Show(); } } if (viewSettings.IsOpenModal) { ShowModal(winFormView, previousView, taskId, parentForm); } else { winFormView.Show(); } return(winFormView); }
/// <summary> /// Occurs when the WinFormView loads. /// </summary> /// <param name="source">The source of the event.</param> /// <param name="e">The event arguments.</param> public virtual void WinFormViewOnLoad(object source, EventArgs e) { // because all WinForms in UIP apps inherit from this, // we have to be conscious of design-time problems. // The full UIP can't be invoked when designing the form, so short-circuit here to avoid design time exceptions. if (this.DesignMode == true) { _controller = null; } else { if (_navigator != null) { _controller = _navigator.GetController(this); } } }
private void InitializeChildren(Control container, Navigator navigator, Guid taskId) { foreach (Control control in container.Controls) { if (control is WindowsFormControlView) { WindowsFormControlView child = (WindowsFormControlView)control; child.InternalNavigator = navigator; child.InternalTaskId = taskId; string viewName = navigator.GetViewNameFromNodeName(child.Name); child.InternalViewName = viewName; ViewSettings viewSettings = UIPConfiguration.Config.GetViewSettingsFromName(viewName); AddActiveControl(taskId, child.Name, child); child.InternalController = navigator.GetController(child); child.Initialize(null, viewSettings); } if (control.Controls.Count > 0) { InitializeChildren(control, navigator, taskId); } } }