Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / Serialization / System / Runtime / Serialization / Configuration / DeclaredTypeValidator.cs / 1305376 / DeclaredTypeValidator.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.Runtime.Serialization.Configuration { using System; using System.Configuration; using System.Runtime.Serialization; internal class DeclaredTypeValidator : ConfigurationValidatorBase { public override bool CanValidate(Type type) { return (typeof(string) == type); } public override void Validate(object value) { string type = (string)value; if (type.StartsWith(Globals.TypeOfObject.FullName, StringComparison.Ordinal)) { Type t = Type.GetType(type, false); if (t != null && Globals.TypeOfObject.Equals(t)) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument(SR.GetString(SR.KnownTypeConfigObject)); } } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.Runtime.Serialization.Configuration { using System; using System.Configuration; using System.Runtime.Serialization; internal class DeclaredTypeValidator : ConfigurationValidatorBase { public override bool CanValidate(Type type) { return (typeof(string) == type); } public override void Validate(object value) { string type = (string)value; if (type.StartsWith(Globals.TypeOfObject.FullName, StringComparison.Ordinal)) { Type t = Type.GetType(type, false); if (t != null && Globals.TypeOfObject.Equals(t)) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument(SR.GetString(SR.KnownTypeConfigObject)); } } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Privilege.cs
- MainMenu.cs
- ObjectDataSourceFilteringEventArgs.cs
- BoundPropertyEntry.cs
- SecurityContextSecurityTokenResolver.cs
- NavigationProperty.cs
- TreeNodeEventArgs.cs
- BoundField.cs
- RSAOAEPKeyExchangeDeformatter.cs
- FixedFindEngine.cs
- CompensatableSequenceActivity.cs
- RepeatButtonAutomationPeer.cs
- DataServiceClientException.cs
- MessageBox.cs
- ContextStaticAttribute.cs
- SessionEndingEventArgs.cs
- DBConnectionString.cs
- Hash.cs
- NumericPagerField.cs
- Model3DCollection.cs
- DecimalConverter.cs
- CacheModeConverter.cs
- EditingMode.cs
- MdiWindowListStrip.cs
- ConfigXmlAttribute.cs
- Help.cs
- AssemblyBuilderData.cs
- ServiceRoute.cs
- WmfPlaceableFileHeader.cs
- CDSCollectionETWBCLProvider.cs
- OSEnvironmentHelper.cs
- EntityDataSourceWizardForm.cs
- ColorAnimation.cs
- CompoundFileReference.cs
- CryptoStream.cs
- ChildTable.cs
- _HeaderInfoTable.cs
- ControlBuilderAttribute.cs
- DbMetaDataCollectionNames.cs
- WebPartConnectionsCancelEventArgs.cs
- CodeTypeParameterCollection.cs
- BypassElement.cs
- DashStyles.cs
- SslStream.cs
- XamlGridLengthSerializer.cs
- ProcessModelInfo.cs
- XmlSchemaSimpleContent.cs
- SafeNativeMethods.cs
- PeerEndPoint.cs
- GrammarBuilderBase.cs
- TextParentUndoUnit.cs
- SpecialNameAttribute.cs
- LongValidatorAttribute.cs
- HwndKeyboardInputProvider.cs
- dtdvalidator.cs
- NamespaceTable.cs
- RuleConditionDialog.cs
- SizeAnimationClockResource.cs
- WebControlsSection.cs
- DataGridViewRowsAddedEventArgs.cs
- OracleFactory.cs
- ScrollItemPatternIdentifiers.cs
- xsdvalidator.cs
- ZoneButton.cs
- ResponseStream.cs
- WebPartRestoreVerb.cs
- SoapCodeExporter.cs
- Span.cs
- FontInfo.cs
- TrackingProfile.cs
- ColorTransform.cs
- TCPListener.cs
- MemberDescriptor.cs
- ConditionedDesigner.cs
- DependencyProperty.cs
- SqlConnectionHelper.cs
- GraphicsState.cs
- SchemaType.cs
- TextInfo.cs
- ContractMapping.cs
- DeviceContexts.cs
- Error.cs
- FrameworkElement.cs
- ProfileService.cs
- PolicyValidationException.cs
- TableRowsCollectionEditor.cs
- TableLayout.cs
- ShellProvider.cs
- BaseServiceProvider.cs
- ListViewGroupConverter.cs
- HtmlValidationSummaryAdapter.cs
- TypeToken.cs
- GridSplitterAutomationPeer.cs
- CompilerLocalReference.cs
- AppDomainCompilerProxy.cs
- TableHeaderCell.cs
- CallTemplateAction.cs
- SizeLimitedCache.cs
- UnsafeNativeMethods.cs
- VariableDesigner.xaml.cs