Exemple #1
0
        public override bool Equals(object obj)
        {
            if (!(obj is SC.Interfaces.DefaultPlugins.IActivation))
            {
                return(false);
            }

            SC.Interfaces.DefaultPlugins.IActivation other = obj as SC.Interfaces.DefaultPlugins.IActivation;
            if (DurationTimeSpan != other.DurationTimeSpan || RepetitionTimeSpan != other.RepetitionTimeSpan)
            {
                return(false);
            }

            DateTime otherStartTime = other.StartTime;

            while (otherStartTime < StartTime)
            {
                otherStartTime = RepetitionTimeSpan.GetNextTime(otherStartTime);
            }
            while (otherStartTime > StartTime)
            {
                otherStartTime = RepetitionTimeSpan.GetPreviousTime(otherStartTime);
            }

            return(otherStartTime == StartTime);
        }
 private void btnRemove_Click(object sender, EventArgs e)
 {
     SC.Interfaces.DefaultPlugins.IActivation act = lstActivations.SelectedItem as SC.Interfaces.DefaultPlugins.IActivation;
     if (act != null && plugin.HavePermission())
     {
         plugin.RemoveActivation(act);
     }
 }
Exemple #3
0
 public void RemoveActivation(SC.Interfaces.DefaultPlugins.IActivation activation)
 {
     if (InvokeRequired)
     {
         Invoke(new SC.Messaging.Delegate <SC.Interfaces.DefaultPlugins.IActivation>(RemoveActivation), activation);
     }
     else
     {
         if (!(times.ContainsKey(activation.StartTime) && times[activation.StartTime].Equals(activation)))
         {
             throw new ArgumentException("There is not such activation.");
         }
         times.Remove(activation.StartTime);
     }
 }