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
- ActivityMarkupSerializationProvider.cs
- BinaryMessageFormatter.cs
- TrustManagerPromptUI.cs
- TriggerCollection.cs
- MatrixTransform.cs
- ContractTypeNameCollection.cs
- ScrollEvent.cs
- ThreadLocal.cs
- DesignerCommandAdapter.cs
- InkCanvasSelection.cs
- ConfigUtil.cs
- _OverlappedAsyncResult.cs
- PolicyDesigner.cs
- TextEditorTyping.cs
- ImageAutomationPeer.cs
- ExtendedProtectionPolicyTypeConverter.cs
- XamlPoint3DCollectionSerializer.cs
- _AuthenticationState.cs
- MimeBasePart.cs
- EntityKey.cs
- FixedSOMSemanticBox.cs
- ZipIOExtraFieldPaddingElement.cs
- RadioButton.cs
- DataRecord.cs
- PathGeometry.cs
- GridViewCancelEditEventArgs.cs
- RangeBaseAutomationPeer.cs
- AssemblyName.cs
- EntityClassGenerator.cs
- ClientScriptManagerWrapper.cs
- nulltextnavigator.cs
- EncoderParameters.cs
- metadatamappinghashervisitor.cs
- ScrollProviderWrapper.cs
- PrintDialogDesigner.cs
- _ServiceNameStore.cs
- IriParsingElement.cs
- RequestCache.cs
- TheQuery.cs
- LogicalExpr.cs
- WinFormsSpinner.cs
- EventSchemaTraceListener.cs
- SqlUserDefinedAggregateAttribute.cs
- PeerInputChannelListener.cs
- TimersDescriptionAttribute.cs
- ListManagerBindingsCollection.cs
- Utils.cs
- BooleanFunctions.cs
- OutputCacheSection.cs
- XmlCharacterData.cs
- NullableConverter.cs
- BindingNavigatorDesigner.cs
- MaterialGroup.cs
- ListViewItemMouseHoverEvent.cs
- AccessibleObject.cs
- RoleService.cs
- ResourceDefaultValueAttribute.cs
- Rotation3DAnimationUsingKeyFrames.cs
- _HTTPDateParse.cs
- DataBindEngine.cs
- FileSystemInfo.cs
- Run.cs
- XPathChildIterator.cs
- DataPagerField.cs
- LineGeometry.cs
- StandardOleMarshalObject.cs
- LiteralSubsegment.cs
- DBAsyncResult.cs
- DbConnectionStringCommon.cs
- TableItemStyle.cs
- LocatorPartList.cs
- GenericWebPart.cs
- NumericExpr.cs
- ControlPager.cs
- CreateUserWizard.cs
- BitmapVisualManager.cs
- Win32Exception.cs
- SQLInt64.cs
- ConfigurationValues.cs
- IDispatchConstantAttribute.cs
- EmptyReadOnlyDictionaryInternal.cs
- NativeObjectSecurity.cs
- FontSource.cs
- ConfigurationSchemaErrors.cs
- NativeCppClassAttribute.cs
- ComplexBindingPropertiesAttribute.cs
- ComplexBindingPropertiesAttribute.cs
- ListBoxChrome.cs
- ImportDesigner.xaml.cs
- RectAnimation.cs
- ListView.cs
- TypeSystem.cs
- TableItemStyle.cs
- ForceCopyBuildProvider.cs
- MobileControlsSection.cs
- XmlUrlResolver.cs
- FontWeight.cs
- BuildProvider.cs
- HierarchicalDataBoundControl.cs
- Privilege.cs