Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / wpf / src / Base / System / Windows / Markup / XmlnsPrefixAttribute.cs / 1 / XmlnsPrefixAttribute.cs
//------------------------------------------------------------------------ // // Microsoft Windows Client Platform // Copyright (C) Microsoft Corporation, 2005 // // File: XmlnsPrefixAttribute.cs // // Contents: Namespace default prefix recommendation support // Created: 04/28/2005 [....] // //----------------------------------------------------------------------- using System; using System.ComponentModel; namespace System.Windows.Markup { ////// /// This attribute allows an assembly to recommend a prefix to be used when writing elements and /// attributes in a xaml file. /// /// For a WinFX assembly, it can set the attributes as follows: /// /// [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] public sealed class XmlnsPrefixAttribute: Attribute { ////// [assembly:XmlnsDefinition("http://schemas.fabrikam.com/mynamespace", "fabrikam.myproduct.mycategory1")] /// [assembly:XmlnsDefinition("http://schemas.fabrikam.com/mynamespace", "fabrikam.myproduct.mycategory2")] /// [assembly:XmlnsPrefix("http://schemas.fabrikam.com/mynamespace", "myns")] ///
/// /// If fabrikam.myproduct.mycategory namespace in this assembly contains a UIElement such as "MyButton", the /// xaml file could use it like below: ////// <Page xmlns:myns="http://schemas.fabrikam.com/mynamespace" .... > /// <myns:MyButton> ..... </myns:MyButton> /// </Page> ///
////// Constructor /// /// XML namespce /// recommended prefix public XmlnsPrefixAttribute(string xmlNamespace, string prefix) { // Validate Input Arguments if (xmlNamespace == null) { throw new ArgumentNullException("xmlNamespace"); } if (prefix == null) { throw new ArgumentNullException("prefix"); } _xmlNamespace = xmlNamespace; _prefix= prefix; } #region public properties ////// XML Namespace /// public string XmlNamespace { get { return _xmlNamespace; } } ////// New Xml Namespace /// public string Prefix { get { return _prefix; } } #endregion public properties #region Private Fields private string _xmlNamespace; private string _prefix; #endregion Private Fields } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //------------------------------------------------------------------------ // // Microsoft Windows Client Platform // Copyright (C) Microsoft Corporation, 2005 // // File: XmlnsPrefixAttribute.cs // // Contents: Namespace default prefix recommendation support // Created: 04/28/2005 [....] // //----------------------------------------------------------------------- using System; using System.ComponentModel; namespace System.Windows.Markup { ////// /// This attribute allows an assembly to recommend a prefix to be used when writing elements and /// attributes in a xaml file. /// /// For a WinFX assembly, it can set the attributes as follows: /// /// [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] public sealed class XmlnsPrefixAttribute: Attribute { ////// [assembly:XmlnsDefinition("http://schemas.fabrikam.com/mynamespace", "fabrikam.myproduct.mycategory1")] /// [assembly:XmlnsDefinition("http://schemas.fabrikam.com/mynamespace", "fabrikam.myproduct.mycategory2")] /// [assembly:XmlnsPrefix("http://schemas.fabrikam.com/mynamespace", "myns")] ///
/// /// If fabrikam.myproduct.mycategory namespace in this assembly contains a UIElement such as "MyButton", the /// xaml file could use it like below: ////// <Page xmlns:myns="http://schemas.fabrikam.com/mynamespace" .... > /// <myns:MyButton> ..... </myns:MyButton> /// </Page> ///
////// Constructor /// /// XML namespce /// recommended prefix public XmlnsPrefixAttribute(string xmlNamespace, string prefix) { // Validate Input Arguments if (xmlNamespace == null) { throw new ArgumentNullException("xmlNamespace"); } if (prefix == null) { throw new ArgumentNullException("prefix"); } _xmlNamespace = xmlNamespace; _prefix= prefix; } #region public properties ////// XML Namespace /// public string XmlNamespace { get { return _xmlNamespace; } } ////// New Xml Namespace /// public string Prefix { get { return _prefix; } } #endregion public properties #region Private Fields private string _xmlNamespace; private string _prefix; #endregion Private Fields } } // 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
- ExpressionBinding.cs
- NativeWindow.cs
- Size3D.cs
- ListenerConnectionModeReader.cs
- SqlInternalConnectionSmi.cs
- FunctionCommandText.cs
- FocusChangedEventArgs.cs
- HasCopySemanticsAttribute.cs
- MouseActionConverter.cs
- ContentElement.cs
- Repeater.cs
- AutomationProperties.cs
- StylusSystemGestureEventArgs.cs
- COM2ComponentEditor.cs
- TrackingStringDictionary.cs
- ScrollEventArgs.cs
- BamlLocalizationDictionary.cs
- XpsTokenContext.cs
- FontInfo.cs
- MergeExecutor.cs
- __ConsoleStream.cs
- NullExtension.cs
- BindStream.cs
- IntranetCredentialPolicy.cs
- TraceContextRecord.cs
- EdmError.cs
- ArithmeticException.cs
- SortAction.cs
- ContextStaticAttribute.cs
- AliasedExpr.cs
- UIElementParaClient.cs
- DragDropManager.cs
- XsltException.cs
- SafeHandles.cs
- Byte.cs
- StringAttributeCollection.cs
- ChangeBlockUndoRecord.cs
- DataTableReader.cs
- DbParameterCollectionHelper.cs
- SubstitutionResponseElement.cs
- DynamicResourceExtensionConverter.cs
- HandleCollector.cs
- ActivityDesigner.cs
- NumberFormatInfo.cs
- MappingMetadataHelper.cs
- KerberosSecurityTokenProvider.cs
- ActionItem.cs
- TextSpanModifier.cs
- ComplexObject.cs
- Hashtable.cs
- PolicyLevel.cs
- XmlUtil.cs
- KerberosTicketHashIdentifierClause.cs
- XhtmlBasicCommandAdapter.cs
- DataGridViewRowPostPaintEventArgs.cs
- Identity.cs
- securitymgrsite.cs
- DataGridBeginningEditEventArgs.cs
- FragmentQueryProcessor.cs
- CodeExporter.cs
- CreateUserErrorEventArgs.cs
- IgnoreFileBuildProvider.cs
- UTF8Encoding.cs
- Vertex.cs
- PaperSource.cs
- SafeLibraryHandle.cs
- _StreamFramer.cs
- AppDomainProtocolHandler.cs
- DocumentPageTextView.cs
- ProxyFragment.cs
- DbReferenceCollection.cs
- DatagridviewDisplayedBandsData.cs
- RequestStatusBarUpdateEventArgs.cs
- BulletedListDesigner.cs
- ResourceContainer.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- GenericAuthenticationEventArgs.cs
- MonitoringDescriptionAttribute.cs
- DependencyObjectValidator.cs
- _BufferOffsetSize.cs
- Memoizer.cs
- CommandEventArgs.cs
- XmlValidatingReaderImpl.cs
- MinimizableAttributeTypeConverter.cs
- NativeActivityContext.cs
- GACMembershipCondition.cs
- FilterEventArgs.cs
- WeakReference.cs
- PropertyDescriptorCollection.cs
- X509Extension.cs
- DefaultEvaluationContext.cs
- BamlLocalizabilityResolver.cs
- DebugViewWriter.cs
- XmlDataImplementation.cs
- DoubleLinkList.cs
- CompositeDataBoundControl.cs
- OutputCacheSection.cs
- ToolStripItemRenderEventArgs.cs
- SchemaContext.cs
- ArcSegment.cs