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
- Knowncolors.cs
- DbInsertCommandTree.cs
- FacetDescriptionElement.cs
- ModuleBuilder.cs
- ReaderWriterLock.cs
- ScaleTransform.cs
- StylusPointCollection.cs
- FontFamily.cs
- BackStopAuthenticationModule.cs
- WindowsAuthenticationEventArgs.cs
- PropertyPushdownHelper.cs
- DbConnectionStringCommon.cs
- SharedDp.cs
- sqlinternaltransaction.cs
- Queue.cs
- BindingEntityInfo.cs
- XhtmlBasicCalendarAdapter.cs
- ApplicationManager.cs
- SecurityPermission.cs
- AdCreatedEventArgs.cs
- TextTreeText.cs
- ReadOnlyDictionary.cs
- GridViewCancelEditEventArgs.cs
- COM2EnumConverter.cs
- DocumentScope.cs
- UnauthorizedWebPart.cs
- InvalidWMPVersionException.cs
- StorageComplexPropertyMapping.cs
- ContentType.cs
- FontUnitConverter.cs
- OperationCanceledException.cs
- SignatureResourceHelper.cs
- WmpBitmapDecoder.cs
- DefaultValueMapping.cs
- SecurityDocument.cs
- AndCondition.cs
- DataListItem.cs
- SafeNativeMethodsOther.cs
- DataGridViewSelectedColumnCollection.cs
- MultiSelectRootGridEntry.cs
- DataGrid.cs
- TreeNodeCollection.cs
- StorageEntityContainerMapping.cs
- WmpBitmapDecoder.cs
- ChannelBase.cs
- TdsEnums.cs
- ApplicationException.cs
- CancellationHandler.cs
- WaitHandleCannotBeOpenedException.cs
- GenericEnumConverter.cs
- WebPartEditorOkVerb.cs
- ContextMenuStrip.cs
- DataGridViewBand.cs
- MouseGesture.cs
- PingReply.cs
- unsafenativemethodstextservices.cs
- itemelement.cs
- DataGridRow.cs
- GroupBox.cs
- StrongNameIdentityPermission.cs
- DataContractJsonSerializerOperationBehavior.cs
- LoginCancelEventArgs.cs
- IConvertible.cs
- InternalBufferOverflowException.cs
- Boolean.cs
- FileRecordSequence.cs
- SequentialUshortCollection.cs
- OpCodes.cs
- UnmanagedMemoryStream.cs
- StringBuilder.cs
- securestring.cs
- PointCollectionConverter.cs
- GraphicsContext.cs
- SchemaConstraints.cs
- PostBackOptions.cs
- Utils.cs
- RemoteWebConfigurationHostServer.cs
- XmlAtomicValue.cs
- OdbcErrorCollection.cs
- XPathExpr.cs
- LinqDataSourceSelectEventArgs.cs
- GiveFeedbackEvent.cs
- PrincipalPermission.cs
- Int32Animation.cs
- CodeTypeDeclarationCollection.cs
- SQLUtility.cs
- exports.cs
- CommandID.cs
- BitmapMetadataBlob.cs
- XamlWriter.cs
- UpDownBase.cs
- DynamicEndpointElement.cs
- MetabaseReader.cs
- documentsequencetextpointer.cs
- MdiWindowListItemConverter.cs
- SqlNodeAnnotation.cs
- TdsParameterSetter.cs
- SiteMapNodeItem.cs
- _NestedSingleAsyncResult.cs
- SamlSubject.cs