/// <summary> /// Creates an instance of the UnitOperationWrapper unit operation wrapping the unit operation. /// </summary> /// <remarks> /// This constructor creates an instance of the COM-based CAPE-OPEN unit operation identified by its class /// identification (CLSID) number. /// </remarks><param name="CLSID">The class identification number (CLSID) of a COM-based CAPE-OPEN unit operation.</param> public UnitOperationWrapper(System.Guid CLSID) { m_CLSID = CLSID; this.p_Unit = Activator.CreateInstance(Type.GetTypeFromCLSID(m_CLSID)); ICapeUnitCOM test = (ICapeUnitCOM)this.p_Unit; if (test == null) { throwException(new CapeOpen.CapeInvalidArgumentException(string.Concat(Type.GetTypeFromCLSID(m_CLSID).ToString(), "is not a valid ICapeUnit unit operation"), 1)); } }
/// <summary> /// Copy constructor for the UnitOperationWrapper class. /// </summary> /// <remarks> /// Copy constructor for wrapper around a COM-based CAPE-OPEN unit operation. The contructor creates a /// new instance of the wrapped unit operation. /// </remarks> /// <param name="unitOperation">The <see craf = "UnitOperationWrapper"/> to be copied.</param> public UnitOperationWrapper(UnitOperationWrapper unitOperation) : base() { if (unitOperation.p_Unit.GetType().IsCOMObject) { this.p_Unit = Activator.CreateInstance(Type.GetTypeFromCLSID(unitOperation.m_CLSID)); ICapeUnitCOM test = (ICapeUnitCOM)this.p_Unit; if (test == null) { throwException(new CapeOpen.CapeInvalidArgumentException(string.Concat(Type.GetTypeFromCLSID(m_CLSID).ToString(), "is not a valid ICapeUnit unit operation"), 1)); } } else { Type unitType = unitOperation.p_Unit.GetType(); this.p_Unit = AppDomain.CurrentDomain.CreateInstanceAndUnwrap(unitType.AssemblyQualifiedName, unitType.Name); } this.Initialize(); }