示例#1
0
        private async Task <int> GetNotes()
        {
            ListofItems = new List <NotedItem>();

            //retives it then if null its converts it to 0
            string SAoN = await SecureStorage.GetAsync("NotesAmount_Key");

            int AmountOfNotes = Convert.ToInt32(SAoN);

            if (AmountOfNotes.Equals(0))
            {
                return(0);
            }
            string KeyNote = "SecureNoteKey";

            for (int i = 1; i <= AmountOfNotes; i++)
            {
                //Loop to each item and
                string NoteJSON = await SecureStorage.GetAsync(string.Join("_", KeyNote, i));

                //if there is nothing there just skip it
                if (!Equals(NoteJSON, null))
                {
                    //if there is something there move it
                    ListofItems.Add(NotedItem.Static_PraseJSON(NoteJSON));
                }
            }

            NotesDisplay.ItemsSource = ListofItems;

            return(1);
        }
示例#2
0
        //for some reason this works ????
        private async void GetNoteFromMemory(int ID)
        {
            string NoteKey  = string.Join("_", "SecureNoteKey", ID);
            string JSONNote = await SecureStorage.GetAsync(NoteKey);

            Memo = NotedItem.Static_PraseJSON(JSONNote);
        }
示例#3
0
 //When we create a new Item
 public NotesEdit()
 {
     InitializeComponent();
     Memo               = new NotedItem();
     EditingMode        = false;
     PageTitleText.Text = "New Note!";
 }
示例#4
0
        public void PraseJSON(string input)
        {
            NotedItem temp = JsonConvert.DeserializeObject <NotedItem>(input);

            LastModifiedDate = temp.LastModifiedDate;
            TitleText        = temp.TitleText;
            ContentText      = temp.ContentText;
        }