Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / 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 chuckj // //----------------------------------------------------------------------- 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
- HierarchicalDataBoundControlAdapter.cs
- DashStyles.cs
- ResourceDescriptionAttribute.cs
- HostExecutionContextManager.cs
- XPathNodeList.cs
- TableLayout.cs
- IDispatchConstantAttribute.cs
- FullTrustAssembliesSection.cs
- TextLineBreak.cs
- InputScopeNameConverter.cs
- XmlWrappingWriter.cs
- IIS7WorkerRequest.cs
- ZipIOLocalFileDataDescriptor.cs
- Debug.cs
- TabletDevice.cs
- BaseProcessor.cs
- CompressedStack.cs
- XmlNodeWriter.cs
- DBSqlParserColumn.cs
- SettingsPropertyValue.cs
- DataKeyArray.cs
- ViewBox.cs
- BindingExpressionBase.cs
- ItemsPanelTemplate.cs
- Char.cs
- HighContrastHelper.cs
- DbDataAdapter.cs
- DragEvent.cs
- FileNotFoundException.cs
- ConcurrentQueue.cs
- CacheSection.cs
- TableItemStyle.cs
- SystemResources.cs
- Point.cs
- TrustManagerPromptUI.cs
- SqlUtil.cs
- ApplicationDirectory.cs
- TextDpi.cs
- DataFormats.cs
- SetIterators.cs
- ListViewEditEventArgs.cs
- TraceContextEventArgs.cs
- MessageEncodingBindingElement.cs
- InfoCardRSAOAEPKeyExchangeDeformatter.cs
- StylusPlugInCollection.cs
- HtmlToClrEventProxy.cs
- TimelineCollection.cs
- webbrowsersite.cs
- FontConverter.cs
- UxThemeWrapper.cs
- TextPatternIdentifiers.cs
- NumberFunctions.cs
- DataBindingHandlerAttribute.cs
- Command.cs
- FileRecordSequenceCompletedAsyncResult.cs
- TraceSource.cs
- SecUtil.cs
- BuildResultCache.cs
- ConfigXmlSignificantWhitespace.cs
- XmlCharCheckingReader.cs
- RequestSecurityToken.cs
- sapiproxy.cs
- GroupAggregateExpr.cs
- PenCursorManager.cs
- StringDictionary.cs
- ReadContentAsBinaryHelper.cs
- PageAdapter.cs
- Calendar.cs
- BidPrivateBase.cs
- SerializationAttributes.cs
- ControlBuilderAttribute.cs
- TableDetailsCollection.cs
- Interlocked.cs
- XmlSchemaInfo.cs
- DataSvcMapFile.cs
- FontWeight.cs
- HitTestDrawingContextWalker.cs
- IImplicitResourceProvider.cs
- ChtmlPageAdapter.cs
- DataServiceException.cs
- DeferredSelectedIndexReference.cs
- SQLDecimal.cs
- Variable.cs
- MetaColumn.cs
- ButtonPopupAdapter.cs
- ComUdtElementCollection.cs
- SchemaAttDef.cs
- IpcClientManager.cs
- TypeSystem.cs
- WrapPanel.cs
- SimpleWebHandlerParser.cs
- MembershipPasswordException.cs
- TaskDesigner.cs
- HyperlinkAutomationPeer.cs
- datacache.cs
- dataprotectionpermission.cs
- DataGridViewImageCell.cs
- StylusPointPropertyInfoDefaults.cs
- PriorityItem.cs
- ActivityExecutionContext.cs