private void LoadScriptsList(PatchProfile patch)
        {
            ComboBoxEx_Scripts.Items.Clear();

            foreach (PatchScript script in patch.Scripts)
            {
                var item = new ComboItem();
                if (!string.IsNullOrEmpty(script.Name))
                {
                    item.Text = script.Name;
                }
                else
                {
                    item.Text = "Untitled";
                }

                item.Tag = script;
                ComboBoxEx_Scripts.Items.Add(item);
            }

            if (ComboBoxEx_Scripts.Items.Count > 0)
            {
                ComboBoxEx_Scripts.SelectedIndex = 0;
            }

            Panel1.Refresh();
        }
        private void ListTab_SelectedIndexChanged(object sender, EventArgs e)
        {
            switch (ListTab.SelectedTab.Name.ToString())
            {
            case "Linktab":
                if (linklist != null)
                {
                    DrawStr  = linklist.ToString();
                    drawmode = DrawMode.Link;
                    Panel1.Refresh();
                }
                break;

            case "Circulartab":
                if (circularlist != null)
                {
                    DrawStr  = circularlist.ToString();
                    drawmode = DrawMode.Circular;
                    Panel1.Refresh();
                }
                break;

            case "Doubletab":
                if (doublelist != null)
                {
                    DrawStr  = doublelist.ToString();
                    drawmode = DrawMode.Double;
                    Panel1.Refresh();
                }
                break;

            default: break;
            }
        }
Exemple #3
0
 private void Panel1_SizeChanged(object sender, EventArgs e)
 {
     if (DrawingData != null)
     {
         bitmap = DrawingData.Draw(Panel1.Height);
     }
     Panel1.Refresh();
 }
        private void button21_Click(object sender, EventArgs e)
        {
            string Str = text2.Text;

            if (Str.Length < 1)
            {
                MessageBox.Show("请输入用于建立循环链表的字符串!", "提示",
                                MessageBoxButtons.OK, MessageBoxIcon.Warning); return;
            }
            circularlist = new CircularList(Str);
            DrawStr      = circularlist.ToString();
            drawmode     = DrawMode.Circular;
            Panel1.Refresh();
        }
        private void button11_Click(object sender, EventArgs e)
        {
            string Str = text1.Text;

            if (Str.Length < 1)
            {
                MessageBox.Show("请输入用于建立单链表的字符串!", "提示",
                                MessageBoxButtons.OK, MessageBoxIcon.Warning); return;
            }
            linklist = new LinkList(Str);
            DrawStr  = linklist.ToString();
            drawmode = DrawMode.Link;
            Panel1.Refresh();
        }
Exemple #6
0
 private void Button3_Click(object sender, EventArgs e)
 {
     if (images.Images.Empty != true)
     {
         if (images.Images.Count - 1 > currentImage)
         {
             currentImage++;
         }
         else
         {
             currentImage = 0;
         }
         Panel1.Refresh();
         //images.Draw(myGraphics, 10, 10, currentImage);
         PictureBox.Image = images.Images[currentImage];
     }
 }
        private void button14_Click(object sender, EventArgs e)
        {
            if (linklist == null)
            {
                MessageBox.Show("请先建立单链表!", "提示",
                                MessageBoxButtons.OK, MessageBoxIcon.Warning); return;
            }
            string Str = text1.Text;

            if (Str.Length < 1)
            {
                MessageBox.Show("请输入要删除的字符!", "提示",
                                MessageBoxButtons.OK, MessageBoxIcon.Warning); return;
            }
            linklist.Delete(Str);
            DrawStr  = linklist.ToString();
            drawmode = DrawMode.Link;
            Panel1.Refresh();
        }
        private void button32_Click(object sender, EventArgs e)
        {
            if (doublelist == null)
            {
                MessageBox.Show("请先建立双向链表!", "提示",
                                MessageBoxButtons.OK, MessageBoxIcon.Warning); return;
            }
            string Str = text3.Text;

            if (Str.Length < 1)
            {
                MessageBox.Show("请输入要插入的字符!", "提示",
                                MessageBoxButtons.OK, MessageBoxIcon.Warning); return;
            }
            doublelist.Insert(Str);
            DrawStr  = doublelist.ToString();
            drawmode = DrawMode.Double;
            Panel1.Refresh();
        }
        private void button24_Click(object sender, EventArgs e)
        {
            if (circularlist == null || circularlist.Head == null)
            {
                MessageBox.Show("请先建立循环链表!", "提示",
                                MessageBoxButtons.OK, MessageBoxIcon.Warning); return;
            }
            string Str = text2.Text;

            if (Str.Length < 1)
            {
                MessageBox.Show("请输入要删除的字符!", "提示",
                                MessageBoxButtons.OK, MessageBoxIcon.Warning); return;
            }
            circularlist.Delete(Str);
            DrawStr  = circularlist.ToString();
            drawmode = DrawMode.Circular;
            Panel1.Refresh();
        }