private void button_newIcon_Click(object sender, RoutedEventArgs e)
        {
            NewIconWizard nWizard = new NewIconWizard(this.resPath, fList);

            if (nWizard.ShowDialog() == true)
            {
                if (File.Exists(nWizard.destFilePath) == false)
                {
                    File.Copy(nWizard.filePath, nWizard.destFilePath);
                    fList.Add(new FileInfo(nWizard.filePath).Name);
                    Bitmap toResize    = new Bitmap(nWizard.destFilePath);
                    Bitmap resultImage = new Bitmap(toResize, new System.Drawing.Size(nWizard.imgSize, nWizard.imgSize));
                    toResize.Dispose();
                    resultImage.Save(nWizard.destFilePath + ".temp");
                    File.SetAttributes(nWizard.destFilePath, FileAttributes.Normal);
                    File.Delete(nWizard.destFilePath);
                    File.Move(nWizard.destFilePath + ".temp", nWizard.destFilePath);
                    ButtonEnableCheck();
                    textBox_search.Clear();
                    listView_iconList.SelectedIndex = listView_iconList.Items.Count - 1;
                    resultImage.Dispose();
                }
                else
                {
                    MessageBox.Show("Same file name exists!");
                }
            }
        }
예제 #2
0
        private void button_new_Click(object sender, RoutedEventArgs e)
        {
            string        FinalFilePath;
            NewIconWizard nWizard = new NewIconWizard(this.resPath, fList);

            if (nWizard.ShowDialog() == true)
            {
                if (this.comboBox_resolution.Text != "default")
                {
                    FinalFilePath = this.resPath + this.comboBox_resolution.Text + "\\" + nWizard.fileName;
                    if (Directory.Exists(this.resPath + this.comboBox_resolution.Text) == false)
                    {
                        Directory.CreateDirectory(this.resPath + this.comboBox_resolution.Text);
                    }
                }
                else
                {
                    FinalFilePath = nWizard.destFilePath;
                }

                if (File.Exists(FinalFilePath) == false)
                {
                    File.Copy(nWizard.filePath, FinalFilePath);
                    if (this.comboBox_resolution.Text != "default")
                    {
                        fList.Add(this.comboBox_resolution.Text + "/" + new FileInfo(nWizard.filePath).Name);
                    }
                    else
                    {
                        fList.Add(new FileInfo(nWizard.filePath).Name);
                    }

                    Bitmap toResize    = new Bitmap(FinalFilePath);
                    Bitmap resultImage = new Bitmap(toResize, new System.Drawing.Size(nWizard.imgSize, nWizard.imgSize));
                    toResize.Dispose();
                    resultImage.Save(FinalFilePath + ".temp");
                    File.SetAttributes(FinalFilePath, FileAttributes.Normal);
                    File.Delete(FinalFilePath);
                    File.Move(FinalFilePath + ".temp", FinalFilePath);
                    ButtonEnableCheck();
                    resultImage.Dispose();
                    //IncludeInSolutionExplorer(FinalFilePath, false);
                }
                else
                {
                    MessageBox.Show("Same file name exists!");
                }
            }
        }