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
- ReadOnlyCollection.cs
- AlternateViewCollection.cs
- MatrixConverter.cs
- SqlNodeAnnotation.cs
- PaperSize.cs
- SafeLibraryHandle.cs
- WebScriptMetadataFormatter.cs
- DrawToolTipEventArgs.cs
- DatePicker.cs
- ParseElement.cs
- GcHandle.cs
- SettingsBindableAttribute.cs
- RepeatBehaviorConverter.cs
- RoutingUtilities.cs
- SkinBuilder.cs
- DataListItemCollection.cs
- MemoryMappedViewAccessor.cs
- ContentPresenter.cs
- Environment.cs
- TaskFileService.cs
- DiagnosticSection.cs
- Int64AnimationBase.cs
- ConfigurationSectionGroupCollection.cs
- DependencyPropertyValueSerializer.cs
- JumpList.cs
- RemotingServices.cs
- HtmlGenericControl.cs
- JoinElimination.cs
- ChannelManager.cs
- SchemeSettingElement.cs
- PresentationAppDomainManager.cs
- ChameleonKey.cs
- _OverlappedAsyncResult.cs
- InstanceContextMode.cs
- PointHitTestResult.cs
- ContentOperations.cs
- Visual.cs
- PropertyValueEditor.cs
- HatchBrush.cs
- XmlWrappingReader.cs
- CodeVariableReferenceExpression.cs
- WebPartManagerInternals.cs
- DataSourceHelper.cs
- ColumnClickEvent.cs
- StrokeNode.cs
- CheckBoxField.cs
- AlphabeticalEnumConverter.cs
- MenuItemStyleCollection.cs
- SettingsAttributeDictionary.cs
- MenuAdapter.cs
- SBCSCodePageEncoding.cs
- InternalBufferOverflowException.cs
- HScrollProperties.cs
- OverflowException.cs
- WebSysDefaultValueAttribute.cs
- TimeSpanMinutesConverter.cs
- DefaultValidator.cs
- Signature.cs
- QilTargetType.cs
- WindowsStartMenu.cs
- HtmlTextArea.cs
- DrawingAttributesDefaultValueFactory.cs
- BindingListCollectionView.cs
- ValueProviderWrapper.cs
- LOSFormatter.cs
- SqlCommandBuilder.cs
- ChineseLunisolarCalendar.cs
- SiteMapNodeCollection.cs
- VirtualizedContainerService.cs
- PropertyDescriptor.cs
- SqlBulkCopyColumnMappingCollection.cs
- EndpointConfigContainer.cs
- XmlWrappingWriter.cs
- HtmlLiteralTextAdapter.cs
- EndpointIdentityExtension.cs
- URL.cs
- BaseUriHelper.cs
- OutputScopeManager.cs
- ValidationErrorCollection.cs
- EtwTrace.cs
- DocumentEventArgs.cs
- InputEventArgs.cs
- DateTimeOffsetAdapter.cs
- SystemColors.cs
- Substitution.cs
- CodeVariableDeclarationStatement.cs
- IndexObject.cs
- ButtonField.cs
- EntityContainerEntitySet.cs
- TextRenderer.cs
- TextTrailingCharacterEllipsis.cs
- DiscoveryMessageSequenceGenerator.cs
- _BufferOffsetSize.cs
- OrderPreservingPipeliningSpoolingTask.cs
- OleDbConnection.cs
- SqlAliasesReferenced.cs
- CheckBoxRenderer.cs
- StorageMappingFragment.cs
- Exceptions.cs
- LambdaCompiler.Generated.cs