Beispiel #1
0
 /// <summary>
 /// Returns a bool indicating if the feature is active
 /// </summary>
 /// <param name="actuator">The actuator</param>
 /// <param name="userID">Optional User to check</param>
 /// <returns>Bool indicating if the feature active</returns>
 internal bool IsActive(Actuator actuator, string userID)
 {
     if (userID == "")
     {
         return Percentage == 100;
     }
     else
     {
         return IsUserInPercentage(actuator, userID) || Users.Contains(userID) || actuator.UserInGroup(userID, Groups);
     }
 }
Beispiel #2
0
        private bool IsUserInPercentage(Actuator actuator, string userID)
        {
            if (Percentage == 100)
            {
                return true;
            }
            else if (Percentage != 100 || Percentage != 0)
            {
                return int.Parse(userID) % 100 <= Percentage;
            }

            return false;
        }
Beispiel #3
0
 /// <summary>
 /// Creates and initalizes a feature
 /// </summary>
 /// <param name="actuator">Actuator</param>
 /// <param name="Name">Name of the feature</param>
 public Feature(Actuator actuator, string Name)
 {
     this.Name = Name;
     actuator.LoadFeature(this);
 }