コード例 #1
0
        public void RemoveResource(BlockchainNode node, NodeResourceType resourceType, ResponseHandler.DispatherCallback dispatherCallback)
        {
            ActionRequest action = new ActionRequest(ActionType.DeleteFile);

            action.FullNodeName = node.NodeEndpoint.FullNodeName;
            NodeResource nodeResource = NodeResourceLocator.NodeResources[resourceType];

            action.Parameters.Add(ActionParameters.Path, ClientConfigReader.Evaluate(nodeResource.ResourceLocation, node.NodeConfig));
            actionQueue.Enqueue(action);
        }
コード例 #2
0
        private void RemoveResourceForSelectedNodes(NodeResourceType resourceType)
        {
            if (dataGridViewNodes.SelectedRows.Count == 0)
            {
                return;
            }

            foreach (DataGridViewRow row in dataGridViewNodes.SelectedRows)
            {
                BlockchainNode node  = (BlockchainNode)row.Cells["Node"].Value;
                var            agent = clientConnectionManager.GetAgent(node.NodeConfig.Agent);

                NodeActionDispatcher dispatcher = (NodeActionDispatcher)agent.Dispatchers[MessageType.ActionRequest];
                dispatcher.RemoveResource(node, resourceType);
            }
        }
コード例 #3
0
        private void RemoveResourceForSelectedNodes(NodeResourceType resourceType)
        {
            if (dataGridViewNodes.SelectedRows.Count == 0)
            {
                return;
            }

            foreach (DataGridViewRow row in dataGridViewNodes.SelectedRows)
            {
                BlockchainNode node  = (BlockchainNode)row.Cells["Node"].Value;
                var            agent = clientConnectionManager.GetAgent(node.NodeConfig.Agent);

                NodeActionDispatcher dispatcher = (NodeActionDispatcher)agent.Dispatchers[MessageType.ActionRequest];
                dispatcher.RemoveResource(node, resourceType, response =>
                {
                    if (!response.IsSuccess)
                    {
                        MessageBox.Show(response.MessageHeader, "Action failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                });
            }
        }
コード例 #4
0
 public NodeResource(NodeResourceType resourceType, String resourceLocation, bool isDirectory = false)
 {
     ResourceType     = resourceType;
     ResourceLocation = resourceLocation;
     IsDirectory      = isDirectory;
 }