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
- OleDbDataReader.cs
- UserControl.cs
- TransportationConfigurationTypeInstallComponent.cs
- SecurityDocument.cs
- XNodeNavigator.cs
- OleDbErrorCollection.cs
- Atom10FormatterFactory.cs
- XmlWriter.cs
- BindUriHelper.cs
- ToolStripContentPanel.cs
- CancellableEnumerable.cs
- Form.cs
- _ShellExpression.cs
- RangeValidator.cs
- WebPartActionVerb.cs
- WebColorConverter.cs
- XmlHierarchicalEnumerable.cs
- ImageAttributes.cs
- MenuAdapter.cs
- WebPartConnectionCollection.cs
- SchemaNamespaceManager.cs
- OleDbParameterCollection.cs
- MimeMapping.cs
- Soap12FormatExtensions.cs
- OrderedDictionary.cs
- DocumentProperties.cs
- XmlAttributeCache.cs
- LabelAutomationPeer.cs
- ImportRequest.cs
- localization.cs
- HandlerBase.cs
- SafeNativeMethods.cs
- ArraySegment.cs
- compensatingcollection.cs
- DoubleCollectionConverter.cs
- HttpListenerElement.cs
- CodeCatchClauseCollection.cs
- DllNotFoundException.cs
- HandlerFactoryWrapper.cs
- JsonObjectDataContract.cs
- SoapElementAttribute.cs
- GlyphRun.cs
- CodeTypeOfExpression.cs
- XmlSchemaSearchPattern.cs
- CacheRequest.cs
- FormsIdentity.cs
- SafeNativeMethodsMilCoreApi.cs
- Shared.cs
- StdRegProviderWrapper.cs
- HttpListenerElement.cs
- TextSelection.cs
- RMEnrollmentPage2.cs
- HelpProvider.cs
- TextBoxBaseDesigner.cs
- XPathNodeInfoAtom.cs
- MetadataArtifactLoaderFile.cs
- XPathMultyIterator.cs
- XsltArgumentList.cs
- DependencyObject.cs
- MergeFilterQuery.cs
- EpmContentDeSerializerBase.cs
- DtrList.cs
- ObjectHandle.cs
- List.cs
- ListBoxItem.cs
- ConnectionConsumerAttribute.cs
- TraceData.cs
- SettingsPropertyWrongTypeException.cs
- DataGridViewRowStateChangedEventArgs.cs
- RequestQueryProcessor.cs
- SuppressMessageAttribute.cs
- TextCompositionManager.cs
- BrushConverter.cs
- XmlHelper.cs
- LinearKeyFrames.cs
- PrintDocument.cs
- SequentialOutput.cs
- CustomLineCap.cs
- ToggleButtonAutomationPeer.cs
- DataGridLength.cs
- SearchExpression.cs
- ComponentDispatcherThread.cs
- JavaScriptSerializer.cs
- MatrixValueSerializer.cs
- ControlParameter.cs
- BamlCollectionHolder.cs
- XmlCustomFormatter.cs
- BasicKeyConstraint.cs
- Registry.cs
- UnauthorizedAccessException.cs
- CodeComment.cs
- ModelEditingScope.cs
- SortExpressionBuilder.cs
- TraceProvider.cs
- DataGridColumn.cs
- AssemblyNameProxy.cs
- HttpCapabilitiesBase.cs
- MatrixAnimationUsingPath.cs
- EncryptedKey.cs
- TimeSpanConverter.cs