mirror of
				https://github.com/snltty/linker.git
				synced 2025-10-31 04:26:45 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			25 lines
		
	
	
		
			710 B
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			710 B
		
	
	
	
		
			C#
		
	
	
	
	
	
| using linker.libs;
 | |
| 
 | |
| namespace linker.messenger.flow
 | |
| {
 | |
|     public sealed class FlowTransfer
 | |
|     {
 | |
|         private List<IFlow> flows = new List<IFlow>();
 | |
|         public FlowTransfer()
 | |
|         {
 | |
|         }
 | |
| 
 | |
|         public void AddFlows(List<IFlow> list)
 | |
|         {
 | |
|             LoggerHelper.Instance.Info($"add flow {string.Join(",", list.Select(c => c.GetType().Name))}");
 | |
|             this.flows = this.flows.Concat(list).Distinct().ToList();
 | |
|         }
 | |
| 
 | |
|         public Dictionary<string, FlowItemInfo> GetFlows()
 | |
|         {
 | |
|             return flows.Select(c => new FlowItemInfo { ReceiveBytes = c.ReceiveBytes, SendtBytes = c.SendtBytes, FlowName = c.FlowName }).ToDictionary(c => c.FlowName);
 | |
|         }
 | |
|     }
 | |
| 
 | |
| }
 | 
