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
- tabpagecollectioneditor.cs
- DataPagerCommandEventArgs.cs
- ControlCollection.cs
- HostSecurityManager.cs
- RMEnrollmentPage3.cs
- PerformanceCounterNameAttribute.cs
- NotImplementedException.cs
- OleAutBinder.cs
- ToolStripLabel.cs
- ControlTemplate.cs
- CompilationSection.cs
- RevocationPoint.cs
- FirstQueryOperator.cs
- CompositeKey.cs
- EmptyEnumerable.cs
- AppDomainManager.cs
- LocalizableAttribute.cs
- OptionUsage.cs
- RotationValidation.cs
- XmlTypeMapping.cs
- FactoryGenerator.cs
- XmlAnyElementAttribute.cs
- ImagingCache.cs
- AsymmetricKeyExchangeDeformatter.cs
- SrgsElement.cs
- Quack.cs
- TextContainer.cs
- SchemaTypeEmitter.cs
- TextElementEditingBehaviorAttribute.cs
- WhitespaceSignificantCollectionAttribute.cs
- SystemWebCachingSectionGroup.cs
- UrlSyndicationContent.cs
- List.cs
- SecurityRuntime.cs
- FileNotFoundException.cs
- ApplicationServicesHostFactory.cs
- PlatformNotSupportedException.cs
- LoadWorkflowByInstanceKeyCommand.cs
- CodeObject.cs
- QueryHandler.cs
- GridViewDeleteEventArgs.cs
- XPathConvert.cs
- RayMeshGeometry3DHitTestResult.cs
- EntityContainerEntitySet.cs
- UnsafeNativeMethods.cs
- SendContent.cs
- SQLDecimal.cs
- GorillaCodec.cs
- HttpContextServiceHost.cs
- TreeNodeCollection.cs
- LiteralDesigner.cs
- OperationPickerDialog.cs
- WorkerRequest.cs
- BoundColumn.cs
- ClosureBinding.cs
- InternalCache.cs
- Group.cs
- DurableInstanceManager.cs
- ExtensionDataObject.cs
- _ListenerAsyncResult.cs
- Triangle.cs
- PropertySegmentSerializer.cs
- DescendentsWalkerBase.cs
- Vector3DCollectionConverter.cs
- UIPropertyMetadata.cs
- AspNetSynchronizationContext.cs
- ListenerElementsCollection.cs
- ErrorStyle.cs
- GuidelineCollection.cs
- Script.cs
- dtdvalidator.cs
- Line.cs
- AnimationClockResource.cs
- Attributes.cs
- MailWriter.cs
- AssertSection.cs
- ExceptionValidationRule.cs
- TraceXPathNavigator.cs
- SequenceDesignerAccessibleObject.cs
- HighContrastHelper.cs
- CheckBoxRenderer.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- PhonemeConverter.cs
- KeyGestureValueSerializer.cs
- ThicknessAnimationUsingKeyFrames.cs
- BitmapInitialize.cs
- IncomingWebResponseContext.cs
- UserPreferenceChangingEventArgs.cs
- TemplateLookupAction.cs
- LayoutTableCell.cs
- PropertyEmitter.cs
- SecurityAlgorithmSuite.cs
- NavigationWindow.cs
- DmlSqlGenerator.cs
- Registry.cs
- Encoder.cs
- BindingEditor.xaml.cs
- EncryptedXml.cs
- OfTypeExpression.cs
- Quad.cs