private void OnItemClicked(object sender, ItemClickedEventArgs <IModelItem> e) { if (e.Item is INode) { graphControl.CurrentItem = e.Item; if ((ModifierKeys & (Keys.Shift | Keys.Control)) == (Keys.Shift | Keys.Control)) { if (Commands.EnterGroup.CanExecute(e.Item, graphControl)) { Commands.EnterGroup.Execute(e.Item, graphControl); e.Handled = true; } } else if ((ModifierKeys & Keys.Shift) == Keys.Shift) { var url = UrlMapper[(INode)e.Item]; var descriptionWindow = new DescriptionForm(); if (url != null) { descriptionWindow.Uri = url; descriptionWindow.Description = DescriptionMapper[(INode)e.Item]; descriptionWindow.ShowDialog(this); e.Handled = true; } } } }
private void ListAnimativeItem_ItemClicked(object sender, ItemClickedEventArgs e) { if (e.MouseButtonEventArgs.ChangedButton == SwitchButton) { SwitchFrontItem(); } }
protected virtual void ActionClicked(object sender, EventArgs e) { if (e != null) { ItemClickedEventArgs <ActionItem> args = (ItemClickedEventArgs <ActionItem>)e; //standard functionality: //if (((this.detailList != null) && (this.detailList.DataSourceID != null)) && (this.detailList.SelectedRows.Length != 0)) //overridden functionality: if (!String.IsNullOrEmpty(this.LastSelectedRow)) { this.actions.DataModel = this.LastSelectedRow; //standard functionality: //string str = string.Join("|", this.LastSelectedRow); string str = this.LastSelectedRow; int index = args.Item.Url.IndexOf('('); StringBuilder builder = new StringBuilder(); builder.Append(args.Item.Url.Substring(0, (index > 0) ? index : args.Item.Url.Length)); builder.Append("(ids="); builder.Append("{" + str + "}"); if (index > 0) { builder.Append(','); builder.Append(args.Item.Url.Substring(index + 1, (args.Item.Url.Length - index) - 2)); } builder.Append(')'); args.Item.Command = builder.ToString(); } } }
private void SceneListView1_ItemDoubleClicked(object sender, ItemClickedEventArgs e) { if (e.Clicks == 2 && e.Item is IEditableObject obj) { gL_Control.CameraTarget = obj.GetFocusPoint(); } }
private void sceneListView_ItemClicked(object sender, ItemClickedEventArgs e) { if (e.Clicks == 2 && e.Item is GL_EditorFramework.EditorDrawables.IEditableObject obj) { galaxyViewControl.CameraTarget = obj.GetFocusPoint(); } }
private void ListSubItem_ItemClicked(object sender, ItemClickedEventArgs e) { if (ToggleOnClick) { Toggle.Switch(); } }
private void listBar1_ItemClicked(object sender, ItemClickedEventArgs e) { if (e.MouseButton == MouseButtons.Right) { contextItem = e.Item; itemContextMenu.Show(listBar1, e.Location); } }
private void userListBox_ItemClicked(object sender, ItemClickedEventArgs args) { //点击头像代表已经读了吧 UserListItem userItem = args.Item as UserListItem; userItem.UnreadMessageCount = 0; UpdateUnreadMessageUI(); }
protected override void OnItemClicked(ItemClickedEventArgs args) { if (args.Button == MouseButtons.Left) { MessageListItem item = args.Item as MessageListItem; Message m = item.Message; Rectangle rect = item.Bounds; foreach (DrawingObject dobj in item.DrawingObjects) { RectangleF drawingObjRect = dobj.Offset(rect.X, rect.Y); switch (dobj.Type) { //头像 case DrawingObjectType.ProfilePhoto: if (drawingObjRect.Contains(args.Location)) { UserProfileControl control = new UserProfileControl(); control.User = item.User; control.Show(this.PointToScreen(args.Location)); return; } break; case DrawingObjectType.Image: case DrawingObjectType.File: { if (drawingObjRect.Contains(args.Location)) { //点击了图像,显示大图, 或者打开文件 string path; if (m.Type == MessageType.Image) { path = (m as ImageMessage).OriginPath; } else { path = (m as FileMessage).OriginFilePath; } if (LanFile.Exists(path)) { Process.Start(path); } } break; } } } } else if (args.Button == MouseButtons.Right) { //交给显示右键菜单 } }
private void audioListBox_ItemClicked(object sender, ItemClickedEventArgs e) { if (e.IsOutSide) { if (e.Button == MouseButtons.Right) { this.cmsAudioLBnoitem.Show(this.audioListBox, e.X, e.Y); IQueryable <String> query = SharedData.Database.Song.Where(s => s.Filename != null).Select(s => s.Artist.Name + " - " + s.Name); this.fastSearchControl.UpdateSource(query.ToArray(), MediaType.Song); } } else { IMedia media = e.Media; Song s = this.UpdateMediaInformation(media) as Song; if (this.tsBtnChart.Checked && currentMediaSelectedIndex != audioListBox.SelectedIndex) { this.chartTab.VisualizeChart(s); } if (this.tsBtnTagEditor.Checked && currentMediaSelectedIndex != audioListBox.SelectedIndex) { this.taggerTab.Update((IMedia)this.audioListBox.SelectedItem); } if (this.tsBtnTagLyrics.Checked && currentMediaSelectedIndex != audioListBox.SelectedIndex) { this.EnableLoadingCircle(true); if (audioListBox.SelectedItem != null) { Song song = (Song)audioListBox.SelectedItem; DownloadLyric(song); } } if (Settings.Default.ArtistImageFromInternet) { this.ShowCover(media); } this.ShowContextMenuOnItem(e, audioListBox); } if (this.fastSearchControl.Visible) { this.fastSearchControl.Visible = false; } this.currentMediaSelectedIndex = e.CurrentIndex; this.audioListBox.Refresh(); }
private void ShowContextMenuOnItem(ItemClickedEventArgs e, ShauniListBox slb) { if (e.Button == MouseButtons.Right) { /*if (Settings.Default.LearnAudio) * this.Learn(slb, true); * else * this.cmsAudioLBitem.Items["reccomandedToolStripMenuItem"].Text = "Recommended system is disabled...";*/ this.cmsAudioLBitem.Show(slb, e.X, e.Y); return; } }
/// <summary> /// Event handler for clicks on nodes to show or hide the node's label. /// </summary> /// <param name="sender">The object that raised the event.</param> /// <param name="args">Event arguments.</param> private void OnNodeClicked(object sender, ItemClickedEventArgs <IModelItem> args) { var graphNode = args.Item as INode; if (graphNode == null) { return; } var modelNode = graphNode.Tag as ModelNode; if (modelNode == null) { return; } modelNode.LabelVisible = !modelNode.LabelVisible; }
void onItemClicked(ItemClickedEventArgs args) { var curItem = args.Item; var prevItem = previouslyClickedItem; var isStrgPressed = KeyboardHelper.IsKeyPressed(ModifierKeys.Control); var isShiftPressed = KeyboardHelper.IsKeyPressed(ModifierKeys.Shift); var isAltPressed = KeyboardHelper.IsKeyPressed(ModifierKeys.Alt); if (isAltPressed) { return; } if (isStrgPressed) { if (curItem.IsSelected) { SelectedItemIDs.Remove(curItem.Item.ItemId); } else { SelectedItemIDs.Add(curItem.Item.ItemId); } } else if (isShiftPressed) { var section = this.Items.Subsection(curItem, prevItem); if (section.All(item => item.IsSelected)) { SelectedItemIDs.RemoveMany(section.Select(item => item.Item.ItemId)); } else { SelectedItemIDs.AddRange(section.Select(item => item.Item.ItemId).Except(this.SelectedItemIDs.Items)); } } else { if (SelectedItemIDs.Count == 1 && SelectedItemIDs.Items.Contains(curItem.Item.ItemId)) { return; } this.SelectedItemIDs.Clear(); SelectedItemIDs.Add(curItem.Item.ItemId); } previouslyClickedItem = curItem; }
private void Item_ItemClicked(object sender, ItemClickedEventArgs <T> e) { //if (!clickable) // return; IconItem <T> item = (IconItem <T>)sender; if (selectedItem != null && !selectedItem.Equals(item)) { selectedItem.DeselectItem(); } item.SelectItem(); selectedItem = item; ItemClicked(sender, e); }
private void KanBan_ItemClicked(object sender, ItemClickedEventArgs e) { var childWindow = new CreateEditItemChildWindow(); var parameter = e.Parameter; if (parameter == "EDIT") { childWindow.DataContext = ((ContractSalesItem)e.Source).Clone(); childWindow.Closed += ChildWindowEditItem_Closed; childWindow.Show(); } else if (parameter == "DELETE") { DeleteFromRestServerContractSalesItem((ContractSalesItem)e.Source); _contractSalesitems.Remove(((ContractSalesItem)e.Source)); MyKanBanControl.Refresh(); } }
private void IconView_ItemClicked(object sender, ItemClickedEventArgs <ItemModelBase> e) { selectedId = e.Child.Id; ItemModelBase model; details.Title = "Component"; model = new ComponentModel(e.Child.ParentId, e.Child.Id); details.ItemName = model.Description; details.DisplayName = model.DisplayName; details.Price = model.Price; details.Set(e.Child.Id, 1, false); details.ParentId = parent; IconItem <ItemModelBase> icon = (IconItem <ItemModelBase>)sender; if (level == 1) { ; } else { if (fullViewSelected && icon.IsChecked) { details.EnableGroup(); ComponentModel subModel = new ComponentModel(parent, e.Child.Id, true); details.Group = subModel.Group; } else if (fullViewSelected && !icon.IsChecked) { details.DisableGroup(); details.Group = 0; } else if (!fullViewSelected) { details.EnableGroup(); ComponentModel subModel = new ComponentModel(parent, e.Child.Id, true); details.Group = subModel.Group; } } }
private void imageListBox_ItemClicked(object sender, ItemClickedEventArgs e) { if (e.IsOutSide) { if (e.Button == MouseButtons.Right) { this.cmsAudioLBnoitem.Show(this.imageListBox, e.X, e.Y); IQueryable <String> query = SharedData.Database.Picture.Select(s => s.Name); this.fastSearchControl.UpdateSource(query.ToArray(), MediaType.Picture); } } else { IMedia media = e.Media; Picture p = this.UpdateMediaInformation(media) as Picture; if (File.Exists(p.Filename)) { this.mainPictureBox.Image = Image.FromFile(p.Filename); } else { SharedData.Logger.Append("The file at '" + p.Filename + "' doesn't exist.", 1); e.IsItemAlive = false; this.mainPictureBox.Image.Dispose(); this.mainPictureBox.Image = Properties.Resources.ShauniLogo; } this.ShowContextMenuOnItem(e, imageListBox); } if (this.fastSearchControl.Visible) { this.fastSearchControl.Visible = false; } this.currentMediaSelectedIndex = e.CurrentIndex; this.imageListBox.Refresh(); }
/// <summary> /// Handles item clicked event. /// </summary> /// <param name="sender">The sender.</param> /// <param name="args">The <see cref="EventArgs" /> instance containing the event data.</param> protected internal virtual void ItemClicked(object sender, EventArgs args) { ItemClickedEventArgs <ContextItem> clickArgs = args as ItemClickedEventArgs <ContextItem>; if (clickArgs == null) { return; } if (clickArgs.Item == null) { return; } if (string.IsNullOrEmpty(clickArgs.Item.Name)) { return; } Sitecore.Context.User.Profile.SetSelectedShopContext(clickArgs.Item.Name); Sitecore.Context.User.Profile.Save(); this.Refresh(); }
private void listBar1_ItemDoubleClicked(object sender, ItemClickedEventArgs e) { }
public ItemClickedEvent(MouseEventArgs args, ICompletionItem item) { this.args = new ItemClickedEventArgs(args, item); }
private void listBar1_ItemClicked(object sender, ItemClickedEventArgs e) { SelectPointer(); }
/// <summary> /// Called when an item has been double clicked. /// </summary> /// <param name="o">The source of the event.</param> /// <param name="itemClickedEventArgs">The event argument instance containing the event data.</param> private async void OnItemDoubleClicked(object o, ItemClickedEventArgs <IModelItem> itemClickedEventArgs) { graphControl.CurrentItem = itemClickedEventArgs.Item; await ZoomToCurrentItem(); }
protected virtual void OnItemClicked(ItemClickedEventArgs e) { ItemClicked?.Invoke(this, e); }
private void IconView_ItemClicked(object sender, ItemClickedEventArgs <ItemModelBase> e) { SelectItem(e.Child); }