-2

This is the code. I've tried rewriting it in a new program but it's the same problem as soon as I create a class the "using system" and the others appear in light blue as well as attributes.

class Book[][1]

class program

Grant Winney
  • 65,241
  • 13
  • 115
  • 165

2 Answers2

1

It means you can remove them from the file. Visual Studio includes some using directives automatically when you create a class, because they're so frequently used.

For instance,

  • the System library includes types like String, Int32, DateTime, tons of exceptions like IndexOutOfRangeException, FormatException, etc.
  • the System.Collections.Generic library includes List<T>, Dictionary<TKey, TValue>, etc, and nearly every program will use a collection of some sort.
  • the System.Linq library is self-explanatory; again, nearly every program will use LINQ.

But if you don't use anything in them, Visual Studio greys them out so you know they're unused.

If you don't need them, you can delete them.

Grant Winney
  • 65,241
  • 13
  • 115
  • 165
0

Using in light blue are not used in the file.

Example of use of class Task in System.Threading.Tasks:

using System.Threading.Tasks;

class Example
{
   ...
   private void ExampleFunc()
   {
       // Whitout using
       System.Threading.Tasks.Task.Delay(5000).Wait();

       // OR

       // With using
       Task.Delay(5000).Wait();
   }
   ...
}

You have to read the documentation to learn how to use class inside packages. And the most important for begining, what package is made for.

Shim-Sao
  • 2,026
  • 2
  • 18
  • 23