Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / Framework / MS / Internal / IO / Packaging / contentDescriptor.cs / 1 / contentDescriptor.cs
//----------------------------------------------------------------------------
//
//
// Copyright (C) Microsoft Corporation. All rights reserved.
//
//
// Description:
// Types of keys and data in the element table that is used
// by XamlFilter and initialized by the generated function
// InitElementDictionary.
//
// History:
// 02/26/2004: JohnLarc: Initial implementation
//---------------------------------------------------------------------------
using System;
namespace MS.Internal.IO.Packaging
{
///
/// Representation of a fully-qualified XML name for a XAML element.
///
internal class ElementTableKey
{
///
/// Constructor.
///
internal ElementTableKey(string xmlNamespace, string baseName)
{
if (xmlNamespace == null)
{
throw new ArgumentNullException("xmlNamespace");
}
if (baseName == null)
{
throw new ArgumentNullException("baseName");
}
_xmlNamespace = xmlNamespace;
_baseName = baseName;
}
///
/// Equality test.
///
public override bool Equals( object other )
{
if (other == null)
return false; // Standard behavior.
if (other.GetType() != GetType())
return false;
// Note that because of the GetType() checking above, the casting must be valid.
ElementTableKey otherElement = (ElementTableKey)other;
return ( String.CompareOrdinal(BaseName,otherElement.BaseName) == 0
&& String.CompareOrdinal(XmlNamespace,otherElement.XmlNamespace) == 0 );
}
///
/// Hash on all name components.
///
public override int GetHashCode()
{
return XmlNamespace.GetHashCode() ^ BaseName.GetHashCode();
}
///
/// XML namespace.
///
internal string XmlNamespace
{
get
{
return _xmlNamespace;
}
}
///
/// Local name.
///
internal string BaseName
{
get
{
return _baseName;
}
}
private string _baseName;
private string _xmlNamespace;
public static readonly string XamlNamespace = "http://schemas.microsoft.com/winfx/2006/xaml/presentation";
public static readonly string FixedMarkupNamespace = "http://schemas.microsoft.com/xps/2005/06";
}
///Content-location information for an element.
internal class ContentDescriptor
{
///
/// The name of the key to the value of _xamlElementContentDescriptorDictionary in the resource file.
///
internal const string ResourceKeyName = "Dictionary";
///
/// The name of the resource containing the definition of XamlFilter._xamlElementContentDescriptorDictionary.
///
internal const string ResourceName = "ElementTable";
///
/// Standard constructor.
///
internal ContentDescriptor(
bool hasIndexableContent,
bool isInline,
string contentProp,
string titleProp)
{
HasIndexableContent = hasIndexableContent;
IsInline = isInline;
ContentProp = contentProp;
TitleProp = titleProp;
}
///
/// Constructor with default settings for all but HasIndexableContent.
///
///
/// Currently, this constructor is always passed false, since in this case the other values are "don't care".
/// It would make sense to use it with HasIndexableContent=true, however.
///
internal ContentDescriptor(
bool hasIndexableContent)
{
HasIndexableContent = hasIndexableContent;
IsInline = false;
ContentProp = null;
TitleProp = null;
}
///
/// Whether indexable at all.
///
///
/// ContentDescriptor properties are read-write because at table creation time these properties
/// are discovered and stored incrementally.
///
internal bool HasIndexableContent
{
get
{
return _hasIndexableContent;
}
set
{
_hasIndexableContent = value;
}
}
///
/// Block or inline.
///
internal bool IsInline
{
get
{
return _isInline;
}
set
{
_isInline = value;
}
}
///
/// Attribute in which to find content or null.
///
internal string ContentProp
{
get
{
return _contentProp;
}
set
{
_contentProp = value;
}
}
///
/// Attribute in which to find a title rather than the real content.
///
internal string TitleProp
{
get
{
return _titleProp;
}
set
{
_titleProp = value;
}
}
private bool _hasIndexableContent;
private bool _isInline;
private string _contentProp;
private string _titleProp;
}
} // namespace MS.Internal.IO.Packaging
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
//----------------------------------------------------------------------------
//
//
// Copyright (C) Microsoft Corporation. All rights reserved.
//
//
// Description:
// Types of keys and data in the element table that is used
// by XamlFilter and initialized by the generated function
// InitElementDictionary.
//
// History:
// 02/26/2004: JohnLarc: Initial implementation
//---------------------------------------------------------------------------
using System;
namespace MS.Internal.IO.Packaging
{
///
/// Representation of a fully-qualified XML name for a XAML element.
///
internal class ElementTableKey
{
///
/// Constructor.
///
internal ElementTableKey(string xmlNamespace, string baseName)
{
if (xmlNamespace == null)
{
throw new ArgumentNullException("xmlNamespace");
}
if (baseName == null)
{
throw new ArgumentNullException("baseName");
}
_xmlNamespace = xmlNamespace;
_baseName = baseName;
}
///
/// Equality test.
///
public override bool Equals( object other )
{
if (other == null)
return false; // Standard behavior.
if (other.GetType() != GetType())
return false;
// Note that because of the GetType() checking above, the casting must be valid.
ElementTableKey otherElement = (ElementTableKey)other;
return ( String.CompareOrdinal(BaseName,otherElement.BaseName) == 0
&& String.CompareOrdinal(XmlNamespace,otherElement.XmlNamespace) == 0 );
}
///
/// Hash on all name components.
///
public override int GetHashCode()
{
return XmlNamespace.GetHashCode() ^ BaseName.GetHashCode();
}
///
/// XML namespace.
///
internal string XmlNamespace
{
get
{
return _xmlNamespace;
}
}
///
/// Local name.
///
internal string BaseName
{
get
{
return _baseName;
}
}
private string _baseName;
private string _xmlNamespace;
public static readonly string XamlNamespace = "http://schemas.microsoft.com/winfx/2006/xaml/presentation";
public static readonly string FixedMarkupNamespace = "http://schemas.microsoft.com/xps/2005/06";
}
///Content-location information for an element.
internal class ContentDescriptor
{
///
/// The name of the key to the value of _xamlElementContentDescriptorDictionary in the resource file.
///
internal const string ResourceKeyName = "Dictionary";
///
/// The name of the resource containing the definition of XamlFilter._xamlElementContentDescriptorDictionary.
///
internal const string ResourceName = "ElementTable";
///
/// Standard constructor.
///
internal ContentDescriptor(
bool hasIndexableContent,
bool isInline,
string contentProp,
string titleProp)
{
HasIndexableContent = hasIndexableContent;
IsInline = isInline;
ContentProp = contentProp;
TitleProp = titleProp;
}
///
/// Constructor with default settings for all but HasIndexableContent.
///
///
/// Currently, this constructor is always passed false, since in this case the other values are "don't care".
/// It would make sense to use it with HasIndexableContent=true, however.
///
internal ContentDescriptor(
bool hasIndexableContent)
{
HasIndexableContent = hasIndexableContent;
IsInline = false;
ContentProp = null;
TitleProp = null;
}
///
/// Whether indexable at all.
///
///
/// ContentDescriptor properties are read-write because at table creation time these properties
/// are discovered and stored incrementally.
///
internal bool HasIndexableContent
{
get
{
return _hasIndexableContent;
}
set
{
_hasIndexableContent = value;
}
}
///
/// Block or inline.
///
internal bool IsInline
{
get
{
return _isInline;
}
set
{
_isInline = value;
}
}
///
/// Attribute in which to find content or null.
///
internal string ContentProp
{
get
{
return _contentProp;
}
set
{
_contentProp = value;
}
}
///
/// Attribute in which to find a title rather than the real content.
///
internal string TitleProp
{
get
{
return _titleProp;
}
set
{
_titleProp = value;
}
}
private bool _hasIndexableContent;
private bool _isInline;
private string _contentProp;
private string _titleProp;
}
} // namespace MS.Internal.IO.Packaging
// 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
- DbDataReader.cs
- DirectoryNotFoundException.cs
- X509Chain.cs
- InvalidFilterCriteriaException.cs
- CollectionViewGroupRoot.cs
- DispatcherExceptionEventArgs.cs
- DrawingDrawingContext.cs
- PartialClassGenerationTask.cs
- Geometry.cs
- SnapLine.cs
- HtmlTitle.cs
- SqlUDTStorage.cs
- SHA512Managed.cs
- XmlNamespaceMapping.cs
- SystemThemeKey.cs
- TdsParserHelperClasses.cs
- Listener.cs
- Util.cs
- EpmAttributeNameBuilder.cs
- SessionPageStateSection.cs
- CommonObjectSecurity.cs
- ImmutablePropertyDescriptorGridEntry.cs
- SerializationFieldInfo.cs
- BamlRecordWriter.cs
- Page.cs
- ParamArrayAttribute.cs
- KeyNotFoundException.cs
- EntityUtil.cs
- LogicalExpressionTypeConverter.cs
- GatewayDefinition.cs
- ArrayMergeHelper.cs
- NavigationCommands.cs
- ContainerSelectorBehavior.cs
- DeclaredTypeValidator.cs
- SafeRegistryKey.cs
- StorageComplexPropertyMapping.cs
- TaskHelper.cs
- ServiceModelConfigurationSectionCollection.cs
- MemoryMappedViewStream.cs
- ResourcesBuildProvider.cs
- COM2IVsPerPropertyBrowsingHandler.cs
- XamlPoint3DCollectionSerializer.cs
- PolicyUnit.cs
- EraserBehavior.cs
- DynamicResourceExtensionConverter.cs
- SymLanguageType.cs
- ElementFactory.cs
- COSERVERINFO.cs
- SurrogateDataContract.cs
- X509ClientCertificateAuthenticationElement.cs
- __Filters.cs
- OleCmdHelper.cs
- OrderedHashRepartitionStream.cs
- TransactionScopeDesigner.cs
- RelativeSource.cs
- RtfNavigator.cs
- LoginName.cs
- webproxy.cs
- SingleResultAttribute.cs
- MailMessageEventArgs.cs
- ping.cs
- SizeKeyFrameCollection.cs
- ByteAnimationBase.cs
- NavigatorInput.cs
- GorillaCodec.cs
- DataGridViewLinkColumn.cs
- DisableDpiAwarenessAttribute.cs
- CommonGetThemePartSize.cs
- _KerberosClient.cs
- Adorner.cs
- SplayTreeNode.cs
- SecurityUniqueId.cs
- InstanceDescriptor.cs
- PerformanceCounterPermissionEntryCollection.cs
- MessageCredentialType.cs
- Regex.cs
- ConsumerConnectionPoint.cs
- SchemaManager.cs
- PipeStream.cs
- ReferenceSchema.cs
- EFTableProvider.cs
- ClientWindowsAuthenticationMembershipProvider.cs
- HtmlInputRadioButton.cs
- RequestSecurityToken.cs
- ExceptionHandlerDesigner.cs
- FullTextState.cs
- Odbc32.cs
- DataGridItemAttachedStorage.cs
- TemplateApplicationHelper.cs
- Util.cs
- SortExpressionBuilder.cs
- ExtensionSimplifierMarkupObject.cs
- Thickness.cs
- BatchParser.cs
- TdsParserHelperClasses.cs
- ZipArchive.cs
- ExpandCollapsePattern.cs
- FlowDocumentReader.cs
- PropertyGridEditorPart.cs
- DataChangedEventManager.cs