Exemple #1
0
    /// <summary>
    /// 所有数据接收完成的回调,将临时文件保存为制定的文件名
    /// </summary>
    protected override void CompleteContent()
    {
        Debug.Log("下载完成!");
        string CompleteFilePath = SavePath + "/" + FileName; //完整路径
        string TempFilePath     = fs.Name;                   //临时文件路径

        OnDispose();

        if (File.Exists(TempFilePath))
        {
            if (File.Exists(CompleteFilePath))
            {
                File.Delete(CompleteFilePath);
            }
            File.Move(TempFilePath, CompleteFilePath);
            //Debug.Log("重命名文件!");
        }
        else
        {
            Debug.Log("生成文件失败=>下载的文件不存在!");
        }
        if (EventComplete != null)
        {
            EventComplete.Invoke(CompleteFilePath);
        }
    }
Exemple #2
0
        internal static async Task <Task> SendReply(PostEventContext post, string json)
        {
            var result = Task.CompletedTask;

            if (post.IsWebSocketRequest)
            {
                if (post.SocketRemainsOpen())
                {
                    var completion = await post.GetSocketCompletion();

                    return(completion.Task);
                }

                await SendSocketReply(post, json);
            }
            else
            {
                await SendAjaxReply(post.Http, json);
            }
            EventComplete?.Invoke(post.Http, _EventArgs);
            return(result);
        }
Exemple #3
0
 private void GameEventCompleteInternal(object sender, GameEventCompleteEventArgs e)
 {
     EventComplete?.Invoke(this, e);
 }
Exemple #4
0
 private void FireEventComplete() => EventComplete?.Invoke();