Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- WebRequestModulesSection.cs
- DataGridHeaderBorder.cs
- SynchronousChannel.cs
- TextSelectionProcessor.cs
- Style.cs
- SharedPerformanceCounter.cs
- MessagePropertyDescription.cs
- EmbeddedMailObjectsCollection.cs
- FieldMetadata.cs
- Grammar.cs
- ContainerFilterService.cs
- TypeUtil.cs
- VirtualDirectoryMappingCollection.cs
- DetailsViewInsertEventArgs.cs
- _HeaderInfoTable.cs
- FragmentQueryKB.cs
- DotExpr.cs
- TrimSurroundingWhitespaceAttribute.cs
- MailDefinition.cs
- IsolatedStorageFilePermission.cs
- DoubleKeyFrameCollection.cs
- CfgParser.cs
- KnownBoxes.cs
- ModuleConfigurationInfo.cs
- FormsIdentity.cs
- VariableAction.cs
- NullableConverter.cs
- PointLightBase.cs
- IArgumentProvider.cs
- DispatcherSynchronizationContext.cs
- ConfigurationManagerInternal.cs
- SafeLocalMemHandle.cs
- EntityException.cs
- LinqDataSourceSelectEventArgs.cs
- NextPreviousPagerField.cs
- EntityProviderFactory.cs
- DetailsViewUpdatedEventArgs.cs
- DesignerOptionService.cs
- ComPersistableTypeElement.cs
- ReliabilityContractAttribute.cs
- XmlObjectSerializerReadContextComplexJson.cs
- DispatcherTimer.cs
- WmlTextViewAdapter.cs
- SoundPlayer.cs
- OptimizedTemplateContentHelper.cs
- ApplicationFileCodeDomTreeGenerator.cs
- Visual.cs
- ScaleTransform.cs
- ActivityBuilderHelper.cs
- WebDescriptionAttribute.cs
- TrustManagerMoreInformation.cs
- HtmlElementCollection.cs
- CodeIndexerExpression.cs
- CurrentChangedEventManager.cs
- Rect.cs
- IPPacketInformation.cs
- StyleBamlRecordReader.cs
- MultipleViewPatternIdentifiers.cs
- ObjectParameter.cs
- HeaderUtility.cs
- TransactionChannel.cs
- ModelTreeEnumerator.cs
- InternalTypeHelper.cs
- QilLoop.cs
- BitmapEffectCollection.cs
- EncoderParameters.cs
- InvalidEnumArgumentException.cs
- EventWaitHandle.cs
- DiffuseMaterial.cs
- NoResizeSelectionBorderGlyph.cs
- ClientConfigurationHost.cs
- DiscoveryDocumentSerializer.cs
- AliasedSlot.cs
- SynchronizedRandom.cs
- IListConverters.cs
- TextParagraph.cs
- ExceptionUtil.cs
- PauseStoryboard.cs
- HwndSourceParameters.cs
- DataTemplateSelector.cs
- DataObjectMethodAttribute.cs
- DataMemberAttribute.cs
- RangeEnumerable.cs
- Util.cs
- OnOperation.cs
- SqlCacheDependencyDatabaseCollection.cs
- WebPageTraceListener.cs
- WindowsGraphics.cs
- InfoCardKeyedHashAlgorithm.cs
- UriSection.cs
- SystemColors.cs
- DrawingVisualDrawingContext.cs
- Point3DCollectionConverter.cs
- RelationshipConstraintValidator.cs
- UniqueID.cs
- StreamProxy.cs
- PartialCachingAttribute.cs
- securitycriticaldataClass.cs
- _OverlappedAsyncResult.cs
- RadioButtonPopupAdapter.cs