示例#1
0
 private void SetLocalizations()
 {
     Loc.ControlText(checkBoxOwner, "Owner");
     Loc.ControlText(cbTribe, "Tribe");
     Loc.ControlText(checkBoxStatus, "Status");
     Loc.ControlText(checkBoxSex, "Sex");
     Loc.ControlText(checkBoxBred, "Bred");
     Loc.ControlText(checkBoxMother, "Mother");
     Loc.ControlText(checkBoxFather, "Father");
     Loc.ControlText(cbServer, "Server");
     Loc.ControlText(checkBoxNote, "Note");
     Loc.ControlText(checkBoxSpecies, "Species");
     Loc.ControlText(buttonApply, "apply");
     Loc.ControlText(buttonCancel, "Cancel");
 }
        public UpdateModules()
        {
            InitializeComponent();
            Loc.ControlText(BtOk, "OK");
            Loc.ControlText(BtCancel, "Cancel");

            var manifestFilePath = FileService.GetPath(FileService.ManifestFileName);

            if (!File.Exists(manifestFilePath))
            {
                return;
            }

            _asbManifest = AsbManifest.FromJsonFile(manifestFilePath);
            if (_asbManifest?.modules == null)
            {
                return;
            }

            // Display installed and available modules
            var moduleGroups = _asbManifest.modules.Where(kv => kv.Value.Category != "main").Select(kv => kv.Value)
                               .GroupBy(m => m.Category);

            _checkboxesUpdateModule = new List <CheckBox>();
            _checkboxesSelectModule = new List <CheckBox>();

            FlpModules.FlowDirection = FlowDirection.TopDown;
            FlpModules.WrapContents  = false;

            foreach (var g in moduleGroups)
            {
                var header = new Label {
                    Text = g.Key, Margin = new Padding(5, 20, 0, 5), AutoSize = true
                };
                header.Font = new Font(header.Font.FontFamily, header.Font.Size * 2);
                FlpModules.Controls.Add(header);
                var group        = g.OrderBy(m => !m.LocallyAvailable).ThenBy(m => m.Name).ToArray();
                var onlyOneEntry = group.Length == 1;
                foreach (var m in group)
                {
                    var moduleDisplay = CreateModuleControl(m, onlyOneEntry);
                    FlpModules.Controls.Add(moduleDisplay);
                }
            }

            InitiallySelectedSpeciesImageCollectionId = _checkboxesSelectModule.Where(cb => cb.Checked).Select(cb => cb.Tag as AsbModule)
                                                        .FirstOrDefault(m => (m?.LocallyAvailable ?? false) && m?.Category == "Species Images")?.Id;
        }
示例#3
0
 public void SetLocalizations()
 {
     Loc.ControlText(label1, "Mother");
     Loc.ControlText(label2, "Father");
 }
 public void SetLocalizations()
 {
     Loc.ControlText(lbPedigreeEmpty);
     _tt.SetToolTip(PbRegionColors, Loc.S("copyInfoGraphicToClipboard"));
     _tt.SetToolTip(nudGenerations, Loc.S("generations"));
 }
 private void InitializeLocalization()
 {
     Loc.ControlText(buttonOK, "OK");
     Loc.ControlText(buttonCancel, "Cancel");
 }