Exemple #1
0
        public static void Base_Library_Call(string filepath, double speed = 1, string img = null, Color?cl1 = null, Color?cl2 = null)
        {
            Form1  form1;
            string path = Path.GetFullPath(Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, @"..\..\")) + @"\Resources\Backgrounds";

            switch (Regex.Match(filepath, @"[\\]+[^\\]+.dat").Value.Remove(0, 1).Remove(Regex.Match(filepath, @"[\\]+[^\\]+.dat").Value.Remove(0, 1).Length - 4, 4))
            {
            case "Денис Шишов":
            {
                form1 = new Form1(filepath, speed, $@"{path}\bloom.jpg", Color.Yellow, Color.Yellow, Color.DarkOrange, Color.DarkOrange);
                break;
            }

            case "Дмитрий Иващенко":
            {
                form1 = new Form1(filepath, speed, $@"{path}\blue.jpg", Color.DeepSkyBlue, Color.DeepSkyBlue, Color.MidnightBlue, Color.MidnightBlue);
                break;
            }

            case "Артем Шевердин":
            {
                form1 = new Form1(filepath, speed, $@"{path}\hero.jpg", Color.IndianRed, Color.IndianRed, Color.DarkSlateGray, Color.DarkSlateGray);
                break;
            }

            case "Ахмед Хоссайни":
            {
                form1 = new Form1(filepath, speed, $@"{path}\pirates.jpg", Color.Firebrick, Color.Firebrick, Color.Chocolate, Color.Chocolate);
                break;
            }

            case "Андрей Белоусов":
            {
                form1 = new Form1(filepath, speed, $@"{path}\skyrim.jpg", Color.DarkGray, Color.DarkGray, Color.DarkSlateGray, Color.DarkSlateGray);
                break;
            }

            case "Александр Данильченко":
            {
                form1 = new Form1(filepath, speed, $@"{path}\coat of arm.jpg", Color.DarkGray, Color.DarkRed, Color.Crimson, Color.Gold);
                break;
            }

            case "anonymous":
            {
                form1 = new Form1(filepath, speed, $@"{path}\school.jpg", Color.ForestGreen, Color.ForestGreen, Color.DarkGreen, Color.DarkGreen);
                break;
            }

            case "Иван Игнатенко":
            {
                form1 = new Form1(filepath, speed, $@"{path}\piano.jpg", Color.Black, Color.Black, Color.Black, Color.Black);
                break;
            }

            case "test":
            {
                form1 = new Form1(filepath, speed, $@"{path}\test.jpg", Color.Blue, Color.Blue, Color.Indigo, Color.Indigo, true);
                break;
            }

            default:
            {
                form1 = new Form1(filepath, speed, img, cl1, null, cl2, null);
                break;
            }
            }
            form1.ShowDialog();
        }
        private void button1_Click(object sender, EventArgs e)
        {
            Form1 f = new Form1();

            f.ShowDialog();
        }