public void Remove(ProtoActivity activity) { if (activity.Id >= 0) { this.protoActivities[activity.Id] = null; } }
private void ProtoActivity_TextChanged(ProtoActivity activity) { this.Synchronized = false; if (this.TextChanged != null) { this.TextChanged.Invoke(); } }
public void MarkWorse(ProtoActivity worseActivity, ProtoActivity betterActivity, DateTime when) { worseActivity.MarkWorse(when); betterActivity.MarkBetter(when); if (this.RatingsChanged != null) { this.RatingsChanged.Invoke(); } }
// Gives a score telling how soon we want to show the given ProtoActivity next // Higher scores indicate to show the given ProtoActivity sooner public ProtoActivity_EstimatedInterest computeInterest(ProtoActivity protoactivity) { ProtoActivity_EstimatedInterest interest = new ProtoActivity_EstimatedInterest(); interest.ProtoActivity = protoactivity; interest.IntrinsicInterest = protoactivity.IntrinsicInterest; interest.NumIdleSeconds = this.when.Subtract(protoactivity.LastInteractedWith).TotalSeconds; interest.CurrentInterest = interest.IntrinsicInterest * interest.NumIdleSeconds; return(interest); }
public void Put(ProtoActivity protoActivity) { if (protoActivity.Id < 0) { protoActivity.Id = this.protoActivities.Count; } while (this.protoActivities.Count <= protoActivity.Id) { this.protoActivities.Add(null); } this.protoActivities[protoActivity.Id] = protoActivity; if (protoActivity.Text != null && protoActivity.Text != "") { this.ProtoActivity_TextChanged(protoActivity); } protoActivity.TextChanged += ProtoActivity_TextChanged; }
public override void Preview_ProtoActivity(ProtoActivity protoActivity) { string text = this.textConverter.ConvertToString(protoActivity); this.addText(text); }
public virtual void Preview_ProtoActivity(ProtoActivity protoActivity) { }
public void Add_ProtoActivity(ProtoActivity protoActivity) { this.Preview_ProtoActivity(protoActivity); }
public override void Preview_ProtoActivity(ProtoActivity protoActivity) { this.ProtoActivity_Database.Put(protoActivity); }