コード例 #1
0
        public static void Main(string[] args)
        {
            IEnumerable <Type> allItemTypes = AppDomain.CurrentDomain.GetAssemblies()
                                              .SelectMany(assembly => assembly.GetTypes())
                                              .Where(type => type.IsSubclassOf(typeof(BaseItem)))
                                              .OrderBy(x => x.Name);

            foreach (Type type in allItemTypes)
            {
                BaseItem instance = (BaseItem)Activator.CreateInstance(type);
                BaseItem.AllItems.Add(instance);
            }

            ExcelHelper.OpenExcelFile();
            ExcelHelper.GetRequests();
            while (true)
            {
                BaseItem item = BaseItem.ItemsToProcess().FirstOrDefault();
                if (item == null)
                {
                    break;
                }

                item.CalculateProductionChain();
            }

            ExcelHelper.WriteExcelFile();
        }