public void TestStringInt() { StringInt i = "556"; Assert.AreEqual(i + 12, 568); StringInt ia = i; Assert.AreEqual(ia, i); i = i + 2; Assert.AreNotEqual(ia, i); --i; Assert.AreEqual(ia + 1, i); //i = i - "1"; RunningStatus s = RunningStatus.Stopping; Console.WriteLine(s.ToString()); s = RunningStatus.Starting; Console.WriteLine(s.ToString()); }
private void SetStatus(RunningStatus status, string version, string directory, string proconPath) { if (this.lsvInstalls.Items.ContainsKey(proconPath) == true) { this.lsvInstalls.Items[proconPath].Text = status.ToString(); this.lsvInstalls.Items[proconPath].Tag = status; this.lsvInstalls.Items[proconPath].SubItems["Version"].Text = version; this.lsvInstalls.Items[proconPath].SubItems["Directory"].Text = directory; this.lsvInstalls.Items[proconPath].SubItems["Path"].Text = proconPath; } else { ListViewItem newProcon = new ListViewItem(); newProcon.Name = proconPath; newProcon.Text = status.ToString(); newProcon.Tag = status; newProcon.UseItemStyleForSubItems = false; ListViewItem.ListViewSubItem newSubitem = new ListViewItem.ListViewSubItem(); newSubitem.Name = "Version"; newSubitem.Text = version; newSubitem.Font = new Font(this.Font, FontStyle.Bold); newProcon.SubItems.Add(newSubitem); newSubitem = new ListViewItem.ListViewSubItem(); newSubitem.Name = "Directory"; newSubitem.Text = directory; newProcon.SubItems.Add(newSubitem); newSubitem = new ListViewItem.ListViewSubItem(); newSubitem.Name = "Path"; newSubitem.Text = proconPath; newProcon.SubItems.Add(newSubitem); this.lsvInstalls.Items.Add(newProcon); } if (this.lsvInstalls.Items[proconPath].Tag != null && ((RunningStatus)this.lsvInstalls.Items[proconPath].Tag) == RunningStatus.Running) { this.lsvInstalls.Items[proconPath].ImageKey = "running.png"; this.lsvInstalls.Items[proconPath].ForeColor = Color.LightSeaGreen; this.lsvInstalls.Items[proconPath].Font = new Font(this.Font, FontStyle.Bold); } else { this.lsvInstalls.Items[proconPath].ImageKey = "stopped.png"; this.lsvInstalls.Items[proconPath].ForeColor = SystemColors.WindowText; this.lsvInstalls.Items[proconPath].Font = this.Font; } try { if (this.m_latestVersion != null) { if (new Version(version).CompareTo(this.m_latestVersion) >= 0) { this.lsvInstalls.Items[proconPath].SubItems["Version"].ForeColor = Color.LightSeaGreen; } else { this.lsvInstalls.Items[proconPath].SubItems["Version"].ForeColor = Color.Maroon; } } } catch (Exception) { } // }
private void SetStatus(RunningStatus status, string version, string directory, string proconPath) { if (this.lsvInstalls.Items.ContainsKey(proconPath) == true) { this.lsvInstalls.Items[proconPath].Text = status.ToString(); this.lsvInstalls.Items[proconPath].Tag = status; this.lsvInstalls.Items[proconPath].SubItems["Version"].Text = version; this.lsvInstalls.Items[proconPath].SubItems["Directory"].Text = directory; this.lsvInstalls.Items[proconPath].SubItems["Path"].Text = proconPath; } else { ListViewItem newProcon = new ListViewItem(); newProcon.Name = proconPath; newProcon.Text = status.ToString(); newProcon.Tag = status; newProcon.UseItemStyleForSubItems = false; ListViewItem.ListViewSubItem newSubitem = new ListViewItem.ListViewSubItem(); newSubitem.Name = "Version"; newSubitem.Text = version; newSubitem.Font = new Font(this.Font, FontStyle.Bold); newProcon.SubItems.Add(newSubitem); newSubitem = new ListViewItem.ListViewSubItem(); newSubitem.Name = "Directory"; newSubitem.Text = directory; newProcon.SubItems.Add(newSubitem); newSubitem = new ListViewItem.ListViewSubItem(); newSubitem.Name = "Path"; newSubitem.Text = proconPath; newProcon.SubItems.Add(newSubitem); this.lsvInstalls.Items.Add(newProcon); } if (this.lsvInstalls.Items[proconPath].Tag != null && ((RunningStatus)this.lsvInstalls.Items[proconPath].Tag) == RunningStatus.Running) { this.lsvInstalls.Items[proconPath].ImageKey = "running.png"; this.lsvInstalls.Items[proconPath].ForeColor = Color.LightSeaGreen; this.lsvInstalls.Items[proconPath].Font = new Font(this.Font, FontStyle.Bold); } else { this.lsvInstalls.Items[proconPath].ImageKey = "stopped.png"; this.lsvInstalls.Items[proconPath].ForeColor = SystemColors.WindowText; this.lsvInstalls.Items[proconPath].Font = this.Font; } try { if (this.m_latestVersion != null) { if (new Version(version).CompareTo(this.m_latestVersion) >= 0) { this.lsvInstalls.Items[proconPath].SubItems["Version"].ForeColor = Color.LightSeaGreen; } else { this.lsvInstalls.Items[proconPath].SubItems["Version"].ForeColor = Color.Maroon; } } } catch (Exception) { } // }
public string getState() { return(status.ToString()); }