Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- GPPOINT.cs
- FormDesigner.cs
- MTConfigUtil.cs
- DataGridViewTopLeftHeaderCell.cs
- securitycriticaldataClass.cs
- JapaneseCalendar.cs
- DataGrid.cs
- SafeProcessHandle.cs
- DefaultValueConverter.cs
- Scene3D.cs
- AssertSection.cs
- SqlOuterApplyReducer.cs
- ObjectDisposedException.cs
- ConfigXmlSignificantWhitespace.cs
- SqlUtil.cs
- ManualResetEvent.cs
- TextProviderWrapper.cs
- DetailsViewDeletedEventArgs.cs
- IUnknownConstantAttribute.cs
- Registration.cs
- RegexMatch.cs
- Brush.cs
- SmtpFailedRecipientsException.cs
- HttpRawResponse.cs
- PersianCalendar.cs
- WindowsUpDown.cs
- SettingsAttributes.cs
- WinEventHandler.cs
- EntityDataSource.cs
- PolicyLevel.cs
- ScrollBarAutomationPeer.cs
- RepeaterCommandEventArgs.cs
- CodeSubDirectoriesCollection.cs
- FacetEnabledSchemaElement.cs
- EdgeModeValidation.cs
- HandlerBase.cs
- CommonProperties.cs
- ClientViaElement.cs
- Command.cs
- XmlSchemaAttribute.cs
- RectAnimationUsingKeyFrames.cs
- ServiceProviders.cs
- MatrixStack.cs
- Misc.cs
- TemplateContentLoader.cs
- ConstraintManager.cs
- ZipPackage.cs
- RoleManagerModule.cs
- TextTrailingWordEllipsis.cs
- ServiceOperationParameter.cs
- GenericEnumConverter.cs
- ToolStripDropDownButton.cs
- UseAttributeSetsAction.cs
- PropertyPath.cs
- BufferBuilder.cs
- MembershipUser.cs
- EventSinkHelperWriter.cs
- DBSqlParserTableCollection.cs
- ErrorItem.cs
- SqlDataSourceStatusEventArgs.cs
- WindowsSolidBrush.cs
- XmlValidatingReader.cs
- HtmlElementErrorEventArgs.cs
- MessageDecoder.cs
- X509ChainPolicy.cs
- FormView.cs
- URI.cs
- StickyNoteHelper.cs
- SHA512.cs
- Deserializer.cs
- DesignerSerializationOptionsAttribute.cs
- BasicCellRelation.cs
- Number.cs
- BoundColumn.cs
- PackageDocument.cs
- ListenerElementsCollection.cs
- UnmanagedMemoryStreamWrapper.cs
- SystemTcpStatistics.cs
- FigureHelper.cs
- UnknownBitmapDecoder.cs
- Grant.cs
- EventBuilder.cs
- SqlMethodTransformer.cs
- HttpStreamMessage.cs
- SecureStringHasher.cs
- DirectoryObjectSecurity.cs
- HandleExceptionArgs.cs
- Point4D.cs
- DefaultPropertiesToSend.cs
- TemplateControl.cs
- CollectionChange.cs
- CallbackBehaviorAttribute.cs
- WhitespaceRuleLookup.cs
- ComAdminWrapper.cs
- UseLicense.cs
- TokenizerHelper.cs
- DesignObjectWrapper.cs
- CdpEqualityComparer.cs
- MarshalByValueComponent.cs
- MenuAdapter.cs