public Run(IStored <ScheduledTasks> tasks, IStored <ScheduledTasks> likes, Cli cli, IAutomaton automaton, ILog log) { _tweetTasks = tasks; _likeTasks = likes; _cli = cli; _automaton = automaton; _log = log; }
public RandomLikeAutomaton(IStored <RandomLikeAutomatonData> data, IStored <ScheduledTasks> tasks, Like like, ITwitterGateway twitter, ILog log) { _data = data; _tasks = tasks; _like = like; _twitter = twitter; _log = log; }
public IInstance newInstance(Context context, IStored stored) { CategoryDeclaration decl = context.getRegisteredDeclaration <CategoryDeclaration>(this.GetTypeName()); IInstance inst = decl.newInstance(context, stored); inst.setMutable(this.Mutable); return(inst); }
private object ConvertInstance(IStored instance) { IDictionary <string, object> doc = new Dictionary <string, object>(); foreach (string name in instance.Names) { doc[name] = ConvertValue(instance.GetData(name)); } return(doc); }
protected virtual IValue getCurrent() { try { IStored stored = enumerator.Current; CategoryType type = ReadItemType(stored); return(type.newInstance(context, stored)); } catch (PromptoError e) { throw new Exception(e.Message); } }
void PopulateInstance(Context context, IStored stored, IInstance instance) { SetDbId(context, instance, stored.DbId); foreach (String name in GetAllAttributes(context)) { PopulateMember(context, stored, instance, name); } if (instance.getStorable() != null) { instance.getStorable().Dirty = false; } }
public IInstance newInstance(Context context, IStored stored) { IInstance instance = newInstance(context); instance.setMutable(true); try { PopulateInstance(context, stored, instance); } finally { instance.setMutable(false); } return(instance); }
void PopulateMember(Context context, IStored stored, IInstance instance, String name) { AttributeDeclaration decl = context.getRegisteredDeclaration <AttributeDeclaration>(name); if (!decl.Storable) { return; } if (stored.HasData(name)) { Object data = stored.GetData(name); IValue value = decl.getIType().ConvertCSharpValueToIValue(context, data); instance.SetMemberValue(context, name, value); } }
CategoryType ReadItemType(IStored stored) { Object value = stored.GetData("category"); if (value is List <String> ) { List <String> categories = (List <String>)value; String category = categories[categories.Count - 1]; CategoryType type = new CategoryType(category); type.Mutable = this.Mutable; return(type); } else { throw new InvalidDataError("Could not infer category!"); } }
public override IValue interpret(Context context) { IStore store = DataStore.Instance; IQuery query = buildFetchOneQuery(context, store); IStored stored = store.FetchOne(query); if (stored == null) { return(NullValue.Instance); } else { List <String> categories = (List <String>)stored.GetData("category"); String actualTypeName = categories.FindLast((v) => true); CategoryType type = new CategoryType(actualTypeName); if (this.type != null) { type.Mutable = this.type.Mutable; } return(type.newInstance(context, stored)); } }
public Cancel(IStored <ScheduledTasks> tasks, ILog log) { _tasks = tasks; _log = log; }
public WithDisplayedUsername(ILog log, IStored <Credentials> credentials, ICommand inner) { _log = log; _credentials = credentials; _inner = inner; }
public ScheduleTweet(IStored <ScheduledTasks> tasks, Tweet tweet, ILog log) { _tasks = tasks; _tweet = tweet; _log = log; }
public HttpTwitterClient(IStored <Credentials> credentials) { _credentials = credentials; }
public SetupCommand(IStored <Credentials> credentials, ILog log) { _credentials = credentials; _log = log; }
public Run(ILog log, IStored <ProcessTargetList> targets) { _targets = targets; _log = log; }
public ViewTasks(IStored <ScheduledTasks> tasks, ILog log) { _tasks = tasks; _log = log; }
public static Task <V> ViewModelTask <M, V>(this IStored <M> inst) where M : class, IStored <M>, new() where V : ViewModel <M>, new() { return(Task.FromResult((V)inst.ViewModel)); }
/// <summary> /// The Dispose() extension method is called implicitly before the /// ViewModel is returned and saves the M object either to the returned /// ViewState or implicitly on the server. /// </summary> /// <typeparam name="M"></typeparam> public static void Save <M>(this IStored <M> inst) where M : class, IStored <M>, new() { inst.ViewModel.ViewState = StorageServer.Save <M>(inst.ViewModel); }
public ScheduleLike(IStored <ScheduledTasks> tasks, Like like, ILog log) { _tasks = tasks; _like = like; _log = log; }
public ViewCredentials(IStored <Credentials> credentials, ILog log) { _credentials = credentials; _log = log; }
public RemoveTargetProcess(ILog log, IStored <ProcessTargetList> targets) { _log = log; _targets = targets; }
public SetMaxLikes(IStored <RandomLikeAutomatonData> data, ITwitterGateway twitter, ILog log) { _data = data; _twitter = twitter; _log = log; }