Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / System / Windows / Markup / XamlSerializerUtil.cs / 1305600 / 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
- WebControl.cs
- SerializationException.cs
- ToolBar.cs
- RelationshipNavigation.cs
- RegexRunner.cs
- ExtendedPropertyCollection.cs
- ByteStorage.cs
- JpegBitmapEncoder.cs
- CompiledRegexRunnerFactory.cs
- XmlSchemaSimpleContent.cs
- AddInAdapter.cs
- TraceHandlerErrorFormatter.cs
- BatchServiceHost.cs
- IdentityNotMappedException.cs
- CompModSwitches.cs
- ListChunk.cs
- TdsParserStateObject.cs
- DoubleLinkListEnumerator.cs
- SqlStatistics.cs
- DelegatingChannelListener.cs
- XslVisitor.cs
- StreamHelper.cs
- StructuredTypeInfo.cs
- configsystem.cs
- odbcmetadatacollectionnames.cs
- RuleSettings.cs
- Enlistment.cs
- ZoneButton.cs
- X509Chain.cs
- MimeXmlImporter.cs
- WebPartConnectionsConnectVerb.cs
- LogReservationCollection.cs
- HttpRawResponse.cs
- AvTrace.cs
- DataGridViewRowConverter.cs
- CreateRefExpr.cs
- CatalogZone.cs
- AssemblyNameProxy.cs
- SocketInformation.cs
- SqlReorderer.cs
- FlowDocumentPageViewerAutomationPeer.cs
- ResourcesChangeInfo.cs
- UxThemeWrapper.cs
- MouseOverProperty.cs
- ImpersonationContext.cs
- WindowsImpersonationContext.cs
- CqlLexer.cs
- X509CertificateCollection.cs
- DocumentPageTextView.cs
- TransformCryptoHandle.cs
- PageThemeBuildProvider.cs
- PolyQuadraticBezierSegmentFigureLogic.cs
- NgenServicingAttributes.cs
- TypeNameParser.cs
- HtmlElementCollection.cs
- PageTextBox.cs
- TextEffect.cs
- ColumnHeader.cs
- FixedDSBuilder.cs
- SortDescriptionCollection.cs
- SourceFilter.cs
- NGCSerializer.cs
- HierarchicalDataSourceControl.cs
- DrawingGroup.cs
- XmlEncodedRawTextWriter.cs
- NetPeerTcpBinding.cs
- EmbeddedMailObjectCollectionEditor.cs
- TCPClient.cs
- uribuilder.cs
- StateRuntime.cs
- SchemaImporterExtensionElementCollection.cs
- HtmlInputReset.cs
- InvalidPrinterException.cs
- SemanticTag.cs
- FunctionParameter.cs
- RadioButtonPopupAdapter.cs
- IntSecurity.cs
- CultureInfoConverter.cs
- StringArrayConverter.cs
- HttpSessionStateBase.cs
- CustomAttributeFormatException.cs
- XmlSiteMapProvider.cs
- Helper.cs
- IERequestCache.cs
- DatatypeImplementation.cs
- storagemappingitemcollection.viewdictionary.cs
- WhitespaceRuleReader.cs
- ButtonChrome.cs
- httpapplicationstate.cs
- CounterSample.cs
- SchemaDeclBase.cs
- ResourceProperty.cs
- ArrayTypeMismatchException.cs
- LockCookie.cs
- MailAddressCollection.cs
- MaskPropertyEditor.cs
- ContextBase.cs
- SolidBrush.cs
- ParseElementCollection.cs
- DataGridViewCellToolTipTextNeededEventArgs.cs