Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / UI / WebParts / PersonalizationStateQuery.cs / 1305376 / 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.Web.Util; [Serializable] 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; } } } } // 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
- CompilationUnit.cs
- CFStream.cs
- CanExecuteRoutedEventArgs.cs
- DataGridRow.cs
- AssemblyInfo.cs
- BasePattern.cs
- XmlUrlResolver.cs
- ReadOnlyDataSourceView.cs
- ScriptManager.cs
- UpdatableWrapper.cs
- AutomationProperties.cs
- CodeLinePragma.cs
- SyndicationItem.cs
- EmulateRecognizeCompletedEventArgs.cs
- MSAANativeProvider.cs
- DataGridViewCellValidatingEventArgs.cs
- HwndSourceKeyboardInputSite.cs
- ScriptingProfileServiceSection.cs
- LogSwitch.cs
- PageEventArgs.cs
- Menu.cs
- Cursors.cs
- DispatcherTimer.cs
- Matrix3D.cs
- ProfileService.cs
- AuthenticationModuleElementCollection.cs
- TextEditorContextMenu.cs
- FtpRequestCacheValidator.cs
- AssociatedControlConverter.cs
- MetadataItemCollectionFactory.cs
- XmlNavigatorStack.cs
- ServiceNameElement.cs
- GlobalEventManager.cs
- GridPattern.cs
- PeerNameResolver.cs
- XPathNodeList.cs
- SQLResource.cs
- LongCountAggregationOperator.cs
- BinaryParser.cs
- EntityDataSourceDataSelection.cs
- ValidationErrorEventArgs.cs
- EncoderFallback.cs
- Translator.cs
- MatrixKeyFrameCollection.cs
- Cursors.cs
- NoResizeHandleGlyph.cs
- EntityContainerEntitySet.cs
- SymLanguageVendor.cs
- InvalidAsynchronousStateException.cs
- ListViewItemEventArgs.cs
- StreamGeometry.cs
- Panel.cs
- SystemWebExtensionsSectionGroup.cs
- GenericTextProperties.cs
- ConsumerConnectionPoint.cs
- DependencyPropertyAttribute.cs
- SizeConverter.cs
- QueuePropertyVariants.cs
- CodeLinePragma.cs
- MetadataExchangeBindings.cs
- NameValueSectionHandler.cs
- NumberFunctions.cs
- UserNamePasswordValidator.cs
- ObjectQueryExecutionPlan.cs
- EventLogPermissionEntry.cs
- DiffuseMaterial.cs
- Int16Storage.cs
- KnownBoxes.cs
- BufferAllocator.cs
- Int32Animation.cs
- DispatcherExceptionEventArgs.cs
- CqlQuery.cs
- InfoCardRSAOAEPKeyExchangeFormatter.cs
- CollectionViewGroup.cs
- UrlMappingsSection.cs
- ContextStack.cs
- Win32SafeHandles.cs
- SByte.cs
- FileReader.cs
- PolyQuadraticBezierSegment.cs
- TabControlAutomationPeer.cs
- EntryIndex.cs
- AuthenticationModuleElementCollection.cs
- DataBoundLiteralControl.cs
- WebPartTransformerCollection.cs
- Size.cs
- _NegoState.cs
- DataControlCommands.cs
- MetaType.cs
- FamilyTypefaceCollection.cs
- ListManagerBindingsCollection.cs
- CultureTableRecord.cs
- Rectangle.cs
- AuthorizationRuleCollection.cs
- ItemsChangedEventArgs.cs
- AutomationIdentifierGuids.cs
- RegistrySecurity.cs
- QueryParameter.cs
- UndirectedGraph.cs
- NextPreviousPagerField.cs