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
- XPathNavigator.cs
- XmlSchemaImporter.cs
- PageEventArgs.cs
- CodeIndexerExpression.cs
- WebEvents.cs
- ParameterModifier.cs
- NavigationFailedEventArgs.cs
- ToolStripPanelCell.cs
- SystemInfo.cs
- SchemaTableOptionalColumn.cs
- EventWaitHandle.cs
- HMACSHA512.cs
- MetadataHelper.cs
- _Semaphore.cs
- ParameterRetriever.cs
- Win32.cs
- RequestResizeEvent.cs
- DetailsViewModeEventArgs.cs
- DrawingAttributeSerializer.cs
- ConnectionPointGlyph.cs
- InheritanceContextHelper.cs
- Authorization.cs
- XmlMembersMapping.cs
- DataServiceKeyAttribute.cs
- DataView.cs
- ToolStripSeparator.cs
- DesignerHelpers.cs
- PreservationFileWriter.cs
- TextContainerHelper.cs
- HideDisabledControlAdapter.cs
- infer.cs
- ExpressionDumper.cs
- ExpandedWrapper.cs
- RuntimeHandles.cs
- DesignerCalendarAdapter.cs
- DocumentPage.cs
- webclient.cs
- TextAnchor.cs
- ImageClickEventArgs.cs
- CultureSpecificCharacterBufferRange.cs
- Nodes.cs
- TileBrush.cs
- ProtocolViolationException.cs
- XmlDocument.cs
- ToolStripSeparator.cs
- GroupStyle.cs
- CharUnicodeInfo.cs
- InstancePersistenceContext.cs
- SqlRowUpdatedEvent.cs
- ChangePassword.cs
- RequestSecurityToken.cs
- OleServicesContext.cs
- FactorySettingsElement.cs
- RotateTransform.cs
- ClientCultureInfo.cs
- SqlDataSourceStatusEventArgs.cs
- JsonClassDataContract.cs
- StoreConnection.cs
- ProfessionalColors.cs
- wgx_render.cs
- SimpleFileLog.cs
- RTTrackingProfile.cs
- configsystem.cs
- EventMap.cs
- SQLDateTime.cs
- ComplexPropertyEntry.cs
- Model3D.cs
- ToolStripButton.cs
- XsltLibrary.cs
- DescendentsWalkerBase.cs
- BinHexEncoder.cs
- ActivationServices.cs
- StrongTypingException.cs
- WmlPageAdapter.cs
- DataObjectSettingDataEventArgs.cs
- DocumentOrderComparer.cs
- HttpCookiesSection.cs
- WebPartVerb.cs
- ConstructorNeedsTagAttribute.cs
- SettingsAttributes.cs
- WeakReferenceList.cs
- ProviderBase.cs
- CrossSiteScriptingValidation.cs
- ExpressionEditorAttribute.cs
- ErrorRuntimeConfig.cs
- RelationshipConverter.cs
- HttpVersion.cs
- Mappings.cs
- StickyNoteContentControl.cs
- MouseCaptureWithinProperty.cs
- dataobject.cs
- OdbcConnectionPoolProviderInfo.cs
- PropertySegmentSerializationProvider.cs
- TreeViewItemAutomationPeer.cs
- PreProcessInputEventArgs.cs
- EtwTrace.cs
- DataExpression.cs
- DataGridViewCellCollection.cs
- Selection.cs
- AsymmetricSignatureFormatter.cs