예제 #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);
            }
        }
        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;
 }