Example #1
0
        protected virtual IDictionary <object, object> GetDriver(ISessionData session, int driverCarIdx)
        {
            var driversList = (IList <object>)session.SessionInfo.driverInfo["Drivers"];
            var driver      = (IDictionary <object, object>)driversList[driverCarIdx];

            return(driver);
        }
Example #2
0
        protected virtual float GetFastestLapTime(ISessionData session, int driverCarIdx)
        {
            float fastestLapTime = 0F;

            var sessions       = (IList <object>)session.SessionInfo.sessionInfo["Sessions"];
            var currentSession = (IDictionary <object, object>)sessions.LastOrDefault();

            var sessionResults = (IList <object>)currentSession["ResultsPositions"];

            if (sessionResults == null)
            {
                return(-1);
            }
            else
            {
                foreach (IDictionary <object, object> result in sessionResults)
                {
                    if (result["CarIdx"].ToString() == driverCarIdx.ToString())
                    {
                        fastestLapTime = float.Parse(result["FastestTime"].ToString());
                    }
                }

                return(fastestLapTime);
            }
        }
Example #3
0
        protected virtual string GetCurrentSessionInfo(ISessionData session)
        {
            var currentSession = GetCurrentSession(session);
            var sessionName    = currentSession["SessionName"].ToString();

            return(sessionName);
        }
Example #4
0
        protected virtual string GetDriverInfo(ISessionData session, int driverCarIdx)
        {
            var driver   = GetDriver(session, driverCarIdx);
            var userName = driver["UserName"].ToString();

            return(userName);
        }
Example #5
0
        protected virtual string GetLapInfo(ISessionData session, int driverCarIdx)
        {
            string lapCount         = "";
            string fastestLapNumber = "";
            string fastestLapTime   = "";

            var sessions       = (IList <object>)session.SessionInfo.sessionInfo["Sessions"];
            var currentSession = (IDictionary <object, object>)sessions.LastOrDefault();

            var sessionResults = (IList <object>)currentSession["ResultsPositions"];

            if (sessionResults == null)
            {
                return("0");
            }
            else
            {
                foreach (IDictionary <object, object> result in sessionResults)
                {
                    if (result["CarIdx"].ToString() == driverCarIdx.ToString())
                    {
                        lapCount         = result["Lap"].ToString();
                        fastestLapNumber = result["FastestLap"].ToString();
                        fastestLapTime   = result["FastestTime"].ToString();
                    }
                }

                return($"{lapCount}   Best Lap: {fastestLapNumber} [{fastestLapTime}]");
            }
        }
Example #6
0
        public Login(IUsersRepository usersRepository, ISessionData sessionData)
        {
            InitializeComponent();

            _usersRepository = usersRepository;
            _sessionData     = sessionData;
        }
Example #7
0
        public RoutesSelection(IRouteRepository routeRepository, ISessionData sessionData)
        {
            _routeRepository = routeRepository;
            _sessionData     = sessionData;

            InitializeComponent();
        }
Example #8
0
 public ItemProductController(ISessionData sessionData, IItemProductService itemProductService, ICategoryService categoryService, IItemService itemService)
     : base(sessionData)
 {
     _itemProductService = itemProductService;
     _categoryService    = categoryService;
     _itemService        = itemService;
 }
Example #9
0
 /// <summary>
 /// Instancia una clase de negocio para la tabla User
 /// </summary>
 /// <param name="userAppData">repositorios de datos para usuarios</param>
 /// <param name="parametersData">repositorio de datos para parametros</param>
 /// <param name="policyGlobalAppData">repositorios de datos para las politicas globales</param>
 /// <param name="sessionData">repositorios para las sesiones</param>
 public LoginServices(IUserAppData userAppData, IParametersData parametersData, IPolicyGlobalAppData policyGlobalAppData, ISessionData sessionData)
 {
     _userAppData         = userAppData;
     _parametersData      = parametersData;
     _policyGlobalAppData = policyGlobalAppData;
     _sessionData         = sessionData;
 }
Example #10
0
 public ItemController(ISessionData sessionData, IItemService itemService, IInventoryService inventoryService, ICategoryService categoryService)
     : base(sessionData)
 {
     _itemService      = itemService;
     _categoryService  = categoryService;
     _inventoryService = inventoryService;
 }
Example #11
0
        public void SetInsertDefaults(object o, ISessionData session)
        {
            if (o is ICreateDate)
            {
                ((ICreateDate)o).CreateDate = DateTime.UtcNow;
            }
            if (o is ICreatorIp)
            {
                ((ICreatorIp)o).CreatorIp = session.GetUserIP();
            }
            if (o is ICreatorId)
            {
                ((ICreatorId)o).CreatorId = session.UserID;
            }

            if (o is IModifyNr)
            {
                ((IModifyNr)o).ModifyNr = 1;
            }
            if (o is IModifyDate)
            {
                ((IModifyDate)o).ModifyDate = DateTime.UtcNow;
            }
            if (o is IModifierIp)
            {
                ((IModifierIp)o).ModifierIp = session.GetUserIP();
            }
            if (o is IModifierId)
            {
                ((IModifierId)o).ModifierId = session.UserID;
            }
        }
Example #12
0
        public static void End()
        {
            if (!Configuration.Enabled)
            {
                return;
            }

            if (_sessionData == null || !_registeredOnServer)
            {
                return;
            }

            Guid sessionGuid;

            lock (_syncRoot)
            {
                if (_sessionData == null)
                {
                    return;
                }

                sessionGuid  = _sessionData.SessionGuid;
                _sessionData = null;
            }

            EndSessionEx(sessionGuid);
        }
        private string ProcessSlashCommand(ChatState userState, ISessionData session, ISocketClient client, ref byte[] bytes)
        {
            byte[]        tmpBytes;
            ISlashCommand command = null;

            foreach (var cmd in userState.Commands)
            {
                tmpBytes = cmd.Identifier;
                if (bytes.IndexOfSequence(ref tmpBytes) > -1)
                {
                    command = cmd;
                }
            }

            if (command != null)
            {
                var content = bytes.Skip(command.Identifier.Length)
                              .Take(bytes.Length - command.Identifier.Length)
                              .ToArray();

                command.Execute(ref content, _serverState, session, client);
                return(string.Empty);
            }

            return("Invalid slash command.");
        }
Example #14
0
        public static DataTransfer.Session ToSessionData(this ISessionData sessionData)
        {
            if (sessionData == null)
            {
                throw new ArgumentNullException("sessionData", "No session data provided.");
            }

            return(new DataTransfer.Session
            {
                ClientToken = sessionData.ClientToken,
                SessionGuid = sessionData.SessionGuid,
                Environment = sessionData.Environment,
                Application = new ApplicationData
                {
                    Fingerprint = sessionData.Application.Fingerprint,
                    Name = sessionData.Application.Name,
                    Version = sessionData.Application.Version,
                    SupportToolkitNameVersion = sessionData.Application.SupportToolkitNameVersion,
                    BuildTime = sessionData.Application.BuildTime
                },
                Machine = new MachineData
                {
                    Fingerprint = sessionData.Machine.Fingerprint,
                    Name = sessionData.Machine.Name,
                    Data = sessionData.Machine.Data.ToDictionary(x => x.Key, x => x.Value),
                },
                User = new UserData
                {
                    Fingerprint = sessionData.User.Fingerprint,
                    UserName = sessionData.User.UserName,
                },
            });
        }
Example #15
0
        protected virtual string GetVehicleInfo(ISessionData session, int driverCarIdx)
        {
            var driver  = GetDriver(session, driverCarIdx);
            var vehicle = driver["CarScreenName"].ToString();

            return(vehicle);
        }
Example #16
0
 public App()
 {
     httpClient  = ManContainer.container.GetInstance <IHttpClient>();
     logger      = ManContainer.container.GetInstance <ILogger>();
     fileManager = ManContainer.container.GetInstance <IFileManager>();
     sessionData = ManContainer.container.GetInstance <ISessionData>();
 }
Example #17
0
 public MenuDesignerController(ISessionData sessionData, IMenuService menuService, ISettingsService settingsService, ICategoryService categoryService, IItemService itemService)
     : base(sessionData)
 {
     _menuService     = menuService;
     _settingsService = settingsService;
     _categoryService = categoryService;
     _itemService     = itemService;
 }
Example #18
0
        /// <summary>
        /// converting the value which is in coded format.
        /// </summary>
        /// <param name="codedString">
        /// the string value which is in coded format.
        /// </param>
        public QString(string codedString)
        {
            StrongString strongString =
                FromString(codedString);

            sessionData    = strongString;
            stringProvider = strongString;
        }
        public void RegisterSession(ISessionData sessionData)
        {
            var data = new RegisterSessionRequest {
                Session = sessionData.ToSessionData()
            };

            ExecuteCommand(data, "session", "register");
        }
 public void SubscribeToUpdates(ISessionData sessionData)
 {
     if (_activeDataInterfaces.ContainsKey(sessionData.Id))
     {
         Debug.LogError("SessionData with id '" + sessionData.Id + "' is already active.");
         return;
     }
     _activeDataInterfaces.Add(sessionData.Id, sessionData);
 }
Example #21
0
                public static DbTransaction Create(ISessionData session, CreateDatabaseConnectionDelegate create, IsolationLevel level)
                {
                    DbTransaction t = new DbTransaction();

                    t._session     = session;
                    t._connection  = create();
                    t._transaction = t.Connection.BeginTransaction(level);
                    return(t);
                }
Example #22
0
 public CounterData(Guid id, DateTime clientTime, ISessionData session, string userHandle, string message, IDictionary <string, string> data, List <ICheckpoint> checkpoints)
 {
     Id          = id;
     ClientTime  = clientTime;
     Session     = session;
     UserHandle  = userHandle;
     Message     = message;
     Data        = data;
     Checkpoints = checkpoints;
 }
Example #23
0
        public static void EndCurrentSession()
        {
            CurrentSession.Finished = DateTime.Now;

            Repository.Save(CurrentSession);

            CurrentSession   = null;
            addedBreakpoints = false;
            addedPathNode    = false;
        }
Example #24
0
        /// <summary>
        /// Controls the processing of data loaded from a timing data file.
        /// </summary>
        /// <param name="data">The complete file contents</param>
        /// <param name="fileType">The type of data contained by the file</param>
        public void ProcessData(string data, Session session, int raceIndex)
        {
            ISessionData dataToAnalyse = GetDataType(data, session.GetTimingDataType());

            dataToAnalyse.AnalyseData(session);
            dataToAnalyse.WriteArchiveData(session, raceIndex);
            dataToAnalyse.UpdateDatabaseWithData(session, raceIndex);

            sessionDataLoaded[session] = true;
        }
Example #25
0
        public void RegisterSession(ISessionData sessionData)
        {
            var data = new RegisterSessionRequest {
                Session = sessionData.ToSessionData()
            };

            var jsonFormatter = new JsonMediaTypeFormatter();
            var content       = new ObjectContent <RegisterSessionRequest>(data, jsonFormatter);

            ExecuteCommand(content, "session", "register");
        }
Example #26
0
        public static void RegisterNewSession()
        {
            if (CurrentSession != null)
            {
                return;
            }

            CurrentSession = new SessionData
            {
                Description = "TODO",
                Label       = "TODO",
                Purpose     = "TODO",
                Started     = DateTime.Now
            };

            Repository.GenerateIdentifier();
            Repository.Save(CurrentSession);

            SessionInputService    sessionInputService    = new SessionInputService(new RepositoryLog(), String.Empty);
            SessionInputDataSimple sessionInputDataSimple = sessionInputService.GetInputData();

            CurrentSession.Task = new TaskData
            {
                Name        = (sessionInputDataSimple.Task.LastOrDefault() ?? new TaskData {
                    Name = String.Empty
                }).Name,
                Description = (sessionInputDataSimple.Task.LastOrDefault() ?? new TaskData {
                    Description = String.Empty
                }).Description,
                Action      = (sessionInputDataSimple.Task.LastOrDefault() ?? new TaskData {
                    Action = TaskAction.ResolvingBug.ToString()
                }).Action,
                Created     = (sessionInputDataSimple.Task.LastOrDefault() ?? new TaskData {
                    Created = DateTime.Now
                }).Created,
                Project     = new ProjectData
                {
                    Name        = sessionInputDataSimple.Project,
                    Description = String.Empty
                }
            };

            Repository.Save(CurrentSession);

            CurrentSession.Developer = new DeveloperData
            {
                Name = sessionInputDataSimple.Developer
            };

            Repository.Save(CurrentSession);

            addedBreakpoints = false;
            addedPathNode    = false;
        }
Example #27
0
        public override void Execute(ref byte[] contentBytes, ServerState state, ISessionData session, ISocketClient client)
        {
            var sb = new StringBuilder("\n");

            foreach (var room in state.Rooms)
            {
                sb.AppendLine(room.Name);
            }

            client.Send(Encoding.ASCII.GetBytes($"Rooms available:\n{sb}\n"));
        }
Example #28
0
        protected virtual string GetTrackInfo(ISessionData session)
        {
            var trackName      = GetTrackName(session);
            var trackLength    = session.SessionInfo.weekendInfo["TrackLength"].ToString();
            var trackType      = session.SessionInfo.weekendInfo["TrackType"].ToString();
            var sessions       = (IList <object>)session.SessionInfo.sessionInfo["Sessions"];
            var currentSession = (IDictionary <object, object>)sessions.LastOrDefault();
            var trackState     = GetTrackState(session);

            return($"{trackName}\r\n{trackLength}\r\n{trackType}\r\n{trackState}");
        }
Example #29
0
        static public async Task <ISessionData> GetSessionOrThrow(this ISessionRepository repository, IRegionData region)
        {
            ISessionData session = await repository.GetSession(region.SessionId);

            if (session == null)
            {
                throw new HttpResponseException(new HttpResponseMessage {
                    StatusCode = HttpStatusCode.NotFound, ReasonPhrase = "No session found for the provided region"
                });
            }
            return(session);
        }
Example #30
0
 public IssueData(Guid id, DateTime clientTime, ISessionData session, bool?visibleToUser, IDictionary <string, string> data, IssueType issueType, Guid?issueThreadGuid, string userHandle, string userInput)
 {
     Id              = id;
     ClientTime      = clientTime;
     Session         = session;
     VisibleToUser   = visibleToUser;
     Data            = data;
     IssueType       = issueType;
     IssueThreadGuid = issueThreadGuid;
     UserHandle      = userHandle;
     UserInput       = userInput;
 }
 public OrderController(ISessionData sessionData
         , IOrderService orderService
         , IItemService itemService
         , ICommentService commentService
         , IFloorService floorService
         , ICategoryService categoryService
         , IMenuService menuService
     )
     : base(sessionData) {
     _orderService = orderService;
     _itemService = itemService;
     _commentService = commentService;
     _floorService = floorService;
     _categoryService = categoryService;
     _menuService = menuService;
 }
Example #32
0
		public CustomerPageVM(IWebcamVM webcam, ISessionData sessionData)
			: base(sessionData) {
			Webcam = webcam;
			Webcam.CurrentPhotoChanged += newPath => Customer.PhotoPath = newPath;
			InitCommands();
		}
 public CustomerController(ISessionData sessionData, ICustomerService customerService, ISettingsService settingsService)
     : base(sessionData) {
     _customerService = customerService;
     _settingsService = settingsService;
 }
 public LogoutController(ISessionData sessionData)
     : base(sessionData) {
 }
Example #35
0
 public HomeController(ISessionData sessionData, ISettingsService settingsService)
     : base(sessionData) {
     _settingsService = settingsService;
 }
 public AccountController(ISessionData sessionData, IAuthenticationService authenticationService)
 {
     this.sessionData = sessionData;
     this.authenticationService = authenticationService;
 }
 public FloorController(ISessionData sessionData, IFloorService floorService)
     : base(sessionData) {
     _floorService = floorService;
 }
 public CommentsController(ISessionData sessionData, ICommentService commentService)
     : base(sessionData) {
     _commentService = commentService;
 }
Example #39
0
		public NewTransactionVM(ISessionData sessionData) {
			Customer = sessionData.Customer;
			Transaction = Customer.CreateNewTransaction();
			FinishCommand = new RelayCommand<PageName>(Finish, CanFinish);
		}
 public ConfirmationsController(ISessionData sessionData, IUserService userService)
     : base(sessionData) {
     _userService = userService;
 }
 public ErrorController(ISessionData sessionData)
     : base(sessionData) {
 }
Example #42
0
 public BaseController(ISessionData sessionData) {
     this.SessionData = sessionData;
     _LogService = new LogService();
 }
 public DesignerController(ISessionData sessionData, ICategoryService categoryService, IMenuService menuService)
     : base(sessionData) {
     _categoryService = categoryService;
     _menuService = menuService;
 }
 public LoginController(ISessionData sessionData, ILoginService loginService, ISettingsService settingsService)
     : base(sessionData) {
     _loginService = loginService;
     _settingsService = settingsService;
 }
 public RegistrationController(ISessionData sessionData, ICustomerService customerService, IUserService userService)
     : base(sessionData) {
     _customerService = customerService;
     _userService = userService;
 }
Example #46
0
 public ItemController(ISessionData sessionData, IItemService itemService, IInventoryService inventoryService, ICategoryService categoryService)
     : base(sessionData) {
     _itemService = itemService;
     _categoryService = categoryService;
     _inventoryService = inventoryService;
 }
Example #47
0
 public BindableCustomerVM(ISessionData sessionData)
 {
     if (sessionData == null) throw new ArgumentNullException(ExceptionMessages.SessionDataNull, (Exception)null);
     Customer = sessionData.Customer;
     SessionData = sessionData;
 }
 public ConfirmController(ISessionData sessionData, IConfirmationService confirmationService)
     : base(sessionData) {
     _confirmationService = confirmationService;
 }
 public UsersController(ISessionData sessionData, IUserService userService)
     : base(sessionData) {
     _userService = userService;
 }
 public CategoryController(ISessionData sessionData, ICategoryService categoryService)
     : base(sessionData) {
     _categoryService = categoryService;
 }
 public AlertController(ISessionData sessionData, IAlertService alertService)
     : base(sessionData) {
     _alertService = alertService;
 }
 public ReportsController(ISessionData sessionData, IReportsService reportsService)
     : base(sessionData) {
     _reportsService = reportsService;
 }
		public ExistingTransactionVM(ISessionData sessionData) {
			if (sessionData == null) throw new ArgumentNullException(ExceptionMessages.SessionDataNull, (Exception)null);
			InitCommands();
			LoadSessionData(sessionData);
			CreateNewEmptyTransaction();
		}
 public KitchenOrderController(ISessionData sessionData, IOrderService orderService)
     : base(sessionData) {
     _orderService = orderService;
 }
		private void LoadSessionData(ISessionData sessionData) {
			Customer = sessionData.Customer;
		}
Example #56
0
 public MenuController(ISessionData sessionData, ICategoryService categoryService, ISettingsService settingsService)
     : base(sessionData) {
     _categoryService = categoryService;
     _settingsService = settingsService;
 }
 public ItemProductController(ISessionData sessionData, IItemProductService itemProductService, ICategoryService categoryService, IItemService itemService)
     : base(sessionData) {
     _itemProductService = itemProductService;
     _categoryService = categoryService;
     _itemService = itemService;
 }