示例#1
0
        public MainWindow()
        {
            InitializeComponent();
            Stopwatch stopWatch = new Stopwatch();

            stopWatch.Start();

            executorRepo       = new ExecutorRepo();
            directionsRepo     = new DirectionsRepo();
            serviceRepo        = new ServiceRepo();
            grantAgreementRepo = new GrantAgreementRepo();
            historyRepo        = new HistoryRepo();

            stopWatch.Stop();

            TimeSpan ts1         = stopWatch.Elapsed;
            string   elapsedTime = String.Format("{0:00}:{1:00}:{2:00}.{3:00}", ts1.Hours, ts1.Minutes, ts1.Seconds, ts1.Milliseconds);

            Console.WriteLine(elapsedTime);

            SetCulture();
        }
示例#2
0
        /// <summary>
        /// Coming in here means add a new citation. We are called from Sumatra.
        /// </summary>
        /// <param name="message"></param>
        public BelGui(EventData message) : this()
        {
            if (DBService == null)
            {
                Mef.Initialize(this);
            }

            List <RawCitation> rawCitations = DBService.Select <RawCitation>();

            DBService.ClearTable <RawCitation>();

            // Get volume and storage
            History history = HistoryRepo.GetLastOpened(); // Our currently open file in Sumatra

            VM.CurrentVolume  = DBService.SelectById <Volume>(history.VolumeId);
            VM.CurrentStorage = DBService.SelectById <Storage>(history.StorageId);

            // Create new citation
            VM.CurrentCitation = CitationRepo.CreateNewCitation(rawCitations, message);

            CitationService.CitationChanged += CitationService_CitationChanged;
            LoadControls();
        }