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
- WindowShowOrOpenTracker.cs
- PropertyDescriptorGridEntry.cs
- SettingsPropertyValue.cs
- ISessionStateStore.cs
- AsyncContentLoadedEventArgs.cs
- ADMembershipUser.cs
- PeerNeighborManager.cs
- MenuItemStyleCollection.cs
- NumericUpDownAccelerationCollection.cs
- MiniMapControl.xaml.cs
- Attributes.cs
- ReflectEventDescriptor.cs
- DataServiceProcessingPipelineEventArgs.cs
- InputElement.cs
- ProcessHostConfigUtils.cs
- UnsafeNativeMethods.cs
- ServiceContractViewControl.Designer.cs
- ExtensibleClassFactory.cs
- SqlInternalConnectionSmi.cs
- DataSource.cs
- OracleBinary.cs
- ServerValidateEventArgs.cs
- DbgUtil.cs
- ArraySegment.cs
- TableStyle.cs
- RoutedUICommand.cs
- AnnotationComponentChooser.cs
- DataGridTable.cs
- TextTreeRootTextBlock.cs
- PeekCompletedEventArgs.cs
- SliderAutomationPeer.cs
- UserControl.cs
- InlineCategoriesDocument.cs
- ReadingWritingEntityEventArgs.cs
- CodeObject.cs
- PrivateFontCollection.cs
- JsonFaultDetail.cs
- SerializationEventsCache.cs
- LinkLabelLinkClickedEvent.cs
- SQLByteStorage.cs
- XmlSchemaGroupRef.cs
- XDRSchema.cs
- PrtCap_Builder.cs
- WebGetAttribute.cs
- Baml2006ReaderSettings.cs
- ListViewDeleteEventArgs.cs
- handlecollector.cs
- SelectingProviderEventArgs.cs
- WebAdminConfigurationHelper.cs
- OptimalBreakSession.cs
- TransformBlockRequest.cs
- Missing.cs
- GridViewCommandEventArgs.cs
- Size.cs
- UnknownWrapper.cs
- PriorityQueue.cs
- SqlRemoveConstantOrderBy.cs
- AdditionalEntityFunctions.cs
- FamilyTypefaceCollection.cs
- ThaiBuddhistCalendar.cs
- HashJoinQueryOperatorEnumerator.cs
- ServiceHostingEnvironment.cs
- WebProxyScriptElement.cs
- XmlReflectionImporter.cs
- ProtocolImporter.cs
- BuiltInExpr.cs
- DesignerTransactionCloseEvent.cs
- WebMessageEncodingElement.cs
- Button.cs
- UriSection.cs
- ControlUtil.cs
- FactoryMaker.cs
- HyperLinkColumn.cs
- XmlSchemaAnyAttribute.cs
- LeafCellTreeNode.cs
- HostVisual.cs
- UnsafeNativeMethodsCLR.cs
- StrongTypingException.cs
- TraceLevelStore.cs
- PeerInputChannelListener.cs
- ResourceManager.cs
- QueuePathEditor.cs
- QueueSurrogate.cs
- CompositeFontParser.cs
- ObjectListFieldsPage.cs
- XslCompiledTransform.cs
- ProviderConnectionPoint.cs
- SinglePhaseEnlistment.cs
- PropertyChangedEventManager.cs
- SystemMulticastIPAddressInformation.cs
- PlanCompiler.cs
- OptimizedTemplateContent.cs
- CalendarButton.cs
- SeparatorAutomationPeer.cs
- RijndaelManagedTransform.cs
- activationcontext.cs
- DataBinding.cs
- EntityDataSourceColumn.cs
- oledbmetadatacolumnnames.cs
- MobileDeviceCapabilitiesSectionHandler.cs