Esempio n. 1
0
        void Pack()
        {
            var uidList = GetFlyContentBeanList()
                          .Where(b => b.isSelected)
                          .Select(b => b.uid)
                          .ToList();

            var servList = settings
                           .GetAllServersList()
                           .Where(s => uidList.Contains(s.GetCoreStates().GetUid()))
                           .ToList();

            var package = settings
                          .GetPackageList()
                          .FirstOrDefault(p => p.name == tboxName.Text);

            var strategy = (VgcApis.Models.Datas.Enums.BalancerStrategies)cboxBalancerStrategy.SelectedIndex;
            var newUid   = settings.Pack(servList, package?.uid, tboxName.Text, strategy);

            if (package != null && !string.IsNullOrEmpty(newUid))
            {
                package.uid = newUid;
                settings.SavePackage(package);
            }
        }
Esempio n. 2
0
        private void RefreshPackageListBox()
        {
            var packages = settings.GetPackageList();

            this.lstBoxPackages.Items.Clear();
            foreach (var package in packages)
            {
                lstBoxPackages.Items.Add(package.name);
            }
        }
Esempio n. 3
0
        void Pack()
        {
            var uidList = GetFlyContentBeanList()
                          .Where(b => b.isSelected)
                          .Select(b => b.uid)
                          .ToList();

            var servList = settings
                           .GetAllServersList()
                           .Where(s => uidList.Contains(s.GetCoreStates().GetUid()))
                           .ToList();

            var package = settings
                          .GetPackageList()
                          .FirstOrDefault(p => p.name == tboxName.Text);

            var newUid = settings.Pack(servList, package?.uid, tboxName.Text);

            if (package != null)
            {
                package.uid = newUid;
                settings.SavePackage(package);
            }
        }