Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / WinForms / Managed / System / WinForms / FormCollection.cs / 1 / FormCollection.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Windows.Forms { using System; using System.Collections; using System.ComponentModel; using System.Globalization; ////// /// public class FormCollection : ReadOnlyCollectionBase { internal static object CollectionSyncRoot = new object(); ////// This is a read only collection of Forms exposed as a static property of the /// Application class. This is used to store all the currently loaded forms in an app. /// ////// /// public virtual Form this[string name] { get { if (name != null) { lock (CollectionSyncRoot) { foreach(Form form in InnerList) { if (string.Equals(form.Name, name, StringComparison.OrdinalIgnoreCase)) { return form; } } } } return null; } } ////// Gets a form specified by name, if present, else returns null. If there are multiple /// forms with matching names, the first form found is returned. /// ////// /// public virtual Form this[int index] { get { Form f = null; lock (CollectionSyncRoot) { f = (Form) InnerList[index]; } return f; } } ////// Gets a form specified by index. /// ////// Used internally to add a Form to the FormCollection /// internal void Add(Form form) { lock (CollectionSyncRoot) { InnerList.Add(form); } } ////// Used internally to check if a Form is in the FormCollection /// internal bool Contains(Form form) { bool inCollection = false; lock (CollectionSyncRoot) { inCollection = InnerList.Contains(form); } return inCollection; } ////// Used internally to add a Form to the FormCollection /// internal void Remove(Form form) { lock (CollectionSyncRoot) { InnerList.Remove(form); } } } } // 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
- SrgsGrammar.cs
- PasswordDeriveBytes.cs
- SafeHandle.cs
- TimeSpanSecondsOrInfiniteConverter.cs
- RijndaelManaged.cs
- PolyQuadraticBezierSegmentFigureLogic.cs
- HtmlUtf8RawTextWriter.cs
- PrimitiveXmlSerializers.cs
- Rectangle.cs
- SHA256Managed.cs
- DataBoundControlAdapter.cs
- IDQuery.cs
- RightNameExpirationInfoPair.cs
- SHA1Managed.cs
- MailDefinitionBodyFileNameEditor.cs
- XmlHierarchyData.cs
- ExceptionUtil.cs
- DataGridColumnHeaderAutomationPeer.cs
- TextContainer.cs
- HyperLinkStyle.cs
- XmlSortKey.cs
- PageThemeParser.cs
- HtmlInputPassword.cs
- ErrorWebPart.cs
- PointAnimation.cs
- RulePatternOps.cs
- Int32Collection.cs
- HttpModuleActionCollection.cs
- CheckBoxAutomationPeer.cs
- unitconverter.cs
- DoubleAnimationClockResource.cs
- SessionStateItemCollection.cs
- TableLayoutColumnStyleCollection.cs
- Panel.cs
- PeerSecurityHelpers.cs
- PointLightBase.cs
- ErasingStroke.cs
- ProtocolsConfigurationHandler.cs
- SafeHandle.cs
- FamilyCollection.cs
- Soap.cs
- ErrorFormatter.cs
- SafeHandles.cs
- DataGridItemEventArgs.cs
- EntityType.cs
- ProviderConnectionPoint.cs
- InputBinding.cs
- EndpointIdentityConverter.cs
- Token.cs
- CreateInstanceBinder.cs
- OdbcInfoMessageEvent.cs
- DelayedRegex.cs
- PersonalizationStateInfo.cs
- Pair.cs
- RSAOAEPKeyExchangeDeformatter.cs
- CursorConverter.cs
- recordstatefactory.cs
- HostedBindingBehavior.cs
- PathFigure.cs
- SafeNativeMethods.cs
- HelpEvent.cs
- AppSettingsExpressionBuilder.cs
- CultureTableRecord.cs
- ComponentEvent.cs
- CompiledELinqQueryState.cs
- Helper.cs
- CommandID.cs
- WebPartDescriptionCollection.cs
- RoleGroupCollection.cs
- SmtpMail.cs
- TrackBar.cs
- glyphs.cs
- ColumnWidthChangingEvent.cs
- RSAPKCS1KeyExchangeFormatter.cs
- SoapInteropTypes.cs
- FileFormatException.cs
- InfoCardTrace.cs
- CLRBindingWorker.cs
- TogglePatternIdentifiers.cs
- ControlValuePropertyAttribute.cs
- SocketElement.cs
- TakeOrSkipWhileQueryOperator.cs
- ServerType.cs
- ProcessModuleCollection.cs
- CustomUserNameSecurityTokenAuthenticator.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- MsmqBindingBase.cs
- LessThanOrEqual.cs
- Normalization.cs
- DbBuffer.cs
- ScrollableControlDesigner.cs
- WebException.cs
- _Connection.cs
- SqlDataSourceCommandEventArgs.cs
- AliasedSlot.cs
- UIElementParaClient.cs
- EdmToObjectNamespaceMap.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- TypeToken.cs
- FactoryGenerator.cs