Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / UI / HierarchicalDataSourceControl.cs / 1305376 / HierarchicalDataSourceControl.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI { using System.ComponentModel; using System.Security.Permissions; [ Bindable(false), ControlBuilder(typeof(DataSourceControlBuilder)), Designer("System.Web.UI.Design.HierarchicalDataSourceDesigner, " + AssemblyRef.SystemDesign), NonVisualControl() ] public abstract class HierarchicalDataSourceControl : Control, IHierarchicalDataSource { private static readonly object EventDataSourceChanged = new object(); [ Browsable(false), EditorBrowsable(EditorBrowsableState.Never), ] public override string ClientID { get { return base.ClientID; } } [ Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), EditorBrowsable(EditorBrowsableState.Never) ] public override ClientIDMode ClientIDMode { get { return base.ClientIDMode; } set { throw new NotSupportedException(); } } [ EditorBrowsable(EditorBrowsableState.Never), ] public override ControlCollection Controls { get { return base.Controls; } } [ Browsable(false), DefaultValue(false), EditorBrowsable(EditorBrowsableState.Never), ] public override bool EnableTheming { get { return false; } set { throw new NotSupportedException(SR.GetString(SR.NoThemingSupport, this.GetType().Name)); } } [ Browsable(false), DefaultValue(""), EditorBrowsable(EditorBrowsableState.Never), ] public override string SkinID { get { return String.Empty; } set { throw new NotSupportedException(SR.GetString(SR.NoThemingSupport, this.GetType().Name)); } } ////// Gets or sets a value that indicates whether a control should be rendered on /// the page. /// [ Browsable(false), DefaultValue(false), EditorBrowsable(EditorBrowsableState.Never), ] public override bool Visible { get { return false; } set { throw new NotSupportedException(SR.GetString(SR.ControlNonVisual, this.GetType().Name)); } } [ EditorBrowsable(EditorBrowsableState.Never), ] public override void ApplyStyleSheetSkin(Page page) { base.ApplyStyleSheetSkin(page); } ////// Overidden to prevent child controls from being added to this control. /// protected override ControlCollection CreateControlCollection() { return new EmptyControlCollection(this); } [ EditorBrowsable(EditorBrowsableState.Never), ] public override Control FindControl(string id) { return base.FindControl(id); } ////// [ EditorBrowsable(EditorBrowsableState.Never), ] public override void Focus() { throw new NotSupportedException(SR.GetString(SR.NoFocusSupport, this.GetType().Name)); } protected abstract HierarchicalDataSourceView GetHierarchicalView(string viewPath); [ EditorBrowsable(EditorBrowsableState.Never), ] public override bool HasControls() { return base.HasControls(); } protected virtual void OnDataSourceChanged(EventArgs e) { EventHandler onDataSourceChangedHandler = (EventHandler)Events[EventDataSourceChanged]; if (onDataSourceChangedHandler != null) onDataSourceChangedHandler(this, e); } [ EditorBrowsable(EditorBrowsableState.Never), ] public override void RenderControl(HtmlTextWriter writer) { base.RenderControl(writer); } #region Implementation of IHierarchicalDataSource ////// Raised when the underlying data source has changed. The /// change may be due to a change in the control's properties, /// or a change in the data due to an edit action performed by /// the DataSourceControl. /// event EventHandler IHierarchicalDataSource.DataSourceChanged { add { Events.AddHandler(EventDataSourceChanged, value); } remove { Events.RemoveHandler(EventDataSourceChanged, value); } } ///HierarchicalDataSourceView IHierarchicalDataSource.GetHierarchicalView(string viewPath) { return GetHierarchicalView(viewPath); } #endregion } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ // // Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI { using System.ComponentModel; using System.Security.Permissions; [ Bindable(false), ControlBuilder(typeof(DataSourceControlBuilder)), Designer("System.Web.UI.Design.HierarchicalDataSourceDesigner, " + AssemblyRef.SystemDesign), NonVisualControl() ] public abstract class HierarchicalDataSourceControl : Control, IHierarchicalDataSource { private static readonly object EventDataSourceChanged = new object(); [ Browsable(false), EditorBrowsable(EditorBrowsableState.Never), ] public override string ClientID { get { return base.ClientID; } } [ Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), EditorBrowsable(EditorBrowsableState.Never) ] public override ClientIDMode ClientIDMode { get { return base.ClientIDMode; } set { throw new NotSupportedException(); } } [ EditorBrowsable(EditorBrowsableState.Never), ] public override ControlCollection Controls { get { return base.Controls; } } [ Browsable(false), DefaultValue(false), EditorBrowsable(EditorBrowsableState.Never), ] public override bool EnableTheming { get { return false; } set { throw new NotSupportedException(SR.GetString(SR.NoThemingSupport, this.GetType().Name)); } } [ Browsable(false), DefaultValue(""), EditorBrowsable(EditorBrowsableState.Never), ] public override string SkinID { get { return String.Empty; } set { throw new NotSupportedException(SR.GetString(SR.NoThemingSupport, this.GetType().Name)); } } ////// Gets or sets a value that indicates whether a control should be rendered on /// the page. /// [ Browsable(false), DefaultValue(false), EditorBrowsable(EditorBrowsableState.Never), ] public override bool Visible { get { return false; } set { throw new NotSupportedException(SR.GetString(SR.ControlNonVisual, this.GetType().Name)); } } [ EditorBrowsable(EditorBrowsableState.Never), ] public override void ApplyStyleSheetSkin(Page page) { base.ApplyStyleSheetSkin(page); } ////// Overidden to prevent child controls from being added to this control. /// protected override ControlCollection CreateControlCollection() { return new EmptyControlCollection(this); } [ EditorBrowsable(EditorBrowsableState.Never), ] public override Control FindControl(string id) { return base.FindControl(id); } ////// [ EditorBrowsable(EditorBrowsableState.Never), ] public override void Focus() { throw new NotSupportedException(SR.GetString(SR.NoFocusSupport, this.GetType().Name)); } protected abstract HierarchicalDataSourceView GetHierarchicalView(string viewPath); [ EditorBrowsable(EditorBrowsableState.Never), ] public override bool HasControls() { return base.HasControls(); } protected virtual void OnDataSourceChanged(EventArgs e) { EventHandler onDataSourceChangedHandler = (EventHandler)Events[EventDataSourceChanged]; if (onDataSourceChangedHandler != null) onDataSourceChangedHandler(this, e); } [ EditorBrowsable(EditorBrowsableState.Never), ] public override void RenderControl(HtmlTextWriter writer) { base.RenderControl(writer); } #region Implementation of IHierarchicalDataSource ////// Raised when the underlying data source has changed. The /// change may be due to a change in the control's properties, /// or a change in the data due to an edit action performed by /// the DataSourceControl. /// event EventHandler IHierarchicalDataSource.DataSourceChanged { add { Events.AddHandler(EventDataSourceChanged, value); } remove { Events.RemoveHandler(EventDataSourceChanged, value); } } ///HierarchicalDataSourceView IHierarchicalDataSource.GetHierarchicalView(string viewPath) { return GetHierarchicalView(viewPath); } #endregion } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- AssemblyCache.cs
- HttpBufferlessInputStream.cs
- ToolStripHighContrastRenderer.cs
- RowBinding.cs
- Content.cs
- ApplicationGesture.cs
- ImageMap.cs
- PropertyCollection.cs
- BlurEffect.cs
- FormViewUpdatedEventArgs.cs
- ListViewItemMouseHoverEvent.cs
- IdentityHolder.cs
- FileNameEditor.cs
- SoapMessage.cs
- DataError.cs
- ToolStripDropDownClosedEventArgs.cs
- WebMessageEncodingElement.cs
- TableCell.cs
- ItemsControlAutomationPeer.cs
- ValueChangedEventManager.cs
- AudioDeviceOut.cs
- WebUtility.cs
- AssemblyInfo.cs
- X509ChainElement.cs
- ControlValuePropertyAttribute.cs
- SqlDataRecord.cs
- TableCellCollection.cs
- Hex.cs
- ComPlusTypeLoader.cs
- CommonGetThemePartSize.cs
- InfoCardConstants.cs
- SelectedDatesCollection.cs
- SchemaTypeEmitter.cs
- PackageDigitalSignatureManager.cs
- _Events.cs
- SecurityUtils.cs
- SoapSchemaExporter.cs
- ProfileModule.cs
- UpdateCommand.cs
- ImageListStreamer.cs
- RedBlackList.cs
- DataGridViewColumnStateChangedEventArgs.cs
- fixedPageContentExtractor.cs
- SqlDataSourceFilteringEventArgs.cs
- MediaPlayer.cs
- FixedDocumentPaginator.cs
- HandlerBase.cs
- HtmlFormParameterReader.cs
- SizeValueSerializer.cs
- ReadOnlyDataSource.cs
- SecureStringHasher.cs
- ConfigurationElementProperty.cs
- XsltArgumentList.cs
- Literal.cs
- ConfigXmlComment.cs
- SspiSecurityTokenProvider.cs
- CultureInfoConverter.cs
- AttributedMetaModel.cs
- DecodeHelper.cs
- PageThemeParser.cs
- DocumentPageView.cs
- RegexCompiler.cs
- TripleDESCryptoServiceProvider.cs
- ToolStripLabel.cs
- HttpException.cs
- DSASignatureDeformatter.cs
- CancelRequestedQuery.cs
- ApplicationFileCodeDomTreeGenerator.cs
- MetaType.cs
- BindStream.cs
- ConditionCollection.cs
- RowParagraph.cs
- StringBuilder.cs
- CodeMethodReturnStatement.cs
- WinEventWrap.cs
- XamlSerializer.cs
- SystemResourceKey.cs
- CryptoApi.cs
- XmlSchemaComplexType.cs
- ThumbButtonInfo.cs
- RuleInfoComparer.cs
- TypeHelper.cs
- ReverseComparer.cs
- RSAPKCS1SignatureDeformatter.cs
- TypeNameParser.cs
- Unit.cs
- RolePrincipal.cs
- GroupItemAutomationPeer.cs
- ControlPropertyNameConverter.cs
- TraceEventCache.cs
- ArraySortHelper.cs
- TrackingValidationObjectDictionary.cs
- ObjectIDGenerator.cs
- CompositeTypefaceMetrics.cs
- OleDbFactory.cs
- ImageDrawing.cs
- BaseResourcesBuildProvider.cs
- SHA256.cs
- ObjectStateFormatter.cs
- DataGridViewColumnDesigner.cs