Ejemplo n.º 1
0
        public DialogResult ShowPreImportDialogs()
        {
            var historyItems = new List <object>();
            var baseDir      = new DirectoryInfo(path);

            foreach (DirectoryInfo di in baseDir.GetDirectories())
            {
                var antDevice = new ANTDevice(path + di.Name + "\\");
                foreach (HistoryItem hi in antDevice.HistoryItems)
                {
                    historyItems.Insert(0, hi);
                }
            }

            using (var dlg = new SessionSelector())
            {
                if (BeginWork != null)
                {
                    BeginWork(this, new EventArgs());
                }
                dlg.Sessions = historyItems;
                if (BeginWork != null)
                {
                    EndWork(this, new EventArgs());
                }
                DialogResult result = dlg.ShowDialog();
                if (result == DialogResult.OK)
                {
                    itemToImport = (HistoryItem)dlg.SelectedSession;
                }
                dlg.Dispose();

                return(result);
            }
        }
        public DialogResult ShowPreImportDialogs()
        {
            var historyItems = new List<object>();
              var baseDir = new DirectoryInfo(Path);
              if (baseDir.Exists)
              {
            foreach (DirectoryInfo di in baseDir.GetDirectories())
            {
              var antDevice = new ANTDevice(Path + di.Name + "\\");
              foreach (HistoryItem hi in antDevice.HistoryItems)
              {
            historyItems.Insert(0, hi);
              }
            }
              }

              using (var dlg = new SessionSelector())
              {
            if (BeginWork != null) BeginWork(this, new EventArgs());
            dlg.Sessions = historyItems;
            if (BeginWork != null) EndWork(this, new EventArgs());
            DialogResult result = dlg.ShowDialog();
            if (result == DialogResult.OK)
            {
              itemToImport = (HistoryItem)dlg.SelectedSession;
            }
            dlg.Dispose();

            return result;
              }
        }