private static async void ManagePetition(NetworkStream networkStream, ApiFlag flag, object result) { await Task.Delay(100); lock (networkStream) { formatter.Serialize(networkStream, new ServerObject(ServerFlag.ApiConnection, new ApiObject(flag, result))); } }
/// <summary> /// Creates the object to communicate with the API /// </summary> /// <param name="apiFlag">API action</param> /// <param name="data">Needed data to the action</param> public ApiObject(ApiFlag apiFlag, object data) : this() { this.apiFlag = apiFlag; this.data = data; }