示例#1
0
        public override IEnumerable <Item> Perform(IEnumerable <Item> items, IEnumerable <Item> modItems)
        {
            TomboyDBus tb = new TomboyDBus();

            // This action will start Tomboy if it is not
            // already running.
            tb.SearchNotes((items.First() as ITextItem).Text);
            yield break;
        }
示例#2
0
        /// <summary>
        /// This method run in the constructor to find the notes we can get
        /// ahold of.
        /// </summary>
        public override void UpdateItems()
        {
            TomboyDBus tb = new TomboyDBus();

            // Only query Tomboy if it is already running.
            // Do not start it prematurely.
            if (!tb.Connected && !tb.NotesUpdated)
            {
                return;
            }

            notes.Clear();
            foreach (string title in tb.GetAllNoteTitles())
            {
                notes.Add(new NoteItem(title));
            }
            tb.NotesUpdated = false;
        }
示例#3
0
        public override IEnumerable <Item> Perform(IEnumerable <Item> items, IEnumerable <Item> modItems)
        {
            ITextItem mainItem = items.First() as ITextItem;

            ITextItem modItem = null;

            if (modItems.Any())
            {
                modItem = modItems.First() as ITextItem;
            }

            string title = null, content = null;

            // Check prefs to see if first text item should be
            // note title or content. The modifier item can provide
            // content or title, respectively.
            if (TomboyConfiguration.TitleFirst)
            {
                title = mainItem.Text;
                if (modItem != null)
                {
                    content = modItem.Text;
                }
            }
            else
            {
                content = mainItem.Text;
                if (modItem != null)
                {
                    title = modItem.Text;
                }
            }

            TomboyDBus tb = new TomboyDBus();

            // Null values are acceptable here.
            tb.CreateNewNote(title, content);

            yield break;
        }
示例#4
0
        /// <summary>
        /// This method run in the constructor to find the notes we can get
        /// ahold of.
        /// </summary>
        public override void UpdateItems()
        {
            TomboyDBus tb = new TomboyDBus();
            // Only query Tomboy if it is already running.
            // Do not start it prematurely.
            if (!tb.Connected && !tb.NotesUpdated)
                return;

            notes.Clear ();
            foreach(string title in tb.GetAllNoteTitles ())
                notes.Add (new NoteItem (title));
            tb.NotesUpdated = false;
        }
示例#5
0
        public override IEnumerable<Item> Perform(IEnumerable<Item> items, IEnumerable<Item> modItems)
        {
            ITextItem mainItem = items.First () as ITextItem;

            ITextItem modItem = null;
            if (modItems.Any ()) {
                modItem = modItems.First () as ITextItem;
            }

            string title = null, content = null;
            // Check prefs to see if first text item should be
            // note title or content. The modifier item can provide
            // content or title, respectively.
            if (TomboyConfiguration.TitleFirst) {
                title = mainItem.Text;
                if (modItem != null)
                    content = modItem.Text;
            } else {
                content = mainItem.Text;
                if (modItem != null)
                    title = modItem.Text;
            }

            TomboyDBus tb = new TomboyDBus ();
            // Null values are acceptable here.
            tb.CreateNewNote (title, content);

            yield break;
        }