Esempio n. 1
0
File: Main.cs Progetto: owq/NOTE
 public static void Test()
 {
     NotesModel notes = new NotesModel();
     Note n = new Note {
         Title = "Testing",
         Content = "Works"
     };
     //notes.Add(n);
     //notes.SaveToFile();
     notes.LoadFromFile();
     //Note loaded = notes.[0];
     //Console.WriteLine (loaded.Title);
 }
Esempio n. 2
0
File: Main.cs Progetto: owq/NOTE
        public static void Test()
        {
            NotesModel notes = new NotesModel();
            Note       n     = new Note {
                Title   = "Testing",
                Content = "Works"
            };

            //notes.Add(n);
            //notes.SaveToFile();
            notes.LoadFromFile();
            //Note loaded = notes.[0];
            //Console.WriteLine (loaded.Title);
        }
Esempio n. 3
0
    public MainWindow()
        : base(Gtk.WindowType.Toplevel)
    {
        Build ();

        //Notes
        TreeViewColumn notesCol = new TreeViewColumn();
        notesCol.Title = "Notes";
        treeviewNotes.AppendColumn(notesCol);
        //		ListStore nStore = new ListStore(typeof (string));
        //		treeviewNotes.Model = nStore;
        //		nStore.AppendValues("HAHAHA");

        CellRendererText noteTitleCell = new CellRendererText();
        notesCol.PackStart(noteTitleCell, true);
        notesCol.AddAttribute(noteTitleCell, "text", 0);
        /*
        TreeSelection ts = treeviewNotes.Selection;
        ts.Mode = SelectionMode.Multiple;
        treeviewNotes.RubberBanding = true;
        */
        //TODO if multiple selected disable NoteEditor

        notes = new NotesModel();
        treeviewNotes.Model = notes.NotesStore;

        //Tags
        TreeViewColumn tagsCol = new TreeViewColumn();
        tagsCol.Title = "Tags";
        TreeViewColumn tagsCountCol = new TreeViewColumn();
        tagsCountCol.SortIndicator = true;
        tagsCountCol.Title = "Count";
        treeviewTags.AppendColumn(tagsCol);
        treeviewTags.AppendColumn(tagsCountCol);
        treeviewTags.Model = notes.TagStore;

        CellRendererText tagTitleCell = new CellRendererText();
        tagsCol.PackStart(tagTitleCell, true);
        tagsCol.AddAttribute(tagTitleCell, "text", 0);

        CellRendererText tagCountCell = new CellRendererText();
        tagsCountCol.PackStart(tagCountCell, true);
        tagsCountCol.AddAttribute(tagCountCell, "text", 1);
    }