public CrawlSession With(Contexts contexts) { foreach (var context in contexts) Contexts.Add(context.Key, context.Value); return this; }
public override IEnumerable<Dictionary<string, object>> GetRows(Contexts.Sources.Source source) { var context = source as Contexts.Sources.Database; using (var connection = new SqlConnection(context.ConnectionString)) { connection.Open(); using (var cmd = new SqlCommand(context.Command, connection)) { cmd.CommandTimeout = context.CommandTimeout; using (var reader = cmd.ExecuteReader()) { while (reader.Read()) { var rowObj = new Dictionary<string, object>(); for (int i = 0; i < reader.FieldCount; i++) { var data = reader[i]; if (context.SuppressNulls && data == DBNull.Value) continue; ParseColumn(reader.GetName(i), data, rowObj); } yield return rowObj; } } } } }
public static Source GetSource(Contexts.Sources.Source source) { var contextType = source.GetType(); if (contextType == typeof(Contexts.Sources.Database)) return new Database(); else if(contextType == typeof(Contexts.Sources.FlatFile)) return new FlatFile(); else throw new ArgumentException(); }
public SetupController( Contexts.IDS4Context context, LuigiTrabacchin.IdentityServer4.EntityFramework.Identity.UserManager<Int32> userManager, ScopeStore<Int32> scopeStore, ClientStore<Int32> clientStore ) { this.Context = context; this._userManager = userManager; this._scopeStore = scopeStore; this._clientStore = clientStore; }
public override IEnumerable<Dictionary<string, object>> GetRows(Contexts.Sources.Source source) { var context = source as Contexts.Sources.FlatFile; using (var reader = new System.IO.StreamReader(context.Location)) { string line = null; string[] columns = null; while ((line = reader.ReadLine()) != null) { if (columns == null) columns = ParseLine(line, context.Delimiters); else yield return MakeRowObj(ParseLine(line, context.Delimiters), columns); } } }
public void Activate(ActionContext actionContext, object controller) { var controllerType = controller.GetType(); var propertiesToActivate = _activateActions.GetOrAdd( controllerType, _getPropertiesToActivate); var contexts = new Contexts() { ActionBindingContext = _actionBindingContextAccessor.ActionBindingContext, ActionContext = actionContext, }; for (var i = 0; i < propertiesToActivate.Length; i++) { var activateInfo = propertiesToActivate[i]; activateInfo.Activate(controller, contexts); } }
public UsuarioRepository( Contexts.GerenciamentoProjetosDbContext context) { _context = context; }
public Mouth(Contexts.Destination destination) { _destination = destination; _client = new Nest.ElasticClient(new Nest.ConnectionSettings(new Uri(destination.Url))); }
public void init(Contexts contexts) { _contexts = contexts; }
public void AddOffset(int mod = 0) { Contexts.Peek().Offsets.Add(CurrentScript.Code.Count + mod); }
public CleanupFeature(Contexts contexts, ServiceContainer services) : base("Cleanup") { Add(new RemoveDestroyedEntitiesFromView(contexts, services)); }
// Start is called before the first frame update void Start() { _contexts = Contexts.sharedInstance; _systems = CreateSystems(_contexts); InitWorld(); }
public StandardEntityEventRemovedEventSystem(Contexts contexts) : base(contexts.Test) { _listenerBuffer = new System.Collections.Generic.List <IStandardEntityEventRemovedListener>(); }
public PlayerAttackSystem(Contexts contexts) : base(contexts.game) { this.contexts = contexts; player = contexts.game.GetGroup(GameMatcher.Player); enemy = contexts.game.GetGroup(GameMatcher.Enemy); }
public RegisterLocalStorageServiceSystem(Contexts contexts, ILocalStorageService localStorageService) { _context = contexts.game; _localStorageService = localStorageService; }
public InitSystems(Contexts contexts) : base("Init Systems") { Add(new InitTerrainSystem(contexts)); Add(new InitMountainSystem(contexts)); Add(new InitColonistSystem(contexts)); }
public RunCommandSystem(Contexts contexts) { _context = contexts.input; }
public AddVelocityToPositionSystem(Contexts _contexts) { gameContext = _contexts.game; }
public BurstModeRemovedEventSystem(Contexts contexts) : base(contexts.input) { _listeners = contexts.input.GetGroup(InputMatcher.BurstModeRemovedListener); _entityBuffer = new System.Collections.Generic.List <InputEntity>(); _listenerBuffer = new System.Collections.Generic.List <IBurstModeRemovedListener>(); }
public AbilityCooldownSubtractionSystem(Contexts contexts) { cooldownGroup = contexts.game.GetGroup(GameMatcher.AbilityCooldown); }
public StunnedRemovedEventSystem(Contexts contexts) : base(contexts.logic) { }
public UpdateLookSystem(Contexts contexts) { _updates = contexts.game.GetGroup(GameMatcher.UpdateLook); }
public SpamProbability GetSpamProbability(ServerMessagesCacheService serverMessagesCacheService, Contexts contexts) { var howManyMessagesCount = this._configurationService.GetConfigurationItem <HowManyMessagesInShortTimeToBeSpam>(contexts.Server.Id).Value; var howManySeconds = this._configurationService.GetConfigurationItem <HowLongIsShortTimeInSeconds>(contexts.Server.Id).Value; var minDate = DateTime.UtcNow.AddSeconds(-howManySeconds); var messagesCount = serverMessagesCacheService.GetLastUserMessages(contexts.User.Id, contexts.Server.Id) .TakeLast(howManyMessagesCount) .Count(x => x.SentAt >= minDate); if (messagesCount <= howManyMessagesCount / 3) { return(SpamProbability.None); } var userIsSafe = this._userSafetyChecker.IsUserSafe(contexts.User.Id, contexts.Server.Id); return(userIsSafe switch { true when messagesCount < howManyMessagesCount => SpamProbability.None, false when messagesCount <= howManyMessagesCount / 2 => SpamProbability.Low, false when messagesCount < howManyMessagesCount => SpamProbability.Medium, _ => SpamProbability.Sure });
public AddViewSystem(Contexts contexts) : base(contexts.game) { }
public CardViewCreatingSystem(Contexts contexts, CardSetting setting) : base(contexts.card) { _setting = setting; }
public WppViewDestroySystem(Contexts contexts) { uiSoundsManager = UiSoundsManager.Instance(); context = contexts.wppAccrual; movingAwardsGroup = context.GetGroup(WppAccrualMatcher.MovingIcon); }
public PlayerServerStateUpdateSystem(Contexts contexts) { _contexts = contexts; }
public void AddContext(string name, int mod = 0) { Contexts.Push(new Context(name, CurrentScript.Code.Count + mod)); }
public CollisionFixedPenetrationDetectionSystem(Contexts contexts) : base(contexts.game) { gameContext = contexts.game; }
public DeactivateFeatureSystem(Contexts contexts) : base(contexts.events) { _coreContext = contexts.core; }
public Test2EventSystems(Contexts contexts) { Add(new Test2MultipleContextStandardEventEventSystem(contexts)); // priority: 0 Add(new Test2MultipleEventsStandardEventEventSystem(contexts)); // priority: 1 Add(new Test2MultipleEventsStandardEventRemovedEventSystem(contexts)); // priority: 2 }
public IEnumerable<TemporaryIdentifier> GetIdentifiers(Contexts contexts) { var methods = workspace.GetMethods(documentId); foreach (var method in methods) { var returnType = method.ReturnType.ToString(); var identifier = method.Identifier.ToString(); var parameter = method.ParameterList.Parameters.FirstOrDefault()?.Type.ToString(); if (identifier.StartsWith("__") == false && parameter != null) { var context = contexts.Find(parameter); if (context != null) { var isBoolean = returnType == "bool" || returnType == "Boolean"; var contextType = ExtraxtContextType(returnType); var childContext = contexts.Find(contextType)?.Name; var isCollection = childContext != null && contextType != returnType; yield return new TemporaryIdentifier(context, new Identifier { Name = identifier, QuickInfo = "(extension) " + (isCollection ? contextType + "Collection" : contextType) + " " + identifier, Context = childContext, HasContext = childContext != null, IsBoolean = isBoolean, IsCollection = isCollection, RequireTemplate = isCollection, IsCustom = true }); } } } }
public BoardSystem(Contexts contexts) : base(contexts.game) { gameContext = contexts.game; }
public AISupportProductsSystem(Contexts contexts) : base(contexts) { }
public RenderAnimationSystem(Contexts contexts) : base(contexts.game) { m_contexts = contexts; }
public UpdateAnimationTimeSystem(Contexts contexts) : base(contexts.game) { }
public GameEventSystems(Contexts contexts) { Add(new DestroyedEventSystem(contexts)); // priority: 0 Add(new PositionEventSystem(contexts)); // priority: 0 }
public CreateMoverSystem(Contexts contexts) { _gameContext = contexts.game; }
public PhysicsService(Contexts contexts) : base(contexts) { _collidedObjects = new Collider2D[COLLIDED_OBJECT_SIZE]; _castBuffer = new RaycastHit2D[64]; _triggeredObjects = new List <ITrigger>(); }
public abstract IEnumerable<Dictionary<string, object>> GetRows(Contexts.Sources.Source source);
static Context[] findAllContexts() { const BindingFlags bindingFlags = BindingFlags.Public | BindingFlags.Instance; var allContextsProperty = typeof(Contexts).GetProperty("allContexts", bindingFlags); if(allContextsProperty != null) { var contextsType = typeof(Contexts); var setAllContextsMethod = contextsType.GetMethod("SetAllContexts", bindingFlags); if(setAllContextsMethod != null) { var contexts = new Contexts(); setAllContextsMethod.Invoke(contexts, null); var allContextsGetter = contextsType.GetProperty("allContexts", bindingFlags); return (Context[])allContextsGetter.GetValue(contexts, null); } } return new Context[0]; }