コード例 #1
0
 public ManageRunController(IRunService runService, IUserService userService, IPlayerService playerService, IConsumableService consumableService)
 {
     this.runService        = runService;
     this.userService       = userService;
     this.playerService     = playerService;
     this.consumableService = consumableService;
 }
 public CurrentSkierViewModel(IRunService runService, IRaceService raceService)
 {
     _runService      = runService;
     _raceService     = raceService;
     _stopWatch       = new Stopwatch();
     _dispatcherTimer = new DispatcherTimer();
 }
コード例 #3
0
        private static void RunTable(object sender, ExecutedRoutedEventArgs e)
        {
            if (UIContext.Database != null)
            {
                BackgroundWorker worker     = new BackgroundWorker();
                MainWindow       mainWindow = (MainWindow)sender;
                mainWindow.loadingAnimation.Visibility = Visibility.Visible;

                worker.DoWork += delegate(object s, DoWorkEventArgs args)
                {
                    object[]    data       = args.Argument as object[];
                    IRunService runService = ObjectLocator.GetInstance <IRunService>();

                    ObfuscationResult result = runService.ObfuscateTable(UIContext.Database.ConnectionString, data[0] as Table);

                    args.Result = result;
                };

                worker.RunWorkerCompleted += delegate(object s, RunWorkerCompletedEventArgs args)
                {
                    mainWindow.loadingAnimation.Visibility = Visibility.Collapsed;
                    ObfuscationResult result = args.Result as ObfuscationResult;

                    MessageBox.Show(mainWindow, string.Format("Finished table obfuscation in {0}", result.TimeElapsed), "Table Obfuscation Finished",
                                    MessageBoxButton.OK, MessageBoxImage.Information);

                    IReportService reportService = ObjectLocator.GetInstance <IReportService>();

                    //string path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase);
                    //path = path.Replace("file:\\", "");

                    string path = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
                    path = path + "\\Dafuscator";

                    if (Directory.Exists(path) == false)
                    {
                        Directory.CreateDirectory(path);
                    }

                    path = path +
                           string.Format("\\TableObfuscationReport_{0}_{1}_{2}-{3}_{4}.txt", DateTime.Now.Month, DateTime.Now.Day,
                                         DateTime.Now.Year, DateTime.Now.Hour, DateTime.Now.Minute);

                    reportService.GenerateReportForObfucsationResult(result, path);
                };

                worker.RunWorkerAsync(new object[]
                {
                    mainWindow.ColumnsGrid.SelectedTable
                });
            }
            else
            {
                MessageBox.Show("There is no open database project, cannot obfuscate database.", "Error Saving", MessageBoxButton.OK,
                                MessageBoxImage.Exclamation);
            }
        }
コード例 #4
0
        private static void PerformTask(Options options)
        {
            if (!String.IsNullOrEmpty(options.ProjectFile))
            {
                IDatabaseProjectService databaseProjectService = ObjectLocator.GetInstance <IDatabaseProjectService>();
                IEventAggregator        eventAggregator        = ObjectLocator.GetInstance <IEventAggregator>();

                Console.WriteLine(string.Format("Loading the Dafuscator project: {0}", options.ProjectFile));
                Database         db = databaseProjectService.GetDatabaseProject(options.ProjectFile);
                ConnectionString connetionString;

                if (!String.IsNullOrEmpty(options.ConnectionString))
                {
                    connetionString = new ConnectionString(options.ConnectionString);
                }
                else
                {
                    connetionString = db.ConnectionString;
                }
                db.ConnectionString = connetionString;
                eventAggregator.AddListener <StatusUpdateEvent>(e => Console.WriteLine(string.Format("{0}: {1}", DateTime.Now, e.Message)));

                if (!String.IsNullOrEmpty(options.ExportFile))
                {
                    Console.WriteLine(string.Format("Started exporting the Dafuscator project to {0}", options.ExportFile));
                    IExportService exportService = ObjectLocator.GetInstance <IExportService>();
                    exportService.ExportTables(db.Tables, options.ExportFile, connetionString);

                    Console.WriteLine("Finished exporting the Dafuscator project.");
                }
                else
                {
                    Console.WriteLine(string.Format("Started the obfuscation of the {0} database.", db.ConnectionString.DatabaseName));

                    IRunService    runService    = ObjectLocator.GetInstance <IRunService>();
                    IReportService reportService = ObjectLocator.GetInstance <IReportService>();

                    ObfuscationResult result = runService.ObfuscateDatabase(db);

                    string path = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
                    path = path + "\\Dafuscator";

                    if (Directory.Exists(path) == false)
                    {
                        Directory.CreateDirectory(path);
                    }

                    path = path +
                           string.Format("\\DatabaseObfuscationReport_{0}_{1}_{2}-{3}_{4}.txt", DateTime.Now.Month, DateTime.Now.Day,
                                         DateTime.Now.Year, DateTime.Now.Hour, DateTime.Now.Minute);

                    reportService.GenerateReportForObfucsationResult(result, path);

                    Console.WriteLine("Finished the obfuscation process in {0}", result.TimeElapsed);
                }
            }
        }
コード例 #5
0
 public ControlRaceViewModel(IMvxNavigationService navigationService, IMvxMessenger messenger,
                             IRunService runService,
                             IRaceService raceService)
 {
     _navigationService = navigationService;
     _runService        = runService;
     _raceService       = raceService;
     _messenger         = messenger;
 }
コード例 #6
0
 public CreateRaceViewModel(IMvxNavigationService navigationService, IDialogService dialogService,
                            IMvxMessenger messenger,
                            ILocationService locationService, ISkierService skierService, IRaceService raceService,
                            IRunService runService)
 {
     _navigationService = navigationService;
     _dialogService     = dialogService;
     _locationService   = locationService;
     _skierService      = skierService;
     _raceService       = raceService;
     _runService        = runService;
     Messenger          = messenger;
 }
コード例 #7
0
ファイル: FenesterService.cs プロジェクト: gissehel/Fenester
 public FenesterService
 (
     IScreenRepository screenRepository,
     IDesktopRepository desktopRepository,
     IWindowRepository windowRepository,
     IScreenOsService screenOsService,
     IWindowOsServiceSync windowOsService,
     IKeyService keyService,
     IRunService runService
 )
 {
     ScreenRepository  = screenRepository;
     DesktopRepository = desktopRepository;
     WindowRepository  = windowRepository;
     ScreenOsService   = screenOsService;
     WindowOsService   = windowOsService;
     KeyService        = keyService;
 }
 public CurrentResultViewModel(IRaceService raceService, IRunService runService)
 {
     _raceService = raceService;
     _runService  = runService;
 }
コード例 #9
0
 public ContainerProcessHandler(IContainerService containerService, IRunService runService, ILogger logger)
 {
     this.containerService = containerService;
     this.runService = runService;
     this.logger = logger;
 }
コード例 #10
0
 public RunProgram(IRunService runService, IEnrollmentObjectService enrollmentService)
 {
     _runService        = runService;
     _enrollmentService = enrollmentService;
 }
コード例 #11
0
 public RacesController(ILogger <RacesController> logger, IRaceService raceService, IRunService runService)
 {
     _logger      = logger;
     _raceService = raceService;
     _runService  = runService;
 }
コード例 #12
0
ファイル: ServiceMenuItem.cs プロジェクト: EndWorldGame/Menus
 public ServiceMenuItem(String name, IRunService runService)
 {
     _name       = name;
     _runService = runService;
 }
コード例 #13
0
 public ContainerProcessHandler(IContainerService containerService, IRunService runService, ILogger logger)
 {
     this.containerService = containerService;
     this.runService       = runService;
     this.logger           = logger;
 }
コード例 #14
0
 public MatchController(IMatchService matchService, IUserService userService, IRunService runService)
 {
     this.matchService = matchService;
     this.userService  = userService;
     this.runService   = runService;
 }
コード例 #15
0
 public RunsController(ILogger <RunsController> logger,
                       IRunService runService)
 {
     _logger     = logger;
     _runService = runService;
 }
コード例 #16
0
 public RunsController(IRunService runService, IMapper mapper) : base(runService)
 {
     RunService = runService;
     Mapper     = mapper;
 }
コード例 #17
0
 public RunController(IRunService _repo)
 {
     _runRepo = _repo;
 }
コード例 #18
0
ファイル: RunProgram.cs プロジェクト: AJax2012/lisp-parser
 public RunProgram(IRunService runService)
 {
     _runService = runService;
 }
コード例 #19
0
 public RunController(IRunService _repo)
 {
     _context = _repo;
 }