public void AddOrChangeOpener(Opener a) { if (UsersOpener.Find(r => r.TypeOfFile() == a.TypeOfFile()) == null) AddOpener(a); else ChangeOpener(a); }
private void AddProgramBut_Click(object sender, EventArgs e) { Opener a = new Opener(); a.SetAddress(openersway); a.SetName(ProgramNameTB.Text); a.SetTypeOfFile(TypeOfFileTB.Text); CurrentUser.AddOrChangeOpener(a); CurrentUser.WriteOutOpeners(); }
public void AddOrChangeOpener(Opener a) { if (UsersOpener.Find(r => r.TypeOfFile() == a.TypeOfFile()) == null) { AddOpener(a); } else { ChangeOpener(a); } }
private void TracksList_DoubleClick(object sender, EventArgs e) { string wrt; Opener CurrentOpener = CurrentUser.SearchOpener(Tracks.Find(r => r.Name() == TracksList.SelectedItem.ToString()).Type()); MusicFile CurrentMusicFile = Tracks.Find(r => r.Name() == TracksList.SelectedItem.ToString()); if (CurrentOpener == null) { wrt = '"' + CurrentMusicFile.Address() + '"'; } else { wrt = "start \"\" \"" + CurrentOpener.Address() + "\" \"" + CurrentMusicFile.Address() + "\""; } Process pr = new Process(); pr.StartInfo.FileName = "cmd"; pr.StartInfo.Arguments = "/C " + wrt; pr.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; pr.Start(); pr.Close(); pr.Dispose(); }
public void DeleteOpener(Opener a) { UsersOpener.Remove(a); }
public void ChangeOpener(Opener a) { UsersOpener[UsersOpener.FindIndex(r => r.TypeOfFile() == a.TypeOfFile())] = a; }
public void AddOpener(Opener a) { UsersOpener.Add(a); }
public void ChangeOpener(Opener a) { UsersOpener[UsersOpener.FindIndex(r=>r.TypeOfFile()==a.TypeOfFile())]=a; }