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
- ForeignKeyConstraint.cs
- MemberHolder.cs
- WindowsAuthenticationEventArgs.cs
- ConfigurationValue.cs
- TextAdaptor.cs
- MarshalByRefObject.cs
- DrawingContext.cs
- SiteMapSection.cs
- DataException.cs
- ScriptResourceInfo.cs
- followingquery.cs
- MdImport.cs
- WsatConfiguration.cs
- Matrix.cs
- XmlWriterDelegator.cs
- DataMisalignedException.cs
- Section.cs
- MetadataArtifactLoaderComposite.cs
- ImageUrlEditor.cs
- XPathScanner.cs
- DesignBindingValueUIHandler.cs
- XmlAttributeOverrides.cs
- XmlDataProvider.cs
- ThreadAttributes.cs
- UserControlCodeDomTreeGenerator.cs
- FormViewRow.cs
- EmptyEnumerator.cs
- AnimationClock.cs
- FixedTextContainer.cs
- CodeGeneratorOptions.cs
- InfoCardRSAPKCS1SignatureDeformatter.cs
- XmlAttributeCollection.cs
- SingleObjectCollection.cs
- HostTimeoutsElement.cs
- TimeoutValidationAttribute.cs
- VarRemapper.cs
- SafeNativeMethods.cs
- DataGridCellClipboardEventArgs.cs
- DebuggerService.cs
- ADMembershipProvider.cs
- CompiledAction.cs
- ApplicationSecurityManager.cs
- UdpRetransmissionSettings.cs
- EpmSyndicationContentDeSerializer.cs
- FontClient.cs
- DoubleCollection.cs
- EncoderNLS.cs
- SqlTransaction.cs
- HeaderedContentControl.cs
- ToolBarPanel.cs
- IIS7WorkerRequest.cs
- TableCellCollection.cs
- DataObjectMethodAttribute.cs
- RewritingValidator.cs
- DateTimeParse.cs
- ListViewInsertEventArgs.cs
- MetaColumn.cs
- ConnectionDemuxer.cs
- ProcessThread.cs
- WebPartHeaderCloseVerb.cs
- SQLDecimalStorage.cs
- WebServiceClientProxyGenerator.cs
- WizardSideBarListControlItemEventArgs.cs
- VirtualPathProvider.cs
- Action.cs
- WebConfigurationManager.cs
- EmptyReadOnlyDictionaryInternal.cs
- TerminateWorkflow.cs
- AttributeCollection.cs
- ResourceIDHelper.cs
- TextBoxDesigner.cs
- MachinePropertyVariants.cs
- HttpWebRequest.cs
- ColorConvertedBitmapExtension.cs
- RangeValuePattern.cs
- NetCodeGroup.cs
- StateDesigner.CommentLayoutGlyph.cs
- CompleteWizardStep.cs
- ClientSettings.cs
- Identifier.cs
- Events.cs
- ListViewEditEventArgs.cs
- latinshape.cs
- LocalFileSettingsProvider.cs
- Span.cs
- DataBindingExpressionBuilder.cs
- Accessors.cs
- ProjectionPlan.cs
- GenericNameHandler.cs
- WaitHandle.cs
- StickyNote.cs
- NameValueCollection.cs
- RangeValueProviderWrapper.cs
- FontCacheLogic.cs
- ObjectDataSourceDisposingEventArgs.cs
- Function.cs
- ActivityExecutor.cs
- TransformationRules.cs
- webproxy.cs
- AsyncPostBackErrorEventArgs.cs