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
- HtmlHead.cs
- XmlComplianceUtil.cs
- IteratorDescriptor.cs
- HttpWebRequest.cs
- PropertyMapper.cs
- Graphics.cs
- RadioButtonList.cs
- Exceptions.cs
- MessageContractExporter.cs
- XmlImplementation.cs
- Authorization.cs
- FrameDimension.cs
- TextRange.cs
- AppSettings.cs
- DateTimeValueSerializerContext.cs
- CollectionViewGroupRoot.cs
- CapiSymmetricAlgorithm.cs
- PriorityQueue.cs
- ExpressionPrefixAttribute.cs
- UnicodeEncoding.cs
- PromptEventArgs.cs
- HyperLinkStyle.cs
- JsonReader.cs
- ObjectConverter.cs
- RefreshPropertiesAttribute.cs
- ExpandCollapseProviderWrapper.cs
- JsonFormatReaderGenerator.cs
- PropertyChangedEventManager.cs
- Converter.cs
- MetaModel.cs
- XPathMultyIterator.cs
- COMException.cs
- QEncodedStream.cs
- UnitySerializationHolder.cs
- Transactions.cs
- SequentialOutput.cs
- XmlQueryOutput.cs
- XmlToDatasetMap.cs
- GetIsBrowserClientRequest.cs
- ObjectParameter.cs
- ArrangedElementCollection.cs
- RuntimeConfigurationRecord.cs
- MediaPlayerState.cs
- precedingquery.cs
- DataTransferEventArgs.cs
- FormsAuthentication.cs
- UriTemplateLiteralQueryValue.cs
- TextDpi.cs
- EventMappingSettings.cs
- SHA256Cng.cs
- Trace.cs
- ECDiffieHellmanCng.cs
- Lasso.cs
- NextPreviousPagerField.cs
- WebResponse.cs
- SessionEndedEventArgs.cs
- TypefaceCollection.cs
- GridViewEditEventArgs.cs
- DbInsertCommandTree.cs
- PresentationUIStyleResources.cs
- ImageKeyConverter.cs
- XmlEntityReference.cs
- HttpPostedFileBase.cs
- objectquery_tresulttype.cs
- NumberSubstitution.cs
- DbInsertCommandTree.cs
- GeometryValueSerializer.cs
- HtmlTableRowCollection.cs
- DodSequenceMerge.cs
- ScaleTransform3D.cs
- QfeChecker.cs
- SubpageParagraph.cs
- PageContentCollection.cs
- DecoratedNameAttribute.cs
- DesignTimeTemplateParser.cs
- TCPClient.cs
- OdbcConnectionFactory.cs
- TextEditorThreadLocalStore.cs
- DBCommand.cs
- OracleInfoMessageEventArgs.cs
- RectValueSerializer.cs
- ListViewInsertionMark.cs
- MimeTypePropertyAttribute.cs
- TypeForwardedFromAttribute.cs
- EntityDataSourceView.cs
- ConnectionPoint.cs
- CanonicalFontFamilyReference.cs
- COM2IDispatchConverter.cs
- IProvider.cs
- GuidConverter.cs
- AutomationIdentifier.cs
- ServiceReference.cs
- Pointer.cs
- DbInsertCommandTree.cs
- RotateTransform3D.cs
- FieldMetadata.cs
- EqualityComparer.cs
- HostDesigntimeLicenseContext.cs
- SQLStringStorage.cs
- ObjectQuery_EntitySqlExtensions.cs