Example #1
0
        static public Dictionary <int, int> StringToEquipement(string Str)
        {
            // 1,134|2,18
            Dictionary <int, int> Chans = new Dictionary <int, int>();

            if (Str.Length <= 0)
            {
                return(Chans);
            }

            foreach (string Kp in Str.Split('|'))
            {
                if (Kp.Length <= 0)
                {
                    continue;
                }

                int ChannelId = int.Parse(Kp.Split(',')[0]);
                int ItemId    = int.Parse(Kp.Split(',')[1]);

                if (!Chans.ContainsKey(ChannelId))
                {
                    Chans.Add(ChannelId, ItemId);
                }
            }
            return(Chans);
        }
Example #2
0
        static public Dictionary <int, Color> StringToChannels(string Str)
        {
            // 1,18:20:25:45|2,457:154:651:0
            Dictionary <int, Color> Chans = new Dictionary <int, Color>();

            if (Str.Length <= 0)
            {
                return(Chans);
            }

            foreach (string Kp in Str.Split('|'))
            {
                if (Kp.Length <= 0)
                {
                    continue;
                }

                int   ChannelId = int.Parse(Kp.Split(',')[0]);
                Color Col       = StringToColor(Kp.Split(',')[1]);

                if (!Chans.ContainsKey(ChannelId))
                {
                    Chans.Add(ChannelId, Col);
                }
            }
            return(Chans);
        }