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
- WebHttpDispatchOperationSelectorData.cs
- SqlUnionizer.cs
- DataSourceListEditor.cs
- TypeElement.cs
- Message.cs
- FixedFindEngine.cs
- ApplicationServiceHelper.cs
- AsymmetricAlgorithm.cs
- SimpleWebHandlerParser.cs
- LoginUtil.cs
- IdentityReference.cs
- SID.cs
- ActivationServices.cs
- ListDictionaryInternal.cs
- _BufferOffsetSize.cs
- OperationAbortedException.cs
- WorkflowRuntimeBehavior.cs
- QueryActivatableWorkflowsCommand.cs
- MailWebEventProvider.cs
- CellTreeNode.cs
- TypeHelpers.cs
- DefaultParameterValueAttribute.cs
- ConfigurationSectionGroup.cs
- Image.cs
- CryptoProvider.cs
- GcHandle.cs
- TextMarkerSource.cs
- MemoryFailPoint.cs
- CleanUpVirtualizedItemEventArgs.cs
- RedBlackList.cs
- StringInfo.cs
- DropDownList.cs
- CustomAttributeSerializer.cs
- ListBoxItem.cs
- ExpandableObjectConverter.cs
- AuthenticationService.cs
- HttpCacheVary.cs
- DefaultWorkflowTransactionService.cs
- CodeDelegateCreateExpression.cs
- HttpCapabilitiesEvaluator.cs
- ControlsConfig.cs
- OleDbDataReader.cs
- RuntimeTransactionHandle.cs
- OpenFileDialog.cs
- SecurityUtils.cs
- MostlySingletonList.cs
- TableLayoutStyleCollection.cs
- ValidationHelper.cs
- DNS.cs
- ChannelServices.cs
- TitleStyle.cs
- WmiEventSink.cs
- Matrix3DConverter.cs
- DispatcherObject.cs
- RequestNavigateEventArgs.cs
- SqlTriggerContext.cs
- DigitShape.cs
- StyleXamlParser.cs
- Expr.cs
- DirectoryInfo.cs
- QueryActivatableWorkflowsCommand.cs
- Stack.cs
- ExpressionHelper.cs
- EventTrigger.cs
- ViewGenerator.cs
- OutputCacheProviderCollection.cs
- ImageDrawing.cs
- ApplicationTrust.cs
- BitmapEffectRenderDataResource.cs
- LicFileLicenseProvider.cs
- BookmarkUndoUnit.cs
- DataGridViewToolTip.cs
- XPathItem.cs
- WeakReferenceList.cs
- VisualStyleRenderer.cs
- BamlReader.cs
- Model3DGroup.cs
- Serializer.cs
- SqlDeflator.cs
- WindowsTooltip.cs
- EntityDataSourceState.cs
- NativeMethods.cs
- Int32Storage.cs
- XmlExtensionFunction.cs
- SingleObjectCollection.cs
- XhtmlBasicPhoneCallAdapter.cs
- MethodCallExpression.cs
- PeerToPeerException.cs
- PixelFormat.cs
- ReaderContextStackData.cs
- DocumentPageTextView.cs
- SHA256.cs
- XmlSchemaDatatype.cs
- PeerResolverBindingElement.cs
- FilterQuery.cs
- DashStyle.cs
- LambdaCompiler.Statements.cs
- SmtpDigestAuthenticationModule.cs
- TransactionManagerProxy.cs
- StreamUpdate.cs