/// <summary> /// Get Item by a string id or a int id /// </summary> public ICapeParameter this[string id] { get { if (paramCollection == null) { throw new ECapeUnknownException(this, "There is no connected info stream"); } return(paramCollection.Item(id)); } }
override public void Initialize() { ICapeUtilitiesCOM p_Util = ((ICapeUtilitiesCOM)this.p_Unit); p_Util.Initialize(); ICapeIdentification p_Id = (ICapeIdentification)p_Unit; //wrap ports... ICapeCollection portColl = (ICapeCollection)((ICapeUnitCOM)(p_Unit)).ports; int portCount = portColl.Count(); object[] portConnections = new object[portCount]; for (int i = 0; i < portCount; i++) { ICapeUnitPortCOM port = (ICapeUnitPortCOM)portColl.Item(i + 1); this.Ports.Add(new UnitPortWrapper(port)); } //wrap parameters... ICapeCollection paramColl = (ICapeCollection)((ICapeUtilitiesCOM)(p_Unit)).parameters; int paramCount = paramColl.Count(); for (int i = 0; i < paramCount; i++) { ICapeParameter param = (ICapeParameter)paramColl.Item(i + 1); CapeParamType paramType = ((ICapeParameterSpecCOM)param.Specification).Type; if (((ICapeParameterSpecCOM)param.Specification).Type == CapeParamType.CAPE_REAL) { this.Parameters.Add(new RealParameterWrapper(param)); } if (((ICapeParameterSpecCOM)param.Specification).Type == CapeParamType.CAPE_INT) { this.Parameters.Add(new IntegerParameterWrapper(param)); } if (((ICapeParameterSpecCOM)param.Specification).Type == CapeParamType.CAPE_OPTION) { this.Parameters.Add(new OptionParameterWrapper(param)); } if (((ICapeParameterSpecCOM)param.Specification).Type == CapeParamType.CAPE_BOOLEAN) { this.Parameters.Add(new BooleanParameterWrapper(param)); } if (((ICapeParameterSpecCOM)param.Specification).Type == CapeParamType.CAPE_ARRAY) { this.Parameters.Add(new ArrayParameterWrapper(param)); } } }