Exemplo n.º 1
0
        protected SumCommand(IAdsConnection connection, SumCommandMode commandMode, SumAccessMode readWriteMode)
        {
            this.ig          = AdsReservedIndexGroups.SumCommandRead;
            this.connection  = connection;
            this.mode        = readWriteMode;
            this.commandMode = commandMode;
            switch (commandMode)
            {
            case SumCommandMode.Read:
                this.ig = AdsReservedIndexGroups.SumCommandRead;
                return;

            case SumCommandMode.Write:
                this.ig = AdsReservedIndexGroups.SumCommandWrite;
                return;

            case SumCommandMode.ReadWrite:
                this.ig = AdsReservedIndexGroups.SumCommandReadWrite;
                return;

            case SumCommandMode.AddDeviceNotification:
                this.ig = AdsReservedIndexGroups.SumCommandAddDevNote;
                return;

            case SumCommandMode.DeleteDeviceNotification:
                this.ig = AdsReservedIndexGroups.SumCommandDelDevNote;
                return;
            }
            throw new NotImplementedException();
        }
Exemplo n.º 2
0
        protected SumCommand(IAdsConnection connection, IList <SumDataEntity> sumEntities, SumCommandMode accessMode, SumAccessMode readWriteMode)
        {
            this.ig          = AdsReservedIndexGroups.SumCommandRead;
            this.connection  = connection;
            this.sumEntities = sumEntities;
            this.mode        = readWriteMode;
            this.commandMode = accessMode;
            switch (accessMode)
            {
            case SumCommandMode.Read:
                this.ig = AdsReservedIndexGroups.SumCommandRead;
                return;

            case SumCommandMode.Write:
                this.ig = AdsReservedIndexGroups.SumCommandWrite;
                return;

            case SumCommandMode.ReadWrite:
                this.ig = AdsReservedIndexGroups.SumCommandReadWrite;
                return;
            }
        }