Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / DEVDIV / depot / DevDiv / releases / 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. //------------------------------------------------------------------------------ // // 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
- DesignerTransaction.cs
- SequenceQuery.cs
- DataObjectSettingDataEventArgs.cs
- PageCopyCount.cs
- SoapExtensionStream.cs
- ReflectionHelper.cs
- LogRecordSequence.cs
- OutputScope.cs
- GeometryDrawing.cs
- ImpersonationOption.cs
- ActivationArguments.cs
- InfoCardSymmetricAlgorithm.cs
- SignedXml.cs
- nulltextcontainer.cs
- HtmlElement.cs
- XAMLParseException.cs
- AbstractDataSvcMapFileLoader.cs
- ControlAdapter.cs
- XmlJsonWriter.cs
- OracleDataReader.cs
- LineMetrics.cs
- OracleString.cs
- InvalidComObjectException.cs
- HtmlToClrEventProxy.cs
- OdbcConnectionFactory.cs
- RootCodeDomSerializer.cs
- NGCSerializer.cs
- Byte.cs
- WebPartAddingEventArgs.cs
- SweepDirectionValidation.cs
- FormsAuthenticationCredentials.cs
- SingleAnimationUsingKeyFrames.cs
- LinkLabel.cs
- PageWrapper.cs
- BodyGlyph.cs
- OverlappedAsyncResult.cs
- ExecutionContext.cs
- TreeViewImageIndexConverter.cs
- PriorityBindingExpression.cs
- _LazyAsyncResult.cs
- XPathDocumentBuilder.cs
- LinqDataSourceStatusEventArgs.cs
- DbParameterCollection.cs
- IPipelineRuntime.cs
- QualifiedCellIdBoolean.cs
- SourceInterpreter.cs
- SqlDataSourceConfigureSortForm.cs
- PKCS1MaskGenerationMethod.cs
- RectAnimationUsingKeyFrames.cs
- SecurityTokenParameters.cs
- LinqDataSourceView.cs
- EmptyWorkItem.cs
- SoapReflectionImporter.cs
- EUCJPEncoding.cs
- StylusDevice.cs
- ActiveXSite.cs
- ToolboxComponentsCreatedEventArgs.cs
- ViewManager.cs
- ColorDialog.cs
- ValidationSummary.cs
- PresentationAppDomainManager.cs
- PenThread.cs
- TimeSpanConverter.cs
- XmlBinaryReader.cs
- SqlResolver.cs
- LocalsItemDescription.cs
- ForeignKeyFactory.cs
- CurrentChangingEventManager.cs
- ComponentEvent.cs
- StrongTypingException.cs
- DataGridViewImageCell.cs
- AdministrationHelpers.cs
- ErrorHandler.cs
- GraphicsPathIterator.cs
- XPathExpr.cs
- AttributeCollection.cs
- CompiledQueryCacheEntry.cs
- DocumentCollection.cs
- SystemNetworkInterface.cs
- RightsController.cs
- FormViewPagerRow.cs
- EntityDataSource.cs
- HandlerElement.cs
- ManagementClass.cs
- NativeRightsManagementAPIsStructures.cs
- ColorAnimationUsingKeyFrames.cs
- SpellerInterop.cs
- MetadataProperty.cs
- TextProperties.cs
- AssociationSetMetadata.cs
- CurrentChangingEventArgs.cs
- HWStack.cs
- SmtpClient.cs
- DataTableReaderListener.cs
- MergePropertyDescriptor.cs
- AlignmentYValidation.cs
- Hash.cs
- XPathDescendantIterator.cs
- DesignerAttribute.cs
- FastEncoderWindow.cs