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
- StateChangeEvent.cs
- EntitySqlQueryCacheEntry.cs
- SoapEnumAttribute.cs
- Propagator.ExtentPlaceholderCreator.cs
- BaseUriHelper.cs
- Util.cs
- SelectionRangeConverter.cs
- KeyboardEventArgs.cs
- _ConnectOverlappedAsyncResult.cs
- ObfuscateAssemblyAttribute.cs
- GenericIdentity.cs
- RegexWriter.cs
- QuestionEventArgs.cs
- PropertyBuilder.cs
- WebPartMinimizeVerb.cs
- DoubleAnimationClockResource.cs
- EventLogTraceListener.cs
- ListView.cs
- HttpCapabilitiesSectionHandler.cs
- UpdateManifestForBrowserApplication.cs
- SafePipeHandle.cs
- ValidationResult.cs
- XmlComplianceUtil.cs
- RegionInfo.cs
- WinFormsUtils.cs
- BamlResourceSerializer.cs
- CompositeDataBoundControl.cs
- TaskHelper.cs
- BindValidator.cs
- MultipartContentParser.cs
- DataGridViewDesigner.cs
- OutputCacheModule.cs
- HelpInfo.cs
- ExceptionTrace.cs
- ObjectResult.cs
- BitmapEffectInputConnector.cs
- EntityParameter.cs
- LateBoundChannelParameterCollection.cs
- ApplicationException.cs
- SizeAnimationUsingKeyFrames.cs
- Verify.cs
- Util.cs
- LoginView.cs
- RequestDescription.cs
- ScriptingWebServicesSectionGroup.cs
- XmlSchemaComplexContent.cs
- TableLayoutRowStyleCollection.cs
- StoreContentChangedEventArgs.cs
- TdsParserHelperClasses.cs
- ContentElement.cs
- TraceSection.cs
- ExeContext.cs
- InputProcessorProfilesLoader.cs
- FrugalMap.cs
- PackageFilter.cs
- DesignerUtility.cs
- TaskFileService.cs
- GrammarBuilderWildcard.cs
- PasswordBoxAutomationPeer.cs
- CacheMode.cs
- DoubleLinkList.cs
- DataGridViewColumnHeaderCell.cs
- XmlMapping.cs
- QualificationDataAttribute.cs
- ItemCheckEvent.cs
- XmlNodeComparer.cs
- AutomationPropertyInfo.cs
- UmAlQuraCalendar.cs
- GeometryHitTestParameters.cs
- MessageDecoder.cs
- _SecureChannel.cs
- LocationUpdates.cs
- OutOfProcStateClientManager.cs
- SchemaObjectWriter.cs
- Asn1IntegerConverter.cs
- SimpleHandlerFactory.cs
- BoundColumn.cs
- Mutex.cs
- XsltException.cs
- PersonalizationProvider.cs
- Tokenizer.cs
- SapiRecoInterop.cs
- Contracts.cs
- PermissionRequestEvidence.cs
- KeyToListMap.cs
- Pool.cs
- ZipArchive.cs
- ArrayList.cs
- TemplateNameScope.cs
- RegexMatchCollection.cs
- ParameterElement.cs
- DataGridViewIntLinkedList.cs
- PackWebRequest.cs
- CustomErrorsSectionWrapper.cs
- DiscoveryClientProtocol.cs
- FlowPosition.cs
- DataControlHelper.cs
- VisualStates.cs
- XmlCharCheckingReader.cs
- RelatedView.cs