Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / wpf / src / Core / CSharp / System / Windows / Markup / XamlSerializerUtil.cs / 1 / XamlSerializerUtil.cs
//----------------------------------------------------------------------------
//
// File: XamlSerializerUtil.cs
//
// Description:
// Static Helper methods used for Serialization.
//
// Copyright (C) 2005 by Microsoft Corporation. All rights reserved.
//
//---------------------------------------------------------------------------
using System;
using MS.Internal.PresentationCore;
namespace System.Windows.Markup
{
///
/// Static helper methods used for Serialization process
///
internal static class XamlCoreSerializerUtil
{
static XamlCoreSerializerUtil()
{
//
// Dummy code to keep IAddChildInternal from being optimized out of
// PresentationCore. PLEASE REMOVE WHEN IAddChildInternal DISAPPEARS.
//
ThrowIfIAddChildInternal("not IAddChildInternal");
}
internal static void ThrowIfIAddChildInternal(object o)
{
//
// Dummy code to keep IAddChildInternal from being optimized out of
// PresentationCore. PLEASE REMOVE WHEN IAddChildInternal DISAPPEARS.
//
if ( o is IAddChildInternal)
{
throw new InvalidOperationException();
}
}
///
/// Throw an exception if the passed string is not empty and is not
/// all whitespace. This is used to check IAddChild.AddText calls for
/// objects that don't handle text, but may get some whitespace if
/// if xml:space="preserve" is set in xaml.
///
internal static void ThrowIfNonWhiteSpaceInAddText(string s)
{
if (s != null)
{
for (int i = 0; i < s.Length; i++)
{
if (!Char.IsWhiteSpace(s[i]))
{
throw new ArgumentException(SR.Get(SRID.NonWhiteSpaceInAddText, s));
}
}
}
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
//----------------------------------------------------------------------------
//
// File: XamlSerializerUtil.cs
//
// Description:
// Static Helper methods used for Serialization.
//
// Copyright (C) 2005 by Microsoft Corporation. All rights reserved.
//
//---------------------------------------------------------------------------
using System;
using MS.Internal.PresentationCore;
namespace System.Windows.Markup
{
///
/// Static helper methods used for Serialization process
///
internal static class XamlCoreSerializerUtil
{
static XamlCoreSerializerUtil()
{
//
// Dummy code to keep IAddChildInternal from being optimized out of
// PresentationCore. PLEASE REMOVE WHEN IAddChildInternal DISAPPEARS.
//
ThrowIfIAddChildInternal("not IAddChildInternal");
}
internal static void ThrowIfIAddChildInternal(object o)
{
//
// Dummy code to keep IAddChildInternal from being optimized out of
// PresentationCore. PLEASE REMOVE WHEN IAddChildInternal DISAPPEARS.
//
if ( o is IAddChildInternal)
{
throw new InvalidOperationException();
}
}
///
/// Throw an exception if the passed string is not empty and is not
/// all whitespace. This is used to check IAddChild.AddText calls for
/// objects that don't handle text, but may get some whitespace if
/// if xml:space="preserve" is set in xaml.
///
internal static void ThrowIfNonWhiteSpaceInAddText(string s)
{
if (s != null)
{
for (int i = 0; i < s.Length; i++)
{
if (!Char.IsWhiteSpace(s[i]))
{
throw new ArgumentException(SR.Get(SRID.NonWhiteSpaceInAddText, s));
}
}
}
}
}
}
// 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
- ApplicationDirectoryMembershipCondition.cs
- DetailsViewUpdateEventArgs.cs
- ResourceDescriptionAttribute.cs
- InternalConfigConfigurationFactory.cs
- DbFunctionCommandTree.cs
- CacheOutputQuery.cs
- ColumnMapVisitor.cs
- OutputWindow.cs
- Mutex.cs
- EmptyControlCollection.cs
- EditorZone.cs
- HttpException.cs
- AppModelKnownContentFactory.cs
- CompilerCollection.cs
- HtmlUtf8RawTextWriter.cs
- StrongName.cs
- jithelpers.cs
- ScriptDescriptor.cs
- Label.cs
- ConnectionPointCookie.cs
- LogExtentCollection.cs
- CodeParameterDeclarationExpression.cs
- SortedSet.cs
- UserPersonalizationStateInfo.cs
- EndEvent.cs
- TokenizerHelper.cs
- _UriSyntax.cs
- CustomGrammar.cs
- CodeObjectCreateExpression.cs
- BitmapEffectInput.cs
- httpapplicationstate.cs
- MultipartContentParser.cs
- ReferenceConverter.cs
- _ProxyRegBlob.cs
- DesignDataSource.cs
- CompiledQuery.cs
- DataObject.cs
- PrintingPermissionAttribute.cs
- StylusPointProperty.cs
- ColorContextHelper.cs
- GB18030Encoding.cs
- HttpDebugHandler.cs
- Material.cs
- DBAsyncResult.cs
- LayoutSettings.cs
- _CommandStream.cs
- XmlSchemaValidationException.cs
- ParentQuery.cs
- BinaryConverter.cs
- SendMessageContent.cs
- ExecutionEngineException.cs
- XmlSchemaDocumentation.cs
- FileDialogCustomPlace.cs
- ConsoleCancelEventArgs.cs
- AttributeAction.cs
- Scheduling.cs
- SqlDataSourceCommandEventArgs.cs
- ConversionHelper.cs
- SimpleApplicationHost.cs
- DesignerAttribute.cs
- TypeValidationEventArgs.cs
- SortKey.cs
- RelationshipFixer.cs
- ValidationEventArgs.cs
- TextBoxAutoCompleteSourceConverter.cs
- FileReservationCollection.cs
- FormViewPagerRow.cs
- ImageFormatConverter.cs
- HttpResponse.cs
- X509Certificate2.cs
- InputLangChangeEvent.cs
- TouchFrameEventArgs.cs
- httpstaticobjectscollection.cs
- SqlConnectionFactory.cs
- BaseTemplateBuildProvider.cs
- StdRegProviderWrapper.cs
- ListDesigner.cs
- FixedSOMPageElement.cs
- Configuration.cs
- ItemsChangedEventArgs.cs
- SEHException.cs
- PathTooLongException.cs
- TimeIntervalCollection.cs
- TextBox.cs
- WorkflowViewService.cs
- validationstate.cs
- TogglePattern.cs
- SafeNativeMethods.cs
- XslTransform.cs
- SafeLibraryHandle.cs
- InvalidOleVariantTypeException.cs
- TrustManagerPromptUI.cs
- ImmutableObjectAttribute.cs
- ReadOnlyTernaryTree.cs
- VirtualPathProvider.cs
- IndentedTextWriter.cs
- CounterCreationDataCollection.cs
- WebAdminConfigurationHelper.cs
- ImageMapEventArgs.cs
- DiscoveryClientReferences.cs