Exemple #1
0
        private void ExportOptionalValuesForParameters(object sender, RoutedEventArgs e)
        {
            string fileName     = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "GlobalParameters.xlsx");
            bool   overrideFile = true;

            if (File.Exists(fileName))
            {
                if (Reporter.ToUser(eUserMsgKey.FileAlreadyExistWarn) == eUserMsgSelection.Cancel)
                {
                    overrideFile = false;
                }
                else
                {
                    //In case File exists and user selects to overwrite the existing.
                    File.Delete(fileName);
                }
            }

            if (overrideFile)
            {
                ImportOptionalValuesForParameters im = new ImportOptionalValuesForParameters();
                List <AppParameters> parameters      = GetParameterList();
                string filePath = im.ExportParametersToExcelFile(parameters, "GlobalParameters");
                System.Diagnostics.Process.Start(filePath);
            }
        }
        private void ExportOptionalValuesForParameters(object sender, RoutedEventArgs e)
        {
            try
            {
                string fileName     = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), string.Format("{0}_Parameters.xlsx", mApplicationModel.Name));
                bool   overrideFile = true;
                if (File.Exists(fileName))
                {
                    if (MessageBox.Show("File already exists, do you want to override?", "File Exists", System.Windows.MessageBoxButton.OKCancel) == System.Windows.MessageBoxResult.Cancel)
                    {
                        overrideFile = false;
                    }
                }

                if (overrideFile)
                {
                    ImportOptionalValuesForParameters im = new ImportOptionalValuesForParameters();
                    List <AppParameters> parameters      = GetParameterList();
                    string filePath = im.ExportParametersToExcelFile(parameters, string.Format("{0}_Parameters", mApplicationModel.Name));
                    Process.Start(filePath);
                }
            }
            catch (System.Exception ex)
            {
                Reporter.ToLog(eLogLevel.ERROR, ex.StackTrace);
            }
        }
        private void ExportOptionalValuesForParameters(object sender, RoutedEventArgs e)
        {
            try
            {
                string fileName     = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), string.Format("{0}_Parameters.xlsx", mApplicationModel.Name));
                bool   overrideFile = true;
                if (File.Exists(fileName))
                {
                    if (Reporter.ToUser(eUserMsgKey.FileAlreadyExistWarn) == eUserMsgSelection.Cancel)
                    {
                        overrideFile = false;
                    }
                    else
                    {
                        //In case File exists and user selects to overwrite the existing.
                        File.Delete(fileName);
                    }
                }

                if (overrideFile)
                {
                    ImportOptionalValuesForParameters im = new ImportOptionalValuesForParameters();
                    List <AppParameters> parameters      = GetParameterList();
                    string filePath = im.ExportParametersToExcelFile(parameters, string.Format("{0}_Parameters", mApplicationModel.Name));
                    Process.Start(filePath);
                }
            }
            catch (System.Exception ex)
            {
                Reporter.ToLog(eLogLevel.ERROR, ex.StackTrace);
            }
        }
        private void ExportOptionalValuesForParameters(object sender, RoutedEventArgs e)
        {
            ImportOptionalValuesForParameters im = new ImportOptionalValuesForParameters();
            List <AppParameters> parameters      = new List <AppParameters>();

            foreach (var prms in mApplicationModel.AppModelParameters)
            {
                im.AddNewParameterToList(parameters, prms);
            }
            string filePath = im.ExportParametersToExcelFile(parameters, string.Format("{0}_Parameters", mApplicationModel.Name));

            Process.Start(filePath);
        }
Exemple #5
0
        private void ExportOptionalValuesForParameters(object sender, RoutedEventArgs e)
        {
            ImportOptionalValuesForParameters im = new ImportOptionalValuesForParameters();
            List <AppParameters> parameters      = new List <AppParameters>();

            foreach (var prms in mModelsGlobalParamsList)
            {
                im.AddNewParameterToList(parameters, prms);
            }
            string filePath = im.ExportParametersToExcelFile(parameters, "GlobalParameters");

            Process.Start(filePath);
        }
Exemple #6
0
        private void ExportOptionalValuesForParameters(object sender, RoutedEventArgs e)
        {
            string fileName     = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "GlobalParameters.xlsx");
            bool   overrideFile = true;

            if (File.Exists(fileName))
            {
                if (MessageBox.Show("File already exists, do you want to override?", "File Exists", MessageBoxButton.OKCancel) == MessageBoxResult.Cancel)
                {
                    overrideFile = false;
                }
            }

            if (overrideFile)
            {
                ImportOptionalValuesForParameters im = new ImportOptionalValuesForParameters();
                List <AppParameters> parameters      = GetParameterList();
                string filePath = im.ExportParametersToExcelFile(parameters, "GlobalParameters");
                Process.Start(filePath);
            }
        }