public VmServerListPage(VmMain vmMain)
        {
            Debug.Assert(vmMain != null);
            Vm = vmMain;

            var lastSelectedGroup = "";

            if (!string.IsNullOrEmpty(SystemConfig.Instance.Locality.MainWindowTabSelected))
            {
                lastSelectedGroup = SystemConfig.Instance.Locality.MainWindowTabSelected;
            }

            RebuildVmServerCardList();
            GlobalData.Instance.ServerList.CollectionChanged += (sender, args) =>
            {
                RebuildVmServerCardList();
            };

            SystemConfig.Instance.General.PropertyChanged += (sender, args) =>
            {
                if (args.PropertyName == nameof(SystemConfig.General.ServerOrderBy))
                {
                    RebuildVmServerCardList();
                }
            };

            if (!string.IsNullOrEmpty(lastSelectedGroup) && ServerGroupList.Contains(lastSelectedGroup))
            {
                SelectedGroup = lastSelectedGroup;
            }
        }
        public static ServerGroupList CreateServerGroupCollection(SqlDataReader sqlDataReader)
        {
            ServerGroupList groups = new ServerGroupList();

            while (sqlDataReader.Read())
            {
                groups.Add(GenerateServerGroup(sqlDataReader));
            }

            return(groups);
        }
Exemple #3
0
        public void UpdateServerGroupList(ServerGroupList msg)
        {
            var obj = new ServerGroup();

            { var tmpv = msg.Name; if (tmpv != null)
              {
                  obj.Name = (str)tmpv;
              }
            }
            { var tmpv = msg.GroupType; if (tmpv != null)
              {
                  obj.GroupType = (GroupType)tmpv;
              }
            }
            { var tmpv = msg.IconId; if (tmpv != null)
              {
                  obj.IconId = (IconHash)tmpv;
              }
            }
            { var tmpv = msg.IsPermanent; if (tmpv != null)
              {
                  obj.IsPermanent = (bool)tmpv;
              }
            }
            { var tmpv = msg.SortId; if (tmpv != null)
              {
                  obj.SortId = (i32)tmpv;
              }
            }
            { var tmpv = msg.NamingMode; if (tmpv != null)
              {
                  obj.NamingMode = (GroupNamingMode)tmpv;
              }
            }
            { var tmpv = msg.NeededModifyPower; if (tmpv != null)
              {
                  obj.NeededModifyPower = (i32)tmpv;
              }
            }
            { var tmpv = msg.NeededMemberAddPower; if (tmpv != null)
              {
                  obj.NeededMemberAddPower = (i32)tmpv;
              }
            }
            { var tmpv = msg.NeededMemberRemovePower; if (tmpv != null)
              {
                  obj.NeededMemberRemovePower = (i32)tmpv;
              }
            }
            SetServerGroup(obj, msg.ServerGroupId);

            PostServerGroupList(msg);
        }
    public ServerGroupList GetGroupsForServer(int uid)
    {
        ServerGroupList list = new ServerGroupList();

        for (int i = 0; i < Count; i++)
        {
            if (this[i].ContainsServer(uid))
            {
                list.Add(this[i]);
            }
        }
        return(list);
    }
        public void UpdateServerGroupList(ServerGroupList msg)
        {
            var obj = new ServerGroup();

            obj.Name                    = msg.Name;
            obj.GroupType               = msg.GroupType;
            obj.IconId                  = msg.IconId;
            obj.IsPermanent             = msg.IsPermanent;
            obj.SortId                  = msg.SortId;
            obj.NamingMode              = msg.NamingMode;
            obj.NeededModifyPower       = msg.NeededModifyPower;
            obj.NeededMemberAddPower    = msg.NeededMemberAddPower;
            obj.NeededMemberRemovePower = msg.NeededMemberRemovePower;
            SetServerGroup(obj, msg.ServerGroupId);
        }
    public void Start(LogItemQueue log)
    {
        m_Logger = log;
        ServerGroupList list = Configuration.inst().ServerGroups.GetGroupsForServer(UID);

        for (int i = 0; i < list.Count; i++)
        {
            m_strGroups += ((i > 0) ? "," : "") + "\"" + list[i].Name + "\"";
        }

        if (list.Count > 0)
        {
            m_Timer = new Timer(new TimerCallback(Tick), null, 1000, 60000);

            for (int t = 0; t < ThreadCount; t++)
            {
                Connection con = null;
                if (Type == "HTTP/JSON")
                {
                    con = new HttpJson(log, this);
                }
                if (Type == "Wialon")
                {
                    con = new WialonIPSConnection(log, this);
                }
                if (Type == "Dingtek")
                {
                    con = new DingtekConnection(log, this);
                }
                if (Type == "DIMTS")
                {
                    con = new DIMTSConnection(log, this);
                }
                if (Type == "GpsGate")
                {
                    con = new GpsGateConnection(log, this);
                }
                if (Type == "Nagpur")
                {
                    con = new NagpurConnection(log, this);
                }
                if (con != null)
                {
                    connections.Add(con);
                }
            }
        }
    }
Exemple #7
0
 partial void ProcessEachServerGroupList(ServerGroupList notifies);
Exemple #8
0
 partial void PostServerGroupList(ServerGroupList msg);