コード例 #1
0
        public MainWindow()
        {
            InitializeComponent();
            window = this;

            IKernel kernel;

            kernel = new StandardKernel(new NinjectConfigModule());

            resourceRepo = kernel.Get <IResourceRepository>();
            planetRepo   = kernel.Get <IPlanetRepository>();
            missionRepo  = kernel.Get <IMissionRepository>();
            fractionRepo = kernel.Get <IFractionRepository>();
            typeRepo     = kernel.Get <IMissionTypeRepository>();
            pausedRepo   = kernel.Get <IPausedMissionRepository>();
            endedRepo    = kernel.Get <IEndedMissionRepository>();
            planetSer    = kernel.Get <IPlanetService>();
            missionSer   = kernel.Get <IMissionService>();
            resourceSer  = kernel.Get <IResourceService>();

            resourceCollection = new ObservableCollection <string>();
            planetCollection   = new ObservableCollection <string>();
            missionCollection  = new ObservableCollection <string>();

            resourcesListBox.ItemsSource = resourceCollection;
            planetsListBox.ItemsSource   = planetCollection;
            missionsListBox.ItemsSource  = missionCollection;

            resourcesListBox.SelectionChanged += new SelectionChangedEventHandler(ResourceListBox_Click);
            planetsListBox.SelectionChanged   += new SelectionChangedEventHandler(PlanetListBox_Click);
            missionsListBox.SelectionChanged  += new SelectionChangedEventHandler(MissionListBox_Click);

            FillDatabase();
            LoadResources();
        }
コード例 #2
0
 public MissionService(IMissionRepository missionRepository, IFractionRepository fractionRepository, IMissionTypeRepository missionTypeRepository, IPausedMissionRepository pausedMissionRepository, IEndedMissionRepository endedMissionRepository)
 {
     _missionRepository       = missionRepository;
     _fractionRepository      = fractionRepository;
     _missionTypeRepository   = missionTypeRepository;
     _endedMissionRepository  = endedMissionRepository;
     _pausedMissionRepository = pausedMissionRepository;
 }