Exemple #1
0
        public static void HandleGetStartupItemsResponse(Client client, GetStartupItemsResponse packet)
        {
            if (client.Value == null || client.Value.FrmStm == null || packet.StartupItems == null)
                return;

            foreach (var item in packet.StartupItems)
            {
                if (client.Value == null || client.Value.FrmStm == null) return;

                int type;
                if (!int.TryParse(item.Substring(0, 1), out type)) continue;

                string preparedItem = item.Remove(0, 1);
                var temp = preparedItem.Split(new string[] { "||" }, StringSplitOptions.None);
                var l = new ListViewItem(temp)
                {
                    Group = client.Value.FrmStm.GetGroup(type),
                    Tag = type
                };

                if (l.Group == null)
                    return;

                client.Value.FrmStm.AddAutostartItemToListview(l);
            }
        }
Exemple #2
0
        public static void HandleGetStartupItemsResponse(Client client, GetStartupItemsResponse packet)
        {
            if (client.Value.FrmStm == null)
                return;

            try
            {
                foreach (var pair in packet.StartupItems)
                {
                    client.Value.FrmStm.Invoke((MethodInvoker) delegate
                    {
                        var temp = pair.Key.Split(new string[] {"||"}, StringSplitOptions.None);
                        var l = new ListViewItem(temp)
                        {
                            Group = client.Value.FrmStm.lstStartupItems.Groups[pair.Value],
                            Tag = pair.Value
                        };
                        client.Value.FrmStm.lstStartupItems.Items.Add(l);
                    });
                }
            }
            catch
            {
            }
        }