Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / WinForms / Managed / System / WinForms / HtmlWindowCollection.cs / 1 / HtmlWindowCollection.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- using System; using System.ComponentModel; using System.Diagnostics; using System.IO; using System.Drawing; using System.Drawing.Printing; using System.Windows.Forms; using System.Security.Permissions; using System.Security; using System.Runtime.InteropServices; using System.Net; using System.Collections; namespace System.Windows.Forms { ////// /// public class HtmlWindowCollection : ICollection { private UnsafeNativeMethods.IHTMLFramesCollection2 htmlFramesCollection2; private HtmlShimManager shimManager; internal HtmlWindowCollection(HtmlShimManager shimManager, UnsafeNativeMethods.IHTMLFramesCollection2 collection) { this.htmlFramesCollection2 = collection; this.shimManager = shimManager; Debug.Assert(this.NativeHTMLFramesCollection2 != null, "The window collection object should implement IHTMLFramesCollection2"); } private UnsafeNativeMethods.IHTMLFramesCollection2 NativeHTMLFramesCollection2 { get { return this.htmlFramesCollection2; } } ///[To be supplied.] ////// /// public HtmlWindow this[int index] { get { if (index < 0 || index >= this.Count) { throw new ArgumentOutOfRangeException("index", SR.GetString(SR.InvalidBoundArgument, "index", index, 0, this.Count - 1)); } object oIndex = (object)index; UnsafeNativeMethods.IHTMLWindow2 htmlWindow2 = this.NativeHTMLFramesCollection2.Item(ref oIndex) as UnsafeNativeMethods.IHTMLWindow2; return (htmlWindow2 != null) ? new HtmlWindow(shimManager, htmlWindow2) : null; } } ///[To be supplied.] ////// /// public HtmlWindow this[string windowId] { get { object oWindowId = (object)windowId; UnsafeNativeMethods.IHTMLWindow2 htmlWindow2 = null; try { htmlWindow2 = this.htmlFramesCollection2.Item(ref oWindowId) as UnsafeNativeMethods.IHTMLWindow2; } catch (COMException) { throw new ArgumentException(SR.GetString(SR.InvalidArgument, "windowId", windowId)); } return (htmlWindow2 != null) ? new HtmlWindow(shimManager, htmlWindow2) : null; } } ///[To be supplied.] ////// /// Returns the total number of elements in the collection. /// public int Count { get { return this.NativeHTMLFramesCollection2.GetLength(); } } ////// bool ICollection.IsSynchronized { get { return false; } } /// /// object ICollection.SyncRoot { get { return this; } } /// /// void ICollection.CopyTo(Array dest, int index) { int count = this.Count; for (int i = 0; i < count; i++) { dest.SetValue(this[i], index++); } } /// /// public IEnumerator GetEnumerator() { HtmlWindow[] htmlWindows = new HtmlWindow[this.Count]; ((ICollection)this).CopyTo(htmlWindows, 0); return htmlWindows.GetEnumerator(); } } } // 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
- OdbcRowUpdatingEvent.cs
- UInt32Converter.cs
- XmlSchemaValidator.cs
- XmlDocumentFragment.cs
- _HTTPDateParse.cs
- SystemDropShadowChrome.cs
- CacheVirtualItemsEvent.cs
- OleServicesContext.cs
- LayoutExceptionEventArgs.cs
- BitHelper.cs
- WebBrowserProgressChangedEventHandler.cs
- DataGridViewRowEventArgs.cs
- errorpatternmatcher.cs
- Int32RectConverter.cs
- InputBindingCollection.cs
- ExtendedPropertyDescriptor.cs
- TreeNode.cs
- EmptyEnumerable.cs
- RepeatButton.cs
- InvalidComObjectException.cs
- ServerIdentity.cs
- Page.cs
- InstanceValue.cs
- MimeParameterWriter.cs
- Array.cs
- QueryContinueDragEvent.cs
- AdornerDecorator.cs
- XamlWriter.cs
- AdornerLayer.cs
- RijndaelManaged.cs
- UInt64Converter.cs
- XmlWrappingWriter.cs
- SessionParameter.cs
- MaskedTextBox.cs
- RecipientInfo.cs
- CodeSnippetStatement.cs
- shaperfactoryquerycacheentry.cs
- StylusLogic.cs
- TraceHandler.cs
- MethodAccessException.cs
- DataKey.cs
- CodeBlockBuilder.cs
- FileSystemEventArgs.cs
- TogglePattern.cs
- DataView.cs
- FindCriteriaCD1.cs
- RegionInfo.cs
- CodeMemberField.cs
- X509Extension.cs
- TypeToStringValueConverter.cs
- ProxyWebPartManager.cs
- ToolStripSystemRenderer.cs
- TokenFactoryBase.cs
- MappingException.cs
- XmlSchemas.cs
- DesignerDataView.cs
- BaseParagraph.cs
- LightweightCodeGenerator.cs
- SystemIPInterfaceStatistics.cs
- Instrumentation.cs
- EventDescriptorCollection.cs
- DataServiceRequestArgs.cs
- HtmlGenericControl.cs
- PackagingUtilities.cs
- BaseUriHelper.cs
- WindowsListViewItem.cs
- TransformedBitmap.cs
- dataprotectionpermission.cs
- InternalBufferOverflowException.cs
- TagElement.cs
- DynamicField.cs
- DataColumnPropertyDescriptor.cs
- IdentityModelStringsVersion1.cs
- XPathNodeIterator.cs
- ApplicationTrust.cs
- CollectionsUtil.cs
- DeferrableContentConverter.cs
- DataIdProcessor.cs
- WebHeaderCollection.cs
- Timeline.cs
- RegistrationServices.cs
- DataServiceRequestOfT.cs
- ListContractAdapter.cs
- EDesignUtil.cs
- ColorPalette.cs
- SafeRightsManagementHandle.cs
- DataGridRow.cs
- SessionIDManager.cs
- StateManagedCollection.cs
- MailWriter.cs
- ErrorActivity.cs
- AutoCompleteStringCollection.cs
- ProviderCollection.cs
- FilterQuery.cs
- ProgressBarRenderer.cs
- StylusTouchDevice.cs
- Type.cs
- Registry.cs
- StringAttributeCollection.cs
- AddIn.cs