コード例 #1
0
ファイル: TaskHelpers.cs プロジェクト: jibcore/ShareX
        public static void OpenHistory()
        {
            HistoryForm historyForm = new HistoryForm(Program.HistoryFilePath);

            Program.Settings.HistoryWindowState.AutoHandleFormState(historyForm);
            historyForm.Show();
        }
コード例 #2
0
ファイル: TaskHelpers.cs プロジェクト: RavenZZ/ShareX
        public static void OpenHistory()
        {
            HistoryForm historyForm = new HistoryForm(Program.HistoryFilePath, Program.Settings.HistoryMaxItemCount, Program.Settings.HistorySplitterDistance);

            historyForm.SplitterDistanceChanged += splitterDistance => Program.Settings.HistorySplitterDistance = splitterDistance;
            Program.Settings.HistoryWindowState.AutoHandleFormState(historyForm);
            historyForm.Show();
        }
コード例 #3
0
ファイル: MainForm.cs プロジェクト: savannaking/ShareX
        private void tsbHistory_Click(object sender, EventArgs e)
        {
            HistoryForm historyForm = new HistoryForm(Program.HistoryFilePath);

            Program.Settings.HistoryWindowState.AutoHandleFormState(historyForm);
            historyForm.Text = "ShareX - History: " + Program.HistoryFilePath;
            historyForm.Show();
        }
コード例 #4
0
ファイル: MainForm.cs プロジェクト: MiaSanRomen/HitClients
 private void btnTrade_Click(object sender, EventArgs e)
 {
     if (!FrmHistory.IsHandleCreated)
     {
         FrmHistory = new HistoryForm();
     }
     FrmHistory.Show(dockPanel, DockState.DockBottom);
 }
コード例 #5
0
        private void btnGameHistory_Click(object sender, EventArgs e)
        {
            this.Hide();

            HistoryForm form = new HistoryForm();

            form.Closed += (s, args) => this.Close();
            form.Show();
        }
コード例 #6
0
 private void ucBtnExt1_BtnClick(object sender, EventArgs e)
 {
     if (m_object != null)
     {
         if (historyForm == null)
         {
             historyForm = new HistoryForm(model, m_object);
             historyForm.Show();
         }
         else
         {
             if (historyForm.IsDisposed == true)
             {
                 historyForm = new HistoryForm(model, m_object);
                 historyForm.Show();
             }
             else
             {
                 historyForm.Visible = true;
             }
         }
         this.UserSelectFormTemp.Visible = false;
     }
 }
コード例 #7
0
        // this method is a performance sucking machine
        private void BindChannelPlaylistPanel()
        {
            // if (PlaylistPanel.Controls.Count == 0 || !_channelView.IsViewSet)
            if (PlaylistPanel.Controls.Count == PlaylistPanel.Channels.Count)
            {
                return;
            }
            PlaylistPanel.Controls.Clear();
            PlaylistPanel.Controls.AddRange(PlaylistPanel.Channels.ToArray());

            // subscribe to the TrackChanged events here:
            // this will run EVERY TIME PLAYLIST IS REFRESHED...very expensive, so move elsewhere
            // PlaylistPanel.Channels.ForEach(delegate(TChannel channel)
            Parallel.ForEach <IChannel>(PlaylistPanel.Channels, channel =>
            {
                channel.TrackChanged -= (s, ee) =>
                {
                    GC.Collect();
                    GC.WaitForPendingFinalizers();
                };
                channel.TrackChanged += (s, ee) => Invoke((Action)(() =>
                {
                    // first change the title of the window
                    if (
                        ee.RefreshedContent.TrackTitle.Equals(_channel.CurrentTrack.TrackTitle,
                                                              StringComparison.
                                                              CurrentCultureIgnoreCase) &&
                        _channel.IsSelected)
                    {
                        SetTrackText(ee.RefreshedContent);
                    }

                    // show some toast to the user
                    if (!Settings.Default.ShowUserToast)
                    {
                        return;
                    }
                    var toast = new ChannelToastForm <IChannel>(ee.RefreshedContent.ParentChannel)
                    {
                        TitleText = ee.RefreshedContent.ParentChannel.ChannelName,
                        BodyText = string.Format("Track changed to {0}",
                                                 ee.RefreshedContent.TrackTitle),
                        ForeColor = Color.Black
                    };
                    toast.Notify();
                }));
                channel.Tracks[0].ee -= (s, ee) =>
                {
                    GC.Collect();
                    GC.WaitForPendingFinalizers();
                };
                channel.Tracks[0].ee += (s, ee) => Invoke((Action)(() =>
                {
                    var toast = new CommentToastForm <IChannel>(ee.RefreshedContent.ParentChannel)
                    {
                        TitleText = ee.RefreshedContent.ParentChannel.ChannelName,
                        BodyText =
                            string.Format("{0} new comments for track {1}", ee.NewComments,
                                          ee.RefreshedContent.TrackTitle),
                        ForeColor = Color.Black
                    };
                    toast.Notify();
                }));
            });

            foreach (var control in PlaylistPanel.Controls)
            {
                if (!(control is TChannel))
                {
                    continue;
                }
                ((Channel)control).PlaylistHistoryClicked -= (sender, e) => { };
                ((Channel)control).PlaylistHistoryClicked += (sender, e) =>
                {
                    var channel = sender as TChannel;

                    if (channel == null)
                    {
                        return;
                    }
                    if (_trackHistory == null)
                    {
                        _trackHistory = new HistoryForm(channel);
                        _trackHistory.Show();
                    }
                    else
                    {
                        _trackHistory.Channel = channel;
                        _trackHistory.Show();
                    }
                    _trackHistory.Activate();
                    // _trackHistory.Location = this.PointToScreen(this.PlaylistPanel.Controls[((Control)c).Name].Location);
                };
            }
        }