[英]What is this use of C# 'using' statement?
What is this use of c# using statement? c#using语句有什么用?
namespace Microsoft.Owin.Host.SystemWeb.DataProtection {
using DataProtectionProviderDelegate = Func<string[], Tuple<Func<byte[], byte[]>, Func<byte[], byte[]>>>;
using DataProtectionTuple = Tuple<Func<byte[], byte[]>, Func<byte[], byte[]>>;
According to MSDN using statement has two usages. 根据MSDN使用声明有两个用法。
But in this case, it's used to assign a delegate type. 但在这种情况下,它用于分配委托类型。 Can anyone please explain this usage, and provide a link a documentation?
任何人都可以解释这种用法,并提供链接文档?
In this case the using statement is being used to alias a type, so yes point (1) you stated. 在这种情况下,using语句被用于别名类型,所以是你指出的点(1)。
Later on in code rather than having to type: 稍后在代码中而不是必须键入:
var x = new Tuple<Func<byte[], byte[]>, Func<byte[], byte[]>>(/* ... */);
You can write: 你可以写:
var x = new DataProtectionTuple(/* ... */);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.