コード例 #1
0
        private void RaiseSiouxEventReceived(SiouxEvent siouxEvent, string header, JournalEntry journalEntry)
        {
            if (siouxEvent == null)
            {
                return;
            }

            var inlines         = GetMessageParts(journalEntry, _siouxData.FilterOnCurrentCommander, siouxEvent.Format);
            var displayDuration = siouxEvent.DisplayDuration != 0
                                      ? siouxEvent.DisplayDuration
                                      : _siouxData.DefaultDisplayDuration;

            SiouxEventReceived.Raise(this, new SiouxEventArgs(header, inlines, displayDuration));
        }
コード例 #2
0
        public void Start()
        {
            Stop();

            _informationManager = new InformationManager(_appFolderPath, _siouxData.AllowAnonymousErrorFeedback);
            _informationManager.JournalEntryRead      += OnJournalEntryRead;
            _informationManager.JournalEntryException += OnJournalEntryException;
            _currentLoadFilename  = string.Empty;
            _loadJournalFilenames = _informationManager.ListJournalFiles();
            _informationManager.Start();

            LoadProgress.Raise(this, new ProgressEventArgs(100));

            const string Text =
                "Hello Cmdr {commander:Name}!\nCurrent ship: {ship}\nCurrent star system: {starSystem}\nSessions played: {SessionsPlayed}\nTime played: {TotalTimePlayed}";
            var inlines = GetMessageParts(null, false, Text);

            SiouxEventReceived.Raise(this, new SiouxEventArgs("SIOUX Online", inlines, 15));

            var msToNextHour = ((60 - DateTime.UtcNow.Minute) * 60 - DateTime.UtcNow.Second) * 1000;

            _onTheHourTimer.Change(msToNextHour, 60 * 60 * 1000);
        }