Code:
/ FX-1434 / FX-1434 / 1.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
- InvariantComparer.cs
- RowToFieldTransformer.cs
- OrderedDictionary.cs
- QueryTaskGroupState.cs
- WebServiceMethodData.cs
- TextInfo.cs
- ObjectQueryState.cs
- WinInet.cs
- StyleHelper.cs
- DataColumn.cs
- PartitionedStreamMerger.cs
- ThrowHelper.cs
- SafeUserTokenHandle.cs
- WCFModelStrings.Designer.cs
- MgmtConfigurationRecord.cs
- XomlCompilerParameters.cs
- DBSqlParserTable.cs
- GroupBox.cs
- RootBrowserWindowAutomationPeer.cs
- Sql8ConformanceChecker.cs
- TextSelectionProcessor.cs
- Pen.cs
- SqlDesignerDataSourceView.cs
- MembershipSection.cs
- ArraySubsetEnumerator.cs
- SafeNativeMethods.cs
- WebAdminConfigurationHelper.cs
- AppDomainShutdownMonitor.cs
- WmlListAdapter.cs
- ScriptResourceInfo.cs
- DriveInfo.cs
- X509PeerCertificateAuthenticationElement.cs
- AssociationTypeEmitter.cs
- CatalogPart.cs
- GeneralTransform3DGroup.cs
- MethodBuilderInstantiation.cs
- dsa.cs
- InternalControlCollection.cs
- DBCSCodePageEncoding.cs
- CustomError.cs
- Timeline.cs
- SettingsAttributes.cs
- HttpProfileGroupBase.cs
- SortAction.cs
- HorizontalAlignConverter.cs
- ExeContext.cs
- ComEventsSink.cs
- LinkLabelLinkClickedEvent.cs
- BindableAttribute.cs
- IconBitmapDecoder.cs
- SmtpFailedRecipientsException.cs
- SymbolMethod.cs
- MemberExpression.cs
- LostFocusEventManager.cs
- TableCellCollection.cs
- InputReportEventArgs.cs
- CredentialCache.cs
- _DigestClient.cs
- CodeIdentifier.cs
- WebResourceAttribute.cs
- DateRangeEvent.cs
- dbenumerator.cs
- MemberMaps.cs
- ChildTable.cs
- OleDbInfoMessageEvent.cs
- ObjectManager.cs
- ToolStripDropDownClosingEventArgs.cs
- SettingsProperty.cs
- Root.cs
- ClientFormsIdentity.cs
- ObjectListItem.cs
- MetadataCollection.cs
- HwndKeyboardInputProvider.cs
- DrawingContextDrawingContextWalker.cs
- TypeTypeConverter.cs
- ResourceDefaultValueAttribute.cs
- ListSourceHelper.cs
- ProviderIncompatibleException.cs
- CssStyleCollection.cs
- SafeHandle.cs
- DriveNotFoundException.cs
- XmlByteStreamWriter.cs
- XmlCodeExporter.cs
- UnhandledExceptionEventArgs.cs
- SettingsAttributes.cs
- DataSourceHelper.cs
- MessageSmuggler.cs
- CapabilitiesSection.cs
- HttpGetProtocolImporter.cs
- XmlWriterTraceListener.cs
- ReflectionServiceProvider.cs
- ChangeDirector.cs
- ColorDialog.cs
- SwitchAttribute.cs
- ReflectTypeDescriptionProvider.cs
- FilterableData.cs
- Int64Converter.cs
- ObjectDataSourceMethodEventArgs.cs
- InteropExecutor.cs
- XmlReflectionMember.cs