Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- ProtocolsConfigurationEntry.cs
- FamilyTypeface.cs
- XamlReader.cs
- ViewPort3D.cs
- Parallel.cs
- NavigationProgressEventArgs.cs
- EditCommandColumn.cs
- LoadWorkflowByInstanceKeyCommand.cs
- DragCompletedEventArgs.cs
- SamlAdvice.cs
- RenderDataDrawingContext.cs
- AspNetPartialTrustHelpers.cs
- OutputScope.cs
- GraphicsPathIterator.cs
- ResourcesBuildProvider.cs
- AccessorTable.cs
- EmptyControlCollection.cs
- WindowsFormsHostPropertyMap.cs
- SqlDataSourceQueryEditor.cs
- DefaultCompensation.cs
- CompilerGeneratedAttribute.cs
- Point.cs
- PropertyKey.cs
- HtmlHead.cs
- RangeContentEnumerator.cs
- ResourcePart.cs
- RootProfilePropertySettingsCollection.cs
- PrincipalPermission.cs
- WizardPanelChangingEventArgs.cs
- ImageDrawing.cs
- UnmanagedHandle.cs
- CategoryGridEntry.cs
- Propagator.JoinPropagator.JoinPredicateVisitor.cs
- IResourceProvider.cs
- ChannelProtectionRequirements.cs
- DateTimeValueSerializerContext.cs
- SimpleWorkerRequest.cs
- DateTime.cs
- SqlDataSourceEnumerator.cs
- PrePrepareMethodAttribute.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- WindowsMenu.cs
- IISMapPath.cs
- FileRecordSequence.cs
- XmlSchemaComplexContentRestriction.cs
- ValidatorCollection.cs
- TimeManager.cs
- SplitContainerDesigner.cs
- ClaimComparer.cs
- DbModificationClause.cs
- ProviderBase.cs
- KeyGesture.cs
- CheckBoxAutomationPeer.cs
- HttpRequestCacheValidator.cs
- OrderByBuilder.cs
- ListControlConvertEventArgs.cs
- MsmqInputMessagePool.cs
- ApplicationSettingsBase.cs
- DataStreams.cs
- TogglePatternIdentifiers.cs
- AppDomainFactory.cs
- XamlSerializer.cs
- BindingGroup.cs
- PeerResolverBindingElement.cs
- TextBlock.cs
- WriteableOnDemandStream.cs
- InheritanceAttribute.cs
- TableHeaderCell.cs
- LogLogRecordEnumerator.cs
- KnownBoxes.cs
- ResourceDescriptionAttribute.cs
- WsrmTraceRecord.cs
- ToolStripPanelCell.cs
- DiscreteKeyFrames.cs
- MailAddress.cs
- SchemaConstraints.cs
- GridViewSelectEventArgs.cs
- MessageQueueCriteria.cs
- XmlRawWriter.cs
- ServerValidateEventArgs.cs
- TemplatedMailWebEventProvider.cs
- Avt.cs
- RemotingServices.cs
- Int64AnimationUsingKeyFrames.cs
- UpdateException.cs
- System.Data.OracleClient_BID.cs
- GroupStyle.cs
- TokenBasedSetEnumerator.cs
- KeyedHashAlgorithm.cs
- ListDictionaryInternal.cs
- PersistenceTypeAttribute.cs
- BitmapScalingModeValidation.cs
- PointCollectionConverter.cs
- DiscriminatorMap.cs
- SystemBrushes.cs
- XmlDataFileEditor.cs
- HttpHostedTransportConfiguration.cs
- Parser.cs
- FixedNode.cs
- ExpandSegmentCollection.cs