Ejemplo n.º 1
0
        private void CreateNewNote_OnClick(object sender, RoutedEventArgs e)
        {
            string newName;

            NoteText.Text = String.Empty;
            NotesList.UnselectAll();

            Names name = new Names();

            name.ShowDialog();
            newName = name.NewName.Text;
            if (newName == "")
            {
                return;
            }

            Note note = new Note
            {
                Name = newName,
                Text = NoteText.Text
            };

            NotesDL.GetInstance.AddNote(Application.Current.Properties["UserName"].ToString(), note);
            InitNotes();

            MessageBox.Show("File successfully saved");
        }
Ejemplo n.º 2
0
 private void OnSelectedNoteChanged()
 {
     if (SelectedNote != null)
     {
         NotesList.ScrollIntoView(SelectedNote);
     }
 }
        public string Post([FromBody] NotesList value)
        {
            //    Account sd = value;
            int s = 1;

            return(JsonConvert.SerializeObject(value));
        }
Ejemplo n.º 4
0
        public Track Clone()
        {
            var clone = (Track)MemberwiseClone();

            clone.NotesList = new List <Notes>();
            NotesList.ForEach(x => clone.NotesList.Add(x.Clone()));

            clone.InstrumentList = new LinkedList <Event.Instrument>();
            foreach (Event.Instrument inst in InstrumentList)
            {
                clone.InstrumentList.AddLast(inst.Clone());
            }

            clone.VolumeList = new LinkedList <Event.Volume>();
            foreach (Event.Volume vol in VolumeList)
            {
                clone.VolumeList.AddLast(vol.Clone());
            }

            clone.PanList = new LinkedList <Event.Pan>();
            foreach (Event.Pan pan in PanList)
            {
                clone.PanList.AddLast(pan.Clone());
            }

            return(clone);
        }
        private async Task LoadNotes()
        {
            IsBusy = true;

            try
            {
                NotesList.Clear();

                await Task.Delay(new Random().Next(1000, 2000));

                var items = await DatabaseService.GetAllNotes();

                foreach (var item in items)
                {
                    NotesList.Add(item);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
            finally
            {
                IsBusy = false;
            }
        }
Ejemplo n.º 6
0
        public NotesList Read(int page = 1, DateTime?dateFrom = null, DateTime?dateTo = null, int?categoryId = null)
        {
            var filteredList = GetFilteredList(dateFrom, dateTo, categoryId);

            var allPages = (int)Math.Ceiling((decimal)(filteredList.Count()) / 10);

            if (page > allPages)
            {
                page = allPages;
            }
            if (page == 0)
            {
                page = 1;
            }

            var notes = filteredList
                        .Skip((page - 1) * 10)
                        .Take(10)
                        .ToList();

            var notesList = new NotesList
            {
                Notes = notes.Select(n => new NoteWithCategories {
                    Description = n.Description,
                    NoteID      = n.NoteID,
                    Title       = n.Title,
                    Categories  = n.NoteCategories.Select(nc => nc.Category.Title).ToList(),
                    NoteDate    = n.NoteDate
                }).ToList(),
                CurrentPage = page,
                AllPages    = allPages == 0 ? 1 : allPages,
            };

            return(notesList);
        }
Ejemplo n.º 7
0
        public ActionResult List(DateTime bDate, DateTime eDate, string SearchType = "", int codeID = 0, string code = "")
        {
            IEnumerable <meetingnote> NotesList;

            /*
             * if(SearchType == "AgendaSearch")
             * {
             * NotesList = MeetingNoteRepository.GetMeetingNotesByAgenda(codeID);
             * }
             * else */
            if (SearchType == "MinistrySearch")
            {
                NotesList = MeetingNoteRepository.GetMeetingNotesByMinistry(codeID, bDate, eDate);
            }

            /*
             * else if(SearchType == "MeetingSearch")
             * {
             * NotesList = MeetingNoteRepository.GetMeetingNotesByAgenda(codeID);
             * }
             * else
             * */
            else if (SearchType == "StatusSearch")
            {
                NotesList = MeetingNoteRepository.GetMeetingNotesByStatus(code);
            }
            else
            {
                NotesList = MeetingNoteRepository.GetMeetingNotesByDateRange(bDate, eDate);
            }

            ViewBag.RecordCount = NotesList.Count();

            return(PartialView(NotesList));
        }
Ejemplo n.º 8
0
        private void DeleteNoteButtonClicked(object sender, EventArgs args)
        {
            _mainWindowViewModel.Remove(NotesList[_noteIndex]);
            NotesList.RemoveAt(_noteIndex);
            if (NotesList.Count == 0)
            {
                noteDescription.Text      = labelNoteChange.Text = labelPriority.Text = string.Empty;
                noteDescription.BackColor = eventDescription.BackColor;
                return;
            }
            int index;

            if (_noteIndex >= 0 && _noteIndex < NotesList.Count)
            {
                index = _eventIndex;
            }
            else
            {
                index = _eventIndex - 1;
            }
            var description = new StringBuilder();

            description.AppendLine(NotesList[index].Content);
            labelNoteChange.Text      = NotesList[index].TimeOfChange.ToShortDateString();
            labelPriority.Text        = Convert.ToString(NotesList[index].Priority);
            noteDescription.Text      = description.ToString();
            noteDescription.BackColor = NotesList[index].Color;
            UpdateNoteListBox();
        }
Ejemplo n.º 9
0
 private void AddNote(object obj)
 {
     SelectedBookNote = new BookNoteDTO()
     {
         StartDate = DateTime.Now
     };
     SelectedBookNote.Workbook = SelectedWorkBook;
     NotesList.Add(_selectedBookNote);
 }
Ejemplo n.º 10
0
        public static void ReadCallback(IAsyncResult ar)
        {
            String content = String.Empty;

            // Retrieve the state object and the handler socket
            // from the asynchronous state object.
            StateObject state   = (StateObject)ar.AsyncState;
            Socket      handler = state.workSocket;

            // Read data from the client socket.
            int bytesRead = handler.EndReceive(ar);

            if (bytesRead > 0)
            {
                // There  might be more data, so store the data received so far.
                state.sb.Append(Encoding.ASCII.GetString(
                                    state.buffer, 0, bytesRead));

                // Check for end-of-file tag. If it is not there, read
                // more data.
                content = state.sb.ToString();
                if (content.IndexOf("<EOF>") > -1)
                {
                    // All the data has been read from the
                    // client. Display it on the console.
                    Console.WriteLine("\nRead {0} bytes from socket.",
                                      content.Length);

                    // Echo the data back to the client.
                    Send(handler, content);

                    // Wait until it is safe to enter.
                    mut.WaitOne();

                    // Add content receive to the gradesList and remove <EOL>
                    NotesList.AddRange(content.Split('\n')
                                       .Where(i => i != content.Split('\n')
                                              .Last())
                                       .ToList());

                    // Console.WriteLine("\n NEW GRADES ADDED");
                    // Thread.Sleep(1000);

                    // Release the Mutex.
                    mut.ReleaseMutex();

                    // Create a thread that add new grades to the average
                    Task.Factory.StartNew(HandleNewGrades);
                }
                else
                {
                    // Not all data received. Get more.
                    handler.BeginReceive(state.buffer, 0, StateObject.BufferSize, 0,
                                         new AsyncCallback(ReadCallback), state);
                }
            }
        }
Ejemplo n.º 11
0
        private void btnNote_Click(object sender, EventArgs e)
        {
            var addInfo = tbxNoteText.Text.Length > 0 ? " " + tbxNoteText.Text : "";
            var note    = $"{NotesList.Count + 1}. {labelStopwatchTime.Text}{addInfo}";

            NotesList.Add(note);
            listBoxNotes.Focus();
            tbxNoteText.Text = "";
            notesBindingSource.DataSource = new BindingList <string>(NotesList);
        }
Ejemplo n.º 12
0
 private void UpdateNoteHandler(string type)
 {
     if (type == "PageNote")
     {
         FirePropertyChanged("NotesList");
         if (SelectedValue == null)
         {
             SelectedValue = NotesList.ElementAt(0).NoteName;
         }
     }
 }
 /// <summary>
 /// Заорегистрировать объект в реестре объектов
 /// </summary>
 /// <param name="control">TranspControl(стан или нота)</param>
 public static void RegisterObject(TranspControl control)
 {
     if (control is NoteTranspControl)
     {
         NotesList.Add(control as NoteTranspControl);
     }
     if (control is StaffTranspControl)
     {
         StaffList.Add(control as StaffTranspControl);
     }
 }
Ejemplo n.º 14
0
        /// <summary>
        /// Updates the Note
        /// </summary>
        /// <param name="source"></param>
        /// <param name="e"></param>
        protected void NotesList_UpdateCommand(object source, DataListCommandEventArgs e)
        {
            string notes        = ((TextBox)e.Item.FindControl("txtNoteSummary")).Text;
            string notecategory = ((TextBox)e.Item.FindControl("txtNoteCategory")).Text;
            string notedate     = ((TextBox)e.Item.FindControl("txtNoteDate")).Text;
            int    id           = Convert.ToInt32(NotesList.DataKeys[e.Item.ItemIndex]);

            rs.updateNotes(notes, notecategory, notedate, id);
            NotesList.EditItemIndex = -1;
            NotesList.DataBind();
        }
 /// <summary>
 /// Удалить последнюю ноту из реестра.
 /// </summary>
 public static void UnregisterLastNote()
 {
     if (NotesList.Count != 0)
     {
         Form1 noteForm      = NotesList[NotesList.Count - 1].FindForm() as Form1;
         var   getPanel      = noteForm.Controls.Find("panel1", false)[0].Controls.Find("scoreSheetPanel", false)[0];
         Panel noteContainer = (getPanel as Panel);
         noteContainer.Controls.Remove(NotesList[NotesList.Count - 1]);
         NotesList.RemoveAt(NotesList.Count - 1);
     }
 }
Ejemplo n.º 16
0
 // Start is called before the first frame update
 void Start()
 {
     Time.timeScale = 1;
     myTrack        = JsonUtility.FromJson <Track>(textJSON.text);
     Debug.Log(myTrack.name);
     Debug.Log(myTrack.BPM);
     Debug.Log(myTrack.offset);
     beatTempo   = myTrack.BPM / 60f;
     offset      = myTrack.offset / 10000;
     myNotesList = JsonUtility.FromJson <NotesList>(textJSON.text);
     SpawnNotes(2);
 }
Ejemplo n.º 17
0
    public void DisplayActualNote(NotesList notes, int option)
    {
        string line      = new string('-', Console.WindowWidth);
        string helpLine1 = "1 - Add  2 - Modify  3 - Delete  4 - Category";
        string helpLine2 = "<-- --> - Change Note  Esc-Exit";


        if (notes.Count == 0)
        {
            SetConsoleEmpty();
            Console.WriteLine("Not dates");

            Console.Write("Do you want add first record(yes/no): ");
            string answer = Console.ReadLine();
            if (answer == "yes")
            {
                Add();
            }
            else if (answer == "no")
            {
                Console.WriteLine("Okey. See you!");
                Console.WriteLine("Pres ESC to return.");
            }
        }
        else
        {
            SetConsole(notes);
            config.WriteBack(0, 2, "Completed items: ", false);
            int x = 0, y = 4;
            for (int i = 0; i < notesList.Count; i++)
            {
                if (notesList.Notes[i].Title ==
                    notesList.Notes[noteActual].Title &&
                    notesList.Notes[i].Category ==
                    notesList.Notes[noteActual].Category &&
                    notesList.Notes[i].Done == true)
                {
                    Console.SetCursorPosition(x, y);
                    Console.WriteLine((i + 1) + "." +
                                      notesList.Notes[i].Description);
                    y++;
                }
            }
            config.WriteBack("blue");
            config.WriteFore("white");
            config.WriteBack(0, (Console.WindowHeight - 3), line, false);
            config.WriteBack(Console.WindowWidth / 2 -
                             (helpLine1.Length / 2), Console.WindowHeight - 2, helpLine1, false);
            config.WriteBack(Console.WindowWidth / 2 -
                             (helpLine2.Length / 2), Console.WindowHeight - 1, helpLine2, false);
        }
    }
Ejemplo n.º 18
0
        /// <summary>
        /// Deletes (Soft Delete) the note
        /// </summary>
        /// <param name="source"></param>
        /// <param name="e"></param>
        protected void NotesList_DeleteCommand(object source, DataListCommandEventArgs e)
        {
            int id = Convert.ToInt32(NotesList.DataKeys[e.Item.ItemIndex]);

            rs.deleteNotes(id);
            NotesList.EditItemIndex = -1;
            NotesList.DataBind();
            if (Request.QueryString["AID"] != null)
            {
                id = Convert.ToInt32(Request.QueryString["AID"]);
            }
            processDropDowns(id);
        }
Ejemplo n.º 19
0
        private async Task ExecuteLoadItemsCommand()
        {
            this.NotesList.Clear();

            var notes = this.NoteService.GetAllNotes();

            foreach (var note in notes)
            {
                NotesList.Add(note);
            }

            await Task.Delay(1);
        }
Ejemplo n.º 20
0
    public void GetChosenOption(ref NotesList notes, ref int option,
                                ref int changeNote, ref bool exit)
    {
        ConsoleKeyInfo key;

        do
        {
            key = Console.ReadKey(true);
        } while (Console.KeyAvailable);

        switch (key.Key)
        {
        case ConsoleKey.NumPad1: Add(); break;

        case ConsoleKey.NumPad2: Modify(option); break;

        case ConsoleKey.NumPad3: Delete(option); break;

        //case ConsoleKey.NumPad4: Search(); break;
        case ConsoleKey.Escape:
            exit = true;
            notesList.Save();
            break;

        case ConsoleKey.LeftArrow:
            if (changeNote > 1)
            {
                changeNote--;
            }
            else
            {
                changeNote = notes.Count;
            }
            break;

        case ConsoleKey.RightArrow:
            if (changeNote < notes.Count)
            {
                changeNote++;
            }
            else
            {
                changeNote = 1;
            }
            break;

        default:
            break;
        }
    }
Ejemplo n.º 21
0
    public JObject Notes2JSON()
    {
        NotesList notesList = new NotesList
        {
            notes = new NoteInfo[mNotesInfoList.Count]
        };

        for (int i = 0; i < mNotesInfoList.Count; ++i)
        {
            notesList.notes[i] = mNotesInfoList[i];
        }

        return(JObject.FromObject(notesList));
    }
Ejemplo n.º 22
0
    public void Run()
    {
        ConfigureConsole();
        Console.Clear();
        notesList = new NotesList();
        int  option = 1, changeNote = 1;
        bool exit = false;

        do
        {
            DisplayActualNote(notesList, option);
            GetChosenOption(ref notesList, ref option, ref changeNote, ref exit);
        } while (!exit);
    }
Ejemplo n.º 23
0
 /// <summary>
 /// Binds all the grids
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void BindGrids(object sender, EventArgs e)
 {
     CompanyGrid.DataBind();
     DetailsView1.DataBind();
     MarketGrid.DataBind();
     CallCenterGrid.DataBind();
     NotesList.DataBind();
     EmailDeliveryGrid.DataBind();
     ContactGrid.DataBind();
     ContactEmailGrid.DataBind();
     ContactPhoneGrid.DataBind();
     BillingGrid.DataBind();
     BillingEmailGrid.DataBind();
     BillingPhoneGrid.DataBind();
 }
Ejemplo n.º 24
0
        /// <summary>
        /// Insert new note into DB.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnSubmitNote_Click(object sender, EventArgs e)
        {
            int id = 0;

            if (Request.QueryString["AID"] != null)
            {
                id = Convert.ToInt32(Request.QueryString["AID"]);
            }
            rs.insertNotes(txtNote.Text, txtNoteCategory.Text, txtNoteDate.Text, id);
            NotesList.DataBind();
            txtNote.Text         = "";
            txtNoteCategory.Text = "";
            txtNoteDate.Text     = "";
            processDropDowns(id);
        }
Ejemplo n.º 25
0
        private async Task LoadNotes()
        {
            IsBusy = true;

            await Task.Delay(new Random().Next(1000, 2000));

            NotesList.Clear();

            var items = await DatabaseService.GetAllNotes();

            foreach (var item in items)
            {
                NotesList.Add(item);
            }

            IsBusy = false;
        }
Ejemplo n.º 26
0
 private void SearchNoteButtonClicked(object sender, EventArgs args)
 {
     if (nameForSearch.Text.Equals(String.Empty))
     {
         MessageBox.Show("Имя заметки для поиска не указано! Укажите имя.", "Warning", MessageBoxButtons.OK);
     }
     else
     {
         _tempList = NotesList.Where(note => note.Name.Contains(nameForSearch.Text)).ToList();
         if (_tempList == null)
         {
             MessageBox.Show("Заметка с таким именем не найдена.", "Warning", MessageBoxButtons.OK);
             return;
         }
         _isSearching = true;
         UpdateNoteListBox();
     }
 }
Ejemplo n.º 27
0
        public static void HandleNewGrades()
        {
            try
            {
                // Wait until it is safe to enter.
                mut2.WaitOne();

                while (NotesList.Count() != 0)
                {
                    // Add new grades to the average as a string
                    AddNewGrades(NotesList.Last());

                    // Remove the grades add from waiting list
                    NotesList = NotesList.FindAll(notes => notes != NotesList.Last());
                }

                // Print the 'MoyennesElevesMatieres' list items
                foreach (var eleve in MoyennesElevesMatieres)
                {
                    Console.WriteLine("\nL'eleve {0}à :", eleve.nomEleve);

                    foreach (var matiere in eleve.listMoyenneMatiere)
                    {
                        Console.Write("{0:N2} de moyenne en{1} avec les notes: ", matiere.moyenne, matiere.matiere);
                        for (int i = 0; i < matiere.notes.Count; i++)
                        {
                            float note = matiere.notes[i];
                            Console.Write("{0} ", note);
                        }
                        Console.WriteLine();
                    }
                }

                // Console.WriteLine("\nAVERAGE CALCULATED");
                // Thread.Sleep(1000);

                // Release the Mutex.
                mut2.ReleaseMutex();
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
            }
        }
Ejemplo n.º 28
0
    private void SetConsole(NotesList notes)
    {
        Console.ResetColor();
        Console.Clear();


        Console.BackgroundColor = ConsoleColor.Blue;
        for (int i = 0; i < Console.WindowHeight; i++)
        {
            Console.Write(new string(' ', Console.WindowWidth));
            //To draw bar vertical in middle of screen
            if (i <= 23)
            {
                Console.SetCursorPosition((Console.WindowWidth / 2 - 1), i);
                Console.Write("|" + new string(' ', Console.WindowWidth / 2));
            }
            if (i == 2 || i == 21)
            {
                Console.SetCursorPosition(0, i);
                Console.Write(new string('-', (Console.WindowWidth / 2)));
                Console.SetCursorPosition(Console.WindowWidth / 2 + 1, i);
                Console.Write(new string('-', (Console.WindowWidth / 2)));
            }
            if (i == 1)
            {
                config.WriteBack((Console.WindowWidth / 2 - 20) -
                                 notes.Notes[noteActual].Title.Length / 2, i,
                                 notes.Notes[noteActual].Title, true);
            }

            if (i == 22)
            {
                string page = "Page " + noteActual + " of " + notes.NumPages;
                Console.SetCursorPosition(Console.WindowWidth / 2 - 25, i);
                Console.Write(page + new string(' ', 10));
                Console.SetCursorPosition(Console.WindowWidth / 2 + 1, i);
                Console.Write(new string(' ', Console.WindowWidth / 2 - 1));
            }
        }

        Console.SetCursorPosition(0, 0);
        Console.ForegroundColor = ConsoleColor.White;
    }
Ejemplo n.º 29
0
        static void Main(string[] args)
        {
            string str = Console.ReadLine();

            string[] amount_quantity = str.Split('/');
            string   strNotes        = Console.ReadLine();

            string[] tacts = strNotes.Split('|');

            int  amount   = Convert.ToInt32(amount_quantity[0]);
            byte quantity = Convert.ToByte(amount_quantity[1]);

            NotesList notesList = new NotesList(amount, quantity, tacts.Length - 1);

            string[] notes;

            try
            {
                for (int i = 0; i < tacts.Length - 1; i++)
                {
                    notes = tacts[i].Split(' ');

                    if (i != 0)
                    {
                        notesList.CheckBeat();
                    }

                    for (int j = 0; j < notes.Length; j++)
                    {
                        notesList.AddNote(Convert.ToByte(notes[j]));
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                Console.ReadKey();
                return;
            }

            notesList.Write();
            Console.ReadKey();
        }
Ejemplo n.º 30
0
 /// <summary>
 /// Init parameters when open,load or close project
 /// </summary>
 /// <param name="bOpen">true: create,open false: close</param>
 public void InitParameter(bool bOpen)
 {
     if (bOpen)
     {
         PageNoteEanbled = true;
         if (NotesList.Count > 0)
         {
             SelectedValue = NotesList.ElementAt(0).NoteName;
         }
         bSet2Document = true;
     }
     else
     {
         PageNoteEanbled = false;
         bSet2Document   = false;
     }
     _pageAnnotation = null;
     _model.ResetNameCounter();
     Raw_NoteTexts = string.Empty;
 }