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
- MSAAWinEventWrap.cs
- XmlSchemaComplexContentRestriction.cs
- UiaCoreApi.cs
- XmlWriterDelegator.cs
- ImageAnimator.cs
- CodeDOMUtility.cs
- DataServiceRequestException.cs
- EdmConstants.cs
- WinFormsSpinner.cs
- ScriptingScriptResourceHandlerSection.cs
- WriteableBitmap.cs
- XNodeValidator.cs
- PrintEvent.cs
- LocalIdKeyIdentifierClause.cs
- DescendantQuery.cs
- PerformanceCounterPermissionEntry.cs
- ExceptionValidationRule.cs
- mediapermission.cs
- MarshalDirectiveException.cs
- ModelItemImpl.cs
- TextCharacters.cs
- LineServicesRun.cs
- PropertyGeneratedEventArgs.cs
- MergeFailedEvent.cs
- TimeSpanParse.cs
- XmlEventCache.cs
- input.cs
- CustomLineCap.cs
- MulticastIPAddressInformationCollection.cs
- ProjectedSlot.cs
- XmlReflectionMember.cs
- dataobject.cs
- RegistryPermission.cs
- SyndicationLink.cs
- BaseCollection.cs
- TextEffect.cs
- Parser.cs
- DataGridCellClipboardEventArgs.cs
- ConstraintManager.cs
- ListSourceHelper.cs
- ObjectPersistData.cs
- Walker.cs
- HScrollBar.cs
- CheckBoxPopupAdapter.cs
- DataGridViewImageCell.cs
- DayRenderEvent.cs
- DateTimeStorage.cs
- ChangesetResponse.cs
- X509Certificate2Collection.cs
- ReadOnlyObservableCollection.cs
- AddingNewEventArgs.cs
- DesignerHierarchicalDataSourceView.cs
- MatrixTransform3D.cs
- BasicHttpSecurityElement.cs
- TemplatePartAttribute.cs
- __FastResourceComparer.cs
- CompoundFileStreamReference.cs
- ContextProperty.cs
- WebConfigurationFileMap.cs
- Icon.cs
- Model3DGroup.cs
- SpecialNameAttribute.cs
- TraversalRequest.cs
- IListConverters.cs
- FieldDescriptor.cs
- ExportOptions.cs
- VirtualizingPanel.cs
- RemoteArgument.cs
- RC2.cs
- ErrorStyle.cs
- UTF8Encoding.cs
- PngBitmapDecoder.cs
- AbstractSvcMapFileLoader.cs
- WebPartDeleteVerb.cs
- TableDetailsCollection.cs
- SystemThemeKey.cs
- TemplateControlBuildProvider.cs
- DecoratedNameAttribute.cs
- SqlConnectionString.cs
- validationstate.cs
- Publisher.cs
- WebPartRestoreVerb.cs
- XmlUtf8RawTextWriter.cs
- VBIdentifierName.cs
- RestHandlerFactory.cs
- AcceptorSessionSymmetricTransportSecurityProtocol.cs
- HttpAsyncResult.cs
- DataControlButton.cs
- MultilineStringConverter.cs
- DbConnectionStringCommon.cs
- RequestReplyCorrelator.cs
- COM2TypeInfoProcessor.cs
- ClientEventManager.cs
- DataSourceHelper.cs
- InputBinder.cs
- RayHitTestParameters.cs
- TypeNameParser.cs
- ProtectedConfigurationProviderCollection.cs
- ScopelessEnumAttribute.cs
- RegexWriter.cs