Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / WinForms / Managed / System / WinForms / FormCollection.cs / 1305376 / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- AdapterUtil.cs
- SafeWaitHandle.cs
- SingleTagSectionHandler.cs
- AccessText.cs
- DrawItemEvent.cs
- ComponentRenameEvent.cs
- TransportOutputChannel.cs
- JsonClassDataContract.cs
- OpenTypeCommon.cs
- SafeMemoryMappedFileHandle.cs
- TableItemPatternIdentifiers.cs
- DetailsViewPageEventArgs.cs
- X509ChainElement.cs
- FastEncoder.cs
- APCustomTypeDescriptor.cs
- PerformanceCounterPermissionAttribute.cs
- DataBinding.cs
- CacheSection.cs
- ScriptResourceMapping.cs
- GenerateHelper.cs
- RenderData.cs
- BindStream.cs
- InputLanguageProfileNotifySink.cs
- SchemaNamespaceManager.cs
- Point4DConverter.cs
- DocumentXmlWriter.cs
- FieldNameLookup.cs
- WindowsListViewItemCheckBox.cs
- StatusStrip.cs
- PointKeyFrameCollection.cs
- LayoutEditorPart.cs
- DescendantOverDescendantQuery.cs
- TextMessageEncodingBindingElement.cs
- QueryConverter.cs
- ColumnMap.cs
- HttpServerVarsCollection.cs
- Vector.cs
- DataGridPageChangedEventArgs.cs
- RequestCache.cs
- HebrewNumber.cs
- VirtualizingStackPanel.cs
- RegexParser.cs
- SqlDependencyListener.cs
- MediaScriptCommandRoutedEventArgs.cs
- RichListBox.cs
- ContainerParaClient.cs
- XmlLanguageConverter.cs
- Bold.cs
- AnnouncementEventArgs.cs
- URLMembershipCondition.cs
- SignerInfo.cs
- StreamReader.cs
- ListViewGroupConverter.cs
- UserNamePasswordClientCredential.cs
- IntegerValidatorAttribute.cs
- JsonServiceDocumentSerializer.cs
- AttachedPropertyBrowsableForChildrenAttribute.cs
- GridView.cs
- SystemIdentity.cs
- XhtmlConformanceSection.cs
- ItemList.cs
- HashCodeCombiner.cs
- RtfNavigator.cs
- GridViewRowEventArgs.cs
- SystemWebCachingSectionGroup.cs
- XmlFormatExtensionPointAttribute.cs
- XmlSchemaSubstitutionGroup.cs
- ProjectionPruner.cs
- ContextMenuStripActionList.cs
- SectionXmlInfo.cs
- ContentElementAutomationPeer.cs
- TreeNodeStyleCollection.cs
- ErrorProvider.cs
- SrgsDocumentParser.cs
- MimeParameterWriter.cs
- FixedTextSelectionProcessor.cs
- TokenBasedSetEnumerator.cs
- SourceCollection.cs
- WorkBatch.cs
- SelectorItemAutomationPeer.cs
- WebPartHelpVerb.cs
- CustomErrorsSection.cs
- ExpandCollapseProviderWrapper.cs
- HtmlInputReset.cs
- DataRowCollection.cs
- DesignerAttribute.cs
- FileLogRecordHeader.cs
- HttpRuntimeSection.cs
- XmlSchemaInclude.cs
- DateTimeEditor.cs
- ISAPIApplicationHost.cs
- HttpContext.cs
- HttpCapabilitiesSectionHandler.cs
- FragmentQueryProcessor.cs
- PasswordBox.cs
- RegistryConfigurationProvider.cs
- LiteralControl.cs
- CqlWriter.cs
- Menu.cs
- SqlInfoMessageEvent.cs