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
- UntypedNullExpression.cs
- Int64Converter.cs
- DiagnosticsConfigurationHandler.cs
- ObjectDataSourceFilteringEventArgs.cs
- ConfigurationSettings.cs
- XmlSchemaAll.cs
- COSERVERINFO.cs
- GeneralTransformCollection.cs
- ThreadSafeList.cs
- SettingsProviderCollection.cs
- ParallelTimeline.cs
- GetPageCompletedEventArgs.cs
- XPathChildIterator.cs
- ObjectHelper.cs
- ZipIOCentralDirectoryFileHeader.cs
- OrderingQueryOperator.cs
- AnnotationResource.cs
- RowParagraph.cs
- Exceptions.cs
- ColumnMap.cs
- arc.cs
- ObjRef.cs
- MetadataArtifactLoaderCompositeFile.cs
- DataGridState.cs
- HttpCacheVary.cs
- IOException.cs
- TimeSpanStorage.cs
- ListViewGroupItemCollection.cs
- CultureData.cs
- MetafileEditor.cs
- CheckBoxList.cs
- FrugalMap.cs
- GlyphTypeface.cs
- PriorityBinding.cs
- PropertyConverter.cs
- EtwProvider.cs
- EditingContext.cs
- XslAst.cs
- DataTableNewRowEvent.cs
- StringWriter.cs
- Matrix3DConverter.cs
- TypeProvider.cs
- ExpandedWrapper.cs
- EntityDataSourceWrapperCollection.cs
- InvalidPropValue.cs
- XmlILConstructAnalyzer.cs
- ContentDefinition.cs
- ContractUtils.cs
- DataGridPageChangedEventArgs.cs
- KeyNotFoundException.cs
- DataControlFieldCollection.cs
- sqlser.cs
- Convert.cs
- IPEndPointCollection.cs
- Int32RectValueSerializer.cs
- DataSourceControlBuilder.cs
- RtfToken.cs
- XmlSiteMapProvider.cs
- Classification.cs
- ListSortDescriptionCollection.cs
- ReturnValue.cs
- Deserializer.cs
- GZipStream.cs
- RSAPKCS1SignatureFormatter.cs
- CounterCreationData.cs
- XmlDeclaration.cs
- XmlSchemaException.cs
- SignedXml.cs
- OrderingQueryOperator.cs
- FlowDocumentPaginator.cs
- StateDesigner.Layouts.cs
- PersianCalendar.cs
- InputProcessorProfiles.cs
- ObjectConverter.cs
- ListBoxAutomationPeer.cs
- ListenerElementsCollection.cs
- _Connection.cs
- ComEventsInfo.cs
- WsrmFault.cs
- IApplicationTrustManager.cs
- StaticDataManager.cs
- ScriptingRoleServiceSection.cs
- QilReplaceVisitor.cs
- DataBoundControlHelper.cs
- OracleDataAdapter.cs
- BamlRecordWriter.cs
- LinkedResource.cs
- OleCmdHelper.cs
- CellParaClient.cs
- SqlAggregateChecker.cs
- UnmanagedMemoryStream.cs
- NotImplementedException.cs
- SynchronizationContext.cs
- Shape.cs
- ImageCodecInfo.cs
- ColumnHeader.cs
- MonthChangedEventArgs.cs
- Point4DValueSerializer.cs
- MultiBindingExpression.cs
- OneToOneMappingSerializer.cs