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
- DataColumnMapping.cs
- ExitEventArgs.cs
- UrlSyndicationContent.cs
- CalendarAutoFormat.cs
- DecimalAnimationBase.cs
- TableLayoutStyleCollection.cs
- CharacterHit.cs
- HttpWebResponse.cs
- DataGridViewAutoSizeColumnModeEventArgs.cs
- XpsLiterals.cs
- _SingleItemRequestCache.cs
- DesignerDataColumn.cs
- XmlSchemaAnnotation.cs
- EncodingDataItem.cs
- Window.cs
- SqlExpressionNullability.cs
- TextComposition.cs
- RtfToken.cs
- PageContentAsyncResult.cs
- HitTestWithPointDrawingContextWalker.cs
- ObjectListGeneralPage.cs
- ChannelRequirements.cs
- DbConnectionPoolGroupProviderInfo.cs
- Registry.cs
- EditorPartCollection.cs
- DiscreteKeyFrames.cs
- MetadataPropertyvalue.cs
- DataGridRelationshipRow.cs
- SecurityManager.cs
- GotoExpression.cs
- PublishLicense.cs
- CrossSiteScriptingValidation.cs
- PolyQuadraticBezierSegment.cs
- QilLoop.cs
- ConfigurationSettings.cs
- EnumBuilder.cs
- WorkflowIdleBehavior.cs
- AssociatedControlConverter.cs
- AuthenticationModuleElementCollection.cs
- IPPacketInformation.cs
- SQLInt64.cs
- Span.cs
- counter.cs
- SrgsItemList.cs
- StylusPointProperty.cs
- Contracts.cs
- entityreference_tresulttype.cs
- WeakReferenceKey.cs
- ScriptComponentDescriptor.cs
- Exception.cs
- ModelUIElement3D.cs
- DataGridCellsPresenter.cs
- RegistryPermission.cs
- CollectionViewGroupRoot.cs
- ReflectionPermission.cs
- CodeVariableReferenceExpression.cs
- RegularExpressionValidator.cs
- ForwardPositionQuery.cs
- Reference.cs
- ToolStripPanelRow.cs
- StateItem.cs
- BufferedWebEventProvider.cs
- List.cs
- DataPagerFieldCollection.cs
- CalendarDay.cs
- MaterialGroup.cs
- PrivilegeNotHeldException.cs
- ConfigurationCollectionAttribute.cs
- COM2ColorConverter.cs
- SQLString.cs
- DataGridViewCellLinkedList.cs
- ContainerParagraph.cs
- AttachmentCollection.cs
- ItemDragEvent.cs
- GeometryCollection.cs
- CanExecuteRoutedEventArgs.cs
- HwndHostAutomationPeer.cs
- AutomationEvent.cs
- PostBackOptions.cs
- LoginViewDesigner.cs
- DataListItemCollection.cs
- Win32Native.cs
- DynamicMetaObject.cs
- AdCreatedEventArgs.cs
- CommonProperties.cs
- ErrorTableItemStyle.cs
- PlatformCulture.cs
- ConsoleCancelEventArgs.cs
- FixedFlowMap.cs
- PackageDigitalSignature.cs
- CodeRemoveEventStatement.cs
- DependencyPropertyValueSerializer.cs
- Speller.cs
- ProtocolsConfigurationHandler.cs
- TableLayoutPanelCellPosition.cs
- SqlDataSourceStatusEventArgs.cs
- PageBuildProvider.cs
- DivideByZeroException.cs
- DropShadowBitmapEffect.cs
- DateTimeParse.cs