Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / WinForms / Managed / System / WinForms / HtmlElementEventArgs.cs / 1 / HtmlElementEventArgs.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.Runtime.InteropServices;
using System.Net;
namespace System.Windows.Forms {
///
///
/// [To be supplied.]
///
public sealed class HtmlElementEventArgs : EventArgs {
private UnsafeNativeMethods.IHTMLEventObj htmlEventObj;
private HtmlShimManager shimManager;
internal HtmlElementEventArgs(HtmlShimManager shimManager, UnsafeNativeMethods.IHTMLEventObj eventObj) {
this.htmlEventObj = eventObj;
Debug.Assert(this.NativeHTMLEventObj != null, "The event object should implement IHTMLEventObj");
this.shimManager = shimManager;
}
private UnsafeNativeMethods.IHTMLEventObj NativeHTMLEventObj {
get {
return this.htmlEventObj;
}
}
///
///
/// [To be supplied.]
///
public MouseButtons MouseButtonsPressed {
get {
MouseButtons buttons = MouseButtons.None;
int nButtons = this.NativeHTMLEventObj.GetButton();
if ((nButtons & 1) != 0) {
buttons |= MouseButtons.Left;
}
if ((nButtons & 2) != 0) {
buttons |= MouseButtons.Right;
}
if ((nButtons & 4) != 0) {
buttons |= MouseButtons.Middle;
}
return buttons;
}
}
///
///
/// [To be supplied.]
///
public Point ClientMousePosition {
get {
return new Point(this.NativeHTMLEventObj.GetClientX(), this.NativeHTMLEventObj.GetClientY());
}
}
///
///
/// [To be supplied.]
///
public Point OffsetMousePosition {
get {
return new Point(this.NativeHTMLEventObj.GetOffsetX(), this.NativeHTMLEventObj.GetOffsetY());
}
}
///
///
/// [To be supplied.]
///
public Point MousePosition {
get {
return new Point(this.NativeHTMLEventObj.GetX(), this.NativeHTMLEventObj.GetY());
}
}
///
///
/// [To be supplied.]
///
public bool BubbleEvent {
get {
return !this.NativeHTMLEventObj.GetCancelBubble();
}
set {
this.NativeHTMLEventObj.SetCancelBubble(!value);
}
}
///
///
/// [To be supplied.]
///
public int KeyPressedCode {
get {
return this.NativeHTMLEventObj.GetKeyCode();
}
}
///
///
/// Indicates whether the Alt key was pressed, if this information is
/// provided to the IHtmlEventObj
///
public bool AltKeyPressed
{
get
{
return this.NativeHTMLEventObj.GetAltKey();
}
}
///
///
/// Indicates whether the Ctrl key was pressed, if this information is
/// provided to the IHtmlEventObj
///
public bool CtrlKeyPressed
{
get
{
return this.NativeHTMLEventObj.GetCtrlKey();
}
}
///
///
/// Indicates whether the Shift key was pressed, if this information is
/// provided to the IHtmlEventObj
///
public bool ShiftKeyPressed
{
get
{
return this.NativeHTMLEventObj.GetShiftKey();
}
}
///
///
/// [To be supplied.]
///
public string EventType {
get {
return this.NativeHTMLEventObj.GetEventType();
}
}
///
///
/// [To be supplied.]
///
public bool ReturnValue {
get {
object obj = this.NativeHTMLEventObj.GetReturnValue();
return obj == null ? true : (bool)obj;
}
set {
object objValue = value;
this.NativeHTMLEventObj.SetReturnValue(objValue);
}
}
///
///
/// [To be supplied.]
///
[Browsable(false), EditorBrowsable(EditorBrowsableState.Advanced)]
public HtmlElement FromElement {
get {
UnsafeNativeMethods.IHTMLElement htmlElement = this.NativeHTMLEventObj.GetFromElement();
return htmlElement == null ? null : new HtmlElement(shimManager, htmlElement);
}
}
///
///
/// [To be supplied.]
///
[Browsable(false), EditorBrowsable(EditorBrowsableState.Advanced)]
public HtmlElement ToElement {
get {
UnsafeNativeMethods.IHTMLElement htmlElement = this.NativeHTMLEventObj.GetToElement();
return htmlElement == null ? null : new HtmlElement(shimManager, htmlElement);
}
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// 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.Runtime.InteropServices;
using System.Net;
namespace System.Windows.Forms {
///
///
/// [To be supplied.]
///
public sealed class HtmlElementEventArgs : EventArgs {
private UnsafeNativeMethods.IHTMLEventObj htmlEventObj;
private HtmlShimManager shimManager;
internal HtmlElementEventArgs(HtmlShimManager shimManager, UnsafeNativeMethods.IHTMLEventObj eventObj) {
this.htmlEventObj = eventObj;
Debug.Assert(this.NativeHTMLEventObj != null, "The event object should implement IHTMLEventObj");
this.shimManager = shimManager;
}
private UnsafeNativeMethods.IHTMLEventObj NativeHTMLEventObj {
get {
return this.htmlEventObj;
}
}
///
///
/// [To be supplied.]
///
public MouseButtons MouseButtonsPressed {
get {
MouseButtons buttons = MouseButtons.None;
int nButtons = this.NativeHTMLEventObj.GetButton();
if ((nButtons & 1) != 0) {
buttons |= MouseButtons.Left;
}
if ((nButtons & 2) != 0) {
buttons |= MouseButtons.Right;
}
if ((nButtons & 4) != 0) {
buttons |= MouseButtons.Middle;
}
return buttons;
}
}
///
///
/// [To be supplied.]
///
public Point ClientMousePosition {
get {
return new Point(this.NativeHTMLEventObj.GetClientX(), this.NativeHTMLEventObj.GetClientY());
}
}
///
///
/// [To be supplied.]
///
public Point OffsetMousePosition {
get {
return new Point(this.NativeHTMLEventObj.GetOffsetX(), this.NativeHTMLEventObj.GetOffsetY());
}
}
///
///
/// [To be supplied.]
///
public Point MousePosition {
get {
return new Point(this.NativeHTMLEventObj.GetX(), this.NativeHTMLEventObj.GetY());
}
}
///
///
/// [To be supplied.]
///
public bool BubbleEvent {
get {
return !this.NativeHTMLEventObj.GetCancelBubble();
}
set {
this.NativeHTMLEventObj.SetCancelBubble(!value);
}
}
///
///
/// [To be supplied.]
///
public int KeyPressedCode {
get {
return this.NativeHTMLEventObj.GetKeyCode();
}
}
///
///
/// Indicates whether the Alt key was pressed, if this information is
/// provided to the IHtmlEventObj
///
public bool AltKeyPressed
{
get
{
return this.NativeHTMLEventObj.GetAltKey();
}
}
///
///
/// Indicates whether the Ctrl key was pressed, if this information is
/// provided to the IHtmlEventObj
///
public bool CtrlKeyPressed
{
get
{
return this.NativeHTMLEventObj.GetCtrlKey();
}
}
///
///
/// Indicates whether the Shift key was pressed, if this information is
/// provided to the IHtmlEventObj
///
public bool ShiftKeyPressed
{
get
{
return this.NativeHTMLEventObj.GetShiftKey();
}
}
///
///
/// [To be supplied.]
///
public string EventType {
get {
return this.NativeHTMLEventObj.GetEventType();
}
}
///
///
/// [To be supplied.]
///
public bool ReturnValue {
get {
object obj = this.NativeHTMLEventObj.GetReturnValue();
return obj == null ? true : (bool)obj;
}
set {
object objValue = value;
this.NativeHTMLEventObj.SetReturnValue(objValue);
}
}
///
///
/// [To be supplied.]
///
[Browsable(false), EditorBrowsable(EditorBrowsableState.Advanced)]
public HtmlElement FromElement {
get {
UnsafeNativeMethods.IHTMLElement htmlElement = this.NativeHTMLEventObj.GetFromElement();
return htmlElement == null ? null : new HtmlElement(shimManager, htmlElement);
}
}
///
///
/// [To be supplied.]
///
[Browsable(false), EditorBrowsable(EditorBrowsableState.Advanced)]
public HtmlElement ToElement {
get {
UnsafeNativeMethods.IHTMLElement htmlElement = this.NativeHTMLEventObj.GetToElement();
return htmlElement == null ? null : new HtmlElement(shimManager, htmlElement);
}
}
}
}
// 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
- DataGridBoolColumn.cs
- MatrixAnimationUsingPath.cs
- TextTreeObjectNode.cs
- IPEndPointCollection.cs
- ProcessProtocolHandler.cs
- WebServiceReceiveDesigner.cs
- PageThemeBuildProvider.cs
- VirtualDirectoryMappingCollection.cs
- Set.cs
- Enum.cs
- AssociationTypeEmitter.cs
- DataGridViewCellConverter.cs
- Task.cs
- MembershipSection.cs
- PerspectiveCamera.cs
- FileClassifier.cs
- SystemIPInterfaceProperties.cs
- FormViewPageEventArgs.cs
- UnauthorizedWebPart.cs
- DoWorkEventArgs.cs
- RequiredFieldValidator.cs
- ProfilePropertyNameValidator.cs
- UrlMappingsSection.cs
- HttpModuleAction.cs
- MissingFieldException.cs
- ListenerElementsCollection.cs
- PerformanceCounterPermission.cs
- UrlAuthorizationModule.cs
- MarkupCompilePass1.cs
- Point3DKeyFrameCollection.cs
- ExpressionNormalizer.cs
- RenameRuleObjectDialog.cs
- DataMisalignedException.cs
- MarkupCompiler.cs
- WindowCollection.cs
- BuilderPropertyEntry.cs
- InvokePatternIdentifiers.cs
- BinaryUtilClasses.cs
- Pick.cs
- ByteRangeDownloader.cs
- CodeIdentifiers.cs
- PageBuildProvider.cs
- RadioButtonPopupAdapter.cs
- __TransparentProxy.cs
- formatter.cs
- Attributes.cs
- ProjectionQueryOptionExpression.cs
- InputManager.cs
- LockCookie.cs
- ContainerControl.cs
- ResourcePart.cs
- SyntaxCheck.cs
- DialogResultConverter.cs
- ObfuscateAssemblyAttribute.cs
- ObfuscateAssemblyAttribute.cs
- EpmHelper.cs
- UniqueID.cs
- MemoryFailPoint.cs
- Visual3D.cs
- StreamResourceInfo.cs
- HttpConfigurationSystem.cs
- CorrelationHandle.cs
- DbParameterCollectionHelper.cs
- RequestCacheEntry.cs
- FlowLayout.cs
- PlainXmlSerializer.cs
- DbConnectionPoolOptions.cs
- DefaultTextStoreTextComposition.cs
- PhysicalFontFamily.cs
- RichTextBox.cs
- ExportFileRequest.cs
- ExtendedPropertyCollection.cs
- PolyQuadraticBezierSegment.cs
- PropertyInfoSet.cs
- UniqueConstraint.cs
- RNGCryptoServiceProvider.cs
- ExclusiveHandle.cs
- XamlPointCollectionSerializer.cs
- DockAndAnchorLayout.cs
- ExpressionList.cs
- BindUriHelper.cs
- TabControl.cs
- DocumentPageView.cs
- WebPartConnectionsCancelEventArgs.cs
- DataSourceControlBuilder.cs
- XmlElement.cs
- DesignTimeXamlWriter.cs
- RMEnrollmentPage2.cs
- SiteMapDataSourceView.cs
- HMACMD5.cs
- GridViewPageEventArgs.cs
- ZipIOCentralDirectoryDigitalSignature.cs
- SecurityProtocol.cs
- ProcessProtocolHandler.cs
- TextBox.cs
- FixedSOMPageConstructor.cs
- EntityContainerEntitySetDefiningQuery.cs
- CodeCatchClauseCollection.cs
- EmptyStringExpandableObjectConverter.cs
- WebControlsSection.cs