Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / WinForms / Managed / System / WinForms / HtmlHistory.cs / 1305376 / HtmlHistory.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
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.Globalization;
namespace System.Windows.Forms {
///
///
/// [To be supplied.]
///
[PermissionSetAttribute(SecurityAction.LinkDemand, Name = "FullTrust")]
public sealed class HtmlHistory : IDisposable
{
private UnsafeNativeMethods.IOmHistory htmlHistory;
private bool disposed;
[PermissionSet(SecurityAction.Demand, Name = "FullTrust")]
internal HtmlHistory(UnsafeNativeMethods.IOmHistory history)
{
this.htmlHistory = history;
Debug.Assert(this.NativeOmHistory != null, "The history object should implement IOmHistory");
}
private UnsafeNativeMethods.IOmHistory NativeOmHistory {
get {
if (this.disposed) {
throw new System.ObjectDisposedException(GetType().Name);
}
return this.htmlHistory;
}
}
///
public void Dispose() {
this.htmlHistory = null;
this.disposed = true;
GC.SuppressFinalize(this);
}
///
///
/// [To be supplied.]
///
public int Length {
get {
return (int)this.NativeOmHistory.GetLength();
}
}
///
///
/// [To be supplied.]
///
public void Back(int numberBack) {
if (numberBack < 0) {
throw new ArgumentOutOfRangeException("numberBack", SR.GetString(SR.InvalidLowBoundArgumentEx, "numberBack", numberBack.ToString(CultureInfo.CurrentCulture), (0).ToString(CultureInfo.CurrentCulture)));
}
else if (numberBack > 0) {
object oNumForward = (object)(-numberBack);
this.NativeOmHistory.Go(ref oNumForward);
}
}
///
///
/// [To be supplied.]
///
public void Forward(int numberForward) {
if (numberForward < 0) {
throw new ArgumentOutOfRangeException("numberForward", SR.GetString(SR.InvalidLowBoundArgumentEx, "numberForward", numberForward.ToString(CultureInfo.CurrentCulture), (0).ToString(CultureInfo.CurrentCulture)));
}
else if (numberForward > 0) {
object oNumForward = (object)numberForward;
this.NativeOmHistory.Go(ref oNumForward);
}
}
///
///
/// Go to a specific Uri in the history
///
[SuppressMessage("Microsoft.Usage", "CA2234:PassSystemUriObjectsInsteadOfStrings")]
public void Go(Uri url)
{
Go(url.ToString());
}
///
///
/// Go to a specific url(string) in the history
///
/// Note: We intentionally have a string overload (apparently Mort wants one). We don't have
/// string overloads call Uri overloads because that breaks Uris that aren't fully qualified
/// (things like "www.microsoft.com") that the underlying objects support and we don't want to
/// break.
[SuppressMessage("Microsoft.Design", "CA1057:StringUriOverloadsCallSystemUriOverloads")]
public void Go(string urlString)
{
object loc = (object)urlString;
this.NativeOmHistory.Go(ref loc);
}
///
///
/// Go to the specified position in the history list
///
public void Go(int relativePosition) {
object loc = (object)relativePosition;
this.NativeOmHistory.Go(ref loc);
}
///
///
/// [To be supplied.]
///
public object DomHistory {
get {
return this.NativeOmHistory;
}
}
}
}
// 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
- Viewport3DVisual.cs
- DynamicDocumentPaginator.cs
- FixedPageStructure.cs
- ConsoleKeyInfo.cs
- DetailsViewModeEventArgs.cs
- TransactionInformation.cs
- GlobalizationSection.cs
- CodeIndexerExpression.cs
- CodeDOMUtility.cs
- SecureEnvironment.cs
- NameTable.cs
- ReferenceEqualityComparer.cs
- SoundPlayerAction.cs
- MailDefinition.cs
- ProgressBarAutomationPeer.cs
- AttachmentCollection.cs
- DynamicPropertyHolder.cs
- PackageRelationshipSelector.cs
- JpegBitmapDecoder.cs
- EncoderParameter.cs
- EntitySetRetriever.cs
- MultipleViewProviderWrapper.cs
- XpsS0ValidatingLoader.cs
- LayoutTableCell.cs
- FileCodeGroup.cs
- DataGridItemCollection.cs
- SecurityPolicySection.cs
- RadioButton.cs
- FixedSOMPageElement.cs
- EntityContainerEmitter.cs
- InvokeSchedule.cs
- UIElement3D.cs
- DesignerTransactionCloseEvent.cs
- CodePageEncoding.cs
- DataGridViewElement.cs
- PathStreamGeometryContext.cs
- datacache.cs
- ToolStripProfessionalLowResolutionRenderer.cs
- PixelShader.cs
- BaseCodeDomTreeGenerator.cs
- FontCacheUtil.cs
- MessageBox.cs
- RecognizerInfo.cs
- ScriptResourceHandler.cs
- ControlParser.cs
- TextTreeRootNode.cs
- SspiWrapper.cs
- BulletedListEventArgs.cs
- SerializerProvider.cs
- XamlToRtfWriter.cs
- Vector3DCollection.cs
- ToolStripOverflowButton.cs
- SendKeys.cs
- sortedlist.cs
- Qualifier.cs
- JavaScriptSerializer.cs
- RijndaelManagedTransform.cs
- FormViewDeleteEventArgs.cs
- MD5.cs
- DiagnosticsElement.cs
- AutomationPropertyInfo.cs
- PropertyGeneratedEventArgs.cs
- AssociationSet.cs
- ReadContentAsBinaryHelper.cs
- ToolStripPanel.cs
- StickyNote.cs
- ValueExpressions.cs
- ComboBox.cs
- MediaTimeline.cs
- RelatedImageListAttribute.cs
- SqlEnums.cs
- WebProxyScriptElement.cs
- ToolStripContentPanel.cs
- EarlyBoundInfo.cs
- PictureBox.cs
- SystemResourceKey.cs
- TransformProviderWrapper.cs
- BlurEffect.cs
- BehaviorEditorPart.cs
- WindowsUpDown.cs
- ArraySegment.cs
- SQLSingle.cs
- TreeNodeBindingCollection.cs
- DataQuery.cs
- ReferenceConverter.cs
- DefaultHttpHandler.cs
- DataTableMappingCollection.cs
- BamlVersionHeader.cs
- EventMappingSettings.cs
- ColorTransform.cs
- LowerCaseStringConverter.cs
- SQLBoolean.cs
- HttpListenerContext.cs
- TranslateTransform3D.cs
- CommonObjectSecurity.cs
- Decorator.cs
- Random.cs
- DbDataAdapter.cs
- CommonDialog.cs
- GroupLabel.cs