Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / xsp / System / Web / UI / WebParts / PersonalizationStateQuery.cs / 1 / PersonalizationStateQuery.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.WebControls.WebParts { using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Security.Permissions; using System.Web.Util; [Serializable] [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] public sealed class PersonalizationStateQuery { private static readonly Dictionary_knownPropertyTypeMappings; private HybridDictionary _data; static PersonalizationStateQuery() { _knownPropertyTypeMappings = new Dictionary (StringComparer.OrdinalIgnoreCase); _knownPropertyTypeMappings["PathToMatch"] = typeof(string); _knownPropertyTypeMappings["UserInactiveSinceDate"] = typeof(DateTime); _knownPropertyTypeMappings["UsernameToMatch"] = typeof(string); } public PersonalizationStateQuery() { _data = new HybridDictionary(true); // VSWhidbey 357097: UserInactiveSinceDate needs to have a default value returned for the indexer property _data["UserInactiveSinceDate"] = PersonalizationAdministration.DefaultInactiveSinceDate; } public string PathToMatch { get { return (string) this["PathToMatch"]; } set { if (value != null) { value = value.Trim(); } _data["PathToMatch"] = value; } } public DateTime UserInactiveSinceDate { get { object o = this["UserInactiveSinceDate"]; Debug.Assert(o != null, "Should always have a default value!"); return (DateTime) o; } set { _data["UserInactiveSinceDate"] = value; } } public string UsernameToMatch { get { return (string) this["UsernameToMatch"]; } set { if (value != null) { value = value.Trim(); } _data["UsernameToMatch"] = value; } } public object this[string queryKey] { get { queryKey = StringUtil.CheckAndTrimString(queryKey, "queryKey"); return _data[queryKey]; } set { queryKey = StringUtil.CheckAndTrimString(queryKey, "queryKey"); // VSWhidbey 436311: We need to check the value types for known properties if (_knownPropertyTypeMappings.ContainsKey(queryKey)) { Type valueType = _knownPropertyTypeMappings[queryKey]; Debug.Assert(valueType != null); if ((value == null && valueType.IsValueType) || (value != null && !valueType.IsAssignableFrom(value.GetType()))) { throw new ArgumentException( SR.GetString(SR.PersonalizationStateQuery_IncorrectValueType, queryKey, valueType.FullName)); } } _data[queryKey] = value; } } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- TypeSystem.cs
- TextFormatterHost.cs
- CapabilitiesSection.cs
- DataTrigger.cs
- JavaScriptString.cs
- ImageConverter.cs
- PropertyEntry.cs
- WebEventTraceProvider.cs
- ListBox.cs
- TemplateEditingService.cs
- Annotation.cs
- OdbcStatementHandle.cs
- PersonalizationState.cs
- BufferedWebEventProvider.cs
- EdmConstants.cs
- SEHException.cs
- ActiveDocumentEvent.cs
- PointValueSerializer.cs
- CodeArrayCreateExpression.cs
- UITypeEditor.cs
- webclient.cs
- DesignSurfaceServiceContainer.cs
- StructuredCompositeActivityDesigner.cs
- UIElement3DAutomationPeer.cs
- WriteFileContext.cs
- ExtensionsSection.cs
- EditingCoordinator.cs
- FixedSOMTextRun.cs
- SecurityHelper.cs
- GB18030Encoding.cs
- RequestQueryParser.cs
- DirectoryObjectSecurity.cs
- ApplicationProxyInternal.cs
- RenamedEventArgs.cs
- CutCopyPasteHelper.cs
- CryptoHelper.cs
- ProcessingInstructionAction.cs
- NetworkInterface.cs
- DataGridColumnHeaderCollection.cs
- MULTI_QI.cs
- LogicalTreeHelper.cs
- SmtpAuthenticationManager.cs
- Convert.cs
- StandardOleMarshalObject.cs
- ExpressionStringBuilder.cs
- HtmlInputRadioButton.cs
- ExecutedRoutedEventArgs.cs
- TreeNodeStyle.cs
- WebPermission.cs
- XamlInt32CollectionSerializer.cs
- URLIdentityPermission.cs
- ApplicationHost.cs
- ProcessThread.cs
- ChildTable.cs
- PageCodeDomTreeGenerator.cs
- ResourceDisplayNameAttribute.cs
- EmptyQuery.cs
- RouteItem.cs
- ServiceDesigner.xaml.cs
- DataGridState.cs
- RegistrationContext.cs
- HGlobalSafeHandle.cs
- CryptoApi.cs
- RelationshipSet.cs
- TriggerAction.cs
- CompiledIdentityConstraint.cs
- XmlObjectSerializer.cs
- AmbientValueAttribute.cs
- MessageDecoder.cs
- Profiler.cs
- HtmlForm.cs
- XmlSchemaSimpleType.cs
- SchemaConstraints.cs
- HttpRequestCacheValidator.cs
- AppSettingsExpressionBuilder.cs
- Latin1Encoding.cs
- Animatable.cs
- TaskFileService.cs
- LinkButton.cs
- SqlGatherConsumedAliases.cs
- HMACSHA1.cs
- RequiredArgumentAttribute.cs
- StrokeNode.cs
- CaseInsensitiveOrdinalStringComparer.cs
- ObjectNavigationPropertyMapping.cs
- InternalBase.cs
- ValidatedControlConverter.cs
- WasEndpointConfigContainer.cs
- HtmlInputFile.cs
- WebHeaderCollection.cs
- KeySpline.cs
- SoapObjectReader.cs
- GridViewCommandEventArgs.cs
- TaskScheduler.cs
- SmiMetaData.cs
- DiscoveryDocument.cs
- ModulesEntry.cs
- Scene3D.cs
- QueryException.cs
- Descriptor.cs