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
- IisTraceListener.cs
- DataGridCaption.cs
- Rotation3D.cs
- CellPartitioner.cs
- RenderContext.cs
- XpsDocument.cs
- PropertyDescriptors.cs
- CompiledELinqQueryState.cs
- ListViewDataItem.cs
- ServiceOperationListItem.cs
- MostlySingletonList.cs
- UIAgentInitializationException.cs
- XmlArrayAttribute.cs
- PerformanceCounterPermissionAttribute.cs
- Crc32Helper.cs
- InvokePattern.cs
- InternalResources.cs
- SmiEventSink.cs
- X509ChainElement.cs
- SpeechSeg.cs
- EventEntry.cs
- figurelength.cs
- TemplateField.cs
- Socket.cs
- PathFigureCollectionConverter.cs
- ComponentConverter.cs
- StringUtil.cs
- ToolStripHighContrastRenderer.cs
- XmlSchemaSubstitutionGroup.cs
- SByteStorage.cs
- NameValueFileSectionHandler.cs
- AutomationTextAttribute.cs
- BamlCollectionHolder.cs
- HMACMD5.cs
- ScrollBar.cs
- DataGridTextBoxColumn.cs
- VariableExpressionConverter.cs
- NoResizeSelectionBorderGlyph.cs
- Substitution.cs
- ConnectionsZoneDesigner.cs
- DataGridViewCellContextMenuStripNeededEventArgs.cs
- SemanticAnalyzer.cs
- LedgerEntryCollection.cs
- SystemTcpConnection.cs
- Axis.cs
- _NetRes.cs
- SafeCryptHandles.cs
- User.cs
- RubberbandSelector.cs
- DataSourceCache.cs
- XmlElementList.cs
- Line.cs
- sqlser.cs
- RecordsAffectedEventArgs.cs
- AttributeEmitter.cs
- CompilerGlobalScopeAttribute.cs
- WindowsListViewGroup.cs
- CalendarDay.cs
- ListBindingHelper.cs
- DbParameterCollectionHelper.cs
- DataContractJsonSerializer.cs
- UpdateTracker.cs
- RoleManagerModule.cs
- TargetParameterCountException.cs
- Merger.cs
- CharacterString.cs
- Rfc4050KeyFormatter.cs
- Configuration.cs
- ClonableStack.cs
- CustomAttributeBuilder.cs
- Vector.cs
- RayMeshGeometry3DHitTestResult.cs
- UIPropertyMetadata.cs
- Ref.cs
- FileLevelControlBuilderAttribute.cs
- DataBoundControlHelper.cs
- StatusBarItemAutomationPeer.cs
- FormViewUpdateEventArgs.cs
- IsolatedStorageFile.cs
- DragCompletedEventArgs.cs
- SizeConverter.cs
- MobileControlBuilder.cs
- VisualBasicExpressionConverter.cs
- FileLevelControlBuilderAttribute.cs
- XmlSchemaSequence.cs
- AssertFilter.cs
- FontFamily.cs
- QuaternionAnimationBase.cs
- MinMaxParagraphWidth.cs
- ContainerControl.cs
- XmlKeywords.cs
- Point3DKeyFrameCollection.cs
- SHA1CryptoServiceProvider.cs
- __ConsoleStream.cs
- DateTimeParse.cs
- WindowsHyperlink.cs
- MessageDecoder.cs
- NativeMethods.cs
- RelationshipEndCollection.cs
- FieldTemplateUserControl.cs