Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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. // //----------------------------------------------------------------------------- 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
- BehaviorEditorPart.cs
- ApplicationFileParser.cs
- NeutralResourcesLanguageAttribute.cs
- diagnosticsswitches.cs
- FacetDescription.cs
- JournalEntryStack.cs
- SQLRoleProvider.cs
- ImageButton.cs
- LocatorBase.cs
- TransactionState.cs
- CannotUnloadAppDomainException.cs
- DefaultMemberAttribute.cs
- PasswordBoxAutomationPeer.cs
- BrushMappingModeValidation.cs
- RangeValuePatternIdentifiers.cs
- Path.cs
- SqlCachedBuffer.cs
- XmlSchemaDatatype.cs
- StringAnimationUsingKeyFrames.cs
- EdmFunctionAttribute.cs
- NotFiniteNumberException.cs
- FlowDocumentReaderAutomationPeer.cs
- GeometryHitTestResult.cs
- NotImplementedException.cs
- baseshape.cs
- PropertyGridDesigner.cs
- SiteMapNodeItemEventArgs.cs
- COM2ComponentEditor.cs
- ConfigurationSection.cs
- CommonGetThemePartSize.cs
- GroupBoxRenderer.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- SrgsDocument.cs
- WindowsRichEditRange.cs
- ExecutionEngineException.cs
- CircleEase.cs
- HttpResponse.cs
- TransformGroup.cs
- OleDbParameterCollection.cs
- Helper.cs
- XmlBinaryReaderSession.cs
- FileInfo.cs
- DataGridTextBoxColumn.cs
- TextChange.cs
- AsmxEndpointPickerExtension.cs
- XPathAncestorQuery.cs
- InstalledVoice.cs
- SqlCacheDependencyDatabase.cs
- SocketException.cs
- BrowserCapabilitiesCompiler.cs
- AsyncOperation.cs
- AttributeParameterInfo.cs
- OutputWindow.cs
- ScriptReferenceEventArgs.cs
- _UriSyntax.cs
- ClientBuildManager.cs
- PrivilegeNotHeldException.cs
- ContextMenu.cs
- DesignerGenericWebPart.cs
- FacetDescriptionElement.cs
- xmlglyphRunInfo.cs
- UInt16.cs
- LineVisual.cs
- PeerTransportCredentialType.cs
- UncommonField.cs
- UnconditionalPolicy.cs
- ClientRoleProvider.cs
- ReadOnlyDictionary.cs
- ErrorTableItemStyle.cs
- MimeTypePropertyAttribute.cs
- CodeDirectiveCollection.cs
- WorkflowPersistenceService.cs
- XmlSchemaAnnotated.cs
- ArgumentOutOfRangeException.cs
- LocalTransaction.cs
- StylusCaptureWithinProperty.cs
- Vector.cs
- ProvidePropertyAttribute.cs
- Process.cs
- StringUtil.cs
- DependencyPropertyAttribute.cs
- TypeContext.cs
- FastEncoderStatics.cs
- ILGenerator.cs
- FieldToken.cs
- Line.cs
- VariableDesigner.xaml.cs
- TextAction.cs
- AttachedAnnotation.cs
- DataGridViewCellPaintingEventArgs.cs
- XmlSchemaIdentityConstraint.cs
- XmlWrappingReader.cs
- OperatingSystem.cs
- TraceContextEventArgs.cs
- HelpEvent.cs
- CollectionContainer.cs
- Permission.cs
- StringBuilder.cs
- SBCSCodePageEncoding.cs
- Util.cs