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
- DefaultHttpHandler.cs
- CompositeCollectionView.cs
- Token.cs
- DBDataPermissionAttribute.cs
- TemplateKey.cs
- WCFBuildProvider.cs
- QuinticEase.cs
- ComponentCommands.cs
- CustomExpressionEventArgs.cs
- Int16AnimationBase.cs
- OptimisticConcurrencyException.cs
- DocumentationServerProtocol.cs
- PointLightBase.cs
- TypeUnloadedException.cs
- AddressHeaderCollectionElement.cs
- QilScopedVisitor.cs
- storepermission.cs
- DataBinder.cs
- _SslState.cs
- ResXDataNode.cs
- HitTestFilterBehavior.cs
- TextDocumentView.cs
- SrgsSubset.cs
- IListConverters.cs
- InfoCardCryptoHelper.cs
- IdnMapping.cs
- DynamicEntity.cs
- IisTraceListener.cs
- XhtmlTextWriter.cs
- ElementHostPropertyMap.cs
- AuthorizationRule.cs
- BrowserDefinitionCollection.cs
- EntityType.cs
- LinkArea.cs
- BulletDecorator.cs
- SqlDataSourceEnumerator.cs
- XhtmlBasicFormAdapter.cs
- DBSqlParserTable.cs
- ReflectionUtil.cs
- GACMembershipCondition.cs
- TextFormatterHost.cs
- DirectoryRedirect.cs
- StandardBindingElementCollection.cs
- ProcessMessagesAsyncResult.cs
- DataGridColumnHeaderCollection.cs
- HttpListenerPrefixCollection.cs
- SafeCryptoKeyHandle.cs
- GridViewAutomationPeer.cs
- Unit.cs
- ToolStrip.cs
- Slider.cs
- OutOfMemoryException.cs
- Util.cs
- CompoundFileStreamReference.cs
- QilFactory.cs
- ErrorInfoXmlDocument.cs
- XappLauncher.cs
- ConnectionManager.cs
- FormsAuthenticationCredentials.cs
- FormViewInsertedEventArgs.cs
- WindowsIdentity.cs
- SynchronizedChannelCollection.cs
- DateTimeParse.cs
- SecurityElement.cs
- DiscoveryMessageProperty.cs
- MimeObjectFactory.cs
- StringOutput.cs
- MatrixAnimationUsingPath.cs
- ElementsClipboardData.cs
- RtType.cs
- ServiceSecurityContext.cs
- DBPropSet.cs
- SqlRetyper.cs
- DesignerResources.cs
- ParameterBinding.cs
- ToolStripSeparatorRenderEventArgs.cs
- EffectiveValueEntry.cs
- SourceCollection.cs
- LayoutTableCell.cs
- DropTarget.cs
- HyperLink.cs
- ExeConfigurationFileMap.cs
- ExpressionVisitorHelpers.cs
- XamlSerializationHelper.cs
- Canvas.cs
- ApplicationActivator.cs
- RoleGroupCollection.cs
- CustomAttributeSerializer.cs
- ArrayWithOffset.cs
- Validator.cs
- ModulesEntry.cs
- StringWriter.cs
- Decoder.cs
- MultiSelector.cs
- FixedSOMPage.cs
- ContentType.cs
- WebServiceData.cs
- PropertyChangedEventArgs.cs
- SyndicationContent.cs
- PassportAuthentication.cs