Exemplo n.º 1
0
        /// <summary>
        /// Shows the import form and returns the values of the fields to the caller
        /// </summary>
        /// <param name="defaultImportSettings">Values to pre-populate the dialog</param>
        /// <returns>The values selected in the form</returns>
        public static ImportDialogResult Execute(ImportInfo defaultImportSettings)
        {
            lock (_instanceLock)
            {
                if (__instance == null)
                {
                    __instance = new ImportFileForm();
                }
                __instance._importResult = new ImportDialogResult();
                __instance._importResult.DialogResult = DialogResult.Cancel;
                if (defaultImportSettings != null && defaultImportSettings.Parser != null)
                {
                    SelectBoxItemByText(defaultImportSettings.Parser.Name, __instance._boxParserDll);
                    __instance._importResult.ImportInfo = defaultImportSettings;
                    if (defaultImportSettings.Sender != null)
                    {
                        __instance._checkSender.Visible = true;

                        if ((defaultImportSettings.Parser.ImportSupport & ImportMode.Objects) != 0)
                        {
                            __instance._checkSender.Checked = true;
                        }
                        else
                        {
                            __instance._checkSender.Checked = false;
                            __instance._boxTargetPath.Text  = String.Join("|", __instance._importResult.ImportInfo.TargetFiles.ToArray());
                        }
                    }
                }

                __instance.ShowDialog();
            }
            return(__instance._importResult);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Handles the import from log command
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ImportLog(object sender, EventArgs e)
        {
            ImportDialogResult res = ImportFileForm.Execute(_lastImportInfo);

            if (res.DialogResult == DialogResult.OK)
            {
                ImportLogStart(res.ImportInfo);
                //_requestsList.LoadRequests(TrafficViewer.Instance.TrafficDataAccessor); //deprecated
            }
        }
Exemplo n.º 3
0
 /// <summary>
 /// Shows the import form and returns the values of the fields to the caller
 /// </summary>
 /// <returns>The values selected in the form</returns>
 public static ImportDialogResult Execute()
 {
     lock (_instanceLock)
     {
         if (__instance == null)
         {
             __instance = new ImportFileForm();
         }
         __instance._importResult = new ImportDialogResult();
         __instance._importResult.DialogResult = DialogResult.Cancel;
         __instance.ShowDialog();
     }
     return(__instance._importResult);
 }