/// <summary>
        /// Retrieves a project.json file from the cache. It will be added if it does not exist already.
        /// </summary>
        public PackageSpec GetOrCreateSpec(string projectName, string projectJsonPath)
        {
            PackageSpec spec;

            if (!SpecCache.TryGetValue(projectJsonPath, out spec))
            {
                // Read the spec and add it to the cache
                spec = JsonPackageSpecReader.GetPackageSpec(
                    projectName,
                    projectJsonPath);

                SpecCache.Add(projectJsonPath, spec);
            }

            return(spec);
        }
Ejemplo n.º 2
0
        void FrmBaseIdManage_Load(object sender, EventArgs e)
        {
            RIPP.NIR.Controls.StyleTool.FormatGrid(ref this.dataGridView1);

            //throw new NotImplementedException();
            this._sCache = new SpecCache(10);
            var lib = this._sCache.GetBaseLib();

            this.dataGridView1.Columns.Add(new DataGridViewTextBoxColumn()
            {
                HeaderText = "光谱名", AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill
            });
            this.dataGridView1.Columns.Add(new DataGridViewTextBoxColumn()
            {
                HeaderText = "数据库编号"
            });
            foreach (var s in lib)
            {
                this.dataGridView1.Rows.Add(s.Name, s.Components.First().ActualValue.ToString());
            }
        }