コード例 #1
0
ファイル: Form1.cs プロジェクト: gyod/lineage2tools
 private void packethandler_onPacketAdded(object sender)
 {
     if (this.toolStripButtonAutoUpdate.Checked && this.packetContainer != null)
     {
         if (this.fastObjectListView1.InvokeRequired)
         {
             UpdateFastObjectList d = new UpdateFastObjectList(packethandler_onPacketAdded);
             this.Invoke(d, new object[] { sender });
         }
         else
         {
             // Update only after 50ms
             if ((DateTime.Now - this.lastUpdated) > TimeSpan.FromMilliseconds(50))
             {
                 this.fastObjectListView1.SetObjects(this.packetContainer.DisplayedPackets);
                 this.fastObjectListView1.Invalidate();
                 if (this.packetContainer.DisplayedPackets.Count > 0)
                 {
                     this.fastObjectListView1.EnsureVisible(this.packetContainer.DisplayedPackets.Count - 1);
                 }
                 this.toolStripStatusLabel.Text = "Auto Refreshed : " + ((TimeSpan)(DateTime.Now - this.lastUpdated)).Milliseconds + "ms";
                 this.lastUpdated = DateTime.Now;
             }
         }
     }
 }
コード例 #2
0
ファイル: Form1.cs プロジェクト: gyod/lineage2tools
 private void packethandler_onPacketAdded(object sender)
 {
     if (this.toolStripButtonAutoUpdate.Checked && this.packetContainer != null)
     {
         if (this.fastObjectListView1.InvokeRequired)
         {
             UpdateFastObjectList d = new UpdateFastObjectList(packethandler_onPacketAdded);
             this.Invoke(d, new object[] { sender });
         }
         else
         {
             // Update only after 50ms
             if ((DateTime.Now - this.lastUpdated) > TimeSpan.FromMilliseconds(50))
             {
                 this.fastObjectListView1.SetObjects(this.packetContainer.DisplayedPackets);
                 this.fastObjectListView1.Invalidate();
                 if (this.packetContainer.DisplayedPackets.Count > 0)
                 {
                     this.fastObjectListView1.EnsureVisible(this.packetContainer.DisplayedPackets.Count - 1);
                 }
                 this.toolStripStatusLabel.Text = "Auto Refreshed : " + ((TimeSpan)(DateTime.Now - this.lastUpdated)).Milliseconds + "ms";
                 this.lastUpdated = DateTime.Now;
             }
         }
     }
 }