Code:
/ DotNET / DotNET / 8.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 {
///
///
/// [To be supplied.]
///
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;
}
}
///
///
/// 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
- MetabaseSettings.cs
- MarshalByValueComponent.cs
- CollectionTypeElement.cs
- ToolStripGrip.cs
- SoapSchemaMember.cs
- DeviceFiltersSection.cs
- TabItem.cs
- UpdateRecord.cs
- ListenUriMode.cs
- TreeViewTemplateSelector.cs
- XmlNullResolver.cs
- FrameworkElementFactoryMarkupObject.cs
- AncillaryOps.cs
- SqlInternalConnection.cs
- EntitySetBaseCollection.cs
- AsyncStreamReader.cs
- EntityContainerAssociationSetEnd.cs
- BasicHttpMessageCredentialType.cs
- RenderOptions.cs
- TreeNodeMouseHoverEvent.cs
- DataRelation.cs
- ReflectionHelper.cs
- Msmq.cs
- XsdDataContractExporter.cs
- CapabilitiesSection.cs
- VirtualPathData.cs
- AdapterUtil.cs
- CustomWebEventKey.cs
- ErrorProvider.cs
- FamilyCollection.cs
- TemplateControlParser.cs
- UriTemplateClientFormatter.cs
- TypeExtensionConverter.cs
- TextSearch.cs
- cookiecollection.cs
- ProfessionalColors.cs
- DataServiceConfiguration.cs
- ImageAnimator.cs
- Base64Encoder.cs
- RuntimeConfigLKG.cs
- TextServicesDisplayAttributePropertyRanges.cs
- DataObjectPastingEventArgs.cs
- TableAdapterManagerMethodGenerator.cs
- AttributeQuery.cs
- HtmlEmptyTagControlBuilder.cs
- SqlError.cs
- DataGridColumn.cs
- ComAdminInterfaces.cs
- ValidationRule.cs
- NetStream.cs
- ScriptDescriptor.cs
- invalidudtexception.cs
- HttpVersion.cs
- HasCopySemanticsAttribute.cs
- WebHeaderCollection.cs
- x509utils.cs
- ReflectionTypeLoadException.cs
- HtmlMeta.cs
- TypeUnloadedException.cs
- ConnectionProviderAttribute.cs
- EventMappingSettings.cs
- EmptyEnumerator.cs
- InvalidPrinterException.cs
- FilterEventArgs.cs
- sqlmetadatafactory.cs
- IndentedWriter.cs
- SecUtil.cs
- ImageSource.cs
- InvalidContentTypeException.cs
- DrawingVisualDrawingContext.cs
- EventRecordWrittenEventArgs.cs
- CodeCommentStatementCollection.cs
- CodeSnippetTypeMember.cs
- DbProviderFactory.cs
- ToolStripDropDownButton.cs
- AnimatedTypeHelpers.cs
- WebDisplayNameAttribute.cs
- WorkflowOperationAsyncResult.cs
- OdbcConnectionStringbuilder.cs
- NavigationCommands.cs
- Polyline.cs
- XPathAncestorQuery.cs
- TableParaClient.cs
- EditorPart.cs
- DelayedRegex.cs
- HtmlContainerControl.cs
- WorkflowApplicationCompletedEventArgs.cs
- _ChunkParse.cs
- OdbcReferenceCollection.cs
- StateValidator.cs
- ComplexPropertyEntry.cs
- TraceListeners.cs
- ObjectAssociationEndMapping.cs
- IteratorDescriptor.cs
- TransformPattern.cs
- ProfileEventArgs.cs
- dbdatarecord.cs
- HttpModuleActionCollection.cs
- CodeExporter.cs
- EmptyElement.cs