示例#1
0
文件: gui.cs 项目: fthomas/drohne
    /**************************************
    * signal handlers for fileOpenDialog *
    **************************************/
    public void OnFileOpenDialogOkButtonClicked(object obj, EventArgs args)
    {
        string[]  selections = this.fileOpenDialog.Selections;
        LogFormat format     = LogFormat.Unknown;
        ArrayList logFiles   = new ArrayList();
        int       count      = 0;

        foreach (string fn in selections)
        {
            if (Directory.Exists(fn))
            {
                continue;
            }

            format = LogBase.DetectLogFormatFromFile(fn);

            if (format == LogFormat.Unknown)
            {
                this.ShowUnknownLogFormatDialog(fn);
                continue;
            }

            Hashtable logFileInfo = new Hashtable();
            logFileInfo["Filename"] = fn;
            logFileInfo["Format"]   = format;

            logFiles.Add(logFileInfo);
            count++;
        }

        if (count == 0)
        {
            return;
        }

        string status = String.Format("{0}: {1}",
                                      Drohne.i18n("Selected Files"), count);

        this.statusbar.Push(1, status);

        this.fileOpenDialog.Hide();

        this.LoadSelectedLogFiles(logFiles);
    }