zoukankan      html  css  js  c++  java
  • VISUAL STUDIO 使用技巧大全 中英文版本之 一

    http://msdn.microsoft.com/en-us/library/bb514115.aspx 

    Removing Unused Usings

    The Remove Unused Usings option in the Visual Studio user interface removes using directives, using aliases, and extern aliases that are not used in the source code. There are two ways to call the operation:

    • Main Menu - On the Edit menu, point to IntelliSense, point to Organize Usings, and then click Remove Unused Usings.

    • Context Menu - Right-click anywhere inside the code editor, point to Organize Usings, and then click Remove Unused Usings.

      Note Note

      If you perform Remove Unused Usings on source code that does not build, some required using directives may be removed.

    The following example shows the outcome of performing Remove Unused Usings on source code.

     

    Before

    After

     
     
    using System;
    using System.Linq;
    using System.Collections.Generic;
    using System.Text;
    using System;
    
    namespace ConsoleApplication1
    {
        class Program
        {
            static void Main(string[] args)
            {
                Console.WriteLine("test");
            }
        }
    }
    
     
     
    using System;
    
    namespace ConsoleApplication1
    {
        class Program
        {
            static void Main(string[] args)
            {
                Console.WriteLine("test");
            }
        }
    }
    

    In the previous example, only System is used later in the source code. The other using directives, including the duplicate System using directive, are removed.

  • 相关阅读:
    msql 计算连续签到天数
    jetty启动常用命令
    nginx负载均衡, 配置地址带端口
    IDEA java 代码格式化统一
    Linux下安装Zookeeper
    nexus admin 从文件角度进行密码重置
    Monkey测试
    接口测试
    我的IT之路
    cookie 操作(转载)
  • 原文地址:https://www.cnblogs.com/taoqianbao/p/3886711.html
Copyright © 2011-2022 走看看