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); }
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); } }
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); } }); } }
public NodeResource(NodeResourceType resourceType, String resourceLocation, bool isDirectory = false) { ResourceType = resourceType; ResourceLocation = resourceLocation; IsDirectory = isDirectory; }