Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- TraceListeners.cs
- PassportAuthentication.cs
- DataView.cs
- Point3DValueSerializer.cs
- ImageMap.cs
- OperationPickerDialog.designer.cs
- Point3DCollection.cs
- BamlReader.cs
- XmlQueryContext.cs
- SchemaElementDecl.cs
- GradientStop.cs
- ObjectConverter.cs
- HostedHttpTransportManager.cs
- hwndwrapper.cs
- ContextInformation.cs
- TextBox.cs
- ConfigXmlElement.cs
- HttpRuntimeSection.cs
- ProgressBarRenderer.cs
- ForceCopyBuildProvider.cs
- AQNBuilder.cs
- SessionStateContainer.cs
- Cursor.cs
- PaperSize.cs
- ThreadAttributes.cs
- ScrollBar.cs
- StreamWithDictionary.cs
- LoginDesigner.cs
- CreateUserWizardStep.cs
- ColorBlend.cs
- NullableConverter.cs
- PersianCalendar.cs
- SetterBase.cs
- DataMisalignedException.cs
- ScrollItemPattern.cs
- TreeViewImageIndexConverter.cs
- MsmqHostedTransportConfiguration.cs
- GlobalizationAssembly.cs
- AspNetPartialTrustHelpers.cs
- XmlIlGenerator.cs
- DataControlReference.cs
- ZipIOCentralDirectoryDigitalSignature.cs
- UniqueConstraint.cs
- MembershipSection.cs
- ObservableCollection.cs
- userdatakeys.cs
- DataStorage.cs
- Style.cs
- DrawingBrush.cs
- DiagnosticsConfiguration.cs
- _DigestClient.cs
- XmlCharacterData.cs
- RequestQueryParser.cs
- ChildTable.cs
- ListViewUpdatedEventArgs.cs
- CompositeCollection.cs
- CachedPathData.cs
- KeyValueInternalCollection.cs
- TextContainerHelper.cs
- BuildResultCache.cs
- WindowsFormsHelpers.cs
- DecoderBestFitFallback.cs
- Identifier.cs
- Color.cs
- CodeExpressionCollection.cs
- Panel.cs
- QuaternionAnimationBase.cs
- PenContexts.cs
- BitmapEffect.cs
- WebPartsPersonalizationAuthorization.cs
- Quaternion.cs
- WpfGeneratedKnownTypes.cs
- UserPreferenceChangingEventArgs.cs
- StaticFileHandler.cs
- GridViewColumn.cs
- CommandBinding.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- ExtensionCollection.cs
- WinFormsUtils.cs
- UIElement3D.cs
- LicenseProviderAttribute.cs
- PathFigure.cs
- WebBrowserUriTypeConverter.cs
- configsystem.cs
- DbConnectionOptions.cs
- MessageSmuggler.cs
- ValidationError.cs
- SerializationInfo.cs
- DataTemplateSelector.cs
- HttpHandlersSection.cs
- IconConverter.cs
- ExecutionEngineException.cs
- ConfigViewGenerator.cs
- ProgressBarRenderer.cs
- BitmapImage.cs
- AssemblyCollection.cs
- DataGridViewSelectedCellsAccessibleObject.cs
- SiteMapNodeItem.cs
- XmlMtomReader.cs
- ViewBox.cs