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
- IApplicationTrustManager.cs
- AccessedThroughPropertyAttribute.cs
- SingleConverter.cs
- UnicastIPAddressInformationCollection.cs
- SHA256.cs
- HostingEnvironmentSection.cs
- IriParsingElement.cs
- CompModHelpers.cs
- WebServiceData.cs
- PropertyKey.cs
- BinaryFormatterWriter.cs
- ExitEventArgs.cs
- wgx_sdk_version.cs
- DataGridCaption.cs
- VScrollProperties.cs
- TaiwanLunisolarCalendar.cs
- ContentElement.cs
- CodeObject.cs
- CursorInteropHelper.cs
- ManipulationCompletedEventArgs.cs
- CellRelation.cs
- SelectionItemProviderWrapper.cs
- UserMapPath.cs
- DataContractFormatAttribute.cs
- Msmq4PoisonHandler.cs
- ResXResourceSet.cs
- XmlAttributes.cs
- AutomationPropertyInfo.cs
- ContextStack.cs
- CatalogZoneDesigner.cs
- XPathNode.cs
- CodeObjectCreateExpression.cs
- InfoCardRSAPKCS1SignatureDeformatter.cs
- ObjectRef.cs
- QueryResult.cs
- FileAuthorizationModule.cs
- wpf-etw.cs
- ChannelSinkStacks.cs
- NumberFormatter.cs
- ControlBuilder.cs
- ExpressionTable.cs
- DrawTreeNodeEventArgs.cs
- EncryptedType.cs
- KnownTypesProvider.cs
- UnitySerializationHolder.cs
- ThousandthOfEmRealPoints.cs
- GridViewItemAutomationPeer.cs
- PrimaryKeyTypeConverter.cs
- ConnectionPoint.cs
- CodeNamespaceImport.cs
- SqlGenerator.cs
- ComponentEditorForm.cs
- PrimitiveCodeDomSerializer.cs
- SecurityPermission.cs
- ServiceProviders.cs
- HuffmanTree.cs
- ContextActivityUtils.cs
- Buffer.cs
- Utils.cs
- PerformanceCounterCategory.cs
- InfoCardTrace.cs
- SystemSounds.cs
- EventPrivateKey.cs
- EntityDescriptor.cs
- ItemsControlAutomationPeer.cs
- HtmlSelect.cs
- EtwTrace.cs
- FontSourceCollection.cs
- Parser.cs
- StreamGeometry.cs
- CommandValueSerializer.cs
- SqlCommandSet.cs
- XmlDataDocument.cs
- ServiceThrottlingElement.cs
- __TransparentProxy.cs
- FormsAuthenticationEventArgs.cs
- MetadataCollection.cs
- ListViewGroup.cs
- StreamInfo.cs
- ToggleButtonAutomationPeer.cs
- DocumentOutline.cs
- RadioButton.cs
- ParseHttpDate.cs
- BasicViewGenerator.cs
- DataSourceNameHandler.cs
- HotCommands.cs
- SpellCheck.cs
- BindingGraph.cs
- XmlQueryCardinality.cs
- Int16.cs
- RoutingService.cs
- GlobalizationSection.cs
- TransformDescriptor.cs
- ListViewAutomationPeer.cs
- AlignmentYValidation.cs
- HttpWriter.cs
- ZeroOpNode.cs
- WebPartsPersonalizationAuthorization.cs
- formatter.cs
- ConfigurationSchemaErrors.cs