Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / ndp / fx / src / xsp / System / Web / Extensions / ui / UpdatePanelTriggerCollection.cs / 1 / UpdatePanelTriggerCollection.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Web.UI {
using System;
using System.Collections.ObjectModel;
using System.Diagnostics.CodeAnalysis;
using System.Security.Permissions;
using System.Web;
[
AspNetHostingPermission(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal),
AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)
]
public class UpdatePanelTriggerCollection : Collection {
private bool _initialized;
private UpdatePanel _owner;
public UpdatePanelTriggerCollection(UpdatePanel owner) {
if (owner == null) {
throw new ArgumentNullException("owner");
}
_owner = owner;
}
public UpdatePanel Owner {
get {
return _owner;
}
}
[SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")]
protected override void ClearItems() {
foreach (UpdatePanelTrigger trigger in this) {
trigger.SetOwner(null);
}
base.ClearItems();
}
internal bool HasTriggered() {
foreach (UpdatePanelTrigger trigger in this) {
if (trigger.HasTriggered()) {
return true;
}
}
return false;
}
internal void Initialize() {
foreach (UpdatePanelTrigger trigger in this) {
trigger.Initialize();
}
_initialized = true;
}
[SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")]
protected override void InsertItem(int index, UpdatePanelTrigger item) {
item.SetOwner(Owner);
if (_initialized) {
item.Initialize();
}
base.InsertItem(index, item);
}
[SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")]
protected override void RemoveItem(int index) {
this[index].SetOwner(null);
base.RemoveItem(index);
}
[SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")]
protected override void SetItem(int index, UpdatePanelTrigger item) {
this[index].SetOwner(null);
item.SetOwner(Owner);
if (_initialized) {
item.Initialize();
}
base.SetItem(index, item);
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Web.UI {
using System;
using System.Collections.ObjectModel;
using System.Diagnostics.CodeAnalysis;
using System.Security.Permissions;
using System.Web;
[
AspNetHostingPermission(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal),
AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)
]
public class UpdatePanelTriggerCollection : Collection {
private bool _initialized;
private UpdatePanel _owner;
public UpdatePanelTriggerCollection(UpdatePanel owner) {
if (owner == null) {
throw new ArgumentNullException("owner");
}
_owner = owner;
}
public UpdatePanel Owner {
get {
return _owner;
}
}
[SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")]
protected override void ClearItems() {
foreach (UpdatePanelTrigger trigger in this) {
trigger.SetOwner(null);
}
base.ClearItems();
}
internal bool HasTriggered() {
foreach (UpdatePanelTrigger trigger in this) {
if (trigger.HasTriggered()) {
return true;
}
}
return false;
}
internal void Initialize() {
foreach (UpdatePanelTrigger trigger in this) {
trigger.Initialize();
}
_initialized = true;
}
[SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")]
protected override void InsertItem(int index, UpdatePanelTrigger item) {
item.SetOwner(Owner);
if (_initialized) {
item.Initialize();
}
base.InsertItem(index, item);
}
[SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")]
protected override void RemoveItem(int index) {
this[index].SetOwner(null);
base.RemoveItem(index);
}
[SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")]
protected override void SetItem(int index, UpdatePanelTrigger item) {
this[index].SetOwner(null);
item.SetOwner(Owner);
if (_initialized) {
item.Initialize();
}
base.SetItem(index, item);
}
}
}
// 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
- ThreadStaticAttribute.cs
- TileBrush.cs
- DesignTimeTemplateParser.cs
- MappingModelBuildProvider.cs
- MenuItem.cs
- DataGridTable.cs
- DataListCommandEventArgs.cs
- JsonServiceDocumentSerializer.cs
- TrackingProfileDeserializationException.cs
- MessageHeaders.cs
- MainMenu.cs
- EventDescriptor.cs
- ExpandedWrapper.cs
- SpellerInterop.cs
- FormClosedEvent.cs
- XmlObjectSerializerWriteContextComplex.cs
- AvTraceDetails.cs
- LiteralTextParser.cs
- CommandManager.cs
- Keyboard.cs
- ListenerElementsCollection.cs
- securitycriticaldataformultiplegetandset.cs
- StreamReader.cs
- ConstantExpression.cs
- EncryptedKeyHashIdentifierClause.cs
- nulltextnavigator.cs
- XmlMembersMapping.cs
- StrongNameIdentityPermission.cs
- FormatControl.cs
- RenderContext.cs
- DragDeltaEventArgs.cs
- MarginsConverter.cs
- EditorZoneDesigner.cs
- EntityDataSourceQueryBuilder.cs
- RegexWriter.cs
- MailSettingsSection.cs
- RefreshPropertiesAttribute.cs
- UshortList2.cs
- XmlDocument.cs
- SmiMetaDataProperty.cs
- future.cs
- ThaiBuddhistCalendar.cs
- Vector3DConverter.cs
- WebPartChrome.cs
- SecurityBindingElementImporter.cs
- SystemBrushes.cs
- WebBrowser.cs
- SqlPersistenceWorkflowInstanceDescription.cs
- OleAutBinder.cs
- DynamicDocumentPaginator.cs
- XmlQualifiedName.cs
- NaturalLanguageHyphenator.cs
- OleServicesContext.cs
- ClusterSafeNativeMethods.cs
- GridViewActionList.cs
- StringKeyFrameCollection.cs
- GridSplitter.cs
- DependencyPropertyKind.cs
- SoapReflectionImporter.cs
- StyleTypedPropertyAttribute.cs
- TaiwanLunisolarCalendar.cs
- SoapServerMethod.cs
- StrokeRenderer.cs
- SqlRemoveConstantOrderBy.cs
- XLinq.cs
- CompilationUtil.cs
- AuthenticationConfig.cs
- HtmlContainerControl.cs
- DebugInfoGenerator.cs
- CodeAccessSecurityEngine.cs
- SqlNodeAnnotations.cs
- Button.cs
- dtdvalidator.cs
- PrincipalPermission.cs
- SortableBindingList.cs
- SoapTypeAttribute.cs
- Scripts.cs
- TypedRowHandler.cs
- ApplicationDirectoryMembershipCondition.cs
- CallSiteOps.cs
- ClientOptions.cs
- MatrixUtil.cs
- SerializationFieldInfo.cs
- AppSettingsSection.cs
- MetadataException.cs
- TreeNode.cs
- PageThemeBuildProvider.cs
- SrgsRuleRef.cs
- ParseElementCollection.cs
- securestring.cs
- ListGeneralPage.cs
- ColumnMapTranslator.cs
- Process.cs
- LabelEditEvent.cs
- FontStretchConverter.cs
- PowerModeChangedEventArgs.cs
- FlowNode.cs
- OperationCanceledException.cs
- EmptyEnumerator.cs
- DynamicILGenerator.cs