예제 #1
0
 public void Remove(ProtoActivity activity)
 {
     if (activity.Id >= 0)
     {
         this.protoActivities[activity.Id] = null;
     }
 }
예제 #2
0
 private void ProtoActivity_TextChanged(ProtoActivity activity)
 {
     this.Synchronized = false;
     if (this.TextChanged != null)
     {
         this.TextChanged.Invoke();
     }
 }
예제 #3
0
 public void MarkWorse(ProtoActivity worseActivity, ProtoActivity betterActivity, DateTime when)
 {
     worseActivity.MarkWorse(when);
     betterActivity.MarkBetter(when);
     if (this.RatingsChanged != null)
     {
         this.RatingsChanged.Invoke();
     }
 }
예제 #4
0
        // 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);
        }
예제 #5
0
        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;
        }
예제 #6
0
        public override void Preview_ProtoActivity(ProtoActivity protoActivity)
        {
            string text = this.textConverter.ConvertToString(protoActivity);

            this.addText(text);
        }
예제 #7
0
 public virtual void Preview_ProtoActivity(ProtoActivity protoActivity)
 {
 }
예제 #8
0
 public void Add_ProtoActivity(ProtoActivity protoActivity)
 {
     this.Preview_ProtoActivity(protoActivity);
 }
예제 #9
0
 public override void Preview_ProtoActivity(ProtoActivity protoActivity)
 {
     this.ProtoActivity_Database.Put(protoActivity);
 }