예제 #1
0
 public ClrtDisplayableType(ClrtDisplayableType parent, int typeId, int fieldIndex, string typeName, string fieldName, ClrElementKind kind, ulong[] addresses = null)
 {
     _id           = GetId();
     _parent       = parent;
     _typeId       = typeId;
     _fieldIndex   = fieldIndex;
     _typeName     = typeName;
     _fieldName    = fieldName;
     _kind         = kind;
     _fields       = Utils.EmptyArray <ClrtDisplayableType> .Value;
     _valueFilter  = null;
     _getValue     = false;
     _alternatives = null;
     _addresses    = addresses;
 }
예제 #2
0
 public bool HasAlternative(ClrtDisplayableType cdt)
 {
     if (_alternatives == null)
     {
         return(false);
     }
     for (int i = 0, icnt = _alternatives.Length; i < icnt; ++i)
     {
         if (_alternatives[i].Id == cdt.Id)
         {
             return(true);
         }
     }
     return(false);
 }
예제 #3
0
        public void AddAlternative(ClrtDisplayableType dtype)
        {
            if (_alternatives == null)
            {
                _alternatives = new ClrtDisplayableType[] { dtype };
                return;
            }
            for (int i = 0, icnt = _alternatives.Length; i < icnt; ++i)
            {
                if (dtype.TypeId == _alternatives[i].TypeId)
                {
                    return;
                }
            }
            var newAry = new ClrtDisplayableType[_alternatives.Length + 1];

            Array.Copy(_alternatives, newAry, _alternatives.Length);
            newAry[_alternatives.Length] = dtype;
            _alternatives = newAry;
        }
예제 #4
0
 public bool SameAlternativeField(ClrtDisplayableType fld, int dispIndex, int fldType, int fldIndex, string fldName)
 {
     if (!fld.IsAlternative)
     {
         return(false);
     }
     for (int i = 0, icnt = _parent.Alternatives.Length; i < icnt; ++i)
     {
         var altFld = _parent.Alternatives[i];
         if (!altFld.HasFields || dispIndex >= altFld.Fields.Length)
         {
             return(false);
         }
         var checkFld = altFld.Fields[dispIndex];
         if (checkFld.TypeId != fldType || checkFld.FieldIndex != fldIndex || !Utils.SameStrings(checkFld.FieldName, fldName))
         {
             return(false);
         }
     }
     return(true);
 }
예제 #5
0
 public static ClrtDisplayableType GetDummy(ClrtDisplayableType parent, string typeName, string fldName, int fldIndex)
 {
     return(new ClrtDisplayableType(parent, _dummyTypeId, fldIndex, typeName, fldName, ClrElementKind.Unknown));
 }
예제 #6
0
 public void SetParent(ClrtDisplayableType parent)
 {
     _parent = parent;
 }