Пример #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);
 }