public void test_init() { //初期化 task_list test_obj; test_obj = new task_list(); //処理 test_obj.init(get_test_file_name(), true); //テスト Assert.AreEqual("1", test_obj.my_task_list[0].ID); Assert.AreEqual("test_name1", test_obj.my_task_list[0].name); Assert.AreEqual("test_detail1", test_obj.my_task_list[0].detail); Assert.AreEqual("test_status1", test_obj.my_task_list[0].status); Assert.AreEqual("2", test_obj.my_task_list[1].ID); Assert.AreEqual("test_name2", test_obj.my_task_list[1].name); Assert.AreEqual("test_detail2", test_obj.my_task_list[1].detail); Assert.AreEqual("test_status2", test_obj.my_task_list[1].status); Assert.AreEqual("3", test_obj.my_task_list[2].ID); Assert.AreEqual("test_name3", test_obj.my_task_list[2].name); Assert.AreEqual("test_detail3", test_obj.my_task_list[2].detail); Assert.AreEqual("test_status3", test_obj.my_task_list[2].status); Assert.AreEqual("4", test_obj.my_task_list[3].ID); Assert.AreEqual("test_name4", test_obj.my_task_list[3].name); Assert.AreEqual("test_detail4", test_obj.my_task_list[3].detail); Assert.AreEqual("test_status4", test_obj.my_task_list[3].status); //ファイルを削除 delete_test_folder(); }
// Use this for initialization void Start () { utility my_util = new utility (); my_util.set_file_name (Application.persistentDataPath); m_file_name = my_util.get_file_name (); content = GetComponent<RectTransform> (); my_task_list = new task_list (); my_task_list.init (m_file_name); renew_item (); }
public void test_delete_task_file() { //初期化 task_list test_obj; test_obj = new task_list(); test_obj.init(get_test_file_name(), true); //処理 test_obj.delete_task_file(); //確認 Assert.AreEqual(false, System.IO.File.Exists(get_test_file_name())); }
public void test_get_item_count() { //初期化 task_list test_obj; test_obj = new task_list(); test_obj.init(get_test_file_name(), true); //処理 int num = test_obj.get_item_count(); //テスト Assert.AreEqual(4, num); //ファイルを削除 delete_test_folder(); }
public void test_delete_all_task() { //初期化 task_list test_obj; test_obj = new task_list(); test_obj.init(get_test_file_name(), true); //処理前の確認 Assert.AreEqual(4, test_obj.get_item_count()); //処理 test_obj.delete_all_task(); //処理後の確認 Assert.AreEqual(0, test_obj.get_item_count()); }
//call this in Form1 if you wish for your tool to appear in taskbar: taskbar.AddTool(Form X, imageList1.Images[Y]); //X is the form you're currently calling, example "px" for property manager //Y is the image to use for taskbar icon. public static void AddTool(Form original, Image symbol, bool startPoppedOut = false, Window wpfWindow = null) { original.MdiParent = mdiParent; original.WindowState = FormWindowState.Maximized; original.Show(); //creating the button TaskbarToolButton tool_button = new TaskbarToolButton(); tool_button.Image = symbol; tool_button.Tag = id_counter.ToString(); tool_button.Click += new EventHandler(tipek_onclick); if (wpfWindow != null) { tool_button.Text = wpfWindow.Title; tool_button.ContextMenu = new ContextMenu(new MenuItem[] { new MenuItem("This tool cannot be docked.") }); tool_button.ContextMenu.MenuItems[0].Enabled = false; } else { tool_button.Text = original.Text; tool_button.ContextMenu = new ContextMenu(new MenuItem[] { new MenuItem("Undock tool"), new MenuItem("Dock tool") }); tool_button.ContextMenu.MenuItems[0].Click += HandleDockEvent; tool_button.ContextMenu.MenuItems[1].Click += HandleDockEvent; tool_button.ContextMenu.MenuItems[1].Enabled = startPoppedOut; tool_button.ContextMenu.MenuItems[0].Enabled = !startPoppedOut; } tool_button.ContextMenu.Tag = tool_button.Tag; strip.ImageScalingSize = new System.Drawing.Size(64, 64); //adding to toolstrip strip.Items.Add(tool_button); //creating new structure entry task_list add = new task_list(); add.icon = tool_button; add.tool = original; add.ID = id_counter; add.poppedOut = startPoppedOut; add.button = tool_button; add.wpfWindow = wpfWindow; tools.Add(add); //counter, you be here here. id_counter++; }
//call this in Form1 if you wish for your tool to appear in taskbar: taskbar.AddTool(Form X, imageList1.Images[Y]); //X is the form you're currently calling, example "px" for property manager //Y is the image to use for taskbar icon. public static void AddTool(Form original, Image symbol) { //creating the button ToolStripButton tool_button = new ToolStripButton(); tool_button.Text = original.Text; tool_button.Image = symbol; tool_button.Tag = tools.Count().ToString(); tool_button.Click += new EventHandler(tipek_onclick); //I can haz event handler? No? ORLY?! //adding to toolstrip strip.Items.Add(tool_button); //creating new structure entry task_list add = new task_list(); add.icon = tool_button; add.tool = original; add.ID = id_counter; tools.Add(add); //counter, you be here here. id_counter++; }
//call this in Form1 if you wish for your tool to appear in taskbar: taskbar.AddTool(Form X, imageList1.Images[Y]); //X is the form you're currently calling, example "px" for property manager //Y is the image to use for taskbar icon. public static void AddTool(Form original, Image symbol, bool startPoppedOut = false, Window wpfWindow = null) { //creating the button TaskbarToolButton tool_button = new TaskbarToolButton(); tool_button.Image = symbol; tool_button.Tag = id_counter.ToString(); tool_button.Click += new EventHandler(tipek_onclick); //I can haz event handler? No? ORLY?! if (wpfWindow != null) { tool_button.Text = wpfWindow.Title; tool_button.ContextMenu = new ContextMenu(new MenuItem[] { new MenuItem("This tool cannot be docked.") }); tool_button.ContextMenu.MenuItems[0].Enabled = false; } else { tool_button.Text = original.Text; tool_button.ContextMenu = new ContextMenu(new MenuItem[] { new MenuItem("Undock tool"), new MenuItem("Dock tool") }); tool_button.ContextMenu.MenuItems[0].Click += HandleDockEvent; tool_button.ContextMenu.MenuItems[1].Click += HandleDockEvent; tool_button.ContextMenu.MenuItems[1].Enabled = startPoppedOut; tool_button.ContextMenu.MenuItems[0].Enabled = !startPoppedOut; } tool_button.ContextMenu.Tag = tool_button.Tag; strip.ImageScalingSize = new System.Drawing.Size(64, 64); //adding to toolstrip strip.Items.Add(tool_button); //creating new structure entry task_list add = new task_list(); add.icon = tool_button; add.tool = original; add.ID = id_counter; add.poppedOut = startPoppedOut; add.button = tool_button; add.wpfWindow = wpfWindow; tools.Add(add); //counter, you be here here. id_counter++; }