Exemple #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);
            }
        }
Exemple #2
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);
            }
        }