Exemplo n.º 1
0
        private async void BuildFilePath_OnTextChanged(object sender, TextChangedEventArgs e)
        {
            try
            {
                var enabled           = false;
                var openFolderEnabled = false;
                if (ProductUpdateSource.Text.Trim().Length > 0)
                {
                    var match = Regex.Match(ProductUpdateSource.Text, @"^\w:\\|\\\\.*\\..*");
                    if (match.Success)
                    {
                        enabled = true;
                        var folderExists = await GlobalObjects.DirectoryExists(ProductUpdateSource.Text);

                        if (!folderExists)
                        {
                            folderExists = await GlobalObjects.DirectoryExists(ProductUpdateSource.Text);
                        }

                        openFolderEnabled = folderExists;
                    }
                }

                OpenFolderButton.IsEnabled = openFolderEnabled;
                DownloadButton.IsEnabled   = enabled;
            }
            catch (Exception ex)
            {
                LogErrorMessage(ex);
            }
        }
Exemplo n.º 2
0
        private async void OpenExeFolderButton_OnClick(object sender, RoutedEventArgs e)
        {
            try
            {
                var filePath = FileSavePath.Text.Trim();
                if (string.IsNullOrEmpty(filePath))
                {
                    return;
                }

                var folderPath = System.IO.Path.GetDirectoryName(filePath);
                if (await GlobalObjects.DirectoryExists(folderPath))
                {
                    Process.Start("explorer", folderPath);
                }
                else
                {
                    MessageBox.Show("Directory path does not exist.");
                }
            }
            catch (Exception ex)
            {
                LogErrorMessage(ex);
            }
        }
Exemplo n.º 3
0
        private async void BuildFilePath_OnTextChanged(object sender, TextChangedEventArgs e)
        {
            try
            {
                var enabled           = false;
                var openFolderEnabled = false;
                if (BuildFilePath.Text.Length > 0)
                {
                    var match = Regex.Match(BuildFilePath.Text, @"^\w:\\|\\\\.*\\..*");
                    if (match.Success)
                    {
                        enabled = true;

                        var folderExists = await GlobalObjects.DirectoryExists(BuildFilePath.Text);

                        if (!folderExists)
                        {
                            folderExists = await GlobalObjects.DirectoryExists(BuildFilePath.Text);
                        }

                        openFolderEnabled = folderExists;
                    }
                }

                OpenFolderButton.IsEnabled = openFolderEnabled;
            }
            catch (Exception ex)
            {
                LogErrorMessage(ex);
            }
            finally
            {
                EnableGenerateButton();
            }
        }
Exemplo n.º 4
0
        private async void IncludeBuild_OnChecked(object sender, RoutedEventArgs e)
        {
            try
            {
                var enabled = IncludeBuild.IsChecked.HasValue && IncludeBuild.IsChecked.Value;
                SourceFilePath.Visibility = enabled ? Visibility.Visible : Visibility.Collapsed;

                SourcePathLabel.IsEnabled        = enabled;
                BuildFilePath.IsEnabled          = enabled;
                BrowseSourcePathButton.IsEnabled = enabled;

                OpenFolderButton.IsEnabled = enabled;

                var buildFilePath = BuildFilePath.Text.Trim();
                if (enabled && !string.IsNullOrEmpty(buildFilePath))
                {
                    if (await GlobalObjects.DirectoryExists(buildFilePath))
                    {
                        OpenFolderButton.IsEnabled = true;
                    }
                    else
                    {
                        OpenFolderButton.IsEnabled = false;
                    }
                }
                else
                {
                    OpenFolderButton.IsEnabled = false;
                }

                if (SignInstaller.IsChecked.HasValue && SignInstaller.IsChecked.Value)
                {
                    SpacerRow.Height = new GridLength(64, GridUnitType.Pixel);
                }
                else
                {
                    SpacerRow.Height = new GridLength(114, GridUnitType.Pixel);
                }
            }
            catch (Exception ex)
            {
                LogErrorMessage(ex);
            }
            finally
            {
                EnableGenerateButton();
            }
        }
Exemplo n.º 5
0
        private async Task UpdateVersions()
        {
            var branch = (OfficeBranch)UpdateBranch.SelectedItem;

            if (branch == null)
            {
                return;
            }

            UpdateTargetVersion.ItemsSource = branch.Versions;
            UpdateTargetVersion.SetValue(TextBoxHelper.WatermarkProperty, branch.CurrentVersion);

            var officeEdition = OfficeEdition.Office32Bit;

            var configXml = GlobalObjects.ViewModel.ConfigXmlParser.ConfigurationXml;

            if (configXml.Add != null)
            {
                if (configXml.Add.OfficeClientEdition == OfficeClientEdition.Office64Bit)
                {
                    officeEdition = OfficeEdition.Office64Bit;
                }
            }

            if (UpdateUpdatePath.Text.Length > 0)
            {
                var otherFolder = GlobalObjects.SetBranchFolderPath(branch.Branch.ToString(), UpdateUpdatePath.Text);
                if (await GlobalObjects.DirectoryExists(otherFolder))
                {
                    if (!string.IsNullOrEmpty(UpdateUpdatePath.Text))
                    {
                        UpdateUpdatePath.Text = GlobalObjects.SetBranchFolderPath(branch.Branch.ToString(),
                                                                                  UpdateUpdatePath.Text);
                    }
                }
            }

            await GetBranchVersion(branch, officeEdition);
        }
Exemplo n.º 6
0
        private async void OpenFolderButton_OnClick(object sender, RoutedEventArgs e)
        {
            try
            {
                var folderPath = ProductUpdateSource.Text.Trim();
                if (string.IsNullOrEmpty(folderPath))
                {
                    return;
                }

                if (await GlobalObjects.DirectoryExists(folderPath))
                {
                    Process.Start("explorer", folderPath);
                }
                else
                {
                    MessageBox.Show("Directory path does not exist.");
                }
            }
            catch (Exception ex)
            {
                LogErrorMessage(ex);
            }
        }