Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / System.Xaml.Hosting / System / Xaml / Hosting / Configuration / HandlerElement.cs / 1458001 / HandlerElement.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.Xaml.Hosting.Configuration { using System; using System.Web; using System.Configuration; using System.Diagnostics.CodeAnalysis; using System.Runtime; public sealed class HandlerElement : ConfigurationElement { static ConfigurationPropertyCollection properties = InitializeProperties(); Type httpHandlerCLRType; Type xamlRootElementClrType; static ConfigurationPropertyCollection InitializeProperties() { ConfigurationProperty handler = new ConfigurationProperty(XamlHostingConfiguration.HttpHandlerType, typeof(string), " ", null, new StringValidator(1), ConfigurationPropertyOptions.IsRequired); ConfigurationProperty xamlRoot = new ConfigurationProperty(XamlHostingConfiguration.XamlRootElementType, typeof(string), " ", null, new StringValidator(1), ConfigurationPropertyOptions.IsKey | ConfigurationPropertyOptions.IsRequired); ConfigurationPropertyCollection tempProperties = new ConfigurationPropertyCollection(); tempProperties.Add(xamlRoot); tempProperties.Add(handler); return tempProperties; } public HandlerElement() { } [SuppressMessage(FxCop.Category.Usage, FxCop.Rule.DoNotCallOverridableMethodsInConstructors, Justification = "This is enforced by configuration classes in framework library")] public HandlerElement(string xamlType, string handlerType) { XamlRootElementType = xamlType; HttpHandlerType = handlerType; } [ConfigurationProperty(XamlHostingConfiguration.HttpHandlerType, DefaultValue = " ", Options = ConfigurationPropertyOptions.IsRequired)] [StringValidator(MinLength = 1)] public string HttpHandlerType { get { return (string)base[XamlHostingConfiguration.HttpHandlerType]; } set { if (string.IsNullOrEmpty(value)) { value = string.Empty; } base[XamlHostingConfiguration.HttpHandlerType] = value; } } [ConfigurationProperty(XamlHostingConfiguration.XamlRootElementType, DefaultValue = " ", Options = ConfigurationPropertyOptions.IsKey | ConfigurationPropertyOptions.IsRequired)] [StringValidator(MinLength = 1)] public string XamlRootElementType { get { return (string)base[XamlHostingConfiguration.XamlRootElementType]; } set { if (string.IsNullOrEmpty(value)) { value = string.Empty; } base[XamlHostingConfiguration.XamlRootElementType] = value; } } internal string Key { get { return XamlRootElementType; } } protected override ConfigurationPropertyCollection Properties { get { return properties; } } internal Type LoadHttpHandlerType() { if (this.httpHandlerCLRType == null) { this.httpHandlerCLRType = Type.GetType(HttpHandlerType, true); } return this.httpHandlerCLRType; } internal Type LoadXamlRootElementType() { if (this.xamlRootElementClrType == null) { this.xamlRootElementClrType = Type.GetType(XamlRootElementType, true); } return this.xamlRootElementClrType; } } } // 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
- CodeEntryPointMethod.cs
- DataControlFieldCollection.cs
- SapiAttributeParser.cs
- XmlSerializerAssemblyAttribute.cs
- LogRestartAreaEnumerator.cs
- ColorConverter.cs
- Set.cs
- ByteStack.cs
- LockedActivityGlyph.cs
- Drawing.cs
- Int64KeyFrameCollection.cs
- Menu.cs
- TileModeValidation.cs
- ToolStripDropDownMenu.cs
- AddIn.cs
- FunctionMappingTranslator.cs
- DbConnectionFactory.cs
- WindowsStartMenu.cs
- ToolBar.cs
- FileSystemEventArgs.cs
- SafeEventHandle.cs
- SaveFileDialog.cs
- WindowsListViewScroll.cs
- RegexCompiler.cs
- BCryptNative.cs
- RegexBoyerMoore.cs
- printdlgexmarshaler.cs
- InstanceDataCollectionCollection.cs
- Variable.cs
- InboundActivityHelper.cs
- MetadataPropertyAttribute.cs
- TabPage.cs
- IntranetCredentialPolicy.cs
- LogStore.cs
- CalendarDesigner.cs
- FontNamesConverter.cs
- ValidationError.cs
- TimeManager.cs
- AuthenticateEventArgs.cs
- HeaderUtility.cs
- FusionWrap.cs
- Encoder.cs
- DSASignatureFormatter.cs
- WindowsSysHeader.cs
- DesignerAutoFormatCollection.cs
- ComponentEvent.cs
- EditCommandColumn.cs
- ProcessThreadDesigner.cs
- unsafenativemethodstextservices.cs
- MergeFailedEvent.cs
- DragStartedEventArgs.cs
- MailMessage.cs
- RadialGradientBrush.cs
- DbMetaDataCollectionNames.cs
- TextParagraphView.cs
- XamlSerializerUtil.cs
- DrawingCollection.cs
- BitmapFrameDecode.cs
- SettingsProperty.cs
- TypeElement.cs
- BindingManagerDataErrorEventArgs.cs
- TextChange.cs
- ProfileInfo.cs
- MenuEventArgs.cs
- Line.cs
- ToolTipAutomationPeer.cs
- ColorPalette.cs
- TrustManager.cs
- ZipPackage.cs
- KernelTypeValidation.cs
- LiteralDesigner.cs
- EntitySetBaseCollection.cs
- SqlNode.cs
- Attributes.cs
- SHA1.cs
- ExtensibleClassFactory.cs
- PropertyGridEditorPart.cs
- PropertySourceInfo.cs
- XDeferredAxisSource.cs
- CultureTableRecord.cs
- PhysicalFontFamily.cs
- PasswordPropertyTextAttribute.cs
- ListViewDeletedEventArgs.cs
- DomainConstraint.cs
- CategoryGridEntry.cs
- Compiler.cs
- AtlasWeb.Designer.cs
- ConfigurationConverterBase.cs
- PenLineJoinValidation.cs
- SoapWriter.cs
- CompleteWizardStep.cs
- ConfigsHelper.cs
- WriteFileContext.cs
- XmlSchemaCompilationSettings.cs
- CommonDialog.cs
- GeometryCombineModeValidation.cs
- SerializationStore.cs
- SecurityTimestamp.cs
- TransformCryptoHandle.cs
- ControlSerializer.cs