/// <summary> /// Updates the label. /// </summary> public async void UpdateLabel() { var userid = DependencyService.Get <IDatabaseInterface>().GetId(); NoteLabel noteLabel = await this.LabelHelper.GetLabel(this.keyLab); txtLabel.Text = noteLabel.Noteslabel; }
void ReleaseDesignerOutlets() { if (LogView != null) { LogView.Dispose(); LogView = null; } if (NoteLabel != null) { NoteLabel.Dispose(); NoteLabel = null; } if (ReachableLabel != null) { ReachableLabel.Dispose(); ReachableLabel = null; } if (TableContainerView != null) { TableContainerView.Dispose(); TableContainerView = null; } if (TablePlaceholderView != null) { TablePlaceholderView.Dispose(); TablePlaceholderView = null; } }
public static Note FromInt(int note) { NoteLabel n = (NoteLabel)(note % OctaveLength); byte o = (byte)(note / OctaveLength); return(new Note(n, o)); }
/// <summary> /// Labels the edits. /// </summary> public void LabelEdits() { var userid = DependencyService.Get <IDatabaseInterface>().GetId(); NoteLabel labelNotes = new NoteLabel() { Noteslabel = txtLabel.Text }; this.LabelHelper.UpdateLabel(labelNotes, this.keyLab); }
/// <summary> /// Submits the label. /// </summary> /// <param name="noteLabel">The note label.</param> /// <returns>return label added </returns> public async Task SubmitLabel(NoteLabel noteLabel) { try { var userid = DependencyService.Get <IDatabaseInterface>().GetId(); if (userid != null) { await this.Firebase.Child("Users").Child(userid).Child("Labels").PostAsync(new NoteLabel() { Noteslabel = noteLabel.Noteslabel }); } } catch (Exception) { Console.WriteLine(); } }
public static string GetString(this NoteLabel n) { switch (n) { case NoteLabel.A: return("A"); case NoteLabel.AS: return("A#"); case NoteLabel.B: return("B"); case NoteLabel.C: return("C"); case NoteLabel.CS: return("C#"); case NoteLabel.D: return("D"); case NoteLabel.DS: return("D#"); case NoteLabel.E: return("E"); case NoteLabel.F: return("F"); case NoteLabel.FS: return("F#"); case NoteLabel.G: return("G"); case NoteLabel.GS: return("G#"); default: return(""); } }
/// <summary> /// Updates the label. /// </summary> /// <param name="noteLabel">The note label.</param> /// <param name="labelKey">The label key.</param> public void UpdateLabel(NoteLabel noteLabel, string labelKey) { try { ////Get current user id var userid = DependencyService.Get <IDatabaseInterface>().GetId(); if (userid != null) { ////Used to add the User record to the database with Firebase authentication Id this.Firebase.Child("Users").Child(userid).Child("Labels").Child(labelKey).PutAsync <NoteLabel>(new NoteLabel { Noteslabel = noteLabel.Noteslabel }); } } catch (Exception e) { Console.WriteLine(e.Message); } }
void ReleaseDesignerOutlets() { if (PublicationNameLabel != null) { PublicationNameLabel.Dispose(); PublicationNameLabel = null; } if (DateLabel != null) { DateLabel.Dispose(); DateLabel = null; } if (GuidecardLabel != null) { GuidecardLabel.Dispose(); GuidecardLabel = null; } if (HighlightTextLabel != null) { HighlightTextLabel.Dispose(); HighlightTextLabel = null; } if (NoteLabel != null) { NoteLabel.Dispose(); NoteLabel = null; } if (TagContainerView != null) { TagContainerView.Dispose(); TagContainerView = null; } }
void ReleaseDesignerOutlets() { if (CaptionLabel != null) { CaptionLabel.Dispose(); CaptionLabel = null; } if (NoteLabel != null) { NoteLabel.Dispose(); NoteLabel = null; } if (LocationLabel != null) { LocationLabel.Dispose(); LocationLabel = null; } if (MainImageView != null) { MainImageView.Dispose(); MainImageView = null; } if (DateTimeLabel != null) { DateTimeLabel.Dispose(); DateTimeLabel = null; } if (DeleteButton != null) { DeleteButton.Dispose(); DeleteButton = null; } }
void ReleaseDesignerOutlets() { if (bgView != null) { bgView.Dispose(); bgView = null; } if (conLabel != null) { conLabel.Dispose(); conLabel = null; } if (dateLabel != null) { dateLabel.Dispose(); dateLabel = null; } if (TocLabel != null) { TocLabel.Dispose(); TocLabel = null; } if (imageIma != null) { imageIma.Dispose(); imageIma = null; } if (NoteLabel != null) { NoteLabel.Dispose(); NoteLabel = null; } }
public static void Initialize(DatabaseContext context) { //context.Database.EnsureCreated(); // Look for any users. if (context.Users.Any()) { return; // DB has been seeded } var users = new User[] { new User { Username = "******", Email = "*****@*****.**", Name = "Nghia Dau", CreatedAt = DateTime.Parse("2010-09-01"), UpdatedAt = DateTime.Parse("2010-09-01") }, new User { Username = "******", Email = "*****@*****.**", Name = "Admin", CreatedAt = DateTime.Parse("2010-09-01"), UpdatedAt = DateTime.Parse("2010-09-01") }, }; context.Users.AddRange(users); context.SaveChanges(); var notes = new Note[] { new Note { Title = "Carson", Description = "Alexander", UserId = users.Single(i => i.Username == "nghiadd").Id, ColorId = 1, CreatedAt = DateTime.Parse("2010-09-01"), UpdatedAt = DateTime.Parse("2010-09-01") }, new Note { Title = "fsfsf", Description = "fsfsf fsfsf", UserId = users.Single(i => i.Username == "nghiadd").Id, ColorId = 2, CreatedAt = DateTime.Parse("2010-09-01"), UpdatedAt = DateTime.Parse("2010-09-01") }, new Note { Title = "fsdfds", Description = "fsdfsdf", UserId = users.Single(i => i.Username == "nghiadd").Id, ColorId = 3, CreatedAt = DateTime.Parse("2010-09-01"), UpdatedAt = DateTime.Parse("2010-09-01") }, new Note { Title = "fsdf", Description = "dfsdf", UserId = users.Single(i => i.Username == "nghiadd").Id, ColorId = 1, CreatedAt = DateTime.Parse("2010-09-01"), UpdatedAt = DateTime.Parse("2010-09-01") }, new Note { Title = "Carfsdfson", Description = "sdfsdfsdfsd", UserId = users.Single(i => i.Username == "admin").Id, ColorId = 1, CreatedAt = DateTime.Parse("2010-09-01"), UpdatedAt = DateTime.Parse("2010-09-01") }, new Note { Title = "Cars24324sfon", Description = "sdfs", UserId = users.Single(i => i.Username == "admin").Id, ColorId = 1, CreatedAt = DateTime.Parse("2010-09-01"), UpdatedAt = DateTime.Parse("2010-09-01") }, new Note { Title = "fsdaf", Description = "Alexafasdfnder", UserId = users.Single(i => i.Username == "admin").Id, ColorId = 1, CreatedAt = DateTime.Parse("2010-09-01"), UpdatedAt = DateTime.Parse("2010-09-01") }, new Note { Title = "sdfsdf", Description = "Alexaafasdnder", UserId = users.Single(i => i.Username == "admin").Id, ColorId = 1, CreatedAt = DateTime.Parse("2010-09-01"), UpdatedAt = DateTime.Parse("2010-09-01") }, new Note { Title = "fsdfs", Description = "Alexandfdsafdsfsaer", UserId = users.Single(i => i.Username == "admin").Id, ColorId = 1, CreatedAt = DateTime.Parse("2010-09-01"), UpdatedAt = DateTime.Parse("2010-09-01") }, }; context.Notes.AddRange(notes); context.SaveChanges(); var labels = new Label[] { new Label { Name = "English", UserId = users.Single(i => i.Username == "nghiadd").Id, CreatedAt = DateTime.Parse("2010-09-01"), UpdatedAt = DateTime.Parse("2010-09-01") }, new Label { Name = "Drama", UserId = users.Single(i => i.Username == "nghiadd").Id, CreatedAt = DateTime.Parse("2010-09-01"), UpdatedAt = DateTime.Parse("2010-09-01") }, new Label { Name = "Crime", UserId = users.Single(i => i.Username == "admin").Id, CreatedAt = DateTime.Parse("2010-09-01"), UpdatedAt = DateTime.Parse("2010-09-01") }, new Label { Name = "Japan", UserId = users.Single(i => i.Username == "admin").Id, CreatedAt = DateTime.Parse("2010-09-01"), UpdatedAt = DateTime.Parse("2010-09-01") }, }; context.Labels.AddRange(labels); context.SaveChanges(); var noteLabels = new NoteLabel[] { new NoteLabel { NoteId = notes.Single(n => n.Title == "Carson").Id, LabelId = labels.Single(l => l.Name == "English").Id, }, new NoteLabel { NoteId = notes.Single(n => n.Title == "sdfsdf").Id, LabelId = labels.Single(l => l.Name == "Crime").Id, }, }; context.NoteLabels.AddRange(noteLabels); context.SaveChanges(); }
public Note(NoteLabel note, byte octave) { Label = note; Octave = octave; }