Exemplo n.º 1
0
 public AmDbActionCode(AmDbActionInitiator initiator, AmDbActionReason reason, AmDbActionCategory category)
 {
     this.m_initiator = initiator;
     this.m_reason    = reason;
     this.m_category  = category;
     this.m_intValue  = AmDbActionCode.ToInt(initiator, reason, category);
     this.UpdateStringRepresentation();
 }
Exemplo n.º 2
0
 public static void ToEnumFields(int actionCode, out AmDbActionInitiator initiator, out AmDbActionReason reason, out AmDbActionCategory category)
 {
     category = (AmDbActionCategory)(actionCode & 255);
     if (category > (AmDbActionCategory)255)
     {
         throw new AmInvalidActionCodeException(actionCode, category.GetType().Name, category.ToString());
     }
     reason = (AmDbActionReason)(actionCode >> 8 & 1023);
     if (reason > (AmDbActionReason)1023)
     {
         throw new AmInvalidActionCodeException(actionCode, reason.GetType().Name, reason.ToString());
     }
     initiator = (AmDbActionInitiator)(actionCode >> 18 & 255);
     if (initiator > (AmDbActionInitiator)255)
     {
         throw new AmInvalidActionCodeException(actionCode, initiator.GetType().Name, initiator.ToString());
     }
 }
Exemplo n.º 3
0
 public static int ToInt(AmDbActionInitiator initiator, AmDbActionReason reason, AmDbActionCategory category)
 {
     return((int)(category | (AmDbActionCategory)((int)reason << 8) | (AmDbActionCategory)((int)initiator << 18)));
 }