Esempio n. 1
0
        public MainWindow()
        {
            InitializeComponent();

            //Input Supported File Types Into Drop Downs
            PopulateItemCollectionFromIEnurmable(CMBB_TO.Items, Conversion.SupportedExtensions);

            //Input FilemodeOptions
            PopulateItemCollectionFromIEnurmable(CB_DEST.Items, UI_Lists.FilemodeOptions);

            //Generate Extension Unifiers To Accomodate Weird Extensions
            UI_LIB.LoadAlternateExtensions();

            //Generate Conversion Method Library
            Conversion.Initialize();

            //Link Checking ListBox
            LB_CHECK.Items.Clear();
            LB_CHECK.ItemsSource = TruncatedFiles;

            //Populate Tree Views
            RefreshTreeView();

            //Initialize Primary Directory Text
            TXTB_PRIMARYDIRECTORY.Text = PrimaryDirectoryPath;

            //Initialize CheckedComboBox
            CCB_FROM.ItemsSource = UI_Lists.Extensions;
        }
Esempio n. 2
0
        private void RefreshCheckPreview()
        {
            TruncatedFiles.Clear();

            string LCD = "";

            if (Conversion.PathMode == Conversion.PathModeType.SmartDump)
            {
                LCD = BUAFC_Library.Utitlities.FindCommonPath("\\", SelectedFiles);
            }

            for (int i = 0; i < SelectedFiles.Count; ++i)
            {
                ListBoxItem temp = new ListBoxItem();
                temp.Content = UI_LIB.TruncatePathToDirectory(SelectedFiles[i], numberDirectoriesToTruncate);
                temp.ToolTip = SelectedFiles[i] + '\n' + "Will be converted to:" + '\n';
                TruncatedFiles.Add(temp);

                switch (Conversion.PathMode)
                {
                case Conversion.PathModeType.DirectoryDump:
                    temp.ToolTip += Conversion.UserSpecifiedDirectory + "\\" + System.IO.Path.GetFileName(SelectedFiles[i]).Remove(System.IO.Path.GetFileName(SelectedFiles[i]).LastIndexOf('.')) + CMBB_TO.SelectedValue;
                    break;

                case Conversion.PathModeType.InPlace:
                    temp.ToolTip += SelectedFiles[i].Remove(SelectedFiles[i].LastIndexOf('.')) + CMBB_TO.SelectedValue;
                    break;

                case Conversion.PathModeType.SmartDump:
                    FileInfo fi = new FileInfo(Conversion.UserSpecifiedDirectory + SelectedFiles[i].Remove(0, LCD.Length));
                    fi.Directory.Create();
                    if (fi.FullName.LastIndexOf('.') != "".LastIndexOf('.'))
                    {
                        temp.ToolTip += fi.FullName.Remove(fi.FullName.LastIndexOf('.')) + CMBB_TO.SelectedValue;
                    }
                    break;
                }
            }

            LB_CHECK.Items.Refresh();
        }