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
- EncryptedType.cs
- PointF.cs
- ExceptionHelpers.cs
- HandlerMappingMemo.cs
- Application.cs
- ObjectStateEntryOriginalDbUpdatableDataRecord.cs
- SiteMapHierarchicalDataSourceView.cs
- ProfileModule.cs
- KeyProperty.cs
- DragDrop.cs
- DriveInfo.cs
- _AuthenticationState.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs
- DataListGeneralPage.cs
- StringAnimationUsingKeyFrames.cs
- NativeWindow.cs
- SafeFileMappingHandle.cs
- BaseCollection.cs
- TextTreeTextNode.cs
- AdapterDictionary.cs
- SwitchElementsCollection.cs
- PrintPreviewControl.cs
- TextSelectionProcessor.cs
- AccessedThroughPropertyAttribute.cs
- XpsS0ValidatingLoader.cs
- LoginUtil.cs
- InheritedPropertyChangedEventArgs.cs
- ExchangeUtilities.cs
- PointIndependentAnimationStorage.cs
- Pen.cs
- StandardToolWindows.cs
- HtmlElement.cs
- ProtocolsConfigurationEntry.cs
- TextBoxLine.cs
- TimeZoneNotFoundException.cs
- DBConcurrencyException.cs
- TextRangeAdaptor.cs
- DataSourceListEditor.cs
- IList.cs
- IndexingContentUnit.cs
- DbParameterCollectionHelper.cs
- PackUriHelper.cs
- DoubleConverter.cs
- CodeCommentStatement.cs
- RawTextInputReport.cs
- DataGridViewMethods.cs
- EntityDataSourceViewSchema.cs
- peernodeimplementation.cs
- ServiceNameElement.cs
- ImageResources.Designer.cs
- TableParaClient.cs
- Table.cs
- Avt.cs
- FactoryMaker.cs
- CqlParserHelpers.cs
- ProjectionPruner.cs
- SafeLocalAllocation.cs
- DecoderBestFitFallback.cs
- BindingMemberInfo.cs
- RuleConditionDialog.cs
- SystemThemeKey.cs
- IssuanceLicense.cs
- MonitoringDescriptionAttribute.cs
- formatter.cs
- IntSecurity.cs
- DbUpdateCommandTree.cs
- _Events.cs
- oledbconnectionstring.cs
- ManipulationDeltaEventArgs.cs
- log.cs
- Encoder.cs
- OwnerDrawPropertyBag.cs
- SelectionWordBreaker.cs
- BaseCollection.cs
- KeyNotFoundException.cs
- Help.cs
- TaskHelper.cs
- DesignerCalendarAdapter.cs
- SafeMILHandle.cs
- SQLInt64Storage.cs
- SqlDataAdapter.cs
- CommandDevice.cs
- ProcessHostFactoryHelper.cs
- CodeLinePragma.cs
- IconHelper.cs
- Setter.cs
- WebException.cs
- SimpleBitVector32.cs
- EncoderFallback.cs
- AmbientProperties.cs
- DesignTimeTemplateParser.cs
- Decorator.cs
- SerializerWriterEventHandlers.cs
- DataGridCellEditEndingEventArgs.cs
- _RegBlobWebProxyDataBuilder.cs
- SessionEndingCancelEventArgs.cs
- Rights.cs
- SchemaImporter.cs
- PeerPresenceInfo.cs
- HtmlInputSubmit.cs