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
- InternalDispatchObject.cs
- NativeRightsManagementAPIsStructures.cs
- _UncName.cs
- TemplateEditingVerb.cs
- CodeAttributeArgumentCollection.cs
- SafeBitVector32.cs
- BooleanSwitch.cs
- TextOutput.cs
- ReaderWriterLock.cs
- SystemIPInterfaceProperties.cs
- ServiceOperationListItem.cs
- RelationshipSet.cs
- Helper.cs
- HandledMouseEvent.cs
- PartialArray.cs
- XmlNodeChangedEventManager.cs
- ISCIIEncoding.cs
- GeometryGroup.cs
- DoubleCollection.cs
- LinearQuaternionKeyFrame.cs
- RtfControlWordInfo.cs
- FieldBuilder.cs
- ModelChangedEventArgsImpl.cs
- PhysicalAddress.cs
- DataSourceConverter.cs
- TypeExtensionConverter.cs
- SecurityResources.cs
- Style.cs
- AllMembershipCondition.cs
- AutoScrollExpandMessageFilter.cs
- RectAnimationClockResource.cs
- SharedPerformanceCounter.cs
- ToolStripPanelCell.cs
- ContentFileHelper.cs
- BindingExpressionBase.cs
- SqlConnectionPoolProviderInfo.cs
- ApplySecurityAndSendAsyncResult.cs
- NavigationProgressEventArgs.cs
- UnknownBitmapEncoder.cs
- XPathDocumentBuilder.cs
- _DomainName.cs
- userdatakeys.cs
- XmlMembersMapping.cs
- ScrollProviderWrapper.cs
- ColumnWidthChangedEvent.cs
- AncestorChangedEventArgs.cs
- ScrollBar.cs
- GridViewActionList.cs
- GeometryHitTestResult.cs
- RouteData.cs
- DropShadowEffect.cs
- RequestCachePolicy.cs
- DataGridViewRowHeaderCell.cs
- MailAddress.cs
- SortKey.cs
- SqlDataSourceView.cs
- NativeMethods.cs
- DetailsViewCommandEventArgs.cs
- ValidationErrorCollection.cs
- GridViewRowCollection.cs
- ClonableStack.cs
- MultipartIdentifier.cs
- TextTreeText.cs
- PieceNameHelper.cs
- FileDialogCustomPlaces.cs
- BufferModesCollection.cs
- SizeAnimationClockResource.cs
- ImageButton.cs
- ExceptionCollection.cs
- UTF32Encoding.cs
- WebPartConnectionCollection.cs
- RemotingConfiguration.cs
- WebPartTransformerCollection.cs
- Native.cs
- WebConfigurationManager.cs
- WsdlBuildProvider.cs
- HttpRequest.cs
- RepeatInfo.cs
- DetailsViewUpdatedEventArgs.cs
- AuthenticatingEventArgs.cs
- EventItfInfo.cs
- ControlBindingsConverter.cs
- SchemaLookupTable.cs
- ObservableDictionary.cs
- HashMembershipCondition.cs
- x509utils.cs
- _NestedSingleAsyncResult.cs
- MutexSecurity.cs
- DesignTableCollection.cs
- StatusBarAutomationPeer.cs
- StrokeRenderer.cs
- selecteditemcollection.cs
- StyleSelector.cs
- RowToFieldTransformer.cs
- hresults.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- TraceHandler.cs
- BufferedReceiveElement.cs
- QueryContinueDragEvent.cs
- SessionViewState.cs