void RibbonListItem_Click(object sender, EventArgs e) { RibbonListItem rli = (RibbonListItem)sender; C1JumpPath jumpPath = (C1JumpPath)rli.Tag; OpenFile(jumpPath.Path); }
private void btnAddJumpPath_Click(object sender, EventArgs e) { string categoryName = "JumpPath Category"; JumpItemCollection items = taskbarButton.JumpList.Items; foreach (string s in _jumpPathFiles) { C1JumpPath jumpPath = new C1JumpPath(); jumpPath.CustomCategory = categoryName; jumpPath.Path = _destinationPrefix + s; items.Add(jumpPath); } btnAddJumpPath.Enabled = false; }
void AppMenu_DropDown(object sender, EventArgs e) { var ribbonItems = rpc.Ribbon.ApplicationMenu.RightPaneItems; while (ribbonItems.Count > 3) { int index = ribbonItems.Count - 1; var ri = ribbonItems[index]; ribbonItems.RemoveAt(index); ri.Dispose(); } if (CheckAssociations()) { _registerLabel.Text = "< unregister the file associations for .c1dx, .c1d, and .c1mdx >"; _registered = true; } else { _registerLabel.Text = "< register.c1dx, .c1d, and.c1mdx files with this application >"; _registered = false; } var items = atb.JumpList.GetKnownCategoryItems(JumpListKnownCategory.Recent); for (int i = 1; i <= items.Count; i++) { C1JumpPath jumpPath = items[i - 1] as C1JumpPath; if (jumpPath != null) { var rli = new C1.Win.C1Ribbon.RibbonListItem(); var sb = new StringBuilder(); if (i < 10) { sb.Append('&').Append(i).Append(" "); } else { sb.Append(i).Append(' '); } sb.Append(Path.GetFileNameWithoutExtension(jumpPath.Path)); rli.Items.Add(new RibbonLabel(sb.ToString())); var delButton = new C1.Win.C1Ribbon.RibbonButton(); if (i < 10) { delButton.KeyTip = "Y" + i.ToString(); } delButton.SelectableInListItem = true; delButton.SmallImage = Properties.Resources.Delete16x16; delButton.ToolTip = "Remove from list"; delButton.Click += new System.EventHandler(this.DelButton_Click); rli.Items.Add(delButton); ribbonItems.Add(rli); rli.Tag = jumpPath; rli.ToolTip = jumpPath.Path; rli.Click += RibbonListItem_Click; } } }