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
- StructuralCache.cs
- DataGridHeaderBorder.cs
- TextBoxRenderer.cs
- StateMachineWorkflowDesigner.cs
- LogLogRecordEnumerator.cs
- XmlILIndex.cs
- ObjectListDesigner.cs
- ListViewHitTestInfo.cs
- _AutoWebProxyScriptEngine.cs
- PrePrepareMethodAttribute.cs
- BooleanFunctions.cs
- SamlAssertionKeyIdentifierClause.cs
- ItemsControl.cs
- AnonymousIdentificationModule.cs
- listitem.cs
- Facet.cs
- CompilerTypeWithParams.cs
- DataSourceViewSchemaConverter.cs
- TemplateControl.cs
- AnnotationObservableCollection.cs
- DataGridViewRowsRemovedEventArgs.cs
- OutputCacheProfile.cs
- SqlConnectionString.cs
- MsmqAuthenticationMode.cs
- ImplicitInputBrush.cs
- UrlPath.cs
- ConfigurationValues.cs
- NativeActivityMetadata.cs
- SizeConverter.cs
- GeneralTransform3DGroup.cs
- AuthenticationServiceManager.cs
- EdmProperty.cs
- ColorMap.cs
- CacheVirtualItemsEvent.cs
- CubicEase.cs
- DesignerActionUIService.cs
- DataTableNewRowEvent.cs
- IBuiltInEvidence.cs
- LambdaCompiler.Binary.cs
- XamlPathDataSerializer.cs
- XmlWriterTraceListener.cs
- ServicePoint.cs
- RegexCompiler.cs
- Endpoint.cs
- AdapterUtil.cs
- RuntimeHelpers.cs
- SettingsPropertyNotFoundException.cs
- SetIterators.cs
- HostingEnvironmentSection.cs
- TcpTransportSecurityElement.cs
- HttpCachePolicy.cs
- ViewCellRelation.cs
- HttpHandlersSection.cs
- InternalConfigSettingsFactory.cs
- DiffuseMaterial.cs
- XhtmlConformanceSection.cs
- ItemChangedEventArgs.cs
- EntityDataSourceContextDisposingEventArgs.cs
- Marshal.cs
- BooleanAnimationBase.cs
- FontDialog.cs
- KeyBinding.cs
- safemediahandle.cs
- TypeValidationEventArgs.cs
- Rect3D.cs
- XmlObjectSerializerWriteContextComplexJson.cs
- ObjectItemCachedAssemblyLoader.cs
- streamingZipPartStream.cs
- SkewTransform.cs
- RegexBoyerMoore.cs
- FrameworkElement.cs
- UriScheme.cs
- DataControlCommands.cs
- GridViewColumnHeaderAutomationPeer.cs
- XmlLoader.cs
- AddressHeader.cs
- MsmqIntegrationSecurityElement.cs
- SharedDp.cs
- Zone.cs
- UnsafeNativeMethods.cs
- UserPersonalizationStateInfo.cs
- DataGridViewRowCollection.cs
- AsymmetricKeyExchangeDeformatter.cs
- CapabilitiesRule.cs
- HtmlInputText.cs
- BasicViewGenerator.cs
- CodeObject.cs
- ConditionalAttribute.cs
- ContentPlaceHolderDesigner.cs
- DataGridViewEditingControlShowingEventArgs.cs
- XmlSchemaValidator.cs
- ThumbAutomationPeer.cs
- RequestValidator.cs
- SplitterDesigner.cs
- SafeSecurityHandles.cs
- FrameworkTemplate.cs
- TableChangeProcessor.cs
- SafeHandles.cs
- SvcFileManager.cs
- XPathNavigator.cs