Exemplo n.º 1
0
		/// <summary>
		/// Delete the selected note
		/// </summary>
		private void bDelete_Click(object sender, System.EventArgs e)
		{
			Pandora.Profile.Notes.NotesList.Remove( SelectedNote );
			tNotes.Nodes.Remove( tNotes.SelectedNode );

			if ( tNotes.SelectedNode == null )
			{
				SelectedNote = null;
			}
		}
Exemplo n.º 2
0
		/// <summary>
		/// Create a new note
		/// </summary>
		private void bAdd_Click(object sender, System.EventArgs e)
		{
			Note note = new Note( "Note" );
			TreeNode node = new TreeNode( "Note" );
			node.Tag = note;

			node.ImageIndex = (int) NotePriority.Normal;
			node.SelectedImageIndex = (int) NotePriority.Normal;

			Pandora.Profile.Notes.NotesList.Add( note );

			tNotes.Nodes.Add( node );
			tNotes.SelectedNode = node;

			txName.Text = "Note";
		}
Exemplo n.º 3
0
		/// <summary>
		/// Selection of a note on the tree
		/// </summary>
		private void tNotes_AfterSelect(object sender, System.Windows.Forms.TreeViewEventArgs e)
		{
			if ( e.Node != null )
			{
				SelectedNote = e.Node.Tag as Note;
			}
		}
Exemplo n.º 4
0
		/// <summary>
		/// Refreshes the list of notes
		/// </summary>
		/// <param name="select">The note that should be selected after the refresh</param>
		private void RefreshNotes( Note select )
		{
			tNotes.BeginUpdate();
			tNotes.Nodes.Clear();

			tNotes.Nodes.AddRange( Pandora.Profile.Notes.TreeNodes );

			tNotes.EndUpdate();

			if ( select != null )
			{
				foreach ( TreeNode node in tNotes.Nodes )
				{
					if ( ( node.Tag as Note ) == select )
					{
						tNotes.SelectedNode = node;
						break;
					}
				}
			}
		}