Beispiel #1
0
        // todo: check vs quizo's
        public static List <ToolStripItem> CreateRecentFilesItems()
        {
            List <ToolStripItem> ret      = new List <ToolStripItem>();
            List <string>        toRemove = new List <string>();

            if (StaticReg.ExecutedPathsList.Count > 0)
            {
                foreach (string path in StaticReg.ExecutedPathsList.Reverse())
                {
                    if (QTUtility2.IsNetworkPath(path) || File.Exists(path))
                    {
                        QMenuItem item = new QMenuItem(QTUtility2.MakeNameEllipsis(Path.GetFileName(path)), MenuGenre.RecentFile);
                        item.Path = item.ToolTipText = path;
                        item.SetImageReservationKey(path, Path.GetExtension(path));
                        ret.Add(item);
                    }
                    else
                    {
                        toRemove.Add(path);
                    }
                }
            }
            foreach (string str in toRemove)
            {
                StaticReg.ExecutedPathsList.Remove(str);
            }
            return(ret);
        }
Beispiel #2
0
        public static List <ToolStripItem> CreateRecentFilesItems()
        {
            List <ToolStripItem> list  = new List <ToolStripItem>();
            List <string>        list2 = new List <string>();

            if (QTUtility.ExecutedPathsList.Count > 0)
            {
                for (int i = QTUtility.ExecutedPathsList.Count - 1; i >= 0; i--)
                {
                    string path = QTUtility.ExecutedPathsList[i];
                    if (QTUtility2.IsNetworkPath(path) || File.Exists(path))
                    {
                        bool      flag;
                        QMenuItem item = new QMenuItem(QTUtility2.MakeNameEllipsis(Path.GetFileName(path), out flag), MenuGenre.RecentFile);
                        item.Path = item.ToolTipText = path;
                        item.SetImageReservationKey(path, Path.GetExtension(path));
                        list.Add(item);
                    }
                    else
                    {
                        list2.Add(path);
                    }
                }
            }
            foreach (string str2 in list2)
            {
                QTUtility.ExecutedPathsList.Remove(str2);
            }
            return(list);
        }