public void LoadAndUpNotes() { Task task = new Task(LoadNotesCollection); task.Start(); void LoadNotesCollection() { notes = dbl.GetUserNotes(user_id); UpNotes(); } void UpNotes() { foreach (var note in notes) { NoteBlock block = new NoteBlock(note); this.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.SystemIdle, (ThreadStart) delegate() { sp_notes.Children.Add(block.GetNoteBlock()); }); } } }
public int Compare(object x, object y) { NoteBlock noteBlock1 = (NoteBlock)x; NoteBlock noteBlock2 = (NoteBlock)y; return(noteBlock1.GetMyNumber() - noteBlock2.GetMyNumber()); }
private void UIElement_OnMouseDoubleClick(object sender, MouseButtonEventArgs e) { NoteBlock.Focusable = true; NoteBlock.IsReadOnly = false; NoteBlock.Focus(); NoteBlock.Text = ""; NoteBlock.ToolTip = "Enter note name and press enter."; }
private void CreateNoteBlock(NoteType noteType) { //TODO: Pooling of the notes if moved past a prototype const float blockSpeed = 4.0f; GameObject noteObj = Object.Instantiate(m_notePrefab, m_cameraController.CameraPosition, Quaternion.identity); NoteBlock note = new NoteBlock(noteObj.transform, noteType, blockSpeed * m_cameraController.CameraForward); m_noteBlocks.Add(note); }