private object OnReadAnyValue(System.Type managedType, int timeout) { DateTime time; object obj2; if (!this.HasValue) { throw new CannotAccessVirtualSymbolException(this); } IAccessorValueAny valueAccessor = this.ValueAccessor as IAccessorValueAny; if (valueAccessor == null) { throw new ValueAccessorException($"Accessor '{this.ValueAccessor}' doesn't support IValueAnyAccessor", this.ValueAccessor); } int num = 0; IAccessorConnection connection = valueAccessor as IAccessorConnection; if ((timeout >= 0) && (connection != null)) { using (new AdsTimeoutSetter(connection.Connection, timeout)) { num = valueAccessor.TryReadAnyValue(this, managedType, out obj2, out time); goto TR_0004; } } num = valueAccessor.TryReadAnyValue(this, managedType, out obj2, out time); TR_0004: if (num != 0) { throw new SymbolException($"Cannot read (any) of Symbol '{this.InstancePath}'! Error: {num}", this); } return(obj2); }
protected virtual object OnReadAnyValue(Type managedType) { DateTime time; object obj2; if (!this.HasValue) { throw new CannotAccessVirtualSymbolException(this); } IAccessorValueAny valueAccessor = this.ValueAccessor as IAccessorValueAny; if (valueAccessor == null) { throw new ValueAccessorException($"Accessor '{this.ValueAccessor}' doesn't support IValueAnyAccessor", this.ValueAccessor); } int num = valueAccessor.TryReadAnyValue(this, managedType, out obj2, out time); if (num != 0) { throw new SymbolException($"Cannot read (any) of Symbol '{this.InstancePath}'! Error: {num}", this.symbol); } return(obj2); }