GroupBuilderQuarantineVariable class

From Catglobe Wiki
Jump to: navigation, search

GroupBuilderQuarantineVariable


Represents a group builder variable for users in any of the given quarantines.

Parent class

Inherits from GroupBuilderVariable

Constructors

  • () - Create new variable

Methods

  • Empty Add(int quarantineResourceId "Quarantine resource id to add") - Add a new quarantine
  • object this[] { get; }(int index "Index") - Get quarantine resource id at index
  • bool Remove(int quarantineResourceId "Quarantine resource id to remove") - Remove quarantine. Return true if removed
  • (From object) string ToString() - The string representation of the object.

Properties

  • int Count { get; } - Number of specific quarantines
  • bool Include { get; set; } - Include users that match rule, or exclude
  • string ObjectTypeName { get; } - The name of the type of object.
  • (From object) TypeInformation TypeInformation { get; } - Get information about this class.


Examples

Examples Add a quarantine on quarantine variable

//Create a new group
string groupName = "Test Group Builder: quarantineVariable ";
number groupTemplateResourceId=2066;
number parentResourceId = 11088827;
array group = Group_new(groupName, groupTemplateResourceId, parentResourceId);
Group_save(group);
number groupRId = group[GROUP_RESOURCE_ID ];
 
//Create rule for the group
GroupBuilderRoot root = new GroupBuilderRoot (groupRId);

GroupBuilderQuarantineVariable quarantineVariable = new GroupBuilderQuarantineVariable();
quarantineVariable.Include=true;
quarantineVariable.Add(15542993);
quarantineVariable.Add(15549081);
print(quarantineVariable.Count);//2
print(quarantineVariable[0]);//quarantineRId 15542993
print(quarantineVariable[1]);//quarantineRId 15549081
 
GroupBuilderRule rule = new GroupBuilderRule (root);
rule.Add(quarantineVariable);
 
GroupBuilderRuleCollection ruleColection = root.RootRules;
ruleColection.Add(rule);

root.Save();


Examples Remove a quarantine on quarantine variable

GroupBuilderRoot root = new GroupBuilderRoot (15560629);

GroupBuilderRuleCollection ruleColection = root.RootRules;
GroupBuilderRule rule = ruleColection[0];
GroupBuilderQuarantineVariable quarantineVariable = rule[0];
print(quarantineVariable.Count);//2
quarantineVariable.Remove(quarantineVariable[0]);
print(quarantineVariable.Count);//1

root.Save();