Ejemplo 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);
            }
        }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 3
0
        void SaveCurPackageSetting()
        {
            var name = tboxName.Text;

            if (string.IsNullOrEmpty(name))
            {
                Libs.UI.MsgBoxAsync(I18N.NameCanNotBeNull);
                return;
            }
            var package = new Models.Data.Package();

            package.name  = name;
            package.beans = GetFlyContentBeanList();
            settings.SavePackage(package);
            RefreshPackageListBox();
        }