public Note(NotePosition position, NoteTypes type, NotePosition next, NotePosition prev) { this.position = position; this.type = type; this.next = next; this.prev = prev; }
public Note(Note note) { this.position = note.position; this.type = note.type; this.next = note.next; this.prev = note.prev; }
public ActionResult UpdateTypeStatus(int TypeID, int status) { var emailid = User.Identity.Name.ToString(); Users admin = dbobj.Users.Where(x => x.EmailID == emailid).FirstOrDefault(); NoteTypes obj = dbobj.NoteTypes.Where(x => x.ID == TypeID).FirstOrDefault(); if (status == 0) // Deactivate Category { obj.IsActive = false; obj.ModifiedDate = DateTime.Now; obj.ModifiedBy = admin.ID; } else // Activate Category { obj.IsActive = true; obj.ModifiedDate = DateTime.Now; obj.ModifiedBy = admin.ID; } dbobj.Entry(obj).State = System.Data.Entity.EntityState.Modified; dbobj.SaveChanges(); return(RedirectToAction("ManageTypes")); }
/// <summary> /// Creates a timing class. /// Used for timeline x timing placement. /// </summary> /// <param name="time">Object timing in seconds.</param> /// <param name="x">Position of the timing in Transform, starting from first timer.</param> /// <param name="type">Type of the object in NoteTypes type.</param> public Timing(float time, float x, NoteTypes type, bool regenerate = true) { this.time = time; this.x = x; this.type = type; this.regenerate = regenerate; }
/// <summary> /// Create a new instance of a ProjectNote class, initializes with specified arguments. /// </summary> /// <param name="project"></param> /// <param name="type"></param> /// <param name="note"></param> public ProjectNote(Project project, NoteTypes type, string note) { this.Note = note ?? throw new ArgumentNullException(nameof(project)); this.NoteType = type; this.ProjectId = project?.Id ?? throw new ArgumentNullException(nameof(project)); this.Project = project; }
private NoteTypes GetNoteType() { NoteTypes note = new NoteTypes(); string noteTypeString = NoteType.SelectedItem.ToString(); note.noteType = 0; note.noteDuration = 0; if (noteTypeString == "Crotchet") { note.noteType = 4; note.noteDuration = 256; note.noteImagePath = @"C:\Users\Callum\source\repos\LogisUniWork\LogisUniWork\Images\Crotchet.png"; } else if (noteTypeString == "Minim") { note.noteType = 2; note.noteDuration = 512; note.noteImagePath = @"C:\Users\Callum\source\repos\LogisUniWork\LogisUniWork\Images\Minim.png"; } else if (noteTypeString == "Semibreve") { note.noteType = 1; note.noteDuration = 1024; note.noteImagePath = @"C:\Users\Callum\source\repos\LogisUniWork\LogisUniWork\Images\SemiBreve.png"; } else { note.noteType = 0; note.noteDuration = 0; } return(note); }
public Note(ulong userId, string description, ulong createdBy, DateTime date, NoteTypes type) { UserId = userId; Description = description; CreatedBy = createdBy; Date = date; Type = type; }
public Note(Note note) { this.position = note.position; this.type = note.type; this.next = note.next; this.prev = note.prev; this.attributes = note.attributes; this.direction = note.direction; }
public Note(NoteName name, NoteTypes type, Waveforms waveform, int octave) { this.name = name; this.type = type; this.waveform = waveform; this.octave = octave; loadFrequencies(); }
public static string TypeToString(NoteTypes noteType) { switch (noteType) { case NoteTypes.Positive: return("Positive"); case NoteTypes.Negative: return("Negative"); default: return("None"); } }
/// <summary> /// Create a new instance of a ProjectNote class, initializes with specified arguments. /// </summary> /// <param name="project"></param> /// <param name="type"></param> /// <param name="note"></param> public ProjectNote(Project project, NoteTypes type, string note) { if (note == null) { throw new ArgumentNullException(nameof(project)); } if (String.IsNullOrWhiteSpace(note)) { throw new ArgumentException("Argument cannot be null, empty or whitespace.", nameof(note)); } this.Note = note; this.NoteType = type; this.ProjectId = project?.Id ?? throw new ArgumentNullException(nameof(project)); this.Project = project; }
public ActionResult EditType(int TypeID) { var emailid = User.Identity.Name.ToString(); Users admin = dbobj.Users.Where(x => x.EmailID == emailid).FirstOrDefault(); NoteTypes obj = dbobj.NoteTypes.Where(x => x.ID == TypeID).FirstOrDefault(); AddType model = new AddType(); model.TypeID = obj.ID; model.TypeName = obj.Name; model.Description = obj.Description; ViewBag.ProfilePicture = dbobj.Admin.Where(x => x.UserID == admin.ID).Select(x => x.ProfilePicture).FirstOrDefault(); return(View(model)); }
/// <summary> /// Add or update the note for the specified 'type' on the 'project'. /// Presently only one note of each type is supported. /// </summary> /// <param name="project"></param> /// <param name="type"></param> /// <param name="text"></param> /// <returns></returns> public static ProjectNote AddOrUpdateNote(this Project project, NoteTypes type, string text) { var note = project.GetNote(type); if (note == null) { note = new ProjectNote(project, type, text); project.Notes.Add(note); } else { note.Note = text; } return(note); }
/// <summary> /// Return the preview image for note based on note type. /// </summary> /// <param name="type">Note Type</param> /// <param name="wide">Regular or Wide image</param> /// <returns>image path</returns> public static string GetPreviewImageForNote(NoteTypes type, bool wide = false) { switch (type) { case DataModel.NoteTypes.Food: return(wide == false ? "Assets/Tiles/food-small.png".ToBaseUrl() : "Assets/Tiles/food-wide.png".ToBaseUrl()); case DataModel.NoteTypes.ToDo: return(wide == false ? "Assets/Tiles/todo-small.png".ToBaseUrl() : "Assets/Tiles/todo-wide.png".ToBaseUrl()); case DataModel.NoteTypes.Notebook: return(wide == false ? "Assets/Tiles/notebook-small.png".ToBaseUrl() : "Assets/Tiles/notebook-wide.png".ToBaseUrl()); default: return(wide == false ? "Assets/Tiles/note-small.png".ToBaseUrl() : "Assets/Tiles/note-wide.png".ToBaseUrl()); } }
private void btnNewNote_Click(object sender, EventArgs e) { GuitarStringType stringType = GetSelectedString(); NoteTypes noteType = GetCheckedType(); int track = GetStringValue(stringType); if (noteType == NoteTypes.Whole) { stroke += 4; MusicalStorage.AddNote(new MusicalNote_Whole(stringType, track, IdCounter.ToString())); } else if (noteType == NoteTypes.Half) { stroke += 2; MusicalStorage.AddNote(new MusicalNote_Half(stringType, track, IdCounter.ToString())); } else if (noteType == NoteTypes.PunctedQuarter) { stroke += 1.5; MusicalStorage.AddNote(new MusicalNote_PunctedQuarter(stringType, track, IdCounter.ToString())); } else if (noteType == NoteTypes.Quarter) { stroke++; MusicalStorage.AddNote(new MusicalNote_Quarter(stringType, track, IdCounter.ToString())); } else if (noteType == NoteTypes.Eighth) { stroke += 0.5; MusicalStorage.AddNote(new MusicalNote_Eighth(stringType, track, IdCounter.ToString())); } if (stroke >= 4) { stroke = stroke - 4; MusicalStorage.AddNote(new MusicalNote_Stroke(IdCounter.ToString(), stroke)); } IdCounter++; txtChordCounter.Text = IdCounter.ToString(); }
public ActionResult AddType(AddType model) { var emailid = User.Identity.Name.ToString(); Users admin = dbobj.Users.Where(x => x.EmailID == emailid).FirstOrDefault(); if (ModelState.IsValid) { NoteTypes obj = new NoteTypes(); obj.Name = model.TypeName; obj.Description = model.Description; obj.CreatedDate = DateTime.Now; obj.CreaedBy = admin.ID; obj.IsActive = true; dbobj.NoteTypes.Add(obj); dbobj.SaveChanges(); return(RedirectToAction("ManageTypes")); } return(View()); }
private void KeyPressed(int pitch) { NoteTypes noteType = GetNoteType(); MusicNote note = CreateNote(pitch, noteType.noteType, noteType.noteDuration); play_note(note); CurrentNotes.Items.Add(note.pitch); CurrentNotes.SelectedIndex = CurrentNotes.Items.Count - 1; string pictureBoxName = string.Format("staff{0}", NoteId); foreach (Control item in this.Controls) { if (item.Name == pictureBoxName) { int i = 0; } } staff3_1.Load(noteType.noteImagePath); score.notes.Add(note); NoteId = NoteId + 1; }
public ActionResult EditType(AddType model) { var emailid = User.Identity.Name.ToString(); Users admin = dbobj.Users.Where(x => x.EmailID == emailid).FirstOrDefault(); if (ModelState.IsValid) { NoteTypes obj = dbobj.NoteTypes.Where(x => x.ID == model.TypeID).FirstOrDefault(); obj.Name = model.TypeName; obj.Description = model.Description; obj.ModifiedDate = DateTime.Now; obj.ModifiedBy = admin.ID; dbobj.Entry(obj).State = System.Data.Entity.EntityState.Modified; dbobj.SaveChanges(); return(RedirectToAction("ManageTypes")); } ViewBag.ProfilePicture = dbobj.Admin.Where(x => x.UserID == admin.ID).Select(x => x.ProfilePicture).FirstOrDefault(); return(View()); }
public ActionResult AddType(ManageTypeViewModel type) { var user = db.Users.FirstOrDefault(x => x.Email == User.Identity.Name); if (ModelState.IsValid) { //add data to notetype table NoteTypes Types = new NoteTypes(); Types.Name = type.typeName; Types.Description = type.description; Types.CreatedDate = DateTime.Now; Types.CreatedBy = user.ID; Types.IsActive = true; db.NoteTypes.Add(Types); db.SaveChanges(); return(RedirectToAction("ManageType")); } return(View()); }
private void RenderNote(NoteTypes type, Waveforms waveform) { NoteName newNoteName = NoteName.E; int octave = 4; if (lastNote != null) { newNoteName = lastNote.name; octave = lastNote.octave; } Note note = new Note(newNoteName, type, waveform, octave); song.AddNote(editVoice - 1, note); lastNote = note; selectedNote++; pnlSheet.Invalidate(); Song.tempo = Convert.ToInt32(numTempo.Value); note = new Note(newNoteName, NoteTypes.eighth, waveform, octave); Song.PlaySingleNote(note); }
public ActionResult AddType(AddType obj) { if (ModelState.IsValid) { var user = dobj.Users.Where(x => x.EmailID == User.Identity.Name).FirstOrDefault(); NoteTypes noteType = new NoteTypes { Name = obj.Name.Trim(), Description = obj.Description.Trim(), CreatedDate = DateTime.Now, CreatedBy = user.ID, IsActive = true }; dobj.NoteTypes.Add(noteType); dobj.SaveChanges(); return(RedirectToAction("ManageType")); } else { return(View(obj)); } }
void ChangeNoteType(NoteTypes target) { judgements.SetJudgementType(index, target); }
/// <summary> /// Changes dropdown value. /// </summary> /// <param name="index">Judgement index.</param> /// <param name="type">Target type in dropdown.</param> public void ChangeDropdownValue(int index, NoteTypes type) { this.index = index; dropdown.value = (int)type; }
public Note(NotePosition position, NoteTypes type) { this.startPosition = position; this.type = type; }
/// <summary> /// Sets judgement's note type. /// </summary> /// <param name="index">Target judgement's index in list.</param> /// <param name="target">Target judgement's type.</param> public void SetJudgementType(int index, NoteTypes target) { judgements[index].type = target; }
// // --------------------------------------------------------------------------- // Insert duplicate validation. // protected override DbEntityValidationResult ValidateEntity( DbEntityEntry entityEntry, IDictionary <object, object> items) { if (entityEntry.Entity is ApplicationUser && entityEntry.State == EntityState.Added) { if (Users.Any(a => a.UserName == ((ApplicationUser)entityEntry.Entity).UserName || a.Email == ((ApplicationUser)entityEntry.Entity).Email || a.FullName == ((ApplicationUser)entityEntry.Entity).FullName )) { // return validation error return(new DbEntityValidationResult(entityEntry, new List <DbValidationError>() { new DbValidationError("User", string.Format("Duplicate User: '******' or '{1}' or '{2}'", ((ApplicationUser)entityEntry.Entity).UserName, ((ApplicationUser)entityEntry.Entity).Email, ((ApplicationUser)entityEntry.Entity).FullName)) })); } } if (entityEntry.Entity is Company && entityEntry.State == EntityState.Added) { if (Companies.Any(a => a.CompanyName == ((Company)entityEntry.Entity).CompanyName)) { // return validation error return(new DbEntityValidationResult(entityEntry, new List <DbValidationError>() { new DbValidationError("Company", string.Format("Duplicate Company: '{0}'", ((Company)entityEntry.Entity).CompanyName)) })); } } // if (entityEntry.Entity is IncidentType && entityEntry.State == EntityState.Added) { if (IncidentTypes.Any(a => a.IncidentTypeShortDesc == ((IncidentType)entityEntry.Entity).IncidentTypeShortDesc || a.IncidentTypeDesc == ((IncidentType)entityEntry.Entity).IncidentTypeDesc )) { // return validation error return(new DbEntityValidationResult(entityEntry, new List <DbValidationError>() { new DbValidationError("IncidentType", string.Format("Duplicate IncidentType: '{0}' or '{1}'", ((IncidentType)entityEntry.Entity).IncidentTypeShortDesc, ((IncidentType)entityEntry.Entity).IncidentTypeShortDesc)) })); } } // if (entityEntry.Entity is NIC && entityEntry.State == EntityState.Added) { if (NICs.Any(a => a.NIC_Id == ((NIC)entityEntry.Entity).NIC_Id || a.NICDescription == ((NIC)entityEntry.Entity).NICDescription )) { // return validation error return(new DbEntityValidationResult(entityEntry, new List <DbValidationError>() { new DbValidationError("NIC", string.Format("Duplicate NIC: '{0}' or '{1}'", ((NIC)entityEntry.Entity).NIC_Id, ((NIC)entityEntry.Entity).NICDescription)) })); } } if (entityEntry.Entity is NoteType && entityEntry.State == EntityState.Added) { if (NoteTypes.Any(a => a.NoteTypeDesc == ((NoteType)entityEntry.Entity).NoteTypeDesc)) { // return validation error return(new DbEntityValidationResult(entityEntry, new List <DbValidationError>() { new DbValidationError("NoteType", "Duplicate NoteType: '" + ((NoteType)entityEntry.Entity).NoteTypeDesc + "'") })); } } // return(base.ValidateEntity(entityEntry, items)); }
public EditorJudgement(float time, float x, NoteTypes type) { this.time = time; this.x = x; this.type = type; }
public Note(NotePosition position, NoteTypes type) { this.position = position; this.type = type; }
/// <summary> /// Get the note for the specified 'type' if it exists. /// </summary> /// <param name="project"></param> /// <param name="type"></param> /// <returns>Note for specified type, or null if one isn't found.</returns> public static ProjectNote GetNote(this Project project, NoteTypes type) { return(project.Notes.FirstOrDefault(n => n.NoteType == type)); }
/// <summary> /// Get the note text for the specified 'type' if it exists. /// </summary> /// <param name="project"></param> /// <param name="type"></param> /// <returns>Note for specified type, or null if one isn't found.</returns> public static string GetNoteText(this Project project, NoteTypes type) { return(project.GetNote(type)?.Note); }
public Note(Note note) { this.startPosition = note.startPosition; this.type = note.type; }