예제 #1
0
        /// <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;
        }
예제 #2
0
        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;
            }
        }
예제 #3
0
        public static Note FromInt(int note)
        {
            NoteLabel n = (NoteLabel)(note % OctaveLength);
            byte      o = (byte)(note / OctaveLength);

            return(new Note(n, o));
        }
예제 #4
0
        /// <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);
        }
예제 #5
0
 /// <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();
     }
 }
예제 #6
0
        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("");
            }
        }
예제 #7
0
        /// <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);
            }
        }
예제 #8
0
        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;
            }
        }
예제 #9
0
        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;
            }
        }
예제 #10
0
        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;
            }
        }
예제 #11
0
        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();
        }
예제 #12
0
 public Note(NoteLabel note, byte octave)
 {
     Label  = note;
     Octave = octave;
 }