本文整理汇总了C#中Microsoft.LiveLabs.Html.HtmlEvent类的典型用法代码示例。如果您正苦于以下问题:C# HtmlEvent类的具体用法?C# HtmlEvent怎么用?C# HtmlEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HtmlEvent类属于Microsoft.LiveLabs.Html命名空间,在下文中一共展示了HtmlEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FocusNext
internal override bool FocusNext(HtmlEvent evt)
{
if (!Visible)
return false;
Focused = Control.FocusNext(evt);
return Focused;
}
示例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;
}
示例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);
}
示例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();
}
示例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();
}
}
示例6: OnKeypress
private void OnKeypress(HtmlEvent evt)
{
if (!CUIUtility.IsNullOrUndefined(evt))
{
if (evt.KeyCode == (int)Key.Enter)
{
OnChange(evt);
Utility.CancelEventUtility(evt, false, true);
}
}
}
示例7: OnMouseover
private void OnMouseover(HtmlEvent args)
{
OnBeginFocus();
if (!Enabled)
return;
if (string.IsNullOrEmpty(Properties.CommandPreview))
return;
DisplayedComponent.RaiseCommandEvent(Properties.CommandPreview,
CommandType.Preview,
StateProperties);
}
示例8: OnFocus
private void OnFocus(HtmlEvent args)
{
OnBeginFocus();
if (!Enabled)
return;
_elmDefaultInput.PerformSelect();
Root.LastFocusedControl = this;
}
示例9: OnKeyDown
private void OnKeyDown(HtmlEvent args)
{
if (!CUIUtility.IsNullOrUndefined(args))
{
if ((Key)args.KeyCode == Key.Enter)
OnLabelClick(args);
}
}
示例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);
}
示例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();
}
示例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);
}
}
示例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);
}
}
}
示例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();
}
示例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();
}
}