static void TimeStartedProperty_Setting(object sender, ValueTranslationEventArgs e)
 {
     if (TimeStartedProperty.GetValue((ServiceInstance)e.Entity) > DateTime.MinValue)
     {
         e.Cancel = true;
     }
 }
        static void ActiveRuleProperty_Setting(object sender, ValueTranslationEventArgs e)
        {
            ServiceInstance current = (ServiceInstance)e.Entity;

            if ((int)current.State > (int)ServiceState.Uninitialized)
            {
                throw new InvalidOperationException("Cannot change properties after Initialize has been called.");
            }

            current._activeRule = (SchedulingRuleElement)e.Input;
            e.Output            = null;
        }
 static void ParentInstanceProperty_ReferenceEntityRequired(object sender, ValueTranslationEventArgs e)
 {
     throw new NotImplementedException("There is currently no way to retrieve the parent ServiceInstance by ID only.");
 }
        static void ActiveRuleProperty_Getting(object sender, ValueTranslationEventArgs e)
        {
            ServiceInstance current = (ServiceInstance)e.Entity;

            e.Output = current._activeRule;
        }
 static void StateProperty_Setting(object sender, ValueTranslationEventArgs e)
 {
 }