예제 #1
0
        private void FToolStripMenuItem_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {
            switch (e.ClickedItem.Tag)
            {
            case "O":
                ImportFile();
                break;

            case "M":
                ImportImageFolder();
                break;

            case "X":
                this.Close();
                break;

            default:
                WordPath wordPath = this.WordSet.Setting.RecentPaths[(int)e.ClickedItem.Tag];
                if (wordPath.PathMode == DisplayMode.ImageFolder)
                {
                    WordSet.ImportImageFolder(wordPath.Path);
                }
                else
                {
                    WordSet.ImportFile(wordPath.Path);
                }

                ShowWord();
                LoadRecentPathToMenu();
                break;
            }
        }
예제 #2
0
        public static Image GetExtImage(WordPath item)
        {
            if (item.PathMode == DisplayMode.ImageFolder)
            {
                return(ImageResource.ImageFolder);
            }

            string fileExt = Path.GetExtension(item.Path).Replace(".", "").ToUpper();

            switch (fileExt)
            {
            case "TXT":
                return(ImageResource.TXT);

            case "CSV":
                return(ImageResource.CSV);
            }

            return(null);
        }