[MyGroupCollection("System.Windows.Forms.Form", "Create__Instance__", "Dispose__Instance__", "My.MyProject.Forms"), EditorBrowsable(EditorBrowsableState.Never)]
internal sealed class MyForms
{
public WindowsApplication1.Form1 m_Form1;
[ThreadStatic]
private static Hashtable m_FormBeingCreated;
[DebuggerHidden]
private static T Create__Instance__<T>(T Instance) where T: Form, new()
{
T local;
if ((Instance != null) && !Instance.IsDisposed)
{
return Instance;
}
if (m_FormBeingCreated != null)
{
if (m_FormBeingCreated.ContainsKey(typeof(T)))
{
throw new InvalidOperationException(Utils.GetResourceString("WinForms_RecursiveFormCreate", new string[0]));
}
}
else
{
m_FormBeingCreated = new Hashtable();
}
m_FormBeingCreated.Add(typeof(T), null);
try
{
local = Activator.CreateInstance<T>();
}
catch when (?)
{
TargetInvocationException exception;
throw new InvalidOperationException(Utils.GetResourceString("WinForms_SeeInnerException", new string[] { exception.InnerException.Message }), exception.InnerException);
}
finally
{
m_FormBeingCreated.Remove(typeof(T));
}
return local;
}
[DebuggerHidden]
private void Dispose__Instance__<T>(ref T instance) where T: Form
{
instance.Dispose();
instance = default(T);
}
只能帖一点局部代码,就是 2个t: form 这里有问题~调试通不过~
以前从来没有用过c#,有没有解决办法~~??
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:https://bianchenghao.cn/bian-cheng-ri-ji/56459.html