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
- Decorator.cs
- TriggerBase.cs
- JsonDataContract.cs
- QilTernary.cs
- ExpressionConverter.cs
- SafeHandles.cs
- StructuredProperty.cs
- TextEffectCollection.cs
- PropertyManager.cs
- FilePrompt.cs
- Panel.cs
- LabelExpression.cs
- Pkcs7Recipient.cs
- HtmlInputHidden.cs
- OutputCacheProfileCollection.cs
- VarRemapper.cs
- InstanceDescriptor.cs
- BlurBitmapEffect.cs
- SafeThreadHandle.cs
- WebBrowserNavigatedEventHandler.cs
- DBDataPermissionAttribute.cs
- OrderedParallelQuery.cs
- PublisherIdentityPermission.cs
- CollectionChangeEventArgs.cs
- WbemProvider.cs
- ObjectStateFormatter.cs
- KeyGesture.cs
- TypeDescriptorContext.cs
- EdmValidator.cs
- ApplicationContext.cs
- VirtualizingPanel.cs
- AttributeCollection.cs
- NestedContainer.cs
- PrincipalPermission.cs
- SkewTransform.cs
- DirectoryRedirect.cs
- DesignerDataView.cs
- ProtocolsConfigurationHandler.cs
- Internal.cs
- ValidatingReaderNodeData.cs
- Point3D.cs
- ipaddressinformationcollection.cs
- Content.cs
- RegexCompilationInfo.cs
- IdentitySection.cs
- ConnectionsZoneAutoFormat.cs
- FixedHyperLink.cs
- GenericAuthenticationEventArgs.cs
- SelectionRangeConverter.cs
- HttpCacheVary.cs
- Typeface.cs
- ProcessInfo.cs
- ProfileSettingsCollection.cs
- SoapDocumentMethodAttribute.cs
- CssClassPropertyAttribute.cs
- TextBoxDesigner.cs
- ProjectionPathSegment.cs
- SimpleRecyclingCache.cs
- DragEvent.cs
- RectAnimationUsingKeyFrames.cs
- TdsParameterSetter.cs
- TextRenderer.cs
- COAUTHIDENTITY.cs
- Hyperlink.cs
- PartitionedStream.cs
- WorkflowServiceHostFactory.cs
- XmlSchemaImport.cs
- SimpleType.cs
- DropShadowBitmapEffect.cs
- OverflowException.cs
- AtomContentProperty.cs
- PageContentAsyncResult.cs
- DaylightTime.cs
- MetadataWorkspace.cs
- VsPropertyGrid.cs
- Page.cs
- TemplateBuilder.cs
- ToolStripItemImageRenderEventArgs.cs
- ConfigXmlElement.cs
- SettingsProviderCollection.cs
- RangeBase.cs
- Matrix3D.cs
- Marshal.cs
- QuaternionAnimation.cs
- UTF7Encoding.cs
- XPathDescendantIterator.cs
- ExclusiveTcpListener.cs
- DbConvert.cs
- ForEachAction.cs
- DataGridCheckBoxColumn.cs
- StringSource.cs
- PropertyItemInternal.cs
- HitTestResult.cs
- ObjectStateFormatter.cs
- EnumDataContract.cs
- SimpleBitVector32.cs
- CollectionBuilder.cs
- ConfigurationStrings.cs
- RequestCachePolicy.cs
- TypeBrowser.xaml.cs