示例#1
0
        /// <summary>
        /// Binds the port to the list of roles and sets the delegate for all operations in each role
        /// </summary>
        /// <param name="port">The port to bind</param>
        /// <param name="roles">The list of roles to bind</param>
        /// <param name="opDelegate">The delegate for all operations</param>
        protected void BindRoles(Port port, List <VRole> roles, OperationDelegate opDelegate)
        {
            platform.SetRoles(port.GetInfo(), roles, this);

            foreach (VRole role in roles)
            {
                foreach (VOperation operation in role.GetOperations())
                {
                    port.SetOperationDelegate(role.Name(), operation.Name(), opDelegate);
                }
            }
        }
示例#2
0
 public void SetRoles(IPortInfo portInfo, IListContract <IRole> roles, IModule module)
 {
     _view.SetRoles(PortInfoAdapter.C2V(portInfo),
                    CollectionAdapters.ToIList <IRole, VRole>(roles, RoleAdapter.C2V, RoleAdapter.V2C),
                    ModuleAdapter.C2V(module));
 }