public UserQuestion(string content, IRxn onOk, IRxn onCancel, string title = "Please choose?") { Title = title; Content = content; Ok = onOk; Cancel = onCancel; }
public void Record(IRxn rxn, TimeSpan?sinceBeginning = null) { sinceBeginning = sinceBeginning ?? _now() - _startedAt; Duration = sinceBeginning.Value; _writer.Write("{0}{1}", _codec.ToString(new CapturedRxn(sinceBeginning.Value, rxn)), _codec.Delimiter); }
private IRxn FilterPlayback(IRxn e) { //when a user presses the back button in the nav bar or other mechanism to pop //a page without a navigation action, we need to handle this! if (e is PhoneNavigationOrchestrator.PoppedPage) { var alreadyPopped = _lastEvent as NavigationAction; if (alreadyPopped == null || alreadyPopped.IsPushing) { return(_nav.Pop()); } } _lastEvent = e; Debug.WriteLine("Saw: {0}", e.GetType()); foreach (var filter in _automator.Filters) { e = filter.FilterPlayback(e); if (e == null) { return(null); } } Debug.WriteLine("Playing"); return(e); }
public ToastAlert(string title, string content, LogLevel level, TimeSpan?duration = null, IRxn onClick = null) { Title = title; Content = content; Level = level; OnClick = onClick; Duration = duration ?? TimeSpan.FromSeconds(5); }
public UserQuestion(string title, string content, string okText, IRxn onOk, string cancelText, IRxn onCancel) { Title = title; Content = content; OkText = okText; Ok = onOk; CancelText = cancelText; Cancel = onCancel; }
public IRxn FilterPlayback(IRxn tapedEvent) { try { var assert = tapedEvent as AssertModel; if (assert != null) { var currentValue = Snapshot(_appNav.Current.Model); //need a better comparision, like the cmdServiceCache hashing function to be ok with datetimes etc that will always be different Ensure.Equal(currentValue.ToJson(), assert.Value.ToJson(), "The model should be the same as when originally recorded"); return(null); } return(tapedEvent); } catch (Exception e) { return(new ToastAlert("Play inconsitancy detected", e.Message, LogLevel.Fatal)); } }
public void Publish(IRxn rxn) { _rxnManager.Publish(rxn).Until(); }
private static object PrettyPrint(IRxn obj) { return(obj.GetType().GetProperties().Select(p => "{0}:{1}".FormatWith(p.Name, p.CanRead ? p.GetValue(obj) : "(na)")).ToStringEach()); }
public MsgWrapper(IRxn toWrap) { Msg = toWrap; }
public static string Wrap(IRxn @event) { return(new MsgWrapper(@event).ToJson()); }
public Question(IServiceCommand ask, IRxn onSuccess = null, IRxn onFailure = null) { OnSuccess = onSuccess; Ask = ask; OnFailure = onFailure; }
public IRxn FilterPlayback(IRxn e) { //only executed message should be played back return(e as UserExecuted); }
public void Publish(IRxn cfg) { _publish(cfg); }
public DialogAlert(string content, string title = null, IRxn onOk = null) { Title = title; OnOk = onOk; Content = content; }
public void Record(IRxn rxn, TimeSpan?sinceBeginning = null) { _store.Add(new CapturedRxn(TimeSpan.Zero, rxn)); }
public CapturedRxn(TimeSpan offSet, IRxn rxn) { Offset = offSet; Recorded = rxn; }
public IRxn FilterPlayback(IRxn tapedEvent) { return(tapedEvent as IUserAction); }