Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / DEVDIV / depot / DevDiv / releases / whidbey / QFE / ndp / fx / src / xsp / System / Web / Configuration / ProfileSettingsCollection.cs / 4 / ProfileSettingsCollection.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Web.Configuration {
using System;
using System.Xml;
using System.Configuration;
using System.Collections.Specialized;
using System.Collections;
using System.Globalization;
using System.IO;
using System.Text;
using System.ComponentModel;
using System.Web.Hosting;
using System.Web.Util;
using System.Web.Configuration;
using System.Web.Management;
using System.Web.Compilation;
using System.Security.Permissions;
[ConfigurationCollection(typeof(ProfileSettings))]
[AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)]
public sealed class ProfileSettingsCollection : ConfigurationElementCollection {
private static ConfigurationPropertyCollection _properties;
static ProfileSettingsCollection() {
// Property initialization
_properties = new ConfigurationPropertyCollection();
}
protected override ConfigurationPropertyCollection Properties {
get {
return _properties;
}
}
public ProfileSettingsCollection() {
}
// public properties
public ProfileSettings this[int index] {
get {
return (ProfileSettings)BaseGet(index);
}
set {
if (BaseGet(index) != null) {
BaseRemoveAt(index);
}
BaseAdd(index, value);
}
}
public new ProfileSettings this[string key] {
get {
return (ProfileSettings)BaseGet(key);
}
}
// Protected Overrides
protected override ConfigurationElement CreateNewElement() {
return new ProfileSettings();
}
protected override Object GetElementKey(ConfigurationElement element) {
return ((ProfileSettings)element).Name;
}
// public methods
public void Add(ProfileSettings profilesSettings) {
BaseAdd(profilesSettings); // add to the end of the list and dont overwrite dups!
}
public void Clear() {
BaseClear();
}
public void RemoveAt(int index) {
BaseRemoveAt(index);
}
public void Insert(int index, ProfileSettings authorizationSettings) {
BaseAdd(index, authorizationSettings);
}
public int IndexOf(String name) {
ConfigurationElement element = BaseGet((Object)name);
return (element != null) ? BaseIndexOf(element) : -1;
}
public void Remove(String name) {
BaseRemove(name);
}
public bool Contains(String name) {
return (IndexOf(name) != -1);
}
}
}
// 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.Configuration {
using System;
using System.Xml;
using System.Configuration;
using System.Collections.Specialized;
using System.Collections;
using System.Globalization;
using System.IO;
using System.Text;
using System.ComponentModel;
using System.Web.Hosting;
using System.Web.Util;
using System.Web.Configuration;
using System.Web.Management;
using System.Web.Compilation;
using System.Security.Permissions;
[ConfigurationCollection(typeof(ProfileSettings))]
[AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)]
public sealed class ProfileSettingsCollection : ConfigurationElementCollection {
private static ConfigurationPropertyCollection _properties;
static ProfileSettingsCollection() {
// Property initialization
_properties = new ConfigurationPropertyCollection();
}
protected override ConfigurationPropertyCollection Properties {
get {
return _properties;
}
}
public ProfileSettingsCollection() {
}
// public properties
public ProfileSettings this[int index] {
get {
return (ProfileSettings)BaseGet(index);
}
set {
if (BaseGet(index) != null) {
BaseRemoveAt(index);
}
BaseAdd(index, value);
}
}
public new ProfileSettings this[string key] {
get {
return (ProfileSettings)BaseGet(key);
}
}
// Protected Overrides
protected override ConfigurationElement CreateNewElement() {
return new ProfileSettings();
}
protected override Object GetElementKey(ConfigurationElement element) {
return ((ProfileSettings)element).Name;
}
// public methods
public void Add(ProfileSettings profilesSettings) {
BaseAdd(profilesSettings); // add to the end of the list and dont overwrite dups!
}
public void Clear() {
BaseClear();
}
public void RemoveAt(int index) {
BaseRemoveAt(index);
}
public void Insert(int index, ProfileSettings authorizationSettings) {
BaseAdd(index, authorizationSettings);
}
public int IndexOf(String name) {
ConfigurationElement element = BaseGet((Object)name);
return (element != null) ? BaseIndexOf(element) : -1;
}
public void Remove(String name) {
BaseRemove(name);
}
public bool Contains(String name) {
return (IndexOf(name) != -1);
}
}
}
// 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
- EncryptedHeader.cs
- CalendarDataBindingHandler.cs
- RadioButton.cs
- SiteMapPathDesigner.cs
- TemplateControl.cs
- OdbcUtils.cs
- PersonalizationStateInfo.cs
- FigureParaClient.cs
- TextTrailingCharacterEllipsis.cs
- ApplicationFileParser.cs
- CompressEmulationStream.cs
- CodeCompileUnit.cs
- InvalidCastException.cs
- RuleSettingsCollection.cs
- XmlConvert.cs
- XmlNode.cs
- ServiceBusyException.cs
- Size.cs
- CheckBoxField.cs
- SmiEventSink_DeferedProcessing.cs
- RemotingAttributes.cs
- Size3D.cs
- HtmlTextArea.cs
- DeploymentSectionCache.cs
- ParamArrayAttribute.cs
- _NegoState.cs
- ObjectDataSourceDisposingEventArgs.cs
- DrawingAttributes.cs
- AssemblyResolver.cs
- DataGridViewIntLinkedList.cs
- WebPartTransformerAttribute.cs
- TableRowGroup.cs
- IntegerValidatorAttribute.cs
- MiniAssembly.cs
- BrowserDefinition.cs
- GrammarBuilder.cs
- wpf-etw.cs
- ProtocolViolationException.cs
- SoapCodeExporter.cs
- securitycriticaldataformultiplegetandset.cs
- SafeFindHandle.cs
- EditingCoordinator.cs
- embossbitmapeffect.cs
- ECDiffieHellmanPublicKey.cs
- XmlSchemaAppInfo.cs
- Light.cs
- TableProviderWrapper.cs
- UserPreferenceChangingEventArgs.cs
- CompilationSection.cs
- EncoderParameters.cs
- DispatcherObject.cs
- IsolatedStorage.cs
- NavigatorInput.cs
- CodeTypeReferenceCollection.cs
- EdmTypeAttribute.cs
- BaseUriHelper.cs
- Int16Storage.cs
- EditorBrowsableAttribute.cs
- TextEmbeddedObject.cs
- RawStylusInputReport.cs
- GeometryGroup.cs
- ProgressBarRenderer.cs
- WebPartDescriptionCollection.cs
- CompilerCollection.cs
- HtmlInputText.cs
- PtsHost.cs
- DeferredTextReference.cs
- HWStack.cs
- CommandLibraryHelper.cs
- ExecutionEngineException.cs
- GroupQuery.cs
- DataGridToolTip.cs
- Package.cs
- PolicyManager.cs
- MexHttpBindingCollectionElement.cs
- OrderByLifter.cs
- EditorPartChrome.cs
- EncodingNLS.cs
- PrintPreviewGraphics.cs
- DataPagerField.cs
- ColorInterpolationModeValidation.cs
- ActivityInterfaces.cs
- InkCollectionBehavior.cs
- ItemList.cs
- BoundColumn.cs
- SafeRightsManagementSessionHandle.cs
- RectangleGeometry.cs
- QueryOutputWriterV1.cs
- TemplateControlParser.cs
- HttpHandlerActionCollection.cs
- PointAnimationBase.cs
- SerialPort.cs
- CountdownEvent.cs
- InstanceCreationEditor.cs
- DispatcherSynchronizationContext.cs
- IgnoreSection.cs
- QueryableDataSourceEditData.cs
- clipboard.cs
- DbParameterHelper.cs
- StrongTypingException.cs