コード例 #1
0
        public static TimerForm Instance(Mainform frmMain)
        {
            if (sForm == null)
            {
                sForm = new TimerForm(frmMain);
            }

            else
            {
                sForm.Close();
                sForm = new TimerForm(frmMain);
            }

            return(sForm);
        }
コード例 #2
0
ファイル: GameForm.xaml.cs プロジェクト: Vaomi/Puzzle
        public GameForm()
        {
            InitializeComponent();
            //Визуализация картинки
            ShowImages.ImageToGameForm(Example); //подсказка

            //Процесс сбора пазла (label)
            if (AssemblingPuzzles.process == 100)
            {
                AssemblingPuzzles.process = 0;
            }
            LabelProcess.Content = AssemblingPuzzles.process + "%";

            //Никнейм (label)
            LabelNicName.Content = GlobalClass.NickName;

            //Время (label)
            tf = new TimerForm(0, LabelTime);
            tf.Stop();
            tf.timer.Tick += timer_Tick;
            tf.Start();

            //Заполнение частей пазлов
            Image[] but = new Image[16]
            {
                Im1,
                Im2,
                Im3,
                Im4,
                Im5,
                Im6,
                Im7,
                Im8,
                Im9,
                Im10,
                Im11,
                Im12,
                Im13,
                Im14,
                Im15,
                Im16,
            };
            foreach (Image puzl in but)
            {
                AssemblingPuzzles.RandomParts(puzl);
            }
        }
コード例 #3
0
        public override void BeginScene()
        {
            var formThread = new Thread(() =>
            {
                Application.EnableVisualStyles();

                form = new TimerForm(
                    splitsPath: splitsPath,
                    layoutPath: layoutPath,
                    drawToBackBuffer: true,
                    basePath: File.ReadAllText(@"plugins\CLRHostPlugin\livesplit.cfg"));
                Application.Run(form);
            })
            {
                Name = "LiveSplit Form Thread"
            };

            formThread.SetApartmentState(ApartmentState.STA);
            formThread.Start();
        }
コード例 #4
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Form1 f1 = new Form1();

            if (f1.ShowDialog() == DialogResult.Cancel)
            {
                Application.Exit();
                return;
            }
            GameDef      def    = f1.Selected;
            AppDomain    domain = AppDomain.CreateDomain("Timer");
            ObjectHandle h      = domain.CreateInstanceFrom(AppDomain.CurrentDomain.BaseDirectory + "Core.dll", "NFSLR.Core.TimerForm", true, BindingFlags.CreateInstance, null, new string[] { AppDomain.CurrentDomain.BaseDirectory + "plugins\\" + def.Dll, def.Classpath, def.Module }, null, null, null);
            TimerForm    t      = h.Unwrap() as TimerForm;

            t.ShowDialog();
            AppDomain.Unload(domain);
            Application.Exit();
        }
コード例 #5
0
 //10ms
 /// <summary>
 /// Hiện thị màn hình sẽ tự đóng sau time (x10 ms)
 /// Phát sinh: Chưa dùng
 /// </summary>
 public static void ShowTimerDialog(XtraForm mainform, XtraForm form, int time)
 {
     TimerForm timerForm = new TimerForm(form);
     timerForm.setTimer(time);
     ProtocolForm.ShowDialog(mainform, form);
 }