ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Task Parallel Library

Solved!
Go to solution

I am using C# with NET4.0. I would like to use the object "Task" in system.Threading.Tasks for parallel processing. But "Task" is already defined in DAQmx namespace. I find that I will have to explictly state the namespace (either system.Threading.Tasks or NationalInstruments.DAQmx) to distinguish which "Task" I am referring to every time I use "Task". Is there an easier way to do this.

 

Best Regards

Shane

0 Kudos
Message 1 of 3
(5,994 Views)
Solution
Accepted by topic author EI

In C#, you can declare an alias for a type with a using directive, like:


    using DAQmxTask = NationalInstruments.DAQmx.Task;
    using ParallelTask = System.Threading.Tasks.Task;

~ Paul H
Message 2 of 3
(5,990 Views)

Thanks a million for quick reply.

 

Much appreciated.

Shane

0 Kudos
Message 3 of 3
(5,986 Views)