Operation is not supported on this platform
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
namespace MahApps.Metro.netcoreapp30
{
public delegate void DoHandler();
public class Timeout
{
private ManualResetEvent mTimeoutObject;
//标记变量
private bool mBoTimeout;
public DoHandler Do;
public Timeout()
{
// 初始状态为 停止
this.mTimeoutObject = new ManualResetEvent(true);
}
///<summary>
/// 指定超时时间 异步执行某个方法
///</summary>
///<returns>执行 是否超时</returns>
public bool DoWithTimeout(TimeSpan timeSpan)
{
if (this.Do == null)
{
return false;
}
this.mTimeoutObject.Reset();
this.mBoTimeout = true; //标记
this.Do.BeginInvoke(DoAsyncCallBack, null);
// 等待 信号Set
if (!this.mTimeoutObject.WaitOne(timeSpan, false))
{
this.mBoTimeout = true;
}
return this.mBoTimeout;
}
///<summary>
/// 异步委托 回调函数
///</summary>
///<param name="result"></param>
private void DoAsyncCallBack(IAsyncResult result)
{
try
{
this.Do.EndInvoke(result);
// 指示方法的执行未超时
this.mBoTimeout = false;
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
this.mBoTimeout = true;
}
finally
{
this.mTimeoutObject.Set();
}
}
}
}
this.Do.BeginInvoke(DoAsyncCallBack, null);
这行。net core 3.0报错,Operation is not supported on this platform 。之前wpf能正常用的。迁移不了了。。。
net core 不能委托吗?
相关推荐
Instruction Set Reference_intel 64
This comprehensive manual is part of a larger series of documents that provide detailed information on
CImg Reference
** - CImg is platform-independent and works on Windows, Linux, macOS, and other Unix-like systems.- *
Python使用pip安装报错:is not a supported wheel on this platform的解决方法
当在Python环境中使用pip安装包时,有时可能会遇到"is not a supported wheel on this platform"的错误。这个问题通常出现在试图安装的轮子(wheel)文件
Python pip安装报错is not a supported wheel on this platform的解决
在使用Python的pip工具进行库或模块安装的过程中,用户有时会遇到错误提示:"is not a supported wheel on this platform"。
ERROR:ABIs [armeabi] are not supported for platform.Supported ABIs are [arm64-v8a, armeabi-v7的完美解决方案-附件资源
ERROR:ABIs [armeabi] are not supported for platform.Supported ABIs are [arm64-v8a, armeabi-v7的完美解决方案


.NET技术前瞻
