Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / DEVDIV / depot / DevDiv / releases / whidbey / QFE / ndp / fx / src / xsp / System / Web / UI / HierarchicalDataSourceControl.cs / 1 / 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() ] [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] [AspNetHostingPermission(SecurityAction.InheritanceDemand, Level=AspNetHostingPermissionLevel.Minimal)] public abstract class HierarchicalDataSourceControl : Control, IHierarchicalDataSource { private static readonly object EventDataSourceChanged = new object(); [ EditorBrowsable(EditorBrowsableState.Never), ] public override string ClientID { get { return base.ClientID; } } [ 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. //------------------------------------------------------------------------------ // // 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() ] [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] [AspNetHostingPermission(SecurityAction.InheritanceDemand, Level=AspNetHostingPermissionLevel.Minimal)] public abstract class HierarchicalDataSourceControl : Control, IHierarchicalDataSource { private static readonly object EventDataSourceChanged = new object(); [ EditorBrowsable(EditorBrowsableState.Never), ] public override string ClientID { get { return base.ClientID; } } [ 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DataGridViewAdvancedBorderStyle.cs
- DockPattern.cs
- categoryentry.cs
- SmiGettersStream.cs
- ImageIndexEditor.cs
- LicenseProviderAttribute.cs
- RenderCapability.cs
- AsyncStreamReader.cs
- CommandBinding.cs
- PartitionedStreamMerger.cs
- LogConverter.cs
- PictureBox.cs
- WebPartEditorApplyVerb.cs
- AssemblyAssociatedContentFileAttribute.cs
- SerializationObjectManager.cs
- NativeMethods.cs
- WebZone.cs
- XmlSerializerSection.cs
- ColumnMap.cs
- FlowDocumentPage.cs
- Enum.cs
- _TimerThread.cs
- CodeSubDirectory.cs
- OdbcConnectionHandle.cs
- MappingModelBuildProvider.cs
- ColorConvertedBitmap.cs
- ResetableIterator.cs
- ResourcesChangeInfo.cs
- SvcMapFile.cs
- Geometry3D.cs
- HyperLinkDesigner.cs
- WinInetCache.cs
- ManifestResourceInfo.cs
- UInt32.cs
- ToolStripRenderEventArgs.cs
- MembershipAdapter.cs
- HttpHandlerAction.cs
- SharedPerformanceCounter.cs
- MediaElement.cs
- ResumeStoryboard.cs
- SearchExpression.cs
- FileUtil.cs
- Attributes.cs
- CustomErrorsSection.cs
- DataExpression.cs
- GACMembershipCondition.cs
- ChannelSinkStacks.cs
- ObjectListDesigner.cs
- AutoGeneratedFieldProperties.cs
- WebBrowser.cs
- SmtpReplyReader.cs
- ContainerUIElement3D.cs
- XamlPoint3DCollectionSerializer.cs
- ClientSession.cs
- SiteOfOriginPart.cs
- OpCopier.cs
- EncodingTable.cs
- CallSiteHelpers.cs
- SplashScreenNativeMethods.cs
- KeyedHashAlgorithm.cs
- BlobPersonalizationState.cs
- SerializerDescriptor.cs
- DrawingVisual.cs
- TabletCollection.cs
- Scene3D.cs
- BulletedList.cs
- Typography.cs
- Attribute.cs
- StaticTextPointer.cs
- VSWCFServiceContractGenerator.cs
- RemotingServices.cs
- DataTableClearEvent.cs
- DiscoveryInnerClientManaged11.cs
- PairComparer.cs
- HandlerMappingMemo.cs
- JpegBitmapEncoder.cs
- UpdatePanelControlTrigger.cs
- WsiProfilesElementCollection.cs
- ChildTable.cs
- HotSpotCollection.cs
- InkCanvasFeedbackAdorner.cs
- CreateBookmarkScope.cs
- HighlightComponent.cs
- ConfigurationLockCollection.cs
- ArraySortHelper.cs
- Simplifier.cs
- OdbcReferenceCollection.cs
- RegexInterpreter.cs
- ToolStripItemCollection.cs
- SystemUnicastIPAddressInformation.cs
- CodeSnippetTypeMember.cs
- DecoderNLS.cs
- SymmetricCryptoHandle.cs
- followingsibling.cs
- WebEventCodes.cs
- SqlRecordBuffer.cs
- WrapPanel.cs
- SoapEnumAttribute.cs
- QueryContinueDragEventArgs.cs
- RtfNavigator.cs