Exemple #1
0
        static int TriggerNewAssetSave(TextBox box)
        {
            DirectoryTreeItem selectedItem = m_targetTreeView.SelectedItem as DirectoryTreeItem;

            if (selectedItem.IsDirectory == false)
            {
                selectedItem = selectedItem.GetParentSave() as DirectoryTreeItem;
            }


            CDCCDefinition def = CApplicationSettings.Instance.GetDCCProgram(m_sRequesteDCCPackage);


            string savepath = selectedItem.FullPath + "\\" + box.Text;


            if (savepath.LastIndexOf('.') == -1)
            {
                // HACK: Add a dot if there is none, so def.Start won't crop the last letter
                savepath += '.';
            }


            def.Start(savepath);


            selectedItem.Items.Clear();

            DirectoryInfo info = new DirectoryInfo(selectedItem.FullPath);

            TraverseDirectory(info, ref selectedItem);

            selectedItem.IsExpanded = true;
            return(0);
        }
Exemple #2
0
        void OnOKClicked(object sender, RoutedEventArgs e)
        {
            // Check if path in textbox is valid
            if (!ValidateFilePath(DesiredSavePath))
            {
                return;
            }

            ComboBoxItem item     = (ComboBoxItem)dccProgramDropdown.SelectedItem;
            string       progName = (string)item.Content;

            CDCCDefinition prog = CApplicationSettings.Instance.GetDCCProgram(progName);

            prog.Start(DesiredSavePath);

            // TODO: Implement prog.Start();

            Close();
        }