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
- AutoGeneratedFieldProperties.cs
- Button.cs
- Transform.cs
- PersonalizationState.cs
- BindingSourceDesigner.cs
- FtpRequestCacheValidator.cs
- coordinatorscratchpad.cs
- XmlSerializerNamespaces.cs
- OpenTypeLayout.cs
- CodeGeneratorOptions.cs
- wgx_exports.cs
- NameNode.cs
- ConfigurationValidatorAttribute.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- InterleavedZipPartStream.cs
- SchemaReference.cs
- XamlStream.cs
- UnicodeEncoding.cs
- ContextQuery.cs
- ToolStripContentPanelRenderEventArgs.cs
- SplineKeyFrames.cs
- ResolvedKeyFrameEntry.cs
- ConfigUtil.cs
- ToolStripItemGlyph.cs
- D3DImage.cs
- RayMeshGeometry3DHitTestResult.cs
- ContentTextAutomationPeer.cs
- NotifyInputEventArgs.cs
- SchemaSetCompiler.cs
- SQLInt16Storage.cs
- UpdateDelegates.Generated.cs
- BamlWriter.cs
- RecognizedWordUnit.cs
- XamlReaderHelper.cs
- PointConverter.cs
- AppSettingsSection.cs
- XmlWriterDelegator.cs
- ConfigPathUtility.cs
- BitmapScalingModeValidation.cs
- UIInitializationException.cs
- GridItemProviderWrapper.cs
- MsmqIntegrationReceiveParameters.cs
- TextTreeInsertUndoUnit.cs
- securitycriticaldataformultiplegetandset.cs
- EventSinkActivityDesigner.cs
- XmlSchemaSimpleTypeRestriction.cs
- FtpWebResponse.cs
- MultiBinding.cs
- StringReader.cs
- WpfSharedBamlSchemaContext.cs
- UserCancellationException.cs
- TextEditorTables.cs
- TransformPatternIdentifiers.cs
- HttpCacheParams.cs
- DrawListViewColumnHeaderEventArgs.cs
- _BasicClient.cs
- FamilyTypeface.cs
- BufferedStream.cs
- ModelPerspective.cs
- StorageEntityContainerMapping.cs
- TextEditorTyping.cs
- UnconditionalPolicy.cs
- StorageEndPropertyMapping.cs
- EventProviderTraceListener.cs
- FileDetails.cs
- TextElementCollection.cs
- DesignerActionListCollection.cs
- GatewayDefinition.cs
- GuidelineCollection.cs
- PermissionRequestEvidence.cs
- PropertyDescriptorCollection.cs
- GeneralTransformGroup.cs
- ReachDocumentPageSerializer.cs
- PropertySet.cs
- UnionQueryOperator.cs
- SqlCacheDependencyDatabase.cs
- followingquery.cs
- InvokePattern.cs
- TextEditorSelection.cs
- _CacheStreams.cs
- PropertyDescriptorCollection.cs
- TagPrefixAttribute.cs
- NumberFunctions.cs
- ToolStripSplitStackLayout.cs
- DictionaryGlobals.cs
- OrderByQueryOptionExpression.cs
- DESCryptoServiceProvider.cs
- WebConvert.cs
- InputLanguageSource.cs
- XmlDocument.cs
- AutomationProperties.cs
- TypeSource.cs
- ComplexPropertyEntry.cs
- BeginEvent.cs
- LongSumAggregationOperator.cs
- ApplicationDirectoryMembershipCondition.cs
- FormsAuthenticationCredentials.cs
- PanelContainerDesigner.cs
- GridViewRowCollection.cs
- StartUpEventArgs.cs