コード例 #1
0
        public MainWindow(string path)
        {
            InitializeComponent();
            folderPath = path;
            iniPath    = folderPath + ".\\desktop.ini";

            string comment = IniHelper.Read(".ShellClassInfo", "InfoTip", "", iniPath);

            textComment.Text = comment;
            textComment.Focus();
            textComment.SelectAll();
        }
コード例 #2
0
        private void 确定_Click(object sender, RoutedEventArgs e)
        {
            // 获取注释
            string comment = textComment.Text.Replace('\n', ' ').Replace('\r', ' ').Trim();

            if (comment.Length == 0)
            {
                IniHelper.Write(".ShellClassInfo", "InfoTip", null, iniPath); // 删除
            }
            else
            {
                IniHelper.Write(".ShellClassInfo", "InfoTip", comment, iniPath);
            }

            // 刷新图标
            FolderSettingsHelper.RefresSettings(folderPath);

            Application.Current.Shutdown();
        }