Code:
/ 4.0 / 4.0 / 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 { ////// /// [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; } } ///[To be supplied.] ///public void Dispose() { this.htmlHistory = null; this.disposed = true; GC.SuppressFinalize(this); } /// /// /// 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); } } ///[To be supplied.] ////// /// [SuppressMessage("Microsoft.Usage", "CA2234:PassSystemUriObjectsInsteadOfStrings")] public void Go(Uri url) { Go(url.ToString()); } ///Go to a specific Uri 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 a specific url(string) in the history ////// /// public void Go(int relativePosition) { object loc = (object)relativePosition; this.NativeOmHistory.Go(ref loc); } ///Go to the specified position in the history list ////// /// public object DomHistory { get { return this.NativeOmHistory; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //[To be supplied.] ///// 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 { ////// /// [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; } } ///[To be supplied.] ///public void Dispose() { this.htmlHistory = null; this.disposed = true; GC.SuppressFinalize(this); } /// /// /// 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); } } ///[To be supplied.] ////// /// [SuppressMessage("Microsoft.Usage", "CA2234:PassSystemUriObjectsInsteadOfStrings")] public void Go(Uri url) { Go(url.ToString()); } ///Go to a specific Uri 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 a specific url(string) in the history ////// /// public void Go(int relativePosition) { object loc = (object)relativePosition; this.NativeOmHistory.Go(ref loc); } ///Go to the specified position in the history list ////// /// public object DomHistory { get { return this.NativeOmHistory; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.[To be supplied.] ///
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- RowTypePropertyElement.cs
- PointF.cs
- UpdateException.cs
- StateMachineHelpers.cs
- CompilationRelaxations.cs
- BindingWorker.cs
- TemplatePagerField.cs
- EllipseGeometry.cs
- ColumnReorderedEventArgs.cs
- OrderByBuilder.cs
- NativeMethodsOther.cs
- baseshape.cs
- DbTransaction.cs
- UserPersonalizationStateInfo.cs
- ProjectionPlanCompiler.cs
- MenuItemStyleCollectionEditor.cs
- DataRecord.cs
- StdValidatorsAndConverters.cs
- Compiler.cs
- ProviderMetadata.cs
- BuildProvidersCompiler.cs
- ExtensionQuery.cs
- SQLString.cs
- StringConverter.cs
- querybuilder.cs
- MessageHeaderDescriptionCollection.cs
- SelectQueryOperator.cs
- LocalizationParserHooks.cs
- GenericIdentity.cs
- SystemMulticastIPAddressInformation.cs
- ImageMap.cs
- CrossContextChannel.cs
- UpdateTracker.cs
- counter.cs
- EntityProviderServices.cs
- ToolStrip.cs
- FreezableCollection.cs
- ApplicationSettingsBase.cs
- NameNode.cs
- RelationshipWrapper.cs
- basemetadatamappingvisitor.cs
- Utils.cs
- HtmlSelect.cs
- PageTheme.cs
- CqlLexerHelpers.cs
- CompilerGeneratedAttribute.cs
- ToolStripLocationCancelEventArgs.cs
- TextEndOfLine.cs
- SortQuery.cs
- BamlBinaryReader.cs
- RelationalExpressions.cs
- ResolveResponseInfo.cs
- Nullable.cs
- TreeNodeStyleCollection.cs
- SqlDataReaderSmi.cs
- HeaderCollection.cs
- Int32CollectionValueSerializer.cs
- DesignerTransactionCloseEvent.cs
- TemplatedWizardStep.cs
- ItemContainerGenerator.cs
- WindowsEditBoxRange.cs
- ObjectDataSource.cs
- DbReferenceCollection.cs
- XPathAxisIterator.cs
- MobileUserControlDesigner.cs
- ProtectedConfigurationProviderCollection.cs
- EventLogPermissionEntryCollection.cs
- SystemIcmpV4Statistics.cs
- PointCollection.cs
- OneOf.cs
- dataprotectionpermission.cs
- StrongBox.cs
- Cursor.cs
- InputLanguageManager.cs
- Grammar.cs
- MsmqHostedTransportConfiguration.cs
- HttpModulesSection.cs
- PositiveTimeSpanValidator.cs
- Menu.cs
- ScopelessEnumAttribute.cs
- MaskedTextBoxTextEditorDropDown.cs
- DoubleKeyFrameCollection.cs
- AlternateView.cs
- PolicyLevel.cs
- File.cs
- DataGridViewAdvancedBorderStyle.cs
- BamlWriter.cs
- HtmlLabelAdapter.cs
- NestPullup.cs
- DataGridViewAdvancedBorderStyle.cs
- Parser.cs
- WeakEventTable.cs
- ResolvedKeyFrameEntry.cs
- ResourcesGenerator.cs
- TranslateTransform.cs
- AssociationTypeEmitter.cs
- GregorianCalendarHelper.cs
- BulletedListEventArgs.cs
- DiagnosticStrings.cs
- MembershipPasswordException.cs