Example #1
0
        public EDDiscoveryForm()
        {
            InitializeComponent();

            EDDConfig = new EDDConfig();

            //_fileTgcSystems = Path.Combine(Tools.GetAppDataDirectory(), "tgcsystems.json");
            _fileEDSMDistances = Path.Combine(Tools.GetAppDataDirectory(), "EDSMDistances.json");

            string logpath="";
            try
            {
                logpath = Path.Combine(Tools.GetAppDataDirectory(), "Log");
                if (!Directory.Exists(logpath))
                {
                    Directory.CreateDirectory(logpath);
                }

            }
            catch (Exception ex)
            {
                Trace.WriteLine($"Unable to create the folder '{logpath}'");
                Trace.WriteLine($"Exception: {ex.Message}");
            }
            _edsmSync = new EDSMSync(this);

            trilaterationControl.InitControl(this);
            travelHistoryControl1.InitControl(this);
            imageHandler1.InitControl(this);

            SystemNames = new AutoCompleteStringCollection();
            Map = new EDDiscovery2._3DMap.MapManager();
        }
 public void InitControl(EDDiscoveryForm discoveryForm)
 {
     _discoveryForm = discoveryForm;
     sync = new EDSMSync(_discoveryForm);
     var db = new SQLiteDBClass();
     defaultColour = db.GetSettingInt("DefaultMap", Color.Red.ToArgb());
 }
        public EDDiscoveryForm()
        {
            InitializeComponent();

            EDDConfig = new EDDConfig();

            //_fileTgcSystems = Path.Combine(Tools.GetAppDataDirectory(), "tgcsystems.json");
            _fileEDSMDistances = Path.Combine(Tools.GetAppDataDirectory(), "EDSMDistances.json");        

            string logpath="";
            try
            {
                logpath = Path.Combine(Tools.GetAppDataDirectory(), "Log");
                if (!Directory.Exists(logpath))
                {
                    Directory.CreateDirectory(logpath);
                }

            }
            catch (Exception ex)
            {
                Trace.WriteLine($"Unable to create the folder '{logpath}'");
                Trace.WriteLine($"Exception: {ex.Message}");
            }
            _edsmSync = new EDSMSync(this);

            trilaterationControl.InitControl(this);
            travelHistoryControl1.InitControl(this);
            imageHandler1.InitControl(this);
            menuStrip1.Renderer = new MenuRenderer(new MenuColorTable());
            listBox1.DataSource = EDDConfig.Themes;
            listBox1.DisplayMember = "Name";
            listBox1.ValueMember = "Name";
            listBox1.SelectedValueChanged += delegate(object sender, EventArgs args)
            {
                var listBox = sender as ListBox;
                var theme = listBox.SelectedItem as ITheme;
                EDDConfig.SelectedTheme = theme;
                this.BackColor = EDDConfig.SelectedTheme.MainBackgroundColor;
                this.ForeColor = EDDConfig.SelectedTheme.MainFontColor;
                ApplyThemeToControls(this.Controls);
            };

            SystemNames = new AutoCompleteStringCollection();
            Map = new EDDiscovery2._3DMap.MapManager();
        }