Example #1
0
 public CircuitRunner(Editor editor)
 {
     this.Editor         = editor;
     this.isMaxSpeed     = this.Editor.IsMaximumSpeed;
     this.oscilloscoping = new SettingsBoolCache(Settings.Session, "Oscilloscoping" + this.Editor.Project.ProjectId.ToString(), false);
     this.RootMap        = new CircuitMap(this.Editor.Project.LogicalCircuit);
 }
Example #2
0
        public UserSettings()
        {
            this.fileWatcher = new FileSystemWatcher {
                EnableRaisingEvents = false
            };
            string file = UserSettings.FileName();

            if (!File.Exists(file))
            {
                this.IsFirstRun = true;
                try {
                    this.Save();
                } catch (Exception exception) {
                    Tracer.Report("UserSettings.ctor", exception);
                }
            }
            try {
                this.Load(file);
                this.fileWatcher.Path                = Path.GetDirectoryName(file);
                this.fileWatcher.Filter              = Path.GetFileName(file);
                this.fileWatcher.Changed            += new FileSystemEventHandler(this.FileChanged);
                this.fileWatcher.EnableRaisingEvents = true;
            } catch (Exception exception) {
                Tracer.Report("UserSettings.ctor", exception);
            }
            this.maxRecentFileCount     = new SettingsIntegerCache(this, "Settings.MaxRecentFileCount", 1, 24, 4);
            this.loadLastFileOnStartup  = new SettingsBoolCache(this, "Settings.LoadLastFileOnStartup", true);
            this.createBackupFileOnSave = new SettingsBoolCache(this, "Settings.CreateBackupFileOnSave", false);
            this.gateShape = new SettingsEnumCache <GateShape>(this, "Settings.GateShape",
                                                               EnumHelper.Parse(Properties.Resources.DefaultGateShape, GateShape.Rectangular)
                                                               );
            this.TruncateRecentFile();
        }
Example #3
0
        private static void InitLogging()
        {
            SettingsBoolCache logging = new SettingsBoolCache(Settings.User, "Tracer.WriteToLogFile", false);

            Tracer.WriteToLogFile = logging.Value;
        }