Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- AssemblyLoader.cs
- LabelInfo.cs
- FreezableDefaultValueFactory.cs
- DataGridViewSelectedCellsAccessibleObject.cs
- PropertyBuilder.cs
- ListSortDescription.cs
- DataControlImageButton.cs
- EdmSchemaAttribute.cs
- OciLobLocator.cs
- PtsPage.cs
- XmlSerializationWriter.cs
- DataControlReferenceCollection.cs
- ThreadStateException.cs
- EditorPartCollection.cs
- FillRuleValidation.cs
- ContentTextAutomationPeer.cs
- ICollection.cs
- TableCellCollection.cs
- IDReferencePropertyAttribute.cs
- XmlAnyElementAttributes.cs
- StringValidatorAttribute.cs
- MediaScriptCommandRoutedEventArgs.cs
- BindToObject.cs
- IntranetCredentialPolicy.cs
- NetNamedPipeBindingCollectionElement.cs
- ConfigurationValues.cs
- DisplayMemberTemplateSelector.cs
- UrlPath.cs
- FolderBrowserDialogDesigner.cs
- WindowsRegion.cs
- PanelDesigner.cs
- TrayIconDesigner.cs
- XappLauncher.cs
- DataGridAddNewRow.cs
- IpcServerChannel.cs
- TemplateGroupCollection.cs
- ZoneMembershipCondition.cs
- FullTextState.cs
- OracleException.cs
- PropertyState.cs
- ConfigXmlWhitespace.cs
- DocumentEventArgs.cs
- PassportAuthenticationEventArgs.cs
- BuildManagerHost.cs
- _Events.cs
- XmlCharCheckingWriter.cs
- SchemaMapping.cs
- SafeRightsManagementSessionHandle.cs
- Vars.cs
- SafeRightsManagementEnvironmentHandle.cs
- SystemInformation.cs
- ExeConfigurationFileMap.cs
- mediaclock.cs
- SqlNodeTypeOperators.cs
- WebPartCatalogAddVerb.cs
- SelectionItemPattern.cs
- OleDbErrorCollection.cs
- DeclarativeCatalogPart.cs
- ServiceControllerDesigner.cs
- SubstitutionList.cs
- SqlCrossApplyToCrossJoin.cs
- BaseParaClient.cs
- SpellerHighlightLayer.cs
- ReadWriteSpinLock.cs
- EncoderNLS.cs
- BreakRecordTable.cs
- EndEvent.cs
- ExpandSegment.cs
- AutomationEvent.cs
- DataGridAutoFormat.cs
- XPathDocument.cs
- GridViewRowCollection.cs
- DateTimePickerDesigner.cs
- DataGridViewRowCollection.cs
- DataRecordObjectView.cs
- StorageAssociationSetMapping.cs
- PlatformCulture.cs
- BmpBitmapDecoder.cs
- StatementContext.cs
- FontInfo.cs
- HttpRuntime.cs
- WsdlImporterElement.cs
- Win32.cs
- DigitShape.cs
- CharacterShapingProperties.cs
- WebResourceAttribute.cs
- PublisherIdentityPermission.cs
- BlockExpression.cs
- DrawItemEvent.cs
- WindowsListViewItemCheckBox.cs
- SmtpMail.cs
- Adorner.cs
- RequestResponse.cs
- ImportContext.cs
- Schema.cs
- TransformGroup.cs
- DBCSCodePageEncoding.cs
- SystemNetworkInterface.cs
- AsymmetricKeyExchangeFormatter.cs
- WebPartHelpVerb.cs