keyword - What is this use of C# 'using' statement? -


what use of c# using statement?

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[]>>; 

taken here

according msdn using statement has 2 usages.

  1. (directive) import types current files, either directly or giving alias
  2. (statement) ensure idisposable objects disposed.

but in case, it's used assign delegate type. can please explain usage, , provide link documentation?

in case using statement being used alias type, yes point (1) stated.

later on in code rather having type:

var x = new  tuple<func<byte[], byte[]>, func<byte[], byte[]>>(/* ... */); 

you can write:

var x = new dataprotectiontuple(/* ... */); 

Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -