本文整理汇总了C#中Microsoft.LiveLabs.Html.HtmlEvent类的典型用法代码示例。如果您正苦于以下问题:C# HtmlEvent类的具体用法?C# HtmlEvent怎么用?C# HtmlEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HtmlEvent类属于Microsoft.LiveLabs.Html命名空间,在下文中一共展示了HtmlEvent类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: FocusNext
internal override bool FocusNext(HtmlEvent evt)
{
if (!Visible)
return false;
Focused = Control.FocusNext(evt);
return Focused;
}
开发者ID:modulexcite,项目名称:IL2JS,代码行数:7,代码来源:menuitem.cs
示例2: LaunchContextMenu
/// <summary>
/// Obsolete API will be removed soon
/// </summary>
/// <param name="evt">The DomEvent that triggered the launch(usually a mouse click)</param>
internal bool LaunchContextMenu(HtmlElement targetElement, HtmlEvent evt)
{
_targetElement = targetElement;
_launchPosition = GetMenuPosition(evt);
LaunchMenu(null);
Menu.FocusOnFirstItem(evt);
return true;
}
开发者ID:modulexcite,项目名称:IL2JS,代码行数:12,代码来源:contextmenulauncher.cs
示例3: OnMenuButtonClick
/// <summary>
/// Invoked when the Menu is opened
/// </summary>
protected void OnMenuButtonClick(HtmlEvent evt)
{
if (!Enabled)
return;
LaunchContextMenu(null, evt);
DisplayedComponent.RaiseCommandEvent(Properties.CommandMenuOpen,
CommandType.MenuCreation,
null);
}
开发者ID:modulexcite,项目名称:IL2JS,代码行数:13,代码来源:contextmenucontrol.cs
示例4: RibbonStartInit
private void RibbonStartInit(HtmlEvent args)
{
if (!NativeUtility.RibbonReadyForInit())
return;
if (!CUIUtility.IsNullOrUndefined(args))
_ribbon.SetField<bool>("initialTabSelectedByUser", true);
Utility.CancelEventUtility(args, false, true);
if (_ribbon.GetField<bool>("initStarted"))
return;
_ribbon.SetField<bool>("initStarted", true);
// Get the name of the tab that was just selected
Anchor tab = (Anchor)args.CurrentTargetElement;
ListItem parent = (ListItem)tab.ParentNode;
string initialTabId = parent.Id.Substring(0, parent.Id.IndexOf("-title"));
string firstTabId = "";
if (!string.IsNullOrEmpty(initialTabId))
{
firstTabId = _ribbon.GetField<string>("initialTabId");
_ribbon.SetField<string>("initialTabId", initialTabId);
}
_ribbon.SetField<bool>("buildMinimized", false);
if(!string.IsNullOrEmpty(initialTabId))
{
NativeUtility.RibbonOnStartInit(_ribbon);
ListItem oldTab = (ListItem)Browser.Document.GetById(firstTabId + "-title");
if (!CUIUtility.IsNullOrUndefined(oldTab))
oldTab.ClassName = "ms-cui-tt";
ListItem newTab = (ListItem)Browser.Document.GetById(initialTabId + "-title");
if (!CUIUtility.IsNullOrUndefined(newTab))
newTab.ClassName = "ms-cui-tt ms-cui-tt-s";
}
RibbonInitFunc1();
}
开发者ID:modulexcite,项目名称:IL2JS,代码行数:42,代码来源:page.cs
示例5: OnTitleClick
/// <summary>
/// Handle when a tab title is clicked.
/// This causes this tab to become the selected one.
/// </summary>
/// <param name="evt"></param>
private void OnTitleClick(HtmlEvent args)
{
#if PERF_METRICS
PMetrics.PerfMark(PMarker.perfCUIRibbonTabSwitchWarmStart);
#endif
Utility.CancelEventUtility(args, false, true);
_shouldProcessSingleClick = true;
// If the tab is selected, then we need to make sure that the user didn't try to double click
// So, we have to wait a bit to let the the double click event fire.
// Double clicking only works on the selected tab so if this tab is not selected, then
// we can process the single click right away.
if (Selected)
{
Browser.Window.SetTimeout(TitleClickCallback, 500);
}
else
{
TitleClickCallback();
}
}
开发者ID:modulexcite,项目名称:IL2JS,代码行数:26,代码来源:tab.cs
示例6: OnKeypress
private void OnKeypress(HtmlEvent evt)
{
if (!CUIUtility.IsNullOrUndefined(evt))
{
if (evt.KeyCode == (int)Key.Enter)
{
OnChange(evt);
Utility.CancelEventUtility(evt, false, true);
}
}
}
开发者ID:modulexcite,项目名称:IL2JS,代码行数:11,代码来源:textbox.cs
示例7: OnMouseover
private void OnMouseover(HtmlEvent args)
{
OnBeginFocus();
if (!Enabled)
return;
if (string.IsNullOrEmpty(Properties.CommandPreview))
return;
DisplayedComponent.RaiseCommandEvent(Properties.CommandPreview,
CommandType.Preview,
StateProperties);
}
开发者ID:modulexcite,项目名称:IL2JS,代码行数:13,代码来源:textbox.cs
示例8: OnFocus
private void OnFocus(HtmlEvent args)
{
OnBeginFocus();
if (!Enabled)
return;
_elmDefaultInput.PerformSelect();
Root.LastFocusedControl = this;
}
开发者ID:modulexcite,项目名称:IL2JS,代码行数:9,代码来源:textbox.cs
示例9: OnKeyDown
private void OnKeyDown(HtmlEvent args)
{
if (!CUIUtility.IsNullOrUndefined(args))
{
if ((Key)args.KeyCode == Key.Enter)
OnLabelClick(args);
}
}
开发者ID:modulexcite,项目名称:IL2JS,代码行数:8,代码来源:checkbox.cs
示例10: FocusOnLastItem
internal override void FocusOnLastItem(HtmlEvent evt)
{
int count = Children.Count;
if (count == 0)
return;
if (_focusedIndex > -1)
((Component)Children[_focusedIndex]).ResetFocusedIndex();
_focusedIndex = count - 1;
((Component)Children[_focusedIndex]).FocusOnLastItem(evt);
}
开发者ID:modulexcite,项目名称:IL2JS,代码行数:11,代码来源:menusection.cs
示例11: OnModalBodyClick
// No matter where we are in the stack, a click anywhere other than on a menu should close all menus
public override void OnModalBodyClick(HtmlEvent args)
{
Root.CloseAllMenus();
}
开发者ID:modulexcite,项目名称:IL2JS,代码行数:5,代码来源:flyoutanchor.cs
示例12: OnModalKeyPress
public override void OnModalKeyPress(HtmlEvent args)
{
if (!CUIUtility.IsNullOrUndefined(args))
{
if ((((Root.TextDirection == Direction.LTR && args.KeyCode == (int)Key.Left) ||
(Root.TextDirection == Direction.RTL && args.KeyCode == (int)Key.Right)) &&
(DisplayedComponent.DisplayMode).StartsWith("Menu")) || args.KeyCode == (int)Key.Esc)
{
Root.CloseMenuStack(this);
return;
}
}
if (IsGroupPopup)
{
if (_focusSet)
return;
if (Menu.SetFocusOnFirstControl())
_focusSet = true;
Utility.CancelEventUtility(args, false, true);
}
else
{
base.OnModalKeyPress(args);
}
}
开发者ID:modulexcite,项目名称:IL2JS,代码行数:27,代码来源:flyoutanchor.cs
示例13: OnKeyPress
private void OnKeyPress(HtmlEvent args)
{
CloseToolTip();
if (!Enabled)
return;
int key = args.KeyCode;
if (MenuLaunched)
{
if ((Root.TextDirection == Direction.LTR && key == (int)Key.Right) ||
(Root.TextDirection == Direction.RTL && key == (int)Key.Left))
Menu.FocusOnFirstItem(args);
}
else
{
if (key == (int)Key.Enter || key == (int)Key.Space ||
(((Root.TextDirection == Direction.LTR && key == (int)Key.Right) ||
(Root.TextDirection == Direction.RTL && key == (int)Key.Left)) &&
(!args.CtrlKey || !args.ShiftKey)))
{
LaunchedByKeyboard = true;
ControlComponent comp = DisplayedComponent;
Anchor elm = (Anchor)comp.ElementInternal;
string command = Properties.Command;
if (!string.IsNullOrEmpty(command))
{
comp.RaiseCommandEvent(command,
CommandType.MenuCreation,
null);
}
LaunchMenuInternal(elm);
}
}
}
开发者ID:modulexcite,项目名称:IL2JS,代码行数:34,代码来源:flyoutanchor.cs
示例14: OnMenuMouseout
private void OnMenuMouseout(HtmlEvent args)
{
OnEndFocus();
if (Utility.IsDescendantOf(DisplayedComponent.ElementInternal, args.RelatedTarget))
return;
if (MenuLaunched)
{
// If mouse is over any menu that is nested in this one, don't close
int mlIndex = Root.MenuLauncherStack.IndexOf(this);
for (int i = mlIndex; i < Root.MenuLauncherStack.Count; i++)
{
if (Utility.IsDescendantOf(Root.MenuLauncherStack[i].Menu.ElementInternal, args.RelatedTarget))
return;
}
SetCloseMenuStackTimeout();
}
RemoveHighlight();
}
开发者ID:modulexcite,项目名称:IL2JS,代码行数:21,代码来源:flyoutanchor.cs
示例15: OnMouseleave
private void OnMouseleave(HtmlEvent args)
{
OnEndFocus();
if (!Enabled)
return;
if (MenuLaunched)
{
// If mouse is over any menu that is nested in this one, don't close
int mlIndex = Root.MenuLauncherStack.IndexOf(this);
for (int i = mlIndex; i < Root.MenuLauncherStack.Count; i++)
{
if (Utility.IsDescendantOf(((MenuLauncher)Root.MenuLauncherStack[i]).Menu.ElementInternal, args.ToElement))
return;
}
SetCloseMenuStackTimeout();
}
}
开发者ID:modulexcite,项目名称:IL2JS,代码行数:19,代码来源:flyoutanchor.cs
示例16: OnArrowButtonKeyPress
protected void OnArrowButtonKeyPress(HtmlEvent args)
{
CloseToolTip();
if (!Enabled)
return;
int key = args.KeyCode;
if (key == (int)Key.Enter || key == (int)Key.Space || key == (int)Key.Down)
{
LaunchedByKeyboard = true;
LaunchMenuInternal(args);
}
}
开发者ID:modulexcite,项目名称:IL2JS,代码行数:13,代码来源:dropdown.cs
示例17: OnClick
protected override void OnClick(HtmlEvent args)
{
// evt.PreventDefault() will prevent checkbox state from being toggled
CloseToolTip();
if (!Enabled)
return;
CommandType ct = CommandType.IgnoredByMenu;
ControlComponent comp = DisplayedComponent;
// Choose appropriate check box
switch (comp.DisplayMode)
{
case "Small":
StateProperties[CheckBoxCommandProperties.On] = _elmSmallCheckboxInput.Checked.ToString();
break;
case "Medium":
StateProperties[CheckBoxCommandProperties.On] = _elmMediumCheckboxInput.Checked.ToString();
break;
default:
EnsureValidDisplayMode(comp.DisplayMode);
return;
}
// Send command
comp.RaiseCommandEvent(Properties.Command,
ct,
StateProperties);
if (Root.PollForState)
PollForStateAndUpdate();
else
SetState(Utility.IsTrue(StateProperties[CheckBoxCommandProperties.On]));
}
开发者ID:modulexcite,项目名称:IL2JS,代码行数:33,代码来源:checkbox.cs
示例18: FocusPrevious
internal override bool FocusPrevious(HtmlEvent evt)
{
int count = Children.Count;
if (_focusedIndex == -1)
_focusedIndex = count - 1;
int i = _focusedIndex;
while (i > -1)
{
Component comp = Children[i];
if (comp.FocusPrevious(evt))
{
// If focus is not moving, don't reset the focus of the menu item
if (i != _focusedIndex)
{
((Component)Children[_focusedIndex]).ResetFocusedIndex();
_focusedIndex = i;
}
return true;
}
i--;
}
if (count > 0)
((Component)Children[_focusedIndex]).ResetFocusedIndex();
_focusedIndex = -1;
return false;
}
开发者ID:modulexcite,项目名称:IL2JS,代码行数:28,代码来源:menusection.cs
示例19: OnLabelClick
private void OnLabelClick(HtmlEvent args)
{
Utility.CancelEventUtility(args, false, true);
CloseToolTip();
if (!Enabled)
return;
Root.LastFocusedControl = this;
// Toggle the checkbox and send the command
SetState(!_elmMediumCheckboxInput.Checked);
OnClick(args);
}
开发者ID:modulexcite,项目名称:IL2JS,代码行数:13,代码来源:checkbox.cs
示例20: FocusNext
internal override bool FocusNext(HtmlEvent evt)
{
if (_focusedIndex == -1)
_focusedIndex = 0;
int i = _focusedIndex;
while (i < Children.Count)
{
Component comp = Children[i];
if (comp.FocusNext(evt))
{
// If focus is not moving, don't reset the focus of the menu item
if (i != _focusedIndex)
{
if (!CUIUtility.IsNullOrUndefined(Children[_focusedIndex]))
((Component)Children[_focusedIndex]).ResetFocusedIndex();
_focusedIndex = i;
}
return true;
}
i++;
}
if (Children.Count > 0)
((Component)Children[_focusedIndex]).ResetFocusedIndex();
_focusedIndex = -1;
return false;
}
开发者ID:modulexcite,项目名称:IL2JS,代码行数:29,代码来源:menusection.cs
注:本文中的Microsoft.LiveLabs.Html.HtmlEvent类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论