Code:
/ DotNET / DotNET / 8.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
- SafePointer.cs
- SQLMoney.cs
- XmlSchemaSimpleContent.cs
- TableSectionStyle.cs
- HttpCapabilitiesEvaluator.cs
- AttributeUsageAttribute.cs
- ParallelTimeline.cs
- Timer.cs
- VirtualPathProvider.cs
- ToolStripDesignerAvailabilityAttribute.cs
- WeakReference.cs
- XamlSerializationHelper.cs
- DynamicDiscoveryDocument.cs
- CompilerError.cs
- Vector3DAnimationUsingKeyFrames.cs
- PaperSource.cs
- AccessorTable.cs
- MarshalByValueComponent.cs
- ElementInit.cs
- PrintDialog.cs
- SecurityKeyUsage.cs
- DrawingImage.cs
- ComponentEditorPage.cs
- TreeViewImageKeyConverter.cs
- DiagnosticTrace.cs
- IssuedTokenClientElement.cs
- PropertyKey.cs
- ParserStack.cs
- ValueHandle.cs
- ConfigurationConverterBase.cs
- Camera.cs
- DrawingContextDrawingContextWalker.cs
- MimeBasePart.cs
- SchemaHelper.cs
- DataBoundControl.cs
- ToolStripItemRenderEventArgs.cs
- TimersDescriptionAttribute.cs
- SqlNode.cs
- DynamicValidatorEventArgs.cs
- BindingObserver.cs
- XmlDataSource.cs
- LambdaCompiler.Lambda.cs
- Model3D.cs
- IpcServerChannel.cs
- OSEnvironmentHelper.cs
- AttachInfo.cs
- GeneralTransformGroup.cs
- FunctionCommandText.cs
- Int16Storage.cs
- NavigationWindowAutomationPeer.cs
- MethodInfo.cs
- TypefaceMetricsCache.cs
- RoleServiceManager.cs
- ResourceProviderFactory.cs
- ContentPropertyAttribute.cs
- TextTreeInsertUndoUnit.cs
- PointAnimationUsingPath.cs
- PictureBoxDesigner.cs
- RbTree.cs
- RegexInterpreter.cs
- StringPropertyBuilder.cs
- ObjectItemAttributeAssemblyLoader.cs
- SwitchLevelAttribute.cs
- Point3DCollectionConverter.cs
- UserControlCodeDomTreeGenerator.cs
- QueryContinueDragEventArgs.cs
- TextDecorationCollectionConverter.cs
- TypeConverter.cs
- StylusPlugInCollection.cs
- OneOf.cs
- XmlAttributes.cs
- MissingMemberException.cs
- TraceLog.cs
- OutputWindow.cs
- RangeContentEnumerator.cs
- QueryableDataSourceEditData.cs
- EmptyStringExpandableObjectConverter.cs
- ParameterModifier.cs
- LightweightEntityWrapper.cs
- ClientSponsor.cs
- smtppermission.cs
- ScriptResourceHandler.cs
- Variant.cs
- ImpersonateTokenRef.cs
- BooleanKeyFrameCollection.cs
- Ref.cs
- ProviderMetadata.cs
- Tag.cs
- SymmetricAlgorithm.cs
- DataObjectAttribute.cs
- TableLayoutCellPaintEventArgs.cs
- ComboBoxItem.cs
- ListViewTableRow.cs
- ComponentEditorForm.cs
- HierarchicalDataSourceDesigner.cs
- SerialPort.cs
- ConvertTextFrag.cs
- HtmlTitle.cs
- OpCodes.cs
- AnnotationResourceChangedEventArgs.cs