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
- TreeNodeCollectionEditor.cs
- AttachedPropertyMethodSelector.cs
- CannotUnloadAppDomainException.cs
- CachedRequestParams.cs
- FrameworkObject.cs
- GridViewColumnCollectionChangedEventArgs.cs
- RequestTimeoutManager.cs
- GlyphElement.cs
- DataGridViewImageColumn.cs
- PageAdapter.cs
- Exception.cs
- SqlUserDefinedAggregateAttribute.cs
- DataServiceQuery.cs
- CombinedHttpChannel.cs
- TextFragmentEngine.cs
- TextFindEngine.cs
- GeneralTransform.cs
- UnsettableComboBox.cs
- RequestStatusBarUpdateEventArgs.cs
- CmsUtils.cs
- XMLUtil.cs
- DateTimePicker.cs
- CommandConverter.cs
- FrameworkElementFactoryMarkupObject.cs
- BitmapCache.cs
- FloaterBaseParagraph.cs
- FixedDSBuilder.cs
- ListViewGroup.cs
- MimeXmlReflector.cs
- SafeFindHandle.cs
- Compiler.cs
- input.cs
- RelationshipConstraintValidator.cs
- SectionInformation.cs
- InputBuffer.cs
- RowsCopiedEventArgs.cs
- httpserverutility.cs
- CounterSample.cs
- ToolStripItemRenderEventArgs.cs
- SymDocumentType.cs
- WeakReference.cs
- validation.cs
- XmlWrappingReader.cs
- BlurEffect.cs
- ProcessStartInfo.cs
- PropertyNames.cs
- SQLGuid.cs
- TextAction.cs
- HtmlInputText.cs
- PriorityBinding.cs
- IgnoreFileBuildProvider.cs
- DataContractSet.cs
- StrongName.cs
- DataGridViewCellLinkedList.cs
- AdornerDecorator.cs
- Vector3DKeyFrameCollection.cs
- ComboBoxRenderer.cs
- FusionWrap.cs
- DisableDpiAwarenessAttribute.cs
- ColumnResizeUndoUnit.cs
- Pens.cs
- WebRequest.cs
- OuterGlowBitmapEffect.cs
- MetadataArtifactLoaderFile.cs
- SizeAnimationClockResource.cs
- SkipStoryboardToFill.cs
- TemplateParser.cs
- DataGridTextBoxColumn.cs
- HierarchicalDataBoundControlAdapter.cs
- EraserBehavior.cs
- ErrorWrapper.cs
- InvalidWMPVersionException.cs
- MenuBase.cs
- ComAdminInterfaces.cs
- TextInfo.cs
- TextEffectCollection.cs
- SystemSounds.cs
- ConstraintConverter.cs
- XmlComment.cs
- SkinBuilder.cs
- UnsafeNativeMethods.cs
- ItemCollection.cs
- HasCopySemanticsAttribute.cs
- ParsedAttributeCollection.cs
- DocumentOutline.cs
- QueryReaderSettings.cs
- _ScatterGatherBuffers.cs
- DataGridColumn.cs
- SocketSettings.cs
- BrowserCapabilitiesCompiler.cs
- RootBrowserWindowProxy.cs
- DateTimeFormat.cs
- IndicFontClient.cs
- EntityDataSourceWrapper.cs
- ContextBase.cs
- shaperfactoryquerycachekey.cs
- DataColumnCollection.cs
- OdbcError.cs
- ItemAutomationPeer.cs
- CryptoHelper.cs