Example #1
0
        private void SelectFolderMockupClick(object sender, RoutedEventArgs e)
        {
            RadOpenFolderDialog openFolderMockupDialog = new RadOpenFolderDialog();

            openFolderMockupDialog.ShowDialog();
            txtPathMockup.Text = openFolderMockupDialog.FileName;
        }
Example #2
0
        public static void AirCopmInvoicesToPDFRus(List <OrderFlight> orders, Func <OrderFlight, bool, Workbook> getWbFunc, bool showDiscount = false)
        {
            var of = new RadOpenFolderDialog();

            of.Owner            = MainClass.MainAppwindow;
            of.InitialDirectory = Properties.Settings.Default.LastDirectory;
            of.ShowDialog();
            of.ExpandToCurrentDirectory = false;
            if (of.DialogResult.GetValueOrDefault())
            {
                Properties.Settings.Default.LastDirectory = of.FileName;
                Properties.Settings.Default.Save();
                foreach (var ord in orders)
                {
                    //string filePath = of.FileName+@"\"+ord.Id.ToString()+"_"+ord.FlightNumber+".pdf";
                    string filePath = of.FileName + @"\" + ord.DeliveryDate.ToString("dd.MM.yyyy") + "_" + ord.FlightNumber + ".pdf";
                    //var wb = AlohaService.ExcelExport.ExportHelper.ExportToExcelWorkbookRussian(ord);
                    int num = 0;
                    while (File.Exists(filePath))
                    {
                        filePath = filePath.Substring(0, filePath.Length - 4) + "_" + (num++).ToString() + ".pdf";
                    }
                    var wb = getWbFunc(ord, showDiscount);
                    InvoiceToPDF(wb, filePath);
                }
            }
        }
Example #3
0
        private void SelectFolderDesignsClick(object sender, RoutedEventArgs e)
        {
            RadOpenFolderDialog openFolderDialog = new RadOpenFolderDialog();

            openFolderDialog.ShowDialog();

            txtPathDesign.Text = openFolderDialog.FileName;
            storage.ListFolderDesign.Clear();
            this.dgListDesigns.ItemsSource = null;
            try
            {
                string filters     = " *.JPG|*.PNG";
                var    designsPath = filters.Split('|').SelectMany(filter => Directory.GetFiles(openFolderDialog.FileName, filter)).ToList();
                for (int i = 0; i < designsPath.Count; i++)
                {
                    var designsName = System.IO.Path.GetFileName(designsPath[i]);
                    storage.ListFolderDesign.Add(new FileDesignDTO()
                    {
                        ID = i + 1, Filename = designsName, FilePath = designsPath[i]
                    });
                }
                dgListDesigns.ItemsSource = storage.ListFolderDesign;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Example #4
0
        private void pathOutputBtn_Click(object sender, RoutedEventArgs e)
        {
            RadOpenFolderDialog openFolderDialog1 = new RadOpenFolderDialog();

            openFolderDialog1.ShowDialog();
            this.storage.PathOutput = openFolderDialog1.FileName;
        }
Example #5
0
        private void SelectFolderButton_Click(object sender, RoutedEventArgs e)
        {
            RadOpenFolderDialog openFolderDialog = new RadOpenFolderDialog();

            openFolderDialog.ShowDialog();
            SDDPFilesFolderTextBox.Text = openFolderDialog.FileName;
            filesReadingParametersViewModel.InputFilesPath = openFolderDialog.FileName;
        }
Example #6
0
        private void EventButtonSettingFolderSelect(object sender, EventArgs e)
        {
            RadOpenFolderDialog dialog = new RadOpenFolderDialog();
            DialogResult        result = dialog.ShowDialog();

            if (result == DialogResult.OK)
            {
                StxFolder.Text = dialog.FileName;
            }
        }
Example #7
0
        private void btnImportImage_Click(object sender, RoutedEventArgs e)
        {
            RadOpenFolderDialog fBD = new RadOpenFolderDialog();

            // Show open folder dialog and check if Open button is pressed.\

            if (fBD.ShowDialog() == true)
            {
                txtPathImageFolder.Text = fBD.FileName;
            }
        }
Example #8
0
        private void CreateNewProject_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                RadOpenFolderDialog openFolderDialog = new RadOpenFolderDialog();
                openFolderDialog.ShowDialog();
                var folderName = openFolderDialog.FileName;

                ViewModel.CreateNewProject(tbProjectName.Text, folderName);
            }
            catch (Exception ex)
            {
                _logger.Error(ex);
            }
        }
Example #9
0
 private void btnAddDesignFolder_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         RadOpenFolderDialog fBD = new RadOpenFolderDialog();
         // Show open folder dialog and check if Open button is pressed.
         if (fBD.ShowDialog() == true)
         {
             txtDesigns_UploadShopify.Text = fBD.FileName;
         }
     }
     catch (Exception ex)
     {
     }
 }
Example #10
0
        private void RadMenuItem_Click(object sender, RoutedEventArgs e)
        {
            RadOpenFolderDialog openFolderDialog = new RadOpenFolderDialog();

            openFolderDialog.Owner = Window.GetWindow(this);
            openFolderDialog.ShowDialog();
            if (openFolderDialog.DialogResult == true)
            {
                string folderName = openFolderDialog.FileName;
                ID.Directory_name = folderName;
                var fg = Directory.GetFiles(folderName, "*.sps", SearchOption.AllDirectories);
                foreach (var f in fg)
                {
                    RLB_sps.Items.Add(System.IO.Path.GetFileName(f));
                }
            }
        }
Example #11
0
        void exp()
        {
            RadOpenFolderDialog openFolderDialog = new RadOpenFolderDialog();

            openFolderDialog.ShowDialog();
            this.storage.FolderName = openFolderDialog.FileName;
            RadOpenFileDialog radOpenFileDialog = new RadOpenFileDialog()
            {
                Filter = "Word Documents (*.doc)|*.doc|Excel Worksheets (*.xls;*.xlsx)|*.xls;*.xlsx|PowerPoint Presentations (*.ppt)|*.ppt" +
                         "|Office Files (*.doc;*.xls;*.ppt)|*.doc;*.xls;*.ppt" +
                         "|All Files (*.*)|*.*",
                FilterIndex = 5,
            };

            radOpenFileDialog.ShowDialog();
            RadSaveFileDialog saveFileDialog = new RadSaveFileDialog()
            {
                Filter = "Word Documents (*.doc)|*.doc|Excel Worksheets (*.xls;*.xlsx)|*.xls;*.xlsx|PowerPoint Presentations (*.ppt)|*.ppt" +
                         "|Office Files (*.doc;*.xls;*.ppt)|*.doc;*.xls;*.ppt" +
                         "|All Files (*.*)|*.*",
                FilterIndex = 5,
            };

            //saveFileDialog.FileName = storageFile != null ? storageFile.Name : null;
            saveFileDialog.ShowDialog();
            if (saveFileDialog.DialogResult == true)
            {
            }

            //this.explorer.Filter = "Word Documents|*.doc;*.docx|Excel Worksheets|*.xls;*.xlsx|PowerPoint Presentations|*.ppt;*.pptx" +
            //                            "|Office Files|*.doc;*.docx*.xls;*.xlsx;*.ppt*.pptx" +
            //                            "|Image Files|*.jpg;*.png;*.bmp" +
            //                            "|Text Files|*.txt;" +
            //                            "|Archives Files|*.zip;*.rar" +
            //                            "|All Files|*.*";
        }
Example #12
0
        private void SelectAuthorFolderButton_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                WriteOutput($"Opening folder picker...", OutputMessageLevel.Normal);

                busyIndicator.IsBusy          = true;
                busyIndicator.BusyContent     = "opening folder...";
                busyIndicator.IsIndeterminate = true;

                if (!string.IsNullOrEmpty(Properties.Settings.Default.LastFolder))
                {
                    // Need to bump up one level from the last folder location
                    var topDirectoryInfo = Directory.GetParent(Properties.Settings.Default.LastFolder);

                    openFolderDialog.InitialDirectory = topDirectoryInfo.FullName;

                    WriteOutput($"Starting at saved folder.", OutputMessageLevel.Normal);
                }
                else
                {
                    WriteOutput($"No saved folder, starting at root.", OutputMessageLevel.Warning);
                }

                openFolderDialog.ShowDialog();

                if (openFolderDialog.DialogResult != true)
                {
                    WriteOutput($"Canceled folder selection.", OutputMessageLevel.Normal);
                    return;
                }
                else
                {
                    Properties.Settings.Default.LastFolder = openFolderDialog.FileName;
                    Properties.Settings.Default.Save();
                }

                Reset();

                busyIndicator.BusyContent = $"searching for albums...";

                var folders = Directory.EnumerateDirectories(openFolderDialog.FileName).ToList();

                AudiobookTitles.Clear();

                foreach (var folder in folders)
                {
                    AudiobookTitles.Add(folder);

                    busyIndicator.BusyContent = $"added {folder}";
                }

                if (AudiobookTitles.Count == 0)
                {
                    WriteOutput("No titles detected.", OutputMessageLevel.Error);

                    MessageBox.Show("The selected Author's folder should have subfolders, each subfolder should be named with the audiobook's title.", "No Titles Available.");
                }
                else if (AudiobookTitles.Count == 1)
                {
                    WriteOutput($"Opened {Path.GetFileName(openFolderDialog.FileName)}' ({AudiobookTitles.Count} title).", OutputMessageLevel.Success);
                }
                else
                {
                    WriteOutput($"Opened {Path.GetFileName(openFolderDialog.FileName)} ({AudiobookTitles.Count} titles).", OutputMessageLevel.Success);
                }

                Analytics.TrackEvent("Audiobook Folder Opened", new Dictionary <string, string>
                {
                    { "Audiobook Titles Loaded", $"{AudiobookTitles.Count}" }
                });
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);

                WriteOutput(ex.Message, OutputMessageLevel.Error);

                Crashes.TrackError(ex, new Dictionary <string, string>
                {
                    { "Folder Open", "Audiobook Author" }
                });
            }
            finally
            {
                busyIndicator.BusyContent     = "";
                busyIndicator.IsBusy          = false;
                busyIndicator.IsIndeterminate = false;
            }
        }
Example #13
0
        private void SelectFolderButton_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                WriteOutput($"Opening folder picker...", OutputMessageLevel.Normal);

                busyIndicator.IsBusy          = true;
                busyIndicator.BusyContent     = "opening folder...";
                busyIndicator.IsIndeterminate = true;

                if (!string.IsNullOrEmpty(Properties.Settings.Default.LastFolder))
                {
                    // Need to bump up one level from the last folder location
                    var topDirectoryInfo = Directory.GetParent(Properties.Settings.Default.LastFolder);

                    openFolderDialog.InitialDirectory = topDirectoryInfo.FullName;

                    WriteOutput($"Starting at saved folder.", OutputMessageLevel.Normal);
                }
                else
                {
                    WriteOutput($"No saved folder, starting at root.", OutputMessageLevel.Warning);
                }

                openFolderDialog.ShowDialog();

                if (openFolderDialog.DialogResult != true)
                {
                    WriteOutput($"Canceled folder selection.", OutputMessageLevel.Normal);
                    return;
                }
                else
                {
                    Properties.Settings.Default.LastFolder = openFolderDialog.FileName;
                    Properties.Settings.Default.Save();
                }

                Reset();

                busyIndicator.BusyContent = $"searching for seasons...";

                var seasonsResult = Directory.EnumerateDirectories(openFolderDialog.FileName).ToList();

                Seasons.Clear();

                foreach (var season in seasonsResult)
                {
                    Seasons.Add(season);

                    busyIndicator.BusyContent = $"added {season}";
                }

                if (Seasons.Count == 0)
                {
                    WriteOutput("No seasons detected, make sure there are subfolders with season number.", OutputMessageLevel.Warning);
                }
                else if (Seasons.Count == 1)
                {
                    WriteOutput($"Opened '{System.IO.Path.GetFileName(openFolderDialog.FileName)}' ({Seasons.Count} season).", OutputMessageLevel.Success);
                }
                else
                {
                    WriteOutput($"Opened '{System.IO.Path.GetFileName(openFolderDialog.FileName)}' ({Seasons.Count} seasons).", OutputMessageLevel.Success);
                }

                Analytics.TrackEvent("Video Folder Opened", new Dictionary <string, string>
                {
                    { "Seasons", Seasons.Count.ToString(CultureInfo.InvariantCulture) }
                });
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);

                WriteOutput(ex.Message, OutputMessageLevel.Error);

                Crashes.TrackError(ex, new Dictionary <string, string>
                {
                    { "Folder Open", "TV Show" }
                });
            }
            finally
            {
                busyIndicator.BusyContent     = "";
                busyIndicator.IsBusy          = false;
                busyIndicator.IsIndeterminate = false;
            }
        }