예제 #1
0
 public DatabaseParam(Database[] databases)
     : base(null)
 {
     _count = databases.Length;
     Value = databases;
     Default = databases;
 }
예제 #2
0
        public DatabasePanel(Database[] value)
        {
            _count = value.Length;

            InitializeComponent();

            Value = value;
        }
예제 #3
0
 public override void Clear()
 {
     Value = new Database[_count];
 }
예제 #4
0
        private static void ParseDatabase(StreamWriter writer, Database db, string status, int progress,
                                          ProcessInfo processInfo)
        {
            if (db.File == null || !File.Exists(db.File)){
                return;
            }

            StreamReader reader = new StreamReader(db.File);

            string line;
            Regex regex = new Regex(db.SearchExpression);

            while ((line = reader.ReadLine()) != null){
                if (line.StartsWith(">")){
                    string identifier = regex.Match(line).Groups[1].Value;
                    object[] items = new object[]{
                        db.File, db.Source, db.Species, db.Taxid, db.Version,
                        db.Prefix == null ? identifier : db.Prefix + identifier
                    };
                    lock (writer){
                        writer.WriteLine(StringUtils.Concat("\t", items));
                    }
                }
            }

            reader.Close();

            lock (processInfo){
                processInfo.Progress(progress);
                processInfo.Status(status);
            }
        }