Esempio n. 1
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 (path.StartsWith(@"\\") || 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);
        }
Esempio n. 2
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);
        }
Esempio n. 3
0
        // TODO: this is absent from Quizo's sources.  Figure out why.
        private static void AddChildrenOnOpening(DirectoryMenuItem parentItem)
        {
            bool          fTruncated;
            DirectoryInfo info      = new DirectoryInfo(parentItem.Path);
            EventPack     eventPack = parentItem.EventPack;

            foreach (DirectoryInfo info2 in info.GetDirectories()
                     .Where(info2 => (info2.Attributes & FileAttributes.Hidden) == 0))
            {
                string text = QTUtility2.MakeNameEllipsis(info2.Name, out fTruncated);
                DropDownMenuReorderable reorderable = new DropDownMenuReorderable(null);
                reorderable.MessageParent     = eventPack.MessageParentHandle;
                reorderable.ItemRightClicked += eventPack.ItemRightClickEventHandler;
                reorderable.ImageList         = QTUtility.ImageListGlobal;
                DirectoryMenuItem item = new DirectoryMenuItem(text);
                item.SetImageReservationKey(info2.FullName, null);
                item.Path         = info2.FullName;
                item.EventPack    = eventPack;
                item.ModifiedDate = info2.LastWriteTime;
                if (fTruncated)
                {
                    item.ToolTipText = info2.Name;
                }
                item.DropDown           = reorderable;
                item.DoubleClickEnabled = true;
                item.DropDownItems.Add(new ToolStripMenuItem());
                item.DropDownItemClicked += realDirectory_DropDownItemClicked;
                item.DropDownOpening     += realDirectory_DropDownOpening;
                item.DoubleClick         += eventPack.DirDoubleClickEventHandler;
                parentItem.DropDownItems.Add(item);
            }
            foreach (FileInfo info3 in info.GetFiles()
                     .Where(info3 => (info3.Attributes & FileAttributes.Hidden) == 0))
            {
                string fileNameWithoutExtension;
                string ext = info3.Extension.ToLower();
                switch (ext)
                {
                case ".lnk":
                case ".url":
                    fileNameWithoutExtension = Path.GetFileNameWithoutExtension(info3.Name);
                    break;

                default:
                    fileNameWithoutExtension = info3.Name;
                    break;
                }
                string    str4  = fileNameWithoutExtension;
                QMenuItem item2 = new QMenuItem(QTUtility2.MakeNameEllipsis(fileNameWithoutExtension, out fTruncated), MenuTarget.File, MenuGenre.Application);
                item2.Path = info3.FullName;
                item2.SetImageReservationKey(info3.FullName, ext);
                item2.MouseMove += qmi_File_MouseMove;
                if (fTruncated)
                {
                    item2.ToolTipText = str4;
                }
                parentItem.DropDownItems.Add(item2);
            }
        }
Esempio n. 4
0
        private static ToolStripItem CreateMenuItem_AppLauncher(string key, string[] appVals, EventPack ep)
        {
            string name = appVals[0];

            try {
                name = Environment.ExpandEnvironmentVariables(name);
            }
            catch {
            }
            MenuItemArguments mia = new MenuItemArguments(name, appVals[1], appVals[2], 0, MenuGenre.Application);

            if ((appVals[0].Length == 0) || string.Equals(appVals[0], "separator", StringComparison.OrdinalIgnoreCase))
            {
                ToolStripSeparator separator = new ToolStripSeparator();
                separator.Name = "appSep";
                return(separator);
            }
            if (appVals.Length == 4)
            {
                int.TryParse(appVals[3], out mia.KeyShortcut);
            }
            if ((name.StartsWith(@"\\") || name.StartsWith("::")) || !Directory.Exists(name))
            {
                mia.Target = MenuTarget.File;
                QMenuItem item = new QMenuItem(key, mia);
                item.Name = key;
                item.SetImageReservationKey(name, Path.GetExtension(name));
                item.MouseMove += new MouseEventHandler(MenuUtility.qmi_File_MouseMove);
                if (!ep.FromTaskBar && (mia.KeyShortcut > 0x100000))
                {
                    int num = mia.KeyShortcut & -1048577;
                    item.ShortcutKeyDisplayString = QTUtility2.MakeKeyString((Keys)num).Replace(" ", string.Empty);
                }
                return(item);
            }
            mia.Target = MenuTarget.Folder;
            DropDownMenuReorderable reorderable = new DropDownMenuReorderable(null);

            reorderable.MessageParent     = ep.MessageParentHandle;
            reorderable.ItemRightClicked += ep.ItemRightClickEventHandler;
            reorderable.ImageList         = QTUtility.ImageListGlobal;
            DirectoryMenuItem item2 = new DirectoryMenuItem(key);

            item2.SetImageReservationKey(name, null);
            item2.Name = key;
            item2.Path = name;
            item2.MenuItemArguments  = mia;
            item2.EventPack          = ep;
            item2.ModifiiedDate      = Directory.GetLastWriteTime(name);
            item2.DropDown           = reorderable;
            item2.DoubleClickEnabled = true;
            item2.DropDownItems.Add(new ToolStripMenuItem());
            item2.DropDownItemClicked += new ToolStripItemClickedEventHandler(MenuUtility.realDirectory_DropDownItemClicked);
            item2.DropDownOpening     += new EventHandler(MenuUtility.realDirectory_DropDownOpening);
            item2.DoubleClick         += ep.DirDoubleClickEventHandler;
            return(item2);
        }
Esempio n. 5
0
        private static void AddChildrenOnOpening(DirectoryMenuItem parentItem) {
            bool flag;
            DirectoryInfo info = new DirectoryInfo(parentItem.Path);
            EventPack eventPack = parentItem.EventPack;
            foreach(DirectoryInfo info2 in info.GetDirectories()) {
                if((info2.Attributes & FileAttributes.Hidden) == 0) {
                    string text = QTUtility2.MakeNameEllipsis(info2.Name, out flag);
                    DropDownMenuReorderable reorderable = new DropDownMenuReorderable(null);
                    reorderable.MessageParent = eventPack.MessageParentHandle;
                    reorderable.ItemRightClicked += eventPack.ItemRightClickEventHandler;
                    reorderable.ImageList = QTUtility.ImageListGlobal;
                    DirectoryMenuItem item = new DirectoryMenuItem(text);
                    item.SetImageReservationKey(info2.FullName, null);
                    item.Path = info2.FullName;
                    item.EventPack = eventPack;
                    item.ModifiiedDate = info2.LastWriteTime;
                    if(flag) {
                        item.ToolTipText = info2.Name;
                    }
                    item.DropDown = reorderable;
                    item.DoubleClickEnabled = true;
                    item.DropDownItems.Add(new ToolStripMenuItem());
                    item.DropDownItemClicked += new ToolStripItemClickedEventHandler(MenuUtility.realDirectory_DropDownItemClicked);
                    item.DropDownOpening += new EventHandler(MenuUtility.realDirectory_DropDownOpening);
                    item.DoubleClick += eventPack.DirDoubleClickEventHandler;
                    parentItem.DropDownItems.Add(item);
                }
            }
            foreach(FileInfo info3 in info.GetFiles()) {
                if((info3.Attributes & FileAttributes.Hidden) == 0) {
                    string fileNameWithoutExtension;
                    string ext = info3.Extension.ToLower();
                    switch(ext) {
                        case ".lnk":
                        case ".url":
                            fileNameWithoutExtension = Path.GetFileNameWithoutExtension(info3.Name);
                            break;

                        default:
                            fileNameWithoutExtension = info3.Name;
                            break;
                    }
                    string str4 = fileNameWithoutExtension;
                    QMenuItem item2 = new QMenuItem(QTUtility2.MakeNameEllipsis(fileNameWithoutExtension, out flag), MenuTarget.File, MenuGenre.Application);
                    item2.Path = info3.FullName;
                    item2.SetImageReservationKey(info3.FullName, ext);
                    item2.MouseMove += new MouseEventHandler(MenuUtility.qmi_File_MouseMove);
                    if(flag) {
                        item2.ToolTipText = str4;
                    }
                    parentItem.DropDownItems.Add(item2);
                }
            }
        }
Esempio n. 6
0
        private static ToolStripItem CreateMenuItem_AppLauncher(UserApp app, EventPack ep, ShellBrowserEx shellBrowser)
        {
            string path = app.Path;

            try {
                path = Environment.ExpandEnvironmentVariables(path);
            }
            catch {
            }
            MenuItemArguments mia = new MenuItemArguments(app, shellBrowser, MenuGenre.Application);

            if (path.StartsWith(@"\\") || path.StartsWith("::") || !Directory.Exists(path))
            {
                mia.Target = MenuTarget.File;
                QMenuItem item = new QMenuItem(app.Name, mia)
                {
                    Name = app.Name
                };
                item.SetImageReservationKey(path, Path.GetExtension(path));
                item.MouseMove += qmi_File_MouseMove;
                if (!ep.FromTaskBar && app.ShortcutKey != Keys.None)
                {
                    item.ShortcutKeyDisplayString = QTUtility2.MakeKeyString(app.ShortcutKey).Replace(" ", string.Empty);
                }
                return(item);
            }
            else
            {
                mia.Target = MenuTarget.Folder;
                DropDownMenuReorderable reorderable = new DropDownMenuReorderable(null)
                {
                    MessageParent = ep.MessageParentHandle,
                    ImageList     = QTUtility.ImageListGlobal
                };
                reorderable.ItemRightClicked += ep.ItemRightClickEventHandler;
                DirectoryMenuItem item = new DirectoryMenuItem(app.Name)
                {
                    Name = app.Name,
                    Path = path,
                    MenuItemArguments  = mia,
                    EventPack          = ep,
                    ModifiedDate       = Directory.GetLastWriteTime(path),
                    DropDown           = reorderable,
                    DoubleClickEnabled = true
                };
                item.DropDownItems.Add(new ToolStripMenuItem());
                item.DropDownItemClicked += realDirectory_DropDownItemClicked;
                item.DropDownOpening     += realDirectory_DropDownOpening;
                item.DoubleClick         += ep.DirDoubleClickEventHandler;
                item.SetImageReservationKey(path, null);
                return(item);
            }
        }
Esempio n. 7
0
        public static QMenuItem CreateMenuItem(MenuItemArguments mia)
        {
            QMenuItem item = new QMenuItem(QTUtility2.MakePathDisplayText(mia.Path, false), mia);

            if (((mia.Genre == MenuGenre.Navigation) && mia.IsBack) && (mia.Index == 0))
            {
                item.ImageKey = "current";
            }
            else
            {
                item.SetImageReservationKey(mia.Path, null);
            }
            item.ToolTipText = QTUtility2.MakePathDisplayText(mia.Path, true);
            return(item);
        }
Esempio n. 8
0
        public static List <ToolStripItem> CreateGroupItems(ToolStripDropDownItem dropDownItem)
        {
            List <ToolStripItem>    ret      = new List <ToolStripItem>();
            DropDownMenuReorderable dropDown = null;

            if (dropDownItem != null)
            {
                dropDown = (DropDownMenuReorderable)dropDownItem.DropDown;
                while (dropDown.Items.Count > 0)
                {
                    dropDown.Items[0].Dispose();
                }
                dropDown.ItemsClear();
            }
            const string key = "groups";

            foreach (Group group in GroupsManager.Groups)
            {
                if (group.Paths.Count == 0 || !QTUtility2.PathExists(group.Paths[0]))
                {
                    continue;
                }
                QMenuItem item = new QMenuItem(group.Name, MenuGenre.Group);
                item.SetImageReservationKey(group.Paths[0], null);
                if (dropDown != null)
                {
                    dropDown.AddItem(item, key);
                }
                ret.Add(item);
                if (!group.Startup)
                {
                    continue;
                }
                if (StartUpTabFont == null)
                {
                    StartUpTabFont = new Font(item.Font, FontStyle.Underline);
                }
                item.Font = StartUpTabFont;
            }
            if (dropDownItem != null)
            {
                dropDownItem.Enabled = dropDown.Items.Count > 0;
            }
            return(ret);
        }
Esempio n. 9
0
 public static void CreateGroupItems(ToolStripDropDownItem dropDownItem)
 {
     QTUtility.RefreshGroupsDic();
     if (QTUtility.GroupPathsDic.Count > 0)
     {
         dropDownItem.Enabled = true;
         DropDownMenuReorderable dropDown = (DropDownMenuReorderable)dropDownItem.DropDown;
         while (dropDown.Items.Count > 0)
         {
             dropDown.Items[0].Dispose();
         }
         dropDown.ItemsClear();
         string key = "groups";
         foreach (string str2 in QTUtility.GroupPathsDic.Keys)
         {
             string str3 = QTUtility.GroupPathsDic[str2];
             string path = str3.Split(QTUtility.SEPARATOR_CHAR)[0];
             if (str3.Length == 0)
             {
                 dropDown.AddItem(new ToolStripSeparator(), key);
             }
             else if (QTUtility2.PathExists(path))
             {
                 QMenuItem item = new QMenuItem(str2, MenuGenre.Group);
                 item.SetImageReservationKey(path, null);
                 dropDown.AddItem(item, key);
                 if (QTUtility.StartUpGroupList.Contains(str2))
                 {
                     if (QTUtility.StartUpTabFont == null)
                     {
                         QTUtility.StartUpTabFont = new Font(item.Font, FontStyle.Underline);
                     }
                     item.Font = QTUtility.StartUpTabFont;
                 }
             }
         }
     }
     else
     {
         dropDownItem.Enabled = false;
     }
 }
Esempio n. 10
0
 private static ToolStripItem CreateMenuItem_AppLauncher(UserApp app, EventPack ep, ShellBrowserEx shellBrowser)
 {
     string path = app.Path;
     try {
         path = Environment.ExpandEnvironmentVariables(path);
     }
     catch {
     }
     MenuItemArguments mia = new MenuItemArguments(app, shellBrowser, MenuGenre.Application);
     if(path.StartsWith(@"\\") || path.StartsWith("::") || !Directory.Exists(path)) {
         mia.Target = MenuTarget.File;
         QMenuItem item = new QMenuItem(app.Name, mia) { Name = app.Name };
         item.SetImageReservationKey(path, Path.GetExtension(path));
         item.MouseMove += qmi_File_MouseMove;
         if(!ep.FromTaskBar && app.ShortcutKey != Keys.None) {
             item.ShortcutKeyDisplayString = QTUtility2.MakeKeyString(app.ShortcutKey).Replace(" ", string.Empty);
         }
         return item;
     }
     else {
         mia.Target = MenuTarget.Folder;
         DropDownMenuReorderable reorderable = new DropDownMenuReorderable(null) {
             MessageParent = ep.MessageParentHandle,
             ImageList = QTUtility.ImageListGlobal
         };
         reorderable.ItemRightClicked += ep.ItemRightClickEventHandler;
         DirectoryMenuItem item = new DirectoryMenuItem(app.Name) {
             Name = app.Name,
             Path = path,
             MenuItemArguments = mia,
             EventPack = ep,
             ModifiedDate = Directory.GetLastWriteTime(path),
             DropDown = reorderable,
             DoubleClickEnabled = true
         };
         item.DropDownItems.Add(new ToolStripMenuItem());
         item.DropDownItemClicked += realDirectory_DropDownItemClicked;
         item.DropDownOpening += realDirectory_DropDownOpening;
         item.DoubleClick += ep.DirDoubleClickEventHandler;
         item.SetImageReservationKey(path, null);
         return item;
     }
 }
Esempio n. 11
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;
 }
Esempio n. 12
0
 private static ToolStripItem CreateMenuItem_AppLauncher(string key, string[] appVals, EventPack ep) {
     string name = appVals[0];
     try {
         name = Environment.ExpandEnvironmentVariables(name);
     }
     catch {
     }
     MenuItemArguments mia = new MenuItemArguments(name, appVals[1], appVals[2], 0, MenuGenre.Application);
     if((appVals[0].Length == 0) || appVals[0].PathEquals("separator")) {
         ToolStripSeparator separator = new ToolStripSeparator();
         separator.Name = "appSep";
         return separator;
     }
     if(appVals.Length == 4) {
         int.TryParse(appVals[3], out mia.KeyShortcut);
     }
     if((name.StartsWith(@"\\") || name.StartsWith("::")) || !Directory.Exists(name)) {
         mia.Target = MenuTarget.File;
         QMenuItem item = new QMenuItem(key, mia);
         item.Name = key;
         item.SetImageReservationKey(name, Path.GetExtension(name));
         item.MouseMove += qmi_File_MouseMove;
         if(!ep.FromTaskBar && (mia.KeyShortcut > 0x100000)) {
             int num = mia.KeyShortcut & -1048577;
             item.ShortcutKeyDisplayString = QTUtility2.MakeKeyString((Keys)num).Replace(" ", string.Empty);
         }
         return item;
     }
     mia.Target = MenuTarget.Folder;
     DropDownMenuReorderable reorderable = new DropDownMenuReorderable(null);
     reorderable.MessageParent = ep.MessageParentHandle;
     reorderable.ItemRightClicked += ep.ItemRightClickEventHandler;
     reorderable.ImageList = QTUtility.ImageListGlobal;
     DirectoryMenuItem item2 = new DirectoryMenuItem(key);
     item2.SetImageReservationKey(name, null);
     item2.Name = key;
     item2.Path = name;
     item2.MenuItemArguments = mia;
     item2.EventPack = ep;
     item2.ModifiiedDate = Directory.GetLastWriteTime(name);
     item2.DropDown = reorderable;
     item2.DoubleClickEnabled = true;
     item2.DropDownItems.Add(new ToolStripMenuItem());
     item2.DropDownItemClicked += realDirectory_DropDownItemClicked;
     item2.DropDownOpening += realDirectory_DropDownOpening;
     item2.DoubleClick += ep.DirDoubleClickEventHandler;
     return item2;
 }
Esempio n. 13
0
 public static QMenuItem CreateMenuItem(MenuItemArguments mia) {
     QMenuItem item = new QMenuItem(QTUtility2.MakePathDisplayText(mia.Path, false), mia);
     if(((mia.Genre == MenuGenre.Navigation) && mia.IsBack) && (mia.Index == 0)) {
         item.ImageKey = "current";
     }
     else {
         item.SetImageReservationKey(mia.Path, null);
     }
     item.ToolTipText = QTUtility2.MakePathDisplayText(mia.Path, true);
     return item;
 }
Esempio n. 14
0
 public static void CreateGroupItems(ToolStripDropDownItem dropDownItem) {
     QTUtility.RefreshGroupsDic();
     if(QTUtility.GroupPathsDic.Count > 0) {
         dropDownItem.Enabled = true;
         DropDownMenuReorderable dropDown = (DropDownMenuReorderable)dropDownItem.DropDown;
         while(dropDown.Items.Count > 0) {
             dropDown.Items[0].Dispose();
         }
         dropDown.ItemsClear();
         string key = "groups";
         foreach(string str2 in QTUtility.GroupPathsDic.Keys) {
             string str3 = QTUtility.GroupPathsDic[str2];
             string path = str3.Split(QTUtility.SEPARATOR_CHAR)[0];
             if(str3.Length == 0) {
                 dropDown.AddItem(new ToolStripSeparator(), key);
             }
             else if(QTUtility2.PathExists(path)) {
                 QMenuItem item = new QMenuItem(str2, MenuGenre.Group);
                 item.SetImageReservationKey(path, null);
                 dropDown.AddItem(item, key);
                 if(QTUtility.StartUpGroupList.Contains(str2)) {
                     if(QTUtility.StartUpTabFont == null) {
                         QTUtility.StartUpTabFont = new Font(item.Font, FontStyle.Underline);
                     }
                     item.Font = QTUtility.StartUpTabFont;
                 }
             }
         }
     }
     else {
         dropDownItem.Enabled = false;
     }
 }
Esempio n. 15
0
 public static List<ToolStripItem> CreateGroupItems(ToolStripDropDownItem dropDownItem)
 {
     List<ToolStripItem> ret = new List<ToolStripItem>();
     DropDownMenuReorderable dropDown = null;
     if(dropDownItem != null) {
         dropDown = (DropDownMenuReorderable)dropDownItem.DropDown;
         while(dropDown.Items.Count > 0) {
             dropDown.Items[0].Dispose();
         }
         dropDown.ItemsClear();
     }
     const string key = "groups";
     foreach(Group group in GroupsManager.Groups) {
         if(group.Paths.Count == 0 || !QTUtility2.PathExists(group.Paths[0])) continue;
         QMenuItem item = new QMenuItem(group.Name, MenuGenre.Group);
         item.SetImageReservationKey(group.Paths[0], null);
         if(dropDown != null) {
             dropDown.AddItem(item, key);
         }
         ret.Add(item);
         if(!group.Startup) continue;
         if(StartUpTabFont == null) {
             StartUpTabFont = new Font(item.Font, FontStyle.Underline);
         }
         item.Font = StartUpTabFont;
     }
     if(dropDownItem != null) {
         dropDownItem.Enabled = dropDown.Items.Count > 0;
     }
     return ret;
 }
Esempio n. 16
0
        private void OnDesktopDblClicked(Point popUpPoint) {
            if(++iMainMenuShownCount > 0x40) {
                ClearThumbnailCache();
            }
            contextMenu.SuspendLayout();
            ddmrGroups.SuspendLayout();
            ddmrHistory.SuspendLayout();
            ddmrUserapps.SuspendLayout();
            ddmrRecentFile.SuspendLayout();
            if(fRequiredRefresh_MenuItems) {
                ClearMenuItems();
            }
            RecreateUndoClosedItems();
            if(contextMenu.Items.Count == 0) {
                string[] strArray = QTUtility.TextResourcesDic["TaskBar_Titles"];
                labelGroupTitle.Text = groupsMenuItem.Text = strArray[0];
                historyMenuItem.Text = labelHistoryTitle.Text = strArray[1];
                userAppsMenuItem.Text = labelUserAppTitle.Text = strArray[2];
                recentFileMenuItem.Text = labelRecentFileTitle.Text = strArray[3];
                if((ConfigValues[2] & 0x80) == 0) {
                    QTUtility.RefreshGroupsDic();
                    foreach(string str in QTUtility.GroupPathsDic.Keys) {
                        string str2 = QTUtility.GroupPathsDic[str];
                        if(str2.Length == 0) {
                            ToolStripSeparator separator = new ToolStripSeparator();
                            separator.Name = "groupSep";
                            GroupItemsList.Add(separator);
                            continue;
                        }
                        string path = str2.Split(QTUtility.SEPARATOR_CHAR)[0];
                        QMenuItem item = new QMenuItem(str, MenuGenre.Group);
                        item.SetImageReservationKey(path, null);
                        if(QTUtility.StartUpGroupList.Contains(str)) {
                            if(QTUtility.StartUpTabFont == null) {
                                QTUtility.StartUpTabFont = new Font(item.Font, FontStyle.Underline);
                            }
                            item.Font = QTUtility.StartUpTabFont;
                        }
                        GroupItemsList.Add(item);
                    }
                }
                if((ConfigValues[2] & 0x20) == 0) {
                    UserappItemsList = MenuUtility.CreateAppLauncherItems(Handle, (ConfigValues[1] & 2) == 0, dropDownMenues_ItemRightClicked, subMenuItems_DoubleClick, true);
                }
                bool flag = false;
                bool flag2 = false;
                bool flag3 = false;
                bool flag4 = false;
                for(int i = 0; i < 3; i++) {
                    switch(Order_Root[i]) {
                        case 0:
                            if(!flag) {
                                AddMenuItems_Group();
                                flag = true;
                            }
                            break;

                        case 1:
                            if(!flag2) {
                                AddMenuItems_History();
                                flag2 = true;
                            }
                            break;

                        case 2:
                            if(!flag3) {
                                AddMenuItems_UserApp();
                                flag3 = true;
                            }
                            break;

                        case 3:
                            if(!flag4) {
                                AddMenuItems_Recent();
                                flag4 = true;
                            }
                            break;
                    }
                }
                if(!flag) {
                    AddMenuItems_Group();
                }
                if(!flag2) {
                    AddMenuItems_History();
                }
                if(!flag3) {
                    AddMenuItems_UserApp();
                }
                if(!flag4) {
                    AddMenuItems_Recent();
                }
            }
            else {
                InsertMenuItems_History();
                InsertMenuItems_Recent();
            }
            ddmrUserapps.ResumeLayout();
            ddmrHistory.ResumeLayout();
            ddmrGroups.ResumeLayout();
            ddmrRecentFile.ResumeLayout();
            contextMenu.ResumeLayout();
            if(contextMenu.Items.Count > 0) {
                if(!QTUtility.IsXP) {
                    contextMenu.SendToBack();
                }
                contextMenu.Show(popUpPoint);
            }
        }
Esempio n. 17
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;
 }