Ejemplo n.º 1
0
        public override IEnumerable <Item> Perform(IEnumerable <Item> items, IEnumerable <Item> modItems)
        {
            Item item = items.First();

            using (Process zim = new Process()) {
                zim.StartInfo.FileName = "zim";

                if (item is ITextItem)
                {
                    ITextItem textitem = item as ITextItem;
                    string    args     = textitem.Text;
                    if (!args.Contains(" :"))
                    {
                        args = "_default_ " + args;
                    }

                    zim.StartInfo.Arguments = args;
                }
                else
                {
                    ZimPage page = item as ZimPage;
                    zim.StartInfo.Arguments = page.Notebook + " " + page.Name;
                }
                zim.Start();
            }
            yield break;
        }
Ejemplo n.º 2
0
        public override IEnumerable <Item> Perform(IEnumerable <Item> items, IEnumerable <Item> modItems)
        {
            ZimPage   page            = items.First() as ZimPage;
            ITextItem newPageNameItem = modItems.First() as ITextItem;

            Process zim = new Process();

            zim.StartInfo.FileName  = "zim";
            zim.StartInfo.Arguments = page.Notebook + " " + page.Name + ":" + newPageNameItem.Text;
            zim.Start();

            yield break;
        }
Ejemplo n.º 3
0
        public override void UpdateItems()
        {
            items.Clear();

            Dictionary <string, string> repos = Zim.LoadNotebooks();

            foreach (string key in repos.Keys)
            {
                if (Directory.Exists(repos[key]))
                {
                    foreach (string file in FindFilesInRepository(repos [key]))
                    {
                        ZimPage page = new ZimPage(file.Substring(0, file.Length - 4).Replace("/", ":"), key);
                        items.Add(page);
                    }
                }
            }
        }