public void SelectFile(IMainWin win) { Cache.IncUserActionCounter(); OpenFileDialog dlg = new OpenFileDialog { DefaultExt = ".txt", Filter = "TXT Files (*.txt)|*.txt" }; bool?success = dlg.ShowDialog(); if (success == true) { var circuit = CircuitFactory.GetFromFile(dlg.FileName); if (circuit.success) { win.SpawnResultWindow(dlg.FileName, circuit.circuit); } else { Console.WriteLine(circuit.error); win.SetErrorText(circuit.error); } } }
public static Circuit GetFullAdderCircuit() { SetTestPaths(); string filePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); return(CircuitFactory.GetFromFile(filePath + "../../../../Circuits/Circuit1_FullAdder.txt").circuit); }
/// <summary> /// Intended for framework use only. Applications should not instantiate /// this class directly. /// </summary> public BlazorHub( ILogger <BlazorHub> logger, IServiceProvider services) { _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _circuitFactory = services.GetRequiredService <CircuitFactory>(); }
/// <summary> /// Intended for framework use only. Applications should not instantiate /// this class directly. /// </summary> public ComponentHub( CircuitFactory circuitFactory, CircuitRegistry circuitRegistry, ILogger <ComponentHub> logger, IOptions <CircuitOptions> options) { _circuitFactory = circuitFactory; _circuitRegistry = circuitRegistry; _options = options.Value; _logger = logger; }
public ComponentHub( ServerComponentDeserializer serializer, CircuitFactory circuitFactory, CircuitIdFactory circuitIdFactory, CircuitRegistry circuitRegistry, ILogger <ComponentHub> logger) { _serverComponentSerializer = serializer; _circuitFactory = circuitFactory; _circuitIdFactory = circuitIdFactory; _circuitRegistry = circuitRegistry; _logger = logger; }
public ComponentHub( ServerComponentDeserializer serializer, IDataProtectionProvider dataProtectionProvider, CircuitFactory circuitFactory, CircuitIdFactory circuitIdFactory, CircuitRegistry circuitRegistry, ILogger <ComponentHub> logger) { _serverComponentSerializer = serializer; _dataProtectionProvider = dataProtectionProvider; _circuitFactory = circuitFactory; _circuitIdFactory = circuitIdFactory; _circuitRegistry = circuitRegistry; _logger = logger; }
/// <summary> /// Intended for framework use only. Applications should not instantiate /// this class directly. /// </summary> public ComponentHub(IServiceProvider services, ILogger <ComponentHub> logger) { _circuitFactory = services.GetRequiredService <CircuitFactory>(); _logger = logger ?? throw new ArgumentNullException(nameof(logger)); }
/// <summary> /// Overrides the default test circuit factory. Test decorators can use this to supply distributed test sequencers or /// other test circuit factory specializations. /// </summary> /// <param name="circuitFactory"> The new test circuit factory. </param> public void SetCircuitFactory(CircuitFactory circuitFactory) { this.circuitFactory = circuitFactory; }