コード例 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sess"></param>
        /// <returns></returns>
        public static Job CreateRestartJob(this ISessionInfo sess)
        {
            var ctrl = sess.CreateRestartControl();
            var job  = ctrl.CreateJob();

            return(job);
        }
コード例 #2
0
        public async Task UpdateSessionInfo(ISessionInfo session)
        {
            if (!initialized)
            {
                await InitializeAsync();
            }

            var entity = new SessionInfoEntity
            {
                PartitionKey = session.ClientDeviceId,
                RowKey       = session.ClientSessionId + DateTime.UtcNow.ToString("yyyyMMddHHmmssfff"),

                AvailableResolution = session.AvailableResolution,
                ClientDeviceId      = session.ClientDeviceId,
                ClientSessionId     = session.ClientSessionId,
                IPAddress           = session.IPAddress,
                LocationLatitude    = session.LocationLatitude,
                LocationLongitude   = session.LocationLongitude,
                Resolution          = session.Resolution,
            };

            var table = tableClient.GetTableReference(SessionInfoTableName);

            var status = await table.InsertAsync(entity);

            if (status >= 400)
            {
                throw new HttpStatusException("EntityErrorInsert:SessionInfo", status);
            }
        }
コード例 #3
0
        private void Write(IAppInfo appInfo, ISessionInfo sessionInfo, DateTime instant, int duration, string screen, string msisdn,
                           string screenType, string accessMode, string executedBy, int viewstateBytes, int sessionBytes, int sessionRequests)
        {
            Instant         = instant;
            Duration        = duration;
            Screen          = screen;
            SessionId       = sessionInfo.SessionID;
            EspaceId        = appInfo.eSpaceId;
            TenantId        = appInfo.TenantId;
            UserId          = sessionInfo.UserId;
            Msisdn          = msisdn;
            ScreenType      = screenType;
            AccessMode      = ScreenLogDefinition.NotNullAccessMode(accessMode);
            ExecutedBy      = executedBy;
            ViewstateBytes  = viewstateBytes;
            SessionBytes    = sessionBytes;
            SessionRequests = sessionRequests;

            RequestTracer reqTracer = RuntimePlatformUtils.GetRequestTracer();

            if (reqTracer != null)
            {
                RequestKey = reqTracer.RequestKey;
                ActionName = reqTracer.EntryActionName;
            }

            ClientIP        = RuntimePlatformUtils.GetRequestSourceForLogging()?.Left(MAX_CLIENT_IP_SIZE);
            EspaceName      = appInfo.eSpaceName;
            ApplicationName = appInfo.ApplicationName;
            ApplicationKey  = appInfo.ApplicationUIDAsKey;
            Username        = sessionInfo.UserName;

            log.Write();
        }
コード例 #4
0
 public HomeController(IOrganizationBusiness orgBusiness, ISessionInfo sessionInfo, IRosterBusiness rosterBusiness, IProvisioningRulesBusiness provisioningRuleBusiness)
 {
     _orgBusiness              = orgBusiness;
     _sessionInfo              = sessionInfo;
     _rosterBusiness           = rosterBusiness;
     _provisioningRuleBusiness = provisioningRuleBusiness;
 }
 private readonly IProvisioningRulesBusiness _provisioningRuleBusiness; public SyncController(IOrganizationBusiness orgBusiness, ISessionInfo sessionInfo, ISetupBusiness setupBusiness, IProvisioningRulesBusiness provisioningRuleBusiness)
 {
     _orgBusiness              = orgBusiness;
     _sessionInfo              = sessionInfo;
     _setupBusiness            = setupBusiness;
     _provisioningRuleBusiness = provisioningRuleBusiness;
 }
コード例 #6
0
ファイル: SpatialConvergence.cs プロジェクト: leyel/BoSSS
            static int[] GetDGDegreeKey(ISessionInfo sess)
            {
                var Degs = sess.KeysAndQueries.Where(kv => kv.Key.StartsWith("DGdegree:")).OrderBy(kv => kv.Key);

                int[] a = Degs.Select(kv => Convert.ToInt32(kv.Value)).ToArray();
                return(a);
            }
コード例 #7
0
        public static void StaticWrite(IAppInfo appInfo, ISessionInfo sessionInfo, DateTime instant, int duration, string screen,
                                       string msisdn, string screenType, string accessMode, string executedBy, int viewstateBytes, int sessionBytes, int sessionRequests)
        {
            ScreenLog log = new ScreenLog();

            log.Write(appInfo, sessionInfo, instant, duration, screen, msisdn, screenType, accessMode, executedBy, viewstateBytes, sessionBytes, sessionRequests);
        }
コード例 #8
0
        public void TestCleanUpDatabase()
        {
            ISessionInfo sess = databaseWithFiles.Controller.CopySession(databaseWithFiles.Controller.Sessions.First(), emptyDatabase);

            int fileCountBefore = CountAllFiles(emptyDatabase.Path);

            // create a bunch of files in the data subdirectory and clean up the database afterwards
            for (int i = 0; i < 10; i++)
            {
                string rndFile = Path.Combine(emptyDatabase.Path, "data", Guid.NewGuid().ToString() + ".1.data");

                if (!File.Exists(rndFile))
                {
                    FileStream fs = File.Create(rndFile);
                    fs.Close();
                }
            }
            emptyDatabase.Controller.CleanDatabase();

            int fileCountAfter = CountAllFiles(emptyDatabase.Path);

            Assert.IsTrue(
                fileCountBefore == fileCountAfter,
                "Either not all or too many files deleted by clean-up operation");
        }
コード例 #9
0
    public String DriverInfo(String method, IStandingsItem standing, ISessionInfo session, Int32 rounding)
    {
        switch (method)
        {
        case "test":
            return("test succesful");

            break;

        case "drivername":
            return(standing.Driver.Name);

            break;

        case "fuel":
            return(((Single)this.sdk.GetData("FuelLevel")).ToString());

            break;

        default:
            return("[invalid]");

            break;
        }
    }
コード例 #10
0
        public UpdaterViewModel(IEventAggregator eventAggregator, IDataTransport dataTransport, IServerInfo serverInfo, ISessionInfo sessionInfo)
        {
            _eventAggregator = eventAggregator;

            _serverInfo  = serverInfo;
            _sessionInfo = sessionInfo;

            // _isVisible = Visibility.Visible;
            _isVisible = Visibility.Collapsed;
            LastTime   = AutoRestartTime;

            _dataTransport = dataTransport;

            RestartAppCommand    = new DelegateCommand <object>(RestartApp);
            WaitForUpdateCommand = new DelegateCommand <object>(UpdateAbortedByUser);

            _checkTimer = new DispatcherTimer {
                Interval = new TimeSpan(0, 0, _serverInfo.UpdateInterval, 0)
            };
            _checkTimer.Tick += StartCheckUpdatesThread;
            _restartTimer     = new DispatcherTimer {
                Interval = new TimeSpan(0, 0, 0, 1)
            };
            _restartTimer.Tick += RestartTimerTick;
        }
コード例 #11
0
        public static string StaticWrite(IAppInfo appInfo, ISessionInfo sessionInfo, DateTime instant, string loginId, string errorId,
                                         string executedBy, string action, int duration, string source, string endpoint, string originalRequestKey)
        {
            ServiceAPILogDefinition logDef = new ServiceAPILogDefinition {
                Id                 = ServiceAPILogDefinition.GenerateLogId(),
                Instant            = instant,
                SessionId          = sessionInfo.SessionID,
                UserId             = sessionInfo.UserId,
                LoginId            = loginId,
                EspaceId           = appInfo.eSpaceId,
                TenantId           = appInfo.TenantId,
                ErrorId            = errorId,
                ExecutedBy         = executedBy,
                Action             = action,
                Duration           = duration,
                Source             = source,
                Endpoint           = endpoint,
                EspaceName         = appInfo.eSpaceName,
                ApplicationName    = appInfo.ApplicationName,
                ApplicationKey     = appInfo.ApplicationUIDAsKey,
                Username           = sessionInfo.UserName,
                OriginalRequestKey = originalRequestKey
            };

            RequestTracer reqTracer = RuntimePlatformUtils.GetRequestTracer();

            if (reqTracer != null)
            {
                logDef.RequestKey = reqTracer.RequestKey;
            }

            logDef.Write();
            return(logDef.Id);
        }
コード例 #12
0
 public BasicAuthenticationHandler(IOptionsMonitor <AuthenticationSchemeOptions> options, ILoggerFactory logger, UrlEncoder urlEncoder, ISystemClock systemClock, ISessionCache sessionCache,
                                   ISessionInfo sessionInfo)
     : base(options, logger, urlEncoder, systemClock)
 {
     _sessionCache = sessionCache;
     _sessionInfo  = sessionInfo;
 }
コード例 #13
0
ファイル: PlotApplication.cs プロジェクト: xj361685640/BoSSS
        /// <summary>
        /// Override the original run method defined by the super-class because
        /// we don't want to run an actual calculation. Plots the data for
        /// every selected time-step.
        /// </summary>
        protected void Run()
        {
            ISessionInfo session   = m_Database.Controller.GetSessionInfo(m_config.SessionGuid);
            var          timesteps = session.Timesteps.Where(
                tsi => this.m_config.TimeSteps.Contains(tsi.TimeStepNumber)).ToArray();
            int TotCnt = timesteps.Count();

            int process      = this.DBDriver.MyRank + 1;
            int processCount = this.DBDriver.Size;

            this.m_info = this.m_Database.Controller.GetSessionInfo(this.m_config.SessionGuid);


            GC.Collect();
            for (int i = 0; i < timesteps.Length; i++)
            {
                var            ts         = timesteps[i];
                double         physTime   = ts.PhysicalTime;
                TimestepNumber timestepNo = ts.TimeStepNumber;

                if (this.GridDat == null || !this.GridDat.Grid.ID.Equals(ts.Grid.ID))
                {
                    WriteMessage(process, processCount, "Loading grid ...");
                    GridCommons grid = DBDriver.LoadGrid(ts.Grid.ID, m_Database);
                    this.GridDat = this.m_Database.Controller.GetInitializationContext(ts).GridData;
                    WriteMessage(process, processCount, "   Number of cells: " + this.GridDat.Grid.NoOfUpdateCells);
                    this.CreatePlotter();
                }



                WriteMessage(process, processCount, "Loading timestep ... (" + (i + 1) + " of " + TotCnt + ")");
                var fields = DBDriver.LoadFields(ts, this.GridDat, this.m_config.FieldNames).ToList();
                WriteMessage(process, processCount, "Loaded timestep " + timestepNo + ". Plotting...");

                //{
                //    Console.WriteLine("computing vorticity...");
                //    DGField velX = fields.Single(f => f.Identification == "VelocityX");
                //    DGField velY = fields.Single(f => f.Identification == "VelocityY");

                //    DGField vortZ = velX.CloneAs();
                //    vortZ.Identification = "Vorticity";
                //    vortZ.Clear();
                //    vortZ.DerivativeByFlux(1.0, velY, 0);
                //    vortZ.DerivativeByFlux(-1.0, velX, 1);
                //    Console.WriteLine("done.");

                //    fields.Add(vortZ);
                //}
                PlotCurrentState(fields, physTime, timestepNo);

                double perc = Math.Round(100.0 * (double)(i + 1) / (double)TotCnt, 1);
                WriteMessage(process, processCount, "Finished timestep (" + perc + "% of timesteps done)");

                // Free memory if possible
                timesteps[i] = null;
                GC.Collect();
            }
        }
コード例 #14
0
ファイル: SessionInfo.cs プロジェクト: davelondon/dontstayin
 /// <summary>Initializes the <see cref="SessionInfo" /> instance, using the specified <see cref="ISessionInfo" /> object to populate its properties.</summary>
 /// <param name="sessionInfo">A <see cref="ISessionInfo" /> object used to overwrite the data in the current instance.</param>
 public virtual void Init(ISessionInfo sessionInfo)
 {
     this.BaseDomain = sessionInfo.BaseDomain;
     this.Expires = sessionInfo.Expires;
     this.Secret = sessionInfo.Secret;
     this.SessionKey = sessionInfo.SessionKey;
     this.Uid = sessionInfo.Uid;
 }
コード例 #15
0
        public bool TryGetSessionInfo(IRequest req, out ISessionInfo sinfo)
        {
            SessionInfo si;
            bool        success = Services.TryGetSessionInfo((Request)req, out si);

            sinfo = si;
            return(success);
        }
コード例 #16
0
 public ApplicationServiceBase(
     ISessionInfo session,
     IUnitOfWorkManager uowManager
     )
 {
     Session    = session ?? throw new ArgumentNullException(nameof(session));
     UowManager = uowManager ?? throw new ArgumentNullException(nameof(uowManager));
 }
コード例 #17
0
 public ResourcesAppService(
     ISessionInfo session,
     IUnitOfWorkManager uowManager,
     IResourceRepository resourceRepository)
     : base(session, uowManager)
 {
     _resourceRepository = resourceRepository ?? throw new ArgumentNullException(nameof(resourceRepository));
 }
コード例 #18
0
 /// <summary>
 /// Saves a session info object to a file on the disk.
 /// </summary>
 /// <param name="session">The session to be saved.</param>
 public void SaveSessionInfo(ISessionInfo session)
 {
     using (Stream s = fsDriver.GetSessionInfoStream(true, session.ID))
     {
         Driver.Serialize(s, session, typeof(SessionInfo));
         s.Close();
     }
 }
コード例 #19
0
 /// <summary>
 /// Constructs a proxy for the time-step with the given
 /// <paramref name="timestepGuid"/> within the given
 /// <paramref name="session"/>.
 /// </summary>
 /// <param name="timestepGuid"></param>
 /// <param name="session"></param>
 public TimestepProxy(Guid timestepGuid, ISessionInfo session)
 {
     this.ID          = timestepGuid;
     this.Session     = session;
     realTimestepInfo = new ExpirableLazy <TimestepInfo>(
         () => session.Database.Controller.DBDriver.LoadTimestepInfo(timestepGuid, session, session.Database),
         t => Utils.GetTimestepFileWriteTime(t) == t.WriteTime);
 }
コード例 #20
0
ファイル: IO_Utils.cs プロジェクト: xyuan/BoSSS
        /// <summary>
        /// Retrieves the directory where the exports for the selected
        /// <paramref name="session"/> are stored.
        /// </summary>
        /// <param name="session">
        /// The selected session.
        /// </param>
        /// <remarks>
        /// Should work on any System.
        /// </remarks>
        public static string GetExportDirectory(ISessionInfo session)
        {
            string path = Path.Combine(
                Utils.GetExportOutputPath(),
                StandardFsDriver.SessionsDir,
                session.ID.ToString());

            return(path);
        }
コード例 #21
0
ファイル: EmptyScript.cs プロジェクト: CloseUpDK/iRTVO
 public String DriverInfo(String method, IStandingsItem standing, ISessionInfo session, Int32 rounding)
 {
     switch (method)
     {            
         default:
             return "[invalid]";
             break;
     }
 }
コード例 #22
0
ファイル: EmptyScript.cs プロジェクト: CloseUpDK/iRTVO
 public String SessionInfo(String method, ISessionInfo session, Int32 rounding)
 {
     switch (method)
     {            
         default:
             return "[invalid]";
             break;
     }
 }
コード例 #23
0
        /// <summary>
        /// Retrieves the directory where the files for the selected
        /// <paramref name="session"/> are stored.
        /// </summary>
        /// <param name="session">
        /// The selected session.
        /// </param>
        /// <remarks>
        /// Should work on any System.
        /// </remarks>
        public static string GetSessionDirectory(ISessionInfo session)
        {
            string path = Path.Combine(
                session.Database.Path,
                StandardFsDriver.SessionsDir,
                session.ID.ToString());

            return(path);
        }
コード例 #24
0
    public String SessionInfo(String method, ISessionInfo session, Int32 rounding)
    {
        switch (method)
        {
        default:
            return("[invalid]");

            break;
        }
    }
コード例 #25
0
        static ISessionInfo CreateSession(int numberOfVoronoiCells)
        {
            AppControl   lShape  = VoronoiControl.TestVoronoi_LDomain(numberOfVoronoiCells, db: Database);
            IApplication poisson = new SipPoissonMain();

            RunApplication(poisson, lShape);
            ISessionInfo session = poisson.CurrentSessionInfo;

            return(session);
        }
コード例 #26
0
ファイル: Job.cs プロジェクト: xj361685640/BoSSS
        private JobStatus GetStatus(out int SubmitCount, out string DD)
        {
            SubmitCount = 0;
            DD          = null;
            if (AssignedBatchProc == null)
            {
                return(JobStatus.PreActivation);
            }

            bool isSubmitted, isRunning, wasSuccessful, isFailed;

            AssignedBatchProc.EvaluateStatus(this, out SubmitCount, out isRunning, out wasSuccessful, out isFailed, out DD);
            isSubmitted = SubmitCount > 0;
            bool isPending = isSubmitted && !(isRunning || wasSuccessful || isFailed);

            if (isPending)
            {
                return(JobStatus.PendingInExecutionQueue);
            }

            if (isRunning)
            {
                return(JobStatus.InProgress);
            }

            ISessionInfo[] RR = this.AllSessions;
            ISessionInfo   R  = RR.Length > 0 ? RR.OrderBy(si => si.CreationTime).Last() : null;

            //if (RR.Length == 0)
            //    // maybe finished, but no result is known.
            //    return JobStatus.PreActivation;

            if (wasSuccessful || RR.Any(si => !si.Tags.Contains(BoSSS.Solution.Application.NOT_TERMINATED_TAG)))
            {
                return(JobStatus.FinishedSuccessful);
            }

            if (isSubmitted && !(isFailed || wasSuccessful) && (R == null))
            {
                return(JobStatus.PendingInExecutionQueue);
            }

            if (isSubmitted == false && isRunning == false && wasSuccessful == false && isFailed == false && (RR.Length <= 0))
            {
                return(JobStatus.PreActivation);
            }

            if (isFailed || (R == null || R.Tags.Contains(BoSSS.Solution.Application.NOT_TERMINATED_TAG)))
            {
                return(JobStatus.Failed);
            }


            throw new IOException("Unable to determine job status.");
        }
コード例 #27
0
 /// <summary>
 /// Creates a plot instruction for the plotting of
 /// <paramref name="session"/>.
 /// </summary>
 /// <param name="session">
 /// The session to be plotted.
 /// </param>
 public SessionExportInstruction(ISessionInfo session)
 {
     this.Session    = session;
     this.fieldNames = new Lazy <List <string> >(
         () => session.Timesteps
         .SelectMany(ts => ts.FieldInitializers
                     .Select(fi => fi.Identification))
         .Distinct().ToList());
     this.timeSteps = new Lazy <List <TimestepNumber> >(
         () => session.Timesteps.Select(t => t.TimeStepNumber).ToList());
 }
コード例 #28
0
ファイル: SessionInfo.cs プロジェクト: rohitvuppala/BoSSS
 /// <summary>
 /// Compares this session to another.
 /// </summary>
 /// <param name="other">The session to compare to.</param>
 /// <returns>
 /// true, if the session GUIDs are the same; false otherwise.
 /// </returns>
 public bool Equals(ISessionInfo other)
 {
     if (other == null)
     {
         return(false);
     }
     else
     {
         return(this.ID.Equals(other.ID));
     }
 }
コード例 #29
0
ファイル: AuthService.cs プロジェクト: McCraigJ/CJ.Exp
 public AuthService(
     UserManager <TAppUser> userManager,
     SignInManager <TAppUser> signInManager,
     RoleManager <TAppRole> roleManager,
     IUsersData usersData, ISessionInfo sessionInfo)
 {
     _userManager   = userManager;
     _signInManager = signInManager;
     _roleManager   = roleManager;
     _usersData     = usersData;
     _sessionInfo   = sessionInfo;
 }
コード例 #30
0
ファイル: sof.cs プロジェクト: CloseUpDK/iRTVO
 public String DriverInfo(String method, IStandingsItem standing, ISessionInfo session, Int32 rounding)
 {
     switch (method)
     {
         case "officialpoints":
             if (session.Standings.Count != drivercount)
                 this.UpdateSOF();
             return Math.Round(this.points[standing.Position], MidpointRounding.ToEven).ToString();
         default:
             return "[invalid]";
     }
 }
コード例 #31
0
 public UsersApplicationService(
     ISessionInfo session,
     IUnitOfWorkManager uowManager,
     IUserPictureRepository userPictureRepository,
     UserManager <User> userManager,
     SignInManager <User> signInManager)
     : base(session, uowManager)
 {
     _userPictureRepository = userPictureRepository ?? throw new ArgumentNullException(nameof(userPictureRepository));
     _userManager           = userManager ?? throw new ArgumentException(nameof(userManager));
     _signInManager         = signInManager ?? throw new ArgumentException(nameof(signInManager));
 }
コード例 #32
0
ファイル: sof.cs プロジェクト: CloseUpDK/iRTVO
 public String SessionInfo(String method, ISessionInfo session, Int32 rounding)
 {
     switch (method)
     {
         case "sof":
             if (session.Standings.Count != drivercount)
                 this.UpdateSOF();
             return Math.Round(Math.Floor(this.sof), rounding).ToString();
         default:
             return "[invalid]";
     }
 }
コード例 #33
0
ファイル: InvokeRequire.cs プロジェクト: enjoycode/appbox.clr
 public InvokeRequire(InvokeSource source, InvokeProtocol contentType,
                      IntPtr waitHandle, string service, InvokeArgs args, int sourceMsgId,
                      ISessionInfo session = null)
 {
     Source      = source;
     ContentType = contentType;
     WaitHandle  = waitHandle;
     SourceMsgId = sourceMsgId;
     Service     = service;
     Args        = args;
     WaitHandle  = waitHandle;
     Session     = session;
 }
コード例 #34
0
        public EfCoreUnitOfWork(
            IIocResolver iocResolver,
            IEfCoreTransactionStrategy transactionStrategy,
            IDbContextResolver dbContextResolver,
            IConnectionStringResolver connectionStringResolver,
            ISessionInfo sessionInfo)
            : base(connectionStringResolver, sessionInfo)
        {
            IocResolver         = iocResolver;
            TransactionStrategy = transactionStrategy;
            DbContextResolver   = dbContextResolver;

            ActiveDbContexts = new Dictionary <string, EfCoreDbContextBase>();
        }
コード例 #35
0
 public DefaultEfCoreUnitOfWork(
     IIocResolver iocResolver,
     IEfCoreTransactionStrategy transactionStrategy,
     IDbContextResolver dbContextResolver,
     IConnectionStringResolver connectionStringResolver,
     ISessionInfo sessionInfo)
     : base(
         iocResolver,
         transactionStrategy,
         dbContextResolver,
         connectionStringResolver,
         sessionInfo)
 {
 }
コード例 #36
0
ファイル: HelloWorld.cs プロジェクト: CloseUpDK/iRTVO
 public String SessionInfo(String method, ISessionInfo session, Int32 rounding)
 {
     switch (method)
     {
         case "test":
             return "test succesful";
             break;
         case "state":
             return session.State.ToString();
             break;
         default:
             return "[invalid]";
             break;
     }
 }
コード例 #37
0
        public void Set(ISessionInfo sessionInfo)
        {
            if (sessionInfo == null)
                return;

            NhibernateService.Instance.CreateOrUpdateSingle(new SessionInfo
            {
                UserId = sessionInfo.UserId,
                AccessToken = sessionInfo.AccessToken,
            },
                oldSessionInfo =>
                {
                    oldSessionInfo.UserId = sessionInfo.UserId;
                    oldSessionInfo.AccessToken = sessionInfo.AccessToken;
                });
        }
コード例 #38
0
ファイル: EsterBootstrapper.cs プロジェクト: kib357/Ester2
        public EsterBootstrapper(IUnityContainer container, IEventAggregator eventAggregator, ISessionInfo sessionInfo)
        {
            _container = container;
            _sessionInfo = sessionInfo;
            _eventAggregator = eventAggregator;

            //_repositories.Add(container.Resolve<PeopleRepository>());
            //_repositories.Add(container.Resolve<PlansRepository>());
            _repositories.Add(container.Resolve<SchedulesRepository>());
            _repositories.Add(container.Resolve<PlanObjectsRepository>());

            //_viewModels.Add(container.Resolve<IEsterViewModel>("building"));
            //_viewModels.Add(container.Resolve<IEsterViewModel>("schedules"));
            ////_viewModels.Add(container.Resolve<IEsterViewModel>("people"));
            //_viewModels.Add(container.Resolve<IEsterViewModel>("logs"));
        }
コード例 #39
0
ファイル: HelloWorld.cs プロジェクト: CloseUpDK/iRTVO
 public String DriverInfo(String method, IStandingsItem standing, ISessionInfo session, Int32 rounding)
 {
     switch (method)
     {
         case "test":
             return "test succesful";
             break;
         case "drivername":
             return standing.Driver.Name;
             break;
         case "fuel":
             return ((Single)this.sdk.GetData("FuelLevel")).ToString();
             break;
         default:
             return "[invalid]";
             break;
     }
 }
コード例 #40
0
ファイル: UpdaterViewModel.cs プロジェクト: kib357/Ester2
        public UpdaterViewModel(IEventAggregator eventAggregator, IDataTransport dataTransport, IServerInfo serverInfo, ISessionInfo sessionInfo)
        {
            _eventAggregator = eventAggregator;

            _serverInfo = serverInfo;
            _sessionInfo = sessionInfo;

            // _isVisible = Visibility.Visible;
            _isVisible = Visibility.Collapsed;
            LastTime = AutoRestartTime;

            _dataTransport = dataTransport;

            RestartAppCommand = new DelegateCommand<object>(RestartApp);
            WaitForUpdateCommand = new DelegateCommand<object>(UpdateAbortedByUser);

            _checkTimer = new DispatcherTimer { Interval = new TimeSpan(0, 0, _serverInfo.UpdateInterval, 0) };
            _checkTimer.Tick += StartCheckUpdatesThread;
            _restartTimer = new DispatcherTimer { Interval = new TimeSpan(0, 0, 0, 1) };
            _restartTimer.Tick += RestartTimerTick;
        }
コード例 #41
0
ファイル: GlobalData.cs プロジェクト: ukionik/EasyMessenger
 protected GlobalData()
 {
     _sessionInfo = GetSessionInfo();
 }
コード例 #42
0
ファイル: SessionToken.cs プロジェクト: Vadi/sones
 public SessionToken(ISessionInfo mySessionInfo)
 {
     SessionInfo     = mySessionInfo;
     SessionSettings = new SessionSettings();
 }
コード例 #43
0
 public void SaveToDB(ISessionInfo sessionInfo)
 {
     new SetSessionInfo().Set(sessionInfo);
 }
コード例 #44
0
ファイル: slowmo.cs プロジェクト: CloseUpDK/iRTVO
 public String DriverInfo(String method, IStandingsItem standing, ISessionInfo session, Int32 rounding)
 {
     return "";
 }
コード例 #45
0
ファイル: slowmo.cs プロジェクト: CloseUpDK/iRTVO
 public String SessionInfo(String method, ISessionInfo session, Int32 rounding)
 {
     return "";
 }
コード例 #46
0
 public SessionInfoEventArgs(ISessionInfo sessionInfo)
 {
     SessionInfo = sessionInfo;
 }
コード例 #47
0
ファイル: GlobalData.cs プロジェクト: ukionik/EasyMessenger
 /// <summary>
 /// Записывает в базу данных новые данные сессии
 /// И обновляет текущие данные
 /// </summary>
 /// <param name="newSessionInfo"></param>
 public void UpdateSessionInfo(ISessionInfo newSessionInfo)
 {
     var setSessionInfo = new SetSessionInfo();
     setSessionInfo.Set(newSessionInfo);
     _sessionInfo = newSessionInfo;
 }
コード例 #48
0
ファイル: SessionToken.cs プロジェクト: TheByte/sones
 public SessionToken(ISessionInfo mySessionInfo)
 {
     SessionInfo     = mySessionInfo;
     SessionSettings = new SessionSettings();
       //  Transaction     = null;
 }