Beispiel #1
0
        /// <summary>
        /// Begins reading the version file list from the master server(s).
        /// </summary>
        /// <param name="callback">The <see cref="MasterServerReaderReadCallback"/> to invoke with the results when complete.</param>
        /// <param name="version">The version to get the <see cref="VersionFileList"/> for.</param>
        /// <param name="userState">An optional state object passed by the caller to supply information to the callback method
        /// from the method call.</param>
        public void BeginReadVersionFileList(MasterServerReaderReadCallback callback, int version, object userState)
        {
            // Create the worker
            var t = new Thread(ReadThreadWorker)
            {
                IsBackground = true
            };

            try
            {
                t.Name = "MasterServerReader BeginReadVersionFileList thread.";
            }
            catch (InvalidOperationException)
            {
            }

            // Start it
            var args = new ThreadWorkerArgs(callback, userState, version);

            t.Start(args);
        }
Beispiel #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ThreadWorkerArgs"/> class.
 /// </summary>
 /// <param name="callback">The <see cref="MasterServerReaderReadCallback"/> to invoke with the results when complete.</param>
 /// <param name="userState">An optional state object passed by the caller to supply information to the callback method
 /// from the method call.</param>
 /// <param name="version">When using <see cref="IMasterServerReader.BeginReadVersionFileList"/>, contains the verison
 /// to read. When null, assume using <see cref="IMasterServerReader.BeginReadVersion"/>.</param>
 public ThreadWorkerArgs(MasterServerReaderReadCallback callback, object userState, int? version)
 {
     _callback = callback;
     _userState = userState;
     _version = version;
 }
Beispiel #3
0
        /// <summary>
        /// Begins reading the version file list from the master server(s).
        /// </summary>
        /// <param name="callback">The <see cref="MasterServerReaderReadCallback"/> to invoke with the results when complete.</param>
        /// <param name="version">The version to get the <see cref="VersionFileList"/> for.</param>
        /// <param name="userState">An optional state object passed by the caller to supply information to the callback method
        /// from the method call.</param>
        public void BeginReadVersionFileList(MasterServerReaderReadCallback callback, int version, object userState)
        {
            // Create the worker
            var t = new Thread(ReadThreadWorker) { IsBackground = true };

            try
            {
                t.Name = "MasterServerReader BeginReadVersionFileList thread.";
            }
            catch (InvalidOperationException)
            {
            }

            // Start it
            var args = new ThreadWorkerArgs(callback, userState, version);
            t.Start(args);
        }
Beispiel #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ThreadWorkerArgs"/> class.
 /// </summary>
 /// <param name="callback">The <see cref="MasterServerReaderReadCallback"/> to invoke with the results when complete.</param>
 /// <param name="userState">An optional state object passed by the caller to supply information to the callback method
 /// from the method call.</param>
 /// <param name="version">When using <see cref="IMasterServerReader.BeginReadVersionFileList"/>, contains the verison
 /// to read. When null, assume using <see cref="IMasterServerReader.BeginReadVersion"/>.</param>
 public ThreadWorkerArgs(MasterServerReaderReadCallback callback, object userState, int?version)
 {
     _callback  = callback;
     _userState = userState;
     _version   = version;
 }