コード例 #1
0
ファイル: Cache.cs プロジェクト: hahaking119/vienna-add-in
        public void LoadACCs(ICctsRepository repository)
        {
            if (ACCs.Count == 0)
            {
                ICcLibrary ccl = repository.GetCcLibraryById(Id);

                foreach (IAcc acc in ccl.Accs)
                {
                    if (ACCs.ContainsKey(acc.Name))
                    {
                        ACCs.Clear();
                        throw new CacheException("The wizard encountered two ACCs having identical names. Please verify your model!");
                    }

                    ACCs.Add(acc.Name, new cACC(acc.Name, acc.Id, CheckState.Unchecked));
                }
            }

            if (ACCs.Count == 0)
            {
                throw new CacheException("The CC library did not contain any ACCs. Please make sure at least one ACC is present in the library before proceeding with the wizard.");
            }
        }