Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / xsp / System / Web / UI / WebControls / WizardStepBase.cs / 1 / WizardStepBase.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.WebControls { using System; using System.CodeDom.Compiler; using System.Collections; using System.ComponentModel; using System.Security.Permissions; using System.Web; using System.Web.UI; [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] public sealed class WizardStepControlBuilder : ControlBuilder { internal override void SetParentBuilder(ControlBuilder parentBuilder) { // Do not check containment at designtime or in a skin file. if (Parser.FInDesigner || Parser is PageThemeParser) return; if (parentBuilder.ControlType == null || !(typeof(WizardStepCollection).IsAssignableFrom(parentBuilder.ControlType))) { throw new HttpException(SR.GetString(SR.WizardStep_WrongContainment)); } base.SetParentBuilder(parentBuilder); } } [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] [AspNetHostingPermission(SecurityAction.InheritanceDemand, Level=AspNetHostingPermissionLevel.Minimal)] [ Bindable(false), ControlBuilderAttribute(typeof(WizardStepControlBuilder)), ToolboxItem(false) ] public abstract class WizardStepBase : View { private Wizard _owner; [ WebCategory("Behavior"), Themeable(false), Filterable(false), DefaultValue(true), WebSysDescription(SR.WizardStep_AllowReturn) ] public virtual bool AllowReturn { get { object o = ViewState["AllowReturn"]; return o == null? true : (bool)o; } set { ViewState["AllowReturn"] = value; } } ////// [ Browsable(true) ] public override bool EnableTheming { get { return base.EnableTheming; } set { base.EnableTheming = value; } } public override string ID { get { return base.ID; } set { // VSWhidbey 407127. Need to validate control ID here since WiardStepBase does not have a designer. if (Owner != null && Owner.DesignMode) { if (!CodeGenerator.IsValidLanguageIndependentIdentifier(value)) { throw new ArgumentException(SR.GetString(SR.Invalid_identifier, value)); } if (value != null && value.Equals(Owner.ID, StringComparison.OrdinalIgnoreCase)) { throw new ArgumentException(SR.GetString(SR.Id_already_used, value)); } foreach (WizardStepBase step in Owner.WizardSteps) { if (step == this) { continue; } if (step.ID != null && step.ID.Equals(value, StringComparison.OrdinalIgnoreCase)) { throw new ArgumentException(SR.GetString(SR.Id_already_used, value)); } } } base.ID = value; } } [ Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), WebCategory("Appearance"), WebSysDescription(SR.WizardStep_Name) ] public virtual String Name { get { if (!String.IsNullOrEmpty(Title)) { return Title; } if (!String.IsNullOrEmpty(ID)) { return ID; } return null; } } internal virtual Wizard Owner { get { return _owner; } set { _owner = value; } } [ WebCategory("Behavior"), DefaultValue(WizardStepType.Auto), WebSysDescription(SR.WizardStep_StepType) ] public virtual WizardStepType StepType { get { object o = ViewState["StepType"]; return o == null? WizardStepType.Auto : (WizardStepType)o; } set { if (value < WizardStepType.Auto || value > WizardStepType.Step) { throw new ArgumentOutOfRangeException("value"); } if (StepType != value) { ViewState["StepType"] = value; if (Owner != null) { Owner.OnWizardStepsChanged(); } } } } ///Gets and sets a value indicating whether theme is enabled. ////// [ DefaultValue(""), Localizable(true), WebCategory("Appearance"), WebSysDescription(SR.WizardStep_Title) ] public virtual string Title { get { string s = (string)ViewState["Title"]; return((s == null) ? String.Empty : s); } set { if (Title != value) { ViewState["Title"] = value; if (Owner != null) { Owner.OnWizardStepsChanged(); } } } } internal string TitleInternal { get { return (string)ViewState["Title"]; } } [ Browsable(false), EditorBrowsable(EditorBrowsableState.Advanced), WebCategory("Appearance"), ] public Wizard Wizard { get { return Owner; } } // VSWhidbey 397000, need to notify the Owner of type change so // the sidebar can be re-databound correctly. protected override void LoadViewState(object savedState) { if (savedState != null) { base.LoadViewState(savedState); if (Owner != null && (ViewState["Title"] != null || ViewState["StepType"] != null)) { Owner.OnWizardStepsChanged(); } } } protected internal override void OnLoad(EventArgs e) { base.OnLoad(e); if (Owner == null && !DesignMode) { throw new InvalidOperationException(SR.GetString(SR.WizardStep_WrongContainment)); } } protected internal override void RenderChildren(HtmlTextWriter writer) { if (!Owner.ShouldRenderChildControl) { return; } base.RenderChildren(writer); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.Gets or sets the title on the ///.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- BufferModesCollection.cs
- RelatedCurrencyManager.cs
- ConfigXmlReader.cs
- OdbcFactory.cs
- IPAddressCollection.cs
- OuterGlowBitmapEffect.cs
- dataprotectionpermission.cs
- Object.cs
- ToolStripSeparatorRenderEventArgs.cs
- InstanceKeyCollisionException.cs
- EmptyEnumerator.cs
- ExponentialEase.cs
- SQLBinaryStorage.cs
- Nullable.cs
- DependencyProperty.cs
- SizeFConverter.cs
- TableHeaderCell.cs
- _NativeSSPI.cs
- _ShellExpression.cs
- DataObject.cs
- ConnectionsZone.cs
- KeyConstraint.cs
- EdmConstants.cs
- DataGridCellItemAutomationPeer.cs
- XmlnsDefinitionAttribute.cs
- ToolStripItemTextRenderEventArgs.cs
- UnorderedHashRepartitionStream.cs
- LoginName.cs
- Oid.cs
- DeflateStream.cs
- PeerTransportElement.cs
- ContextMenuStripActionList.cs
- ThreadStateException.cs
- DataGridCell.cs
- TextTreePropertyUndoUnit.cs
- PnrpPermission.cs
- DesignerHost.cs
- ToolBarOverflowPanel.cs
- DesignerActionUIStateChangeEventArgs.cs
- XamlTreeBuilder.cs
- TraceEventCache.cs
- ObjectManager.cs
- ObfuscateAssemblyAttribute.cs
- TranslateTransform.cs
- XmlDictionaryReaderQuotasElement.cs
- BaseTemplateCodeDomTreeGenerator.cs
- StaticSiteMapProvider.cs
- XamlInt32CollectionSerializer.cs
- Socket.cs
- UnsafeNativeMethods.cs
- TransportReplyChannelAcceptor.cs
- ResourceDisplayNameAttribute.cs
- DbConnectionPoolIdentity.cs
- ValidationErrorInfo.cs
- EasingFunctionBase.cs
- FileAuthorizationModule.cs
- ImportDesigner.xaml.cs
- ProfileElement.cs
- SettingsBase.cs
- AnimatedTypeHelpers.cs
- ResourceDisplayNameAttribute.cs
- Point4DValueSerializer.cs
- ServicePoint.cs
- LoadRetryStrategyFactory.cs
- PrivacyNoticeElement.cs
- MembershipValidatePasswordEventArgs.cs
- SqlProcedureAttribute.cs
- RenamedEventArgs.cs
- WindowsButton.cs
- Missing.cs
- RawAppCommandInputReport.cs
- HtmlAnchor.cs
- RightsManagementEncryptedStream.cs
- InstanceStore.cs
- SoapCodeExporter.cs
- TraceHandlerErrorFormatter.cs
- ResourceProperty.cs
- GCHandleCookieTable.cs
- FontDriver.cs
- TypedTableBase.cs
- LinqDataSourceHelper.cs
- TriState.cs
- BaseUriHelper.cs
- AccessibilityApplicationManager.cs
- UInt16Converter.cs
- UTF8Encoding.cs
- ResourceDictionaryCollection.cs
- PolyLineSegmentFigureLogic.cs
- COM2Properties.cs
- Window.cs
- GridViewItemAutomationPeer.cs
- FileCodeGroup.cs
- DecodeHelper.cs
- HttpRawResponse.cs
- QueryResult.cs
- DispatcherExceptionFilterEventArgs.cs
- MenuItem.cs
- WindowsClientCredential.cs
- SqlIdentifier.cs
- ListItemViewControl.cs