private void Window_Loaded(object sender, RoutedEventArgs e) { this.Left = 0; this.Top = 0; this.Width = SystemParameters.WorkArea.Width; this.Height = SystemParameters.WorkArea.Height; string[] Programs = Directory.GetFiles(Directory.GetCurrentDirectory() + "\\..\\Data\\FavorProg", "*.DOSSTONED.*"); foreach (string program in Programs) { string sname = ""; //uint sclick = 0; using (StreamReader sr = File.OpenText(program)) { sname = sr.ReadLine(); //sclick = Convert.ToUInt32(Path.GetExtension(program)); } Progs p = new Progs(sname, System.IO.Path.GetFileNameWithoutExtension(program)); //Label a = new Label(); //a.Content = "111"; //a.Foreground = System.Windows.Media.Brushes.AliceBlue; //p.Content = a;// //System.Drawing.Image icon = System.Drawing.Image.FromFile(@"E:\石道辰\Icons\ICO_6.ico"); //p.Content = icon; //p.Width = 1000; //p.ClickedTimes = sclick; listViewProgram.Children.Add(p); } }
public void AmaxBmin() { int b = 3, a = 4; int expected = 0; Progs c = new Progs(); int result = c.For8(a, b); Assert.AreEqual(expected, result); }
public void RightAn() { int b = 1; double expected = 1.1; Progs c = new Progs(); double result = c.For12(b); Assert.AreEqual(expected, result); }
public void Nzero() { int b = 0; int expected = 0; Progs c = new Progs(); double result = c.For12(b); Assert.AreEqual(expected, result); }
public void RightAns() { int b = 3, a = 1; int expected = 18; Progs c = new Progs(); int result = c.For8(a, b); Assert.AreEqual(expected, result); }
private void ButtonAddProg_Click(object sender, RoutedEventArgs e) { if (File.Exists(textBoxInputPath.Text)) { if (textBoxInputName.Text != "") { Progs p = new Progs(textBoxInputPath.Text, textBoxInputName.Text); string path = Directory.GetCurrentDirectory() + "\\..\\Data\\FavorProg\\" + textBoxInputName.Text + ".DOSSTONED";// +p.ClickedTimes.ToString(); listViewProgram.Children.Add(p); if (!File.Exists(path)) { using (StreamWriter sw = File.CreateText(path)) { sw.WriteLine(textBoxInputPath.Text); } } textBoxInputPath.Text = ""; textBoxInputName.Text = ""; } else { MessageBox.Show("缺少名称!"); } } else { if (textBoxInputName.Text != "" && textBoxInputPath.Text != "") { MessageBox.Show(new FileNotFoundException().Message); } } th.Background = System.Windows.Media.Brushes.Transparent; stackPanel.Visibility = Visibility.Collapsed; th.Visibility = Visibility.Collapsed; }
public rpcd(Ports portNumber, Progs prog) { this.prog = (uint)prog; conn = new UdpClient(new IPEndPoint(IPAddress.Any, (int)portNumber)); }
private void QuickStartAdd(Progs p) { }