public void LoadSettings(ProjectConfig[] configs)
        {
            originalConfig = Configuration.Debug.LoadFrom(configs);
            config = originalConfig.Clone();

            radioButton1.CheckedChanged += (src, arg) => {
                if (radioButton1.Checked)
                    config.StartAction = Configuration.StartAction.Project;
                else
                    config.StartAction = Configuration.StartAction.Program;
                externalProg.Enabled = !radioButton1.Checked;
                browseProg.Enabled = !radioButton1.Checked;
            };
            radioButton1.Checked = config.StartAction == Configuration.StartAction.Project;
            radioButton2.Checked = !radioButton1.Checked;

            externalProg.Text = config.ExternalProgram;
            externalProg.TextChanged += (src, arg) => config.ExternalProgram = externalProg.Text;

            commandLineArgs.Text = config.CommandLineArgs;
            commandLineArgs.TextChanged += (src, arg) => config.CommandLineArgs = commandLineArgs.Text;

            workDir.Text = config.WorkingDir;
            workDir.TextChanged += (src, arg) => config.WorkingDir = workDir.Text;

            debuggerScript.Text = config.DebuggerScript;
            debuggerScript.TextChanged += (src, erg) => config.DebuggerScript = debuggerScript.Text;

            config.Changed += (src, arg) => isDirty(config.HasChangedFrom(originalConfig));
        }
Exemple #2
0
        /// <summary>
        /// Constructor for IVSOutputGroup2 implementation
        /// </summary>
        /// <param name="outputName">Name of the output group. See VS_OUTPUTGROUP_CNAME_Build in vsshell.idl for the list of standard values</param>
        /// <param name="msBuildTargetName">MSBuild target name</param>
        /// <param name="projectManager">Project that produce this output</param>
        /// <param name="configuration">Configuration that produce this output</param>
        public OutputGroup(string outputName, string msBuildTargetName, ProjectNode projectManager, ProjectConfig configuration) {
            Utilities.ArgumentNotNull("outputName", outputName);
            Utilities.ArgumentNotNull("msBuildTargetName", msBuildTargetName);
            Utilities.ArgumentNotNull("projectManager", projectManager);
            Utilities.ArgumentNotNull("configuration", configuration);

            _name = outputName;
            _targetName = msBuildTargetName;
            _project = projectManager;
            _projectCfg = configuration;
        }
Exemple #3
0
 public static Build LoadFrom(ProjectConfig[] configs)
 {
     return configs.Select(LoadFromForConfig).Aggregate((prev, cur) =>
     {
         if(prev.LTO != null && !EqualityComparer<bool?>.Default.Equals(prev.LTO, cur.LTO))
             prev.LTO = null;
         if(prev.EmitDebug != null && !EqualityComparer<bool?>.Default.Equals(prev.EmitDebug, cur.EmitDebug))
             prev.EmitDebug = null;
         if(prev.OptimizationLevel != null && !EqualityComparer<VisualRust.Shared.OptimizationLevel?>.Default.Equals(prev.OptimizationLevel, cur.OptimizationLevel))
             prev.OptimizationLevel = null;
         if(prev.PlatformTarget != null && !EqualityComparer<System.String>.Default.Equals(prev.PlatformTarget, cur.PlatformTarget))
             prev.PlatformTarget = null;
         return prev;
     });
 }
 public void LoadSettings(ProjectConfig[] configs)
 {
     originalConfig = Configuration.Build.LoadFrom(configs);
     config = originalConfig.Clone();
     customTargetBox.Text = config.PlatformTarget;
     customTargetBox.TextChanged += (src,arg) => config.PlatformTarget = customTargetBox.Text;
     if(config.OptimizationLevel.HasValue)
         optimizationBox.SelectedIndex = (int)config.OptimizationLevel.Value;
     else
         optimizationBox.SelectedItem = null;
     optimizationBox.SelectedIndexChanged += (src,arg) => config.OptimizationLevel = (OptimizationLevel)optimizationBox.SelectedIndex;
     lto.CheckState = ToCheckState(config.LTO);
     lto.CheckedChanged += (src,arg) => config.LTO = lto.Checked;
     emitDebug.CheckState = ToCheckState(config.EmitDebug);
     emitDebug.CheckedChanged += (src,arg) => config.EmitDebug = emitDebug.Checked;
     config.Changed += (src, arg) => isDirty(config.HasChangedFrom(originalConfig));
 }
Exemple #5
0
 public BuildableProjectConfig(ProjectConfig config) {
     this.config = config;
 }
 public void ApplyConfig(ProjectConfig[] configs)
 {
     config.SaveTo(configs);
     originalConfig = config.Clone();
 }
Exemple #7
0
 private static Build LoadFromForConfig(ProjectConfig cfg)
 {
     var x = new Build();
     Utils.FromString(cfg.GetConfigurationProperty("LinkTimeOptimization", false), out x.lTO);
     Utils.FromString(cfg.GetConfigurationProperty("DebugSymbols", false), out x.emitDebug);
     x.OptimizationLevel = OptimizationLevelFromString(cfg.GetConfigurationProperty("OptimizationLevel", false));
     x.PlatformTarget = PlatformTargetFromString(cfg.GetConfigurationProperty("PlatformTarget", false));
     return x;
 }
Exemple #8
0
 public void SaveTo(ProjectConfig[] configs)
 {
     foreach(ProjectConfig cfg in configs)
     {
         if(LTO != null)
             cfg.SetConfigurationProperty("LinkTimeOptimization", LTO.ToString());
         if(EmitDebug != null)
             cfg.SetConfigurationProperty("DebugSymbols", EmitDebug.ToString());
         if(OptimizationLevel != null)
             cfg.SetConfigurationProperty("OptimizationLevel", OptimizationLevelToString(OptimizationLevel));
         if(PlatformTarget != null)
             cfg.SetConfigurationProperty("PlatformTarget", PlatformTargetToString(PlatformTarget));
     }
 }
Exemple #9
0
 public static Debug LoadFrom(ProjectConfig[] configs)
 {
     return configs.Select(LoadFromForConfig).Aggregate((prev, cur) =>
     {
         if(prev.StartActionQ != null && !EqualityComparer<StartAction?>.Default.Equals(prev.StartActionQ, cur.StartActionQ))
             prev.StartActionQ = null;
         if(prev.ExternalProgram != null && !EqualityComparer<System.String>.Default.Equals(prev.ExternalProgram, cur.ExternalProgram))
             prev.ExternalProgram = null;
         if(prev.CommandLineArgs != null && !EqualityComparer<System.String>.Default.Equals(prev.CommandLineArgs, cur.CommandLineArgs))
             prev.CommandLineArgs = null;
         if(prev.WorkingDir != null && !EqualityComparer<System.String>.Default.Equals(prev.WorkingDir, cur.WorkingDir))
             prev.WorkingDir = null;
         if(prev.DebuggerScript != null && !EqualityComparer<System.String>.Default.Equals(prev.DebuggerScript, cur.DebuggerScript))
             prev.DebuggerScript = null;
         return prev;
     });
 }
Exemple #10
0
 private static Debug LoadFromForConfig(ProjectConfig cfg)
 {
     var x = new Debug();
     x.StartActionQ = StartActionQFromString(cfg.GetConfigurationProperty("StartAction", false));
     Utils.FromString(cfg.GetConfigurationProperty("StartProgram", false), out x.externalProgram);
     Utils.FromString(cfg.GetConfigurationProperty("StartArguments", false), out x.commandLineArgs);
     Utils.FromString(cfg.GetConfigurationProperty("StartWorkingDirectory", false), out x.workingDir);
     Utils.FromString(cfg.GetConfigurationProperty("StartDebuggerScript", false), out x.debuggerScript);
     return x;
 }
Exemple #11
0
 public void SaveTo(ProjectConfig[] configs)
 {
     foreach(ProjectConfig cfg in configs)
     {
         if(StartActionQ != null)
             cfg.SetConfigurationProperty("StartAction", StartActionQToString(StartActionQ));
         if(ExternalProgram != null)
             cfg.SetConfigurationProperty("StartProgram", ExternalProgram.ToString());
         if(CommandLineArgs != null)
             cfg.SetConfigurationProperty("StartArguments", CommandLineArgs.ToString());
         if(WorkingDir != null)
             cfg.SetConfigurationProperty("StartWorkingDirectory", WorkingDir.ToString());
         if(DebuggerScript != null)
             cfg.SetConfigurationProperty("StartDebuggerScript", DebuggerScript.ToString());
     }
 }
Exemple #12
0
 public BuildableProjectConfig(ProjectConfig config)
 {
     this.config = config;
 }
Exemple #13
0
        /// <summary>
        /// Constructor for IVSOutputGroup2 implementation
        /// </summary>
        /// <param name="outputName">Name of the output group. See VS_OUTPUTGROUP_CNAME_Build in vsshell.idl for the list of standard values</param>
        /// <param name="msBuildTargetName">MSBuild target name</param>
        /// <param name="projectManager">Project that produce this output</param>
        /// <param name="configuration">Configuration that produce this output</param>
        public OutputGroup(string outputName, string msBuildTargetName, ProjectNode projectManager, ProjectConfig configuration)
        {
            Utilities.ArgumentNotNull("outputName", outputName);
            Utilities.ArgumentNotNull("msBuildTargetName", msBuildTargetName);
            Utilities.ArgumentNotNull("projectManager", projectManager);
            Utilities.ArgumentNotNull("configuration", configuration);

            _name       = outputName;
            _targetName = msBuildTargetName;
            _project    = projectManager;
            _projectCfg = configuration;
        }
Exemple #14
0
        /// <summary>
        /// Constructor for IVSOutputGroup2 implementation
        /// </summary>
        /// <param name="outputName">Name of the output group. See VS_OUTPUTGROUP_CNAME_Build in vsshell.idl for the list of standard values</param>
        /// <param name="msBuildTargetName">MSBuild target name</param>
        /// <param name="projectManager">Project that produce this output</param>
        /// <param name="configuration">Configuration that produce this output</param>
        public OutputGroup(string outputName, string msBuildTargetName, ProjectNode projectManager, ProjectConfig configuration)
        {
            Utilities.ArgumentNotNull(nameof(outputName), outputName);
            Utilities.ArgumentNotNull(nameof(msBuildTargetName), msBuildTargetName);
            Utilities.ArgumentNotNull(nameof(projectManager), projectManager);
            Utilities.ArgumentNotNull(nameof(configuration), configuration);

            this._name       = outputName;
            this._targetName = msBuildTargetName;
            this._project    = projectManager;
            this._projectCfg = configuration;
        }