zoukankan      html  css  js  c++  java
  • Visual Studio .NET项目转换器(ProjectConverter)修改

    Visual Studio .NET 项目转换器非常类似于ASP.NET版本转换器,区别在于它用于转换 Visual Studio 项目文件的版本。尽管在 .NET 框架的 1.0 版和 1.1 版之间只有很小的差异,但一旦将项目文件从 Visual Studio .NET 2002 转换到 Visual Studio .NET 2003,将无法再把它转换回去。虽然这在大多数时候可能不会成为问题(因为在 .NET 框架 1.0 版和 1.1 版之间几乎没有什么破坏性的更改),但在某些时刻你可能需要将项目转换回去。该转换器可以将任何解决方案或项目文件从 Visual Studio 7.1 (Visual Studio .NET 2003) 转换到 Visual Studio 7.0 (Visual Studio .NET 2002),并在必要时进行反向转换。

     原始程序:

    这个程序的不方便之处:

    1、不支持文件拖放,每次点击后面按钮流量项目解决文件还要找半天。

    2、启动不在屏幕最中央。

    3、不置顶。

    针对以上情况修改完善,打开.NET Reflector导出工程源码,修复编译错误,

    添加拖放支持:

            private void fmMain_DragDrop(object sender, DragEventArgs e)
            {
                this.tbSolutionFile.Text = ((System.Array)e.Data.GetData(DataFormats.FileDrop)).GetValue(0).ToString();
                try{
                    if ( this.VerifyVersion(this.GetVersion(this.tbSolutionFile.Text))==false ) {
                        this.tbSolutionFile.Text = "";
                    }
                }catch (Exception exception1) {
                    ProjectData.SetProjectError(exception1);
                    Exception exception = exception1;
                    Interaction.MsgBox("Error reading the solution file
    " + exception.Message, MsgBoxStyle.Critical, "Error");
                    ProjectData.ClearProjectError();
                    this.tbSolutionFile.Text = "";
                }
            }
    
            private void fmMain_DragEnter(object sender, DragEventArgs e)
            {
                if (e.Data.GetDataPresent(DataFormats.FileDrop)) {
                    e.Effect = DragDropEffects.Link;
                }else {
                    e.Effect = DragDropEffects.None;
                }
            }

    置顶和屏幕居中:

            private void fmMain_Load(object sender, EventArgs e)
            {
                AllowDrop = true;
                CenterToScreen();
                if (MyProject.Application.CommandLineArgs.Count == 1)
                {
                    this.tbSolutionFile.Text = MyProject.Application.CommandLineArgs[0];
                    try
                    {
                        this.VerifyVersion(this.GetVersion(this.tbSolutionFile.Text));
                    }
                    catch (Exception exception1)
                    {
                        ProjectData.SetProjectError(exception1);
                        Exception exception = exception1;
                        Interaction.MsgBox("Error reading the solution file
    " + exception.Message, MsgBoxStyle.Critical, "Error");
                        ProjectData.ClearProjectError();
                    }
                }
                TopMost = true;
            }
            [DebuggerNonUserCode]
            public fmMain()
            {
                TopMost = true;
                base.Load += new EventHandler(this.fmMain_Load);
                base.DragEnter += new System.Windows.Forms.DragEventHandler(this.fmMain_DragEnter);
                base.DragDrop += new System.Windows.Forms.DragEventHandler(this.fmMain_DragDrop);
                __ENCList.Add(new WeakReference(this));
                this.InitializeComponent();
            }

    修改完成后将原始程序的图标添加为资源,.NET Reflector导出的工程没有图标的,编译成功通过截图:

    现在支持:

    1、启动后屏幕居中显示。

    2、置顶显示。

    3、支持文件拖放,直接拖拽.sln文件到窗口即可。

    编译后的exe文件放在csdn资源下载站:

    http://download.csdn.net/detail/asmcvc/7136663

    修改后的C#源代码工程文件(可编译)也放在csdn资源下载站:

    http://download.csdn.net/detail/asmcvc/7136693

  • 相关阅读:
    Android获取视频音频的时长的方法
    Android动画效果之Frame Animation(逐帧动画)
    去除自定义Toolbar中左边距
    Android Toolbar样式定制详解
    Android 5.x Theme 与 ToolBar 实战
    Android ToolBar 使用完全解析
    Android开发:最详细的 Toolbar 开发实践总结
    SpannableString 转换局部字体大小,但在EditText测量之前设置内容,测量高度为,字体变小之前的高度
    android在Service中弹出Dialog对话框,即全局性对话框
    Could not find com.android.tools.build:gradle:3.0.0-alpha3
  • 原文地址:https://www.cnblogs.com/daxingxing/p/3641148.html
Copyright © 2011-2022 走看看