Example #1
0
        /// <summary>
        /// 获取用户使用痕迹
        /// </summary>
        /// <param name="path"></param>
        public static Stack <string> getUserTrack()
        {
            Stack <string> userIDStack = new Stack <string>();

            try
            {
                StreamReader trackReader = new StreamReader(PATH_USER_TRACK, Encoding.Default);
                string       line;
                string       userName;
                while ((line = trackReader.ReadLine()) != null)
                {
                    userName = CodeAnalysis.getValueString(line)[0];
                    if (!userIDStack.Contains(userName))
                    {
                        userIDStack.Push(userName);
                    }
                }
                trackReader.Close();
            }
            catch (Exception e)
            {
                Reporter.reportBug(e.ToString());
            }
            return(userIDStack);
        }
Example #2
0
        /// <summary>
        /// 获取小文件图标
        /// </summary>
        /// <returns></returns>
        public static Dictionary <string, Image> getSmallFileIconDictionary()
        {
            Dictionary <string, Image> iconDict = new Dictionary <string, Image>();

            //if (!Directory.Exists(LARGE_ICON_PATH)) return null;
            if (!Directory.Exists(SMALL_ICON_PATH))
            {
                return(null);
            }
            if (!File.Exists(ICON_CONF_PATH))
            {
                return(null);
            }
            StreamReader confReader = new StreamReader(ICON_CONF_PATH, Encoding.Default);
            string       line;

            while ((line = confReader.ReadLine()) != null)
            {
                iconDict.Add(Path.GetExtension(CodeAnalysis.getCommandString(line)),
                             Image.FromFile(SMALL_ICON_PATH + "/" + CodeAnalysis.getValueString(line)[0]));
            }
            confReader.Close();
            return(iconDict);
        }