/// <include file='doc\ComponentEditorForm.uex' path='docs/doc[@for="ComponentEditorForm.ComponentEditorPageSite.ComponentEditorPageSite"]/*' /> /// <devdoc> /// Creates the page site. /// </devdoc> /// <internalonly/> internal ComponentEditorPageSite(Control parent, Type pageClass, IComponent component, ComponentEditorForm form) { this.component = component; this.parent = parent; this.isActive = false; this.isDirty = false; if (form == null) { throw new ArgumentNullException(nameof(form)); } this.form = form; try { pageControl = (ComponentEditorPage)Activator.CreateInstance(pageClass); } catch (TargetInvocationException e) { Debug.Fail(e.ToString()); throw new TargetInvocationException(string.Format(SR.ExceptionCreatingCompEditorControl, e.ToString()), e.InnerException); } pageControl.SetSite(this); pageControl.SetComponent(component); }
/// <summary> /// Creates the page site. /// </summary> internal ComponentEditorPageSite(Control parent, Type pageClass, IComponent component, ComponentEditorForm form) { _component = component; _parent = parent; _isActive = false; _isDirty = false; _form = form.OrThrowIfNull(); try { _pageControl = (ComponentEditorPage)Activator.CreateInstance(pageClass) !; } catch (TargetInvocationException e) { Debug.Fail(e.ToString()); throw new TargetInvocationException(string.Format(SR.ExceptionCreatingCompEditorControl, e.ToString()), e.InnerException); } _pageControl.SetSite(this); _pageControl.SetComponent(component); }
/// <include file='doc\ComponentEditorForm.uex' path='docs/doc[@for="ComponentEditorForm.ComponentEditorPageSite.ComponentEditorPageSite"]/*' /> /// <devdoc> /// Creates the page site. /// </devdoc> /// <internalonly/> internal ComponentEditorPageSite(Control parent, Type pageClass, IComponent component, ComponentEditorForm form) { this.component = component; this.parent = parent; this.isActive = false; this.isDirty = false; if (form == null) throw new ArgumentNullException("form"); this.form = form; try { pageControl = (ComponentEditorPage)SecurityUtils.SecureCreateInstance(pageClass); } catch (TargetInvocationException e) { Debug.Fail(e.ToString()); throw new TargetInvocationException(SR.GetString(SR.ExceptionCreatingCompEditorControl, e.ToString()), e.InnerException); } pageControl.SetSite(this); pageControl.SetComponent(component); }