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
- SessionStateSection.cs
- DataSourceCache.cs
- DataBoundControl.cs
- TransactionChannelListener.cs
- TextDecorationUnitValidation.cs
- Vector.cs
- WebSysDescriptionAttribute.cs
- SimpleTextLine.cs
- FixedSOMTextRun.cs
- WindowCollection.cs
- PropertyNames.cs
- XhtmlBasicImageAdapter.cs
- Animatable.cs
- RemotingAttributes.cs
- ApplicationContext.cs
- XmlAttributes.cs
- AssemblyCache.cs
- StickyNoteAnnotations.cs
- Composition.cs
- COSERVERINFO.cs
- DataKeyArray.cs
- JapaneseLunisolarCalendar.cs
- SpecialFolderEnumConverter.cs
- SwitchLevelAttribute.cs
- _Events.cs
- TextDecoration.cs
- ThreadPool.cs
- OdbcConnection.cs
- AgileSafeNativeMemoryHandle.cs
- ConfigXmlComment.cs
- TemplateBaseAction.cs
- FamilyCollection.cs
- ForwardPositionQuery.cs
- GridViewDesigner.cs
- PageContentCollection.cs
- SqlProcedureAttribute.cs
- PlainXmlWriter.cs
- SqlNode.cs
- FunctionNode.cs
- OrderPreservingMergeHelper.cs
- SessionStateUtil.cs
- MenuStrip.cs
- WS2007HttpBindingCollectionElement.cs
- ActiveXHelper.cs
- ListChangedEventArgs.cs
- PathTooLongException.cs
- XmlObjectSerializerWriteContext.cs
- DataContractSerializer.cs
- RectValueSerializer.cs
- Attachment.cs
- ListItemConverter.cs
- GridViewCancelEditEventArgs.cs
- Subtree.cs
- Matrix3DConverter.cs
- ElementUtil.cs
- XmlQueryTypeFactory.cs
- UDPClient.cs
- DesignerGeometryHelper.cs
- LessThan.cs
- SqlResolver.cs
- OptionalColumn.cs
- TraceListeners.cs
- SendMessageRecord.cs
- StringComparer.cs
- CodeVariableReferenceExpression.cs
- CroppedBitmap.cs
- CharacterBuffer.cs
- ToolbarAUtomationPeer.cs
- TextEffectCollection.cs
- ConfigurationConverterBase.cs
- RewritingPass.cs
- FileSystemInfo.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- TrackingServices.cs
- MultiView.cs
- SessionSymmetricTransportSecurityProtocolFactory.cs
- BaseCodeDomTreeGenerator.cs
- StringValueSerializer.cs
- AttributeCollection.cs
- DesignerOptions.cs
- ColorIndependentAnimationStorage.cs
- Permission.cs
- PlatformNotSupportedException.cs
- BridgeDataRecord.cs
- SinglePageViewer.cs
- unitconverter.cs
- HtmlElementCollection.cs
- ObjectDataSourceEventArgs.cs
- ListViewContainer.cs
- MetadataCollection.cs
- DetailsViewPagerRow.cs
- assemblycache.cs
- ThemeDictionaryExtension.cs
- DataGridViewDataErrorEventArgs.cs
- SubstitutionList.cs
- InternalDispatchObject.cs
- DocumentPageTextView.cs
- PersonalizationProvider.cs
- BaseTemplateCodeDomTreeGenerator.cs
- UIElementAutomationPeer.cs