private void Window_Loaded_1(object sender, RoutedEventArgs e) { try { //VkApi.AccessToken = "501e669057305704920915316838e10b8c30adff0f7f037d135b0a9a92d4b3c20d2a5ed3dfd0bc1414d20"; if (File.Exists("token.txt")) { VkApi.AccessToken = File.ReadAllText("token.txt"); } else { File.Create("token.txt"); VkApi.AccessToken = ""; } if (VkApi.AccessToken == "") { var form = new LoginVk(); form.ShowDialog(); VkApi.AccessToken = form.AccessToken; } if (!Directory.Exists("image")) { Directory.CreateDirectory("image"); } if (VkApi.AccessToken != null && !VkApi.AccessToken.StartsWith("#error")) { User = VkApi.GetUser(); var list = VkApi.GetAudio(User.Uid, ""); AddAudioPlayList(PlayListBox, list); GetAlbomsUser(); PlayListTabs.SelectedIndex = 0; var t = (ScrollViewer)PlayListTabs.Template.FindName("ScrollViewerTab", PlayListTabs); t.ScrollToHorizontalOffset(0); TimerPosition.Elapsed += TimerPosition1_Tick; TimerPosition.Interval = 1000; } else { System.Windows.Forms.MessageBox.Show(@"Ошибка авторизации."); } _eq = new Eq(Eq); SetBFX_EQ(); } catch (NetworkInformationException) { System.Windows.Forms.MessageBox.Show(@"Ошибка интернет соединения."); } }
private void equalizerButton_Click(object sender, RoutedEventArgs e) { if (_eq != null && !_eq.Activate()) { _eq = new Eq(Eq); SetBFX_EQ(); _eq.Left = Left + Width; _eq.Top = Top; _eq.Show(); } else if (_eq != null && _eq.Activate()) { _eq.Close(); } }