public CreateDataSourceDialog(ControlDesigner controlDesigner, System.Type dataSourceType, bool configure) : base(controlDesigner.Component.Site) { this._controlDesigner = controlDesigner; this._controlID = ((System.Web.UI.Control) controlDesigner.Component).ID; this._dataSourceType = dataSourceType; this._configure = configure; this._displayNameComparer = new DisplayNameComparer(); base.Glyph = new Bitmap(base.GetType(), "datasourcewizard.bmp"); this.CreatePanel(); }
protected DesignerObject(ControlDesigner designer, string name) { if (designer == null) { throw new ArgumentNullException("designer"); } if ((name == null) || (name.Length == 0)) { throw new ArgumentNullException("name"); } this._designer = designer; this._name = name; }
public TemplateDefinition(ControlDesigner designer, string name, object templatedObject, string templatePropertyName, System.Web.UI.WebControls.Style style, bool serverControlsOnly) : base(designer, name) { if ((templatePropertyName == null) || (templatePropertyName.Length == 0)) { throw new ArgumentNullException("templatePropertyName"); } if (templatedObject == null) { throw new ArgumentNullException("templatedObject"); } this._serverControlsOnly = serverControlsOnly; this._style = style; this._templatedObject = templatedObject; this._templatePropertyName = templatePropertyName; }
public override object EvaluateExpression(string expression, object parseTimeData, Type propertyType, IServiceProvider serviceProvider) { System.Web.Compilation.ResourceExpressionFields fields; IResourceProvider provider; if (parseTimeData is System.Web.Compilation.ResourceExpressionFields) { fields = (System.Web.Compilation.ResourceExpressionFields)parseTimeData; } else { fields = ResourceExpressionBuilder.ParseExpression(expression); } if (string.IsNullOrEmpty(fields.ResourceKey)) { return(null); } object obj2 = null; DesignTimeResourceProviderFactory designTimeResourceProviderFactory = ControlDesigner.GetDesignTimeResourceProviderFactory(serviceProvider); if (string.IsNullOrEmpty(fields.ClassKey)) { provider = designTimeResourceProviderFactory.CreateDesignTimeLocalResourceProvider(serviceProvider); } else { provider = designTimeResourceProviderFactory.CreateDesignTimeGlobalResourceProvider(serviceProvider, fields.ClassKey); } if (provider != null) { obj2 = provider.GetObject(fields.ResourceKey, CultureInfo.InvariantCulture); } if (obj2 != null) { Type c = obj2.GetType(); if (!propertyType.IsAssignableFrom(c)) { TypeConverter converter = TypeDescriptor.GetConverter(propertyType); if ((converter != null) && converter.CanConvertFrom(c)) { return(converter.ConvertFrom(obj2)); } } } return(obj2); }
private object OnCreateService(IServiceContainer container, Type serviceType) { if (!(serviceType == typeof(IImplicitResourceProvider))) { return(null); } if (this._implicitResourceProvider == null) { IResourceProvider provider = ControlDesigner.GetDesignTimeResourceProviderFactory(this.Component.Site).CreateDesignTimeLocalResourceProvider(this.Component.Site); this._implicitResourceProvider = provider as IImplicitResourceProvider; if (this._implicitResourceProvider == null) { this._implicitResourceProvider = new ImplicitResourceProvider(this); } } return(this._implicitResourceProvider); }
internal static IList <IComponent> GetAllComponents(IComponent component, IsValidComponentDelegate componentFilter) { List <IComponent> list = new List <IComponent>(); while (component != null) { IList <IComponent> componentsInContainer = GetComponentsInContainer(component, componentFilter); list.AddRange(componentsInContainer); IDesignerHost service = (IDesignerHost)component.Site.GetService(typeof(IDesignerHost)); ControlDesigner designer = service.GetDesigner(component) as ControlDesigner; component = null; if (((designer != null) && (designer.View != null)) && (designer.View.NamingContainerDesigner != null)) { component = designer.View.NamingContainerDesigner.Component; } } return(list); }
protected ControlDesigner GetBaseDesigner() { if (_designer != null) { return(_designer); } IDesignerHost designerHost = (IDesignerHost)DesignerSite.GetService(typeof(IDesignerHost)); Debug.Assert(designerHost != null, "Expected a designer host."); _designer = (ControlDesigner)designerHost.GetDesigner(GetSelectedComponent()); Debug.Assert(_designer != null, "Expected a designer for the selected component"); return(_designer); }
internal static Control FindControl(IServiceProvider serviceProvider, Control control, string controlIdToFind) { if (string.IsNullOrEmpty(controlIdToFind)) { throw new ArgumentNullException("controlIdToFind"); } while (control != null) { if ((control.Site == null) || (control.Site.Container == null)) { return(null); } IComponent component = control.Site.Container.Components[controlIdToFind]; if (component != null) { return(component as Control); } IDesignerHost service = (IDesignerHost)control.Site.GetService(typeof(IDesignerHost)); if (service == null) { return(null); } ControlDesigner designer = service.GetDesigner(control) as ControlDesigner; if (((designer == null) || (designer.View == null)) || (designer.View.NamingContainerDesigner == null)) { return(null); } control = designer.View.NamingContainerDesigner.Component as Control; } if (serviceProvider != null) { IDesignerHost host2 = (IDesignerHost)serviceProvider.GetService(typeof(IDesignerHost)); if (host2 != null) { IContainer container = host2.Container; if (container != null) { return(container.Components[controlIdToFind] as Control); } } } return(null); }
internal static void SetRenderOuterTable(bool value, ControlDesigner designer, bool isFormView) { TransactedChangeCallback callback = null; IComponent component = designer.Component; IRenderOuterTableControl control = (IRenderOuterTableControl) component; if (value != control.RenderOuterTable) { if (!value && IsAnyPropertyOnOuterTableChanged(component, isFormView)) { if (UIServiceHelper.ShowMessage(component.Site, System.Design.SR.GetString("RenderOuterTable_RemoveOuterTableWarning"), System.Design.SR.GetString("RenderOuterTable_RemoveOuterTableCaption", new object[] { control.GetType().Name, control.ID }), MessageBoxButtons.YesNo) == DialogResult.No) { return; } if (callback == null) { callback = delegate (object context) { try { PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(component); string[] strArray = isFormView ? formViewStylePropertiesOnOuterTable : loginStylePropertiesOnOuterTable; if (isFormView) { ((FormView) control).ControlStyle.Reset(); } foreach (string str in strArray) { properties[str].ResetValue(component); } return true; } catch (Exception) { return false; } }; } ControlDesigner.InvokeTransactedChange(component, callback, null, System.Design.SR.GetString("RenderOuterTableHelper_ResetProperties")); } control.RenderOuterTable = value; TypeDescriptor.Refresh(component); } }
private static bool ShouldLocalizeInnerContents(IServiceProvider serviceProvider, object obj) { Control component = obj as Control; if (component == null) { return(false); } IDesignerHost service = (IDesignerHost)serviceProvider.GetService(typeof(IDesignerHost)); if (service == null) { return(false); } ControlDesigner designer = service.GetDesigner(component) as ControlDesigner; if ((designer != null) && !designer.ReadOnlyInternal) { return(false); } return(true); }
private bool ContainingTemplateIsBindable(ControlDesigner designer) { bool flag = false; IControlDesignerView view = designer.View; if (view != null) { TemplatedEditableDesignerRegion containingRegion = view.ContainingRegion as TemplatedEditableDesignerRegion; if (containingRegion != null) { TemplateDefinition templateDefinition = containingRegion.TemplateDefinition; PropertyDescriptor descriptor = TypeDescriptor.GetProperties(templateDefinition.TemplatedObject)[templateDefinition.TemplatePropertyName]; if (descriptor != null) { TemplateContainerAttribute attribute = descriptor.Attributes[typeof(TemplateContainerAttribute)] as TemplateContainerAttribute; if ((attribute != null) && (attribute.BindingDirection == BindingDirection.TwoWay)) { flag = true; } } } } return flag; }
private void OnDocumentContextChanged() { Interop.IHTMLElement parentElement = this._element.GetParentElement(); if (this._parent == null) { if ((parentElement != null) && (this._control == null)) { this.CreateControlAndDesigner(); this.CreateControlView(); if (this._eventSink == null) { this._eventSink = new EventSink(this); } this.SetControlParent(parentElement); this.ConnectToControlAndDesigner(); } } else if (parentElement == null) { if (this._eventSink != null) { this._eventSink.Disconnect(); this._eventSink = null; } if (!this._dragged) { this._designerHost.Container.Remove(this._control); if (this._control.Parent != null) { this._control.Parent.Controls.Remove(this._control); } } this._control = null; this._designer = null; this._viewElement = null; this._parent = null; } else if (this._control == null) { this.CreateControlAndDesigner(); this.CreateControlView(); this.SetControlParent(parentElement); this.ConnectToControlAndDesigner(); } else { this.SetControlParent(parentElement); } }
private void OnBehaviorDetach() { if (this._designer != null) { this._designer.Behavior = null; this._designer = null; } if (this._eventSink != null) { this._eventSink.Disconnect(); this._eventSink = null; } this._element = null; this._viewElement = null; this._paintSite = null; this._behaviorSite = null; this._editor = null; }
public virtual ViewRendering GetChildViewRendering(Control control) { return(ControlDesigner.GetViewRendering(control)); }
public DesignerRegionCollection(ControlDesigner owner) { this._owner = owner; }
public TemplateDefinition(ControlDesigner designer, string name, object templatedObject, string templatePropertyName, bool serverControlsOnly) : this(designer, name, templatedObject, templatePropertyName, null, serverControlsOnly) { }
public DesignerRegionCollection(ControlDesigner owner) { throw new NotImplementedException(); }
public TemplateDefinition(ControlDesigner designer, string name, object templatedObject, string templatePropertyName, System.Web.UI.WebControls.Style style) : this(designer, name, templatedObject, templatePropertyName, style, false) { }
private static ICollection GetResourceKeys(IServiceProvider serviceProvider, string classKey) { IResourceProvider provider; DesignTimeResourceProviderFactory designTimeResourceProviderFactory = ControlDesigner.GetDesignTimeResourceProviderFactory(serviceProvider); if (string.IsNullOrEmpty(classKey)) { provider = designTimeResourceProviderFactory.CreateDesignTimeLocalResourceProvider(serviceProvider); } else { provider = designTimeResourceProviderFactory.CreateDesignTimeGlobalResourceProvider(serviceProvider, classKey); } if (provider != null) { IResourceReader resourceReader = provider.ResourceReader; if (resourceReader != null) { ArrayList list = new ArrayList(); foreach (DictionaryEntry entry in resourceReader) { list.Add(entry.Key); } list.Sort(StringComparer.CurrentCultureIgnoreCase); return(list); } } return(null); }
protected DesignerObject (ControlDesigner designer, string name) { throw new NotImplementedException (); }
public BaseDataListActionList(ControlDesigner controlDesigner, IDataSourceDesigner dataSourceDesigner) : base(controlDesigner, dataSourceDesigner) { this._controlDesigner = controlDesigner; this._dataSourceDesigner = dataSourceDesigner; }
public static ViewRendering GetViewRendering(ControlDesigner designer) { string content = string.Empty; DesignerRegionCollection regions = new DesignerRegionCollection(); bool visible = true; if (designer != null) { bool supportsRegions = false; if (designer.View != null) { supportsRegions = designer.View.SupportsRegions; } try { designer.ViewControlCreated = false; if (supportsRegions) { content = designer.GetDesignTimeHtml(regions); } else { content = designer.GetDesignTimeHtml(); } visible = designer.Visible; } catch (Exception exception) { regions.Clear(); try { content = designer.GetErrorDesignTimeHtml(exception); } catch (Exception exception2) { content = designer.CreateErrorDesignTimeHtml(exception2.Message); } visible = true; } } return new ViewRendering(content, regions, visible); }
protected DesignerObject(ControlDesigner designer, string name) { throw new NotImplementedException(); }
public void Disconnect() { if (this._eventSinkCookie != null) { this._eventSinkCookie.Disconnect(); this._eventSinkCookie = null; } this._element = null; this._designer = null; this._behavior = null; }
public EditableDesignerRegion(ControlDesigner owner, string name, bool serverControlsOnly) : base(owner, name, serverControlsOnly) { throw new NotImplementedException(); }
public DesignerRegion (ControlDesigner designer, string name) : this (designer, name, false) { throw new NotImplementedException (); }
public DesignerRegion(ControlDesigner designer, string name, bool selectable) : base(designer, name) { this._selectable = selectable; }
public DesignerRegion (ControlDesigner designer, string name, bool selectable) : base (designer, name) { throw new NotImplementedException (); }
public EditableDesignerRegion(ControlDesigner owner, string name, bool serverControlsOnly) : base(owner, name) { this._serverControlsOnly = serverControlsOnly; }
public ServerControl44ControlList(ControlDesigner c) : base(c.Component) { }
public DesignerRegionCollection (ControlDesigner owner) { throw new NotImplementedException (); }
private IDesigner GetNamingContainerDesigner(ControlDesigner designer) { IControlDesignerView view = designer.View; if (view == null) { return null; } return view.NamingContainerDesigner; }
public EditableDesignerRegion(ControlDesigner owner, string name) : this(owner, name, false) { }
private void CreateControlAndDesigner() { bool flag; this._control = this.ParseControl(out flag); if (!flag) { this.EnsureControlID(); this._designerHost.Container.Add(this._control, this._control.ID); this._designer = (ControlDesigner) this._designerHost.GetDesigner(this._control); } else { this._eventSink.AllowResize = false; } }
private void OnContentReady() { IDesignerHost service = (IDesignerHost) this.ServiceProvider.GetService(typeof(IDesignerHost)); if (service.Loading) { this.CreateControlAndDesigner(); this.CreateControlView(); this.SetControlParent(this._element.GetParentElement()); this.ConnectToControlAndDesigner(); } else { Interop.IHTMLElement parentElement = this._element.GetParentElement(); if ((this._parent == null) && (parentElement != null)) { bool flag = false; string attribute = (string) ((IHtmlControlDesignerBehavior) this).GetAttribute("id", true); if (attribute != null) { IComponent component = this._designerHost.Container.Components[attribute]; if ((component != null) && (component is System.Web.UI.Control)) { System.Web.UI.Control control = (System.Web.UI.Control) component; ControlDesigner designer = (ControlDesigner) this._designerHost.GetDesigner(control); if (designer != null) { Behavior behavior = (Behavior) designer.Behavior; if (behavior.IsDragging() && !behavior.IsControlDown()) { ((Behavior) designer.Behavior).StopDrag(); flag = true; this._control = control; this._designer = designer; this.CreateControlView(); this.SetControlParent(parentElement); this.ConnectToControlAndDesigner(); } } } } if (!flag) { this.CreateControlAndDesigner(); this.CreateControlView(); if (this._eventSink == null) { this._eventSink = new EventSink(this); } this.SetControlParent(parentElement); this.ConnectToControlAndDesigner(); } } } Interop.IHTMLStyle runtimeStyle = ((Interop.IHTMLElement2) this._element).GetRuntimeStyle(); if (runtimeStyle != null) { runtimeStyle.SetDisplay("inline-block"); } }
public EditableDesignerRegion (ControlDesigner owner, string name) : base (owner, name) { throw new NotImplementedException (); }
public void Connect(Interop.IHTMLElement element) { this._designer = (ControlDesigner) this._behavior.Designer; try { this._element = element; this._eventSinkCookie = new Interop.ConnectionPointCookie(this._element, this, typeof(Interop.IHTMLElementEvents)); } catch (Exception) { } }
public EditableDesignerRegion (ControlDesigner owner, string name, bool serverControlsOnly) : base (owner, name, serverControlsOnly) { throw new NotImplementedException (); }
public EditableDesignerRegion(ControlDesigner owner, string name) : base(owner, name) { throw new NotImplementedException(); }
public static ViewRendering GetViewRendering(ControlDesigner designer) { throw new NotImplementedException(); }
public static ViewRendering GetViewRendering (ControlDesigner designer) { throw new NotImplementedException (); }
public DesignerRegion(ControlDesigner designer, string name) : this(designer, name, false) { }
public DesignerRegion(ControlDesigner designer, string name) : this(designer, name, false) { throw new NotImplementedException(); }
public TemplateDefinition(ControlDesigner designer, string name, object templatedObject, string templatePropertyName) : this(designer, name, templatedObject, templatePropertyName, false) { }
public DesignerRegion(ControlDesigner designer, string name, bool selectable) : base(designer, name) { throw new NotImplementedException(); }
public TemplateDefinition (ControlDesigner designer, string name, Object templatedObject, string templatePropertyName, Style style, bool serverControlsOnly) : base (designer, name) { throw new NotImplementedException (); }
public override void Initialize(IComponent component) { ControlDesigner.VerifyInitializeArgument(component, typeof(Control)); base.Initialize(component); }
public DataEntryControllerComponentEditorFormX(DataEntryController component, System.Web.UI.Design.ControlDesigner designer) { // // Required for Windows Form Designer support // InitializeComponent(); // _dec = component; // _designer = designer; // // label1.Text = "Editing: " + _dec.ID.ToString(); // textBox1.Text = _dec.PrimaryKeyField; txtConnectString.Text = "packet size=4096;integrated security=SSPI;data source=\"autism-SQL\";persist security info=False;initial catalog=uwautism_research_data"; txtSqlTable.Text = "edst3_ppvt"; //wireup check box event handler chkIsInsertField.CheckedChanged += new EventHandler(this.FieldTypeCheckedHandler); chkIsInsertValueRequired.CheckedChanged += new EventHandler(this.FieldTypeCheckedHandler); chkIsEntryField.CheckedChanged += new EventHandler(this.FieldTypeCheckedHandler); chkIsEntryValueRequired.CheckedChanged += new EventHandler(this.FieldTypeCheckedHandler); chkIsReadOnly.CheckedChanged += new EventHandler(this.FieldTypeCheckedHandler); chkIsDoubleEntryField.CheckedChanged += new EventHandler(this.FieldTypeCheckedHandler); }
private IDictionary GetPageResources() { if (this._owner.Component == null) { return(null); } IServiceProvider site = this._owner.Component.Site; if (site == null) { return(null); } DesignTimeResourceProviderFactory designTimeResourceProviderFactory = ControlDesigner.GetDesignTimeResourceProviderFactory(site); if (designTimeResourceProviderFactory == null) { return(null); } IResourceProvider provider2 = designTimeResourceProviderFactory.CreateDesignTimeLocalResourceProvider(site); if (provider2 == null) { return(null); } IResourceReader resourceReader = provider2.ResourceReader; if (resourceReader == null) { return(null); } IDictionary dictionary = new HybridDictionary(true); if (resourceReader != null) { foreach (DictionaryEntry entry in resourceReader) { string str = (string)entry.Key; string str2 = string.Empty; if (str.IndexOf(':') > 0) { string[] strArray = str.Split(new char[] { ':' }); if (strArray.Length > 2) { continue; } str2 = strArray[0]; str = strArray[1]; } int index = str.IndexOf('.'); if (index > 0) { string str3 = str.Substring(0, index); string str4 = str.Substring(index + 1); ArrayList list = (ArrayList)dictionary[str3]; if (list == null) { list = new ArrayList(); dictionary[str3] = list; } ImplicitResourceKey key = new ImplicitResourceKey { Filter = str2, Property = str4, KeyPrefix = str3 }; list.Add(key); } } } return(dictionary); }
public LoginViewDesignerRegion(ControlDesigner owner, object obj, ITemplate template, System.ComponentModel.PropertyDescriptor descriptor, TemplateDefinition definition) : base(definition) { this._template = template; this._object = obj; this._prop = descriptor; base.EnsureSize = true; }