예제 #1
0
        private void SoleObjectListView_HyperlinkClicked(object sender, BrightIdeasSoftware.HyperlinkClickedEventArgs e)
        {
            var cardInfo  = (CardInfo)e.Item.RowObject;
            var cardInfos = new List <CardInfo> {
                cardInfo
            };

            // 選択されたカードを元に、関連カード一覧を更新する
            Util.GetCardInfos(out var allCardInfos, Util.JapaneseCode);
            List <CardInfo> associatedCardInfoList = new List <CardInfo>();

            foreach (string cardCode in cardInfo.associatedCardRefs)
            {
                var associatedCard = allCardInfos.FirstOrDefault(s => s.cardCode == cardCode);
                if (associatedCard == null)
                {
                    // TODO: エラーログなど
                    continue;
                }

                associatedCardInfoList.Add(associatedCard);
            }

            AssociatedCardsObjectListView.SetObjects(associatedCardInfoList);

            // カード選択イベントを発生させる
            ((Form1)MdiParent)._selectCardInfos?.Invoke(cardInfos);

            e.Handled = true;
        }
예제 #2
0
 /// <summary>
 /// Do the default processing for a hyperlink clicked event, which
 /// is to try and open the url.
 /// </summary>
 /// <param name="args"></param>
 protected virtual void StandardHyperlinkClickedProcessing(HyperlinkClickedEventArgs args)
 {
     Cursor originalCursor = this.Cursor;
     try {
         this.Cursor = Cursors.WaitCursor;
         System.Diagnostics.Process.Start(args.Url);
     } catch (Win32Exception) {
         System.Media.SystemSounds.Beep.Play();
         // ignore it
     } finally {
         this.Cursor = originalCursor;
     }
     this.MarkUrlVisited(args.Url);
     this.RefreshHotItem();
 }
예제 #3
0
 /// <summary>
 /// Tell the world that a hyperlink was clicked and if the event isn't handled,
 /// do the default processing.
 /// </summary>
 /// <param name="e"></param>
 protected virtual void ProcessHyperlinkClicked(CellClickEventArgs e)
 {
     HyperlinkClickedEventArgs args = new HyperlinkClickedEventArgs();
     args.HitTest = e.HitTest;
     args.ListView = this;
     args.Location = new Point(-1, -1);
     args.Item = e.Item;
     args.SubItem = e.SubItem;
     args.Model = e.Model;
     args.ColumnIndex = e.ColumnIndex;
     args.Column = e.Column;
     args.RowIndex = e.RowIndex;
     args.ModifierKeys = Control.ModifierKeys;
     args.Url = e.SubItem.Url;
     this.OnHyperlinkClicked(args);
     if (!args.Handled) {
         this.StandardHyperlinkClickedProcessing(args);
     }
 }
예제 #4
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="e"></param>
 protected virtual void OnHyperlinkClicked(HyperlinkClickedEventArgs e) {
     if (this.HyperlinkClicked != null)
         this.HyperlinkClicked(this, e);
 }
예제 #5
0
 private void OnHyperlinkClick(object sender, HyperlinkClickedEventArgs e)
 {
     e.Url = UrlGetter(e.Column, e.Model);
 }
예제 #6
0
        private void objectListView_HyperlinkClicked(object sender, HyperlinkClickedEventArgs e)
        {
            var movie = e.Model as Movie;
               if (movie != null)
               {
               if(e.Column == this.olvColumnLink1)
                e.Url = movie.Link1.Url;
               else if(e.Column == this.olvColumnLink2)
                   e.Url = movie.Link2.Url;

               }
        }
        private void objectListView_HyperlinkClicked(object sender, HyperlinkClickedEventArgs e)
        {
            var row = e.Model as CombatantWrapper;
            switch (e.Column.Text) {
                case "+":
                    this.Encounter.AddCombatant(row.Combatant);
                    break;

                case "-":
                    this.Encounter.RemoveCombatant(row.Combatant);
                    break;
            }

            // finally, don't attempt to browse to the URL
            e.Handled = true;
        }
예제 #8
0
파일: Form1.cs 프로젝트: coxymla/Wabang
        private void fastObjectListView1_HyperlinkClicked(object sender, HyperlinkClickedEventArgs e)
        {
            if (string.IsNullOrEmpty(browserExe.Text) || !File.Exists(browserExe.Text))
            {
                e.Handled = false;
                return;
            }

            System.Diagnostics.Process.Start(browserExe.Text, e.Url);
            e.Handled = true;
        }