Beispiel #1
0
        public ref readonly PortStatus this[PortValue value]
        {
            get
            {
                switch (value)
                {
                case PortValue.PortA:
                    return(ref portA);

                case PortValue.PortB:
                    return(ref portB);

                case PortValue.PortC:
                    return(ref portC);

                case PortValue.PortD:
                    return(ref portD);

                case PortValue.PortE:
                    return(ref portE);

                case PortValue.PortF:
                    return(ref portF);

                default:
                    throw new ArgumentOutOfRangeException(nameof(value));
                }
            }
        }
        private void UpdateValues(PortValue source)
        {
            values.Clear();
            if (source == null)
            {
                return;
            }

            foreach (var valuePair in source.Values)
            {
                _genericsNames.Clear();
                var type  = valuePair.Key;
                var value = valuePair.Value;

                var containerValue = value as IReadonlyObjectValue;
                var resultValue    = containerValue != null?containerValue.GetValue() : value;


                values.Add(new ContextValueInfo().Update(resultValue, type));
            }
        }