Query.Store C# (CSharp) Method

Store() public method

public Store ( int count ) : string[]
count int
return string[]
    public string[] Store(int count)
    {
        string[] rString = new string[count];

            for (int i = 0; i < count && i < _count; i++)
                rString[i] = results[i];

            _count = 0;

            return rString;
    }

Usage Example

Beispiel #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="eventServerInfoChanged">Invocato se il download dei dati ha causato una modifica ai dati</param>
        /// <returns></returns>
        public Task ReadData(EventHandler <EventArgs> eventServerInfoChanged = null)
        {
            return(Task.Factory.StartNew(() =>
            {
                var query = new Query(Server.Ip, Server.Port);
                query.Send('i');

                var count = query.Receive();
                var info = query.Store(count);

                if (info.Length == 0)
                {
                    /* qualcosa รจ andato storto? */
                    return;
                }

                Locked = int.Parse(info[0]) == 1;
                Players = new List <Player>(int.Parse(info[2]));
                Server.HostName = info[3];
                Gamemode = info[4];
                MapName = info[5];

                if (updated && eventServerInfoChanged != null)
                {
                    eventServerInfoChanged(Server, null);
                }

                updated = false;
            }));
        }
All Usage Examples Of Query::Store