Example #1
0
 public KeyField(DbType DBType, bool IsIncrement, string Sequence, EKeyType KeyType)
     : base(string.Empty, DBType, ESerializedType.NO)
 {
     this.IsIncrement = IsIncrement;
     this.Sequence    = Sequence;
     this.KeyType     = KeyType;
 }
Example #2
0
 public Key(EKeyType enKeyType, string chNormal, string chShift)
 {
     KeyType      = enKeyType;
     Char         = chNormal;
     CharForShift = chShift;
     KeyState     = EKeyState.Ok;
 }
Example #3
0
    static public Dictionary <KEY, COMPONENT> GetComponentInChildren <KEY, COMPONENT>(this Component pTarget)
        where COMPONENT : UnityEngine.Component
    {
        Dictionary <KEY, COMPONENT> mapInitTarget = new Dictionary <KEY, COMPONENT>();

        System.Type pType    = typeof(KEY);
        EKeyType    eKeyType = EKeyType.None;

        if (pType.Equals(typeof(string)))
        {
            eKeyType = EKeyType.String;
        }
        else if (pType.IsEnum)
        {
            eKeyType = EKeyType.Enum;
        }

        if (eKeyType == EKeyType.None)
        {
            Debug.LogWarning(pTarget.name + " GetComponentInChildren_InitEnumerator eKeyType == EKeyType.None", pTarget);
            return(null);
        }

        COMPONENT[] arrComponent = pTarget.GetComponentsInChildren <COMPONENT>(true);
        for (int i = 0; i < arrComponent.Length; i++)
        {
            KEY Key = default(KEY);
            switch (eKeyType)
            {
            case EKeyType.CustomKey: break;

            case EKeyType.String: Key = (KEY)(object)arrComponent[i].name; break;

            case EKeyType.Enum:
                try
                {
                    Key = (KEY)System.Enum.Parse(typeof(KEY), arrComponent[i].name);
                }
                catch
                {
                    Debug.LogWarning(pTarget.name + " GetComponentInChildren_InitEnumerator Enum Parsing Error - " + arrComponent[i].name, pTarget);
                    continue;
                }
                break;
            }
            mapInitTarget.Add(Key, arrComponent[i]);
        }

        return(mapInitTarget);
    }
Example #4
0
 internal void Add(string isoCode, double weight, EKeyType type)
 {
     Keys.Add(new KeyboardKey(isoCode, weight, type));
 }
Example #5
0
 public KeyboardKey(string isoCode, double weight, EKeyType type)
 {
     IsoCode = isoCode;
     Weight  = weight;
     Type    = type;
 }
Example #6
0
 public KeyboardKey(string isoCode, double weight)
 {
     IsoCode = isoCode;
     Weight  = weight;
     Type    = EKeyType.Normal;
 }
Example #7
0
 public KeyField(string FieldName, DbType DBType, bool IsIncrement, string Sequence, string ForeignMappingEntity, EKeyType KeyType)
     : base(FieldName, DBType, ESerializedType.NO)
 {
     this.IsIncrement          = IsIncrement;
     this.Sequence             = Sequence;
     this.ForeignMappingEntity = ForeignMappingEntity;
     this.KeyType = KeyType;
 }
Example #8
0
 public KeyboardEventArgs(EState state, EKeyType type, Keys keys)
 {
     State = state;
     Type  = type;
     Key   = keys;
 }