Exemplo n.º 1
0
        private void calcAccess(ISymbol parent, Member member, out uint indexGroup, out uint indexOffset)
        {
            DataType         dataType    = (DataType)member.DataType;
            AdsDataTypeFlags memberFlags = member.MemberFlags;
            bool             flag        = memberFlags.HasFlag(AdsDataTypeFlags.None | AdsDataTypeFlags.Static);

            this.calcAccess(parent, dataType, member.Offset, member.Flags, memberFlags, out indexGroup, out indexOffset);
            if (indexGroup == 0xf017)
            {
                indexOffset = member.TypeHashValue;
            }
        }
Exemplo n.º 2
0
        private void calcAccess(ISymbol parent, DataType memberType, int offset, AdsSymbolFlags symbolFlags, AdsDataTypeFlags flags, out uint indexGroup, out uint indexOffset)
        {
            ISymbol symbol    = Unwrap(parent);
            bool    isBitType = false;

            if (memberType != null)
            {
                isBitType = memberType.IsBitType;
            }
            bool flag2 = flags.HasFlag(AdsDataTypeFlags.None | AdsDataTypeFlags.Static);

            if ((flags & (AdsDataTypeFlags.None | AdsDataTypeFlags.PropItem)) == (AdsDataTypeFlags.None | AdsDataTypeFlags.PropItem))
            {
                indexGroup  = 0xf017;
                indexOffset = 0;
            }
            else if (flag2)
            {
                indexGroup  = 0xf019;
                indexOffset = 0;
            }
            else if (symbol.IsBitType | isBitType)
            {
                this.calcBitAccess(symbol, offset, symbolFlags, flags, out indexGroup, out indexOffset);
            }
            else if (this.IsDereferencedPointer)
            {
                indexGroup  = !isBitType ? 0xf014 : 0xf01a;
                indexOffset = 0;
            }
            else if (base.IsReference || this.IsDereferencedReference)
            {
                indexGroup  = !isBitType ? 0xf016 : 0xf01b;
                indexOffset = 0;
            }
            else
            {
                indexGroup  = ((IAdsSymbol)symbol).IndexGroup;
                indexOffset = ((IAdsSymbol)symbol).IndexOffset + ((uint)offset);
            }
        }