Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / ndp / fx / src / xsp / System / Web / UI / WebParts / PersonalizationStateQuery.cs / 2 / 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); // _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"); // 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. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- VisualBrush.cs
- KeyMatchBuilder.cs
- AssemblyAssociatedContentFileAttribute.cs
- VoiceSynthesis.cs
- MediaSystem.cs
- IPipelineRuntime.cs
- NavigationWindowAutomationPeer.cs
- GPRECTF.cs
- ArgIterator.cs
- IriParsingElement.cs
- SessionStateModule.cs
- HandledMouseEvent.cs
- DataSourceCache.cs
- DataTableNewRowEvent.cs
- DataGridViewCellPaintingEventArgs.cs
- MessageDecoder.cs
- Command.cs
- WasHttpHandlersInstallComponent.cs
- CapabilitiesAssignment.cs
- XPathItem.cs
- FilterException.cs
- HealthMonitoringSectionHelper.cs
- LinkButton.cs
- CaseInsensitiveOrdinalStringComparer.cs
- _NTAuthentication.cs
- DefaultParameterValueAttribute.cs
- GridEntryCollection.cs
- FontStyles.cs
- GlyphInfoList.cs
- HostTimeoutsElement.cs
- RegexReplacement.cs
- ComponentResourceKeyConverter.cs
- Scripts.cs
- XPathDocumentBuilder.cs
- PerformanceCounterPermissionEntry.cs
- MemoryRecordBuffer.cs
- Empty.cs
- BaseDataListActionList.cs
- WebPartEditorCancelVerb.cs
- DataServiceQueryException.cs
- UrlPath.cs
- ThicknessAnimationBase.cs
- ShutDownListener.cs
- FixedSOMPageConstructor.cs
- CalendarBlackoutDatesCollection.cs
- SystemNetworkInterface.cs
- WebPartsSection.cs
- Figure.cs
- ControllableStoryboardAction.cs
- NegationPusher.cs
- AsyncContentLoadedEventArgs.cs
- NetTcpBindingCollectionElement.cs
- FileReservationCollection.cs
- ProviderCollection.cs
- HandleCollector.cs
- PropertyTab.cs
- CollaborationHelperFunctions.cs
- Win32Native.cs
- AutoScrollHelper.cs
- CaseInsensitiveComparer.cs
- ContainerAction.cs
- RegexStringValidator.cs
- Helpers.cs
- DocumentPageTextView.cs
- MenuItem.cs
- LayoutExceptionEventArgs.cs
- ApplicationHost.cs
- PropertyPath.cs
- Win32KeyboardDevice.cs
- ByteStream.cs
- ArraySegment.cs
- Quaternion.cs
- CompModSwitches.cs
- XmlMtomReader.cs
- RepeatEnumerable.cs
- DesignerOptionService.cs
- IntSecurity.cs
- ButtonStandardAdapter.cs
- DataSourceCache.cs
- SmtpNtlmAuthenticationModule.cs
- CultureTable.cs
- MetadataItemSerializer.cs
- NegationPusher.cs
- HashAlgorithm.cs
- SqlDataReaderSmi.cs
- ObjectItemLoadingSessionData.cs
- CompilationSection.cs
- Menu.cs
- _AcceptOverlappedAsyncResult.cs
- ObjectDataSourceSelectingEventArgs.cs
- EncodingNLS.cs
- ContentHostHelper.cs
- StartUpEventArgs.cs
- KerberosReceiverSecurityToken.cs
- TableCell.cs
- RadioButtonBaseAdapter.cs
- DebugView.cs
- PauseStoryboard.cs
- RemoveStoryboard.cs
- WebPartConnectionsCloseVerb.cs