Ejemplo n.º 1
0
    //读取数据表
    public void InitSkillInfo()
    {
        _UsuallyInfo = new List <string>();
        List <string[]> usualDataList = CfgReader.ReadCfg("UsualInfo");

        foreach (string[] dataStr  in usualDataList)
        {
            string dataInfo = dataStr[2];
            _UsuallyInfo.Add(dataInfo);
        }
    }
Ejemplo n.º 2
0
        private void ComboBoxPopulate()
        {
            try
            {
                var items = CfgReader.ReadCfg(@"Profiles.ini").OrderBy(x => x.Title).ToList();

                ComboBoxProfile.ItemsSource       = items;
                ComboBoxProfile.DisplayMemberPath = "Title";
                ComboBoxProfile.SelectedValuePath = "Data";
                ComboBoxProfile.Text = "Select profile...";
            }
            catch (Exception e)
            {
                Console.WriteLine("An error occured: " + e);
                ComboBoxProfile.IsEnabled = false;
            }
        }
Ejemplo n.º 3
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);
            ThreadedAlerter.CatchErrors(this);

            var cfg = CfgReader.ReadAndParseFromLocal();

            if (cfg == null)
            {
                MessageBox.Show($"Config not found in {CfgReader.ExpectedPath}");
                return;
            }

            var win = new MainWindow();

            using (var scope = Components.GetContainer(cfg).BeginLifetimeScope())
            {
                win.DataContext = scope.Resolve <MainWindowVM>();
            }
            win.Show();
        }
Ejemplo n.º 4
0
 internal static UploaderCfg LoadLocal()
 {
     CfgReader.FileName = "TestUploader_cfg.json";
     return(CfgReader.ReadAndParseFromLocal());
 }