コード例 #1
0
        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);
                }
            }
        }
コード例 #2
0
        public static Circuit GetFullAdderCircuit()
        {
            SetTestPaths();
            string filePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

            return(CircuitFactory.GetFromFile(filePath + "../../../../Circuits/Circuit1_FullAdder.txt").circuit);
        }
コード例 #3
0
 /// <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>();
 }
コード例 #4
0
 /// <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;
 }
コード例 #5
0
 public ComponentHub(
     ServerComponentDeserializer serializer,
     CircuitFactory circuitFactory,
     CircuitIdFactory circuitIdFactory,
     CircuitRegistry circuitRegistry,
     ILogger <ComponentHub> logger)
 {
     _serverComponentSerializer = serializer;
     _circuitFactory            = circuitFactory;
     _circuitIdFactory          = circuitIdFactory;
     _circuitRegistry           = circuitRegistry;
     _logger = logger;
 }
コード例 #6
0
ファイル: ComponentHub.cs プロジェクト: shat90/aspnetcore
 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;
 }
コード例 #7
0
 /// <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));
 }
コード例 #8
0
 /// <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;
 }
コード例 #9
0
 /// <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;
 }