public static void SetCommandArgs(string value) { EnvDTE.Properties props = IDEUtils.GetDtePropertiesFromHierarchy(); if (props == null) { return; } switch (lang) { case ProjLang.CPP: IDEUtils.SetProperty(props, "CommandArguments", value); break; case ProjLang.CS: IDEUtils.SetProperty(props, "StartArguments", value); break; } }
private void Init() { lang = IDEUtils.LANG; CmdArgs.FontFamily = new FontFamily(Properties.Settings.Default.Font.FontFamily.Name); CmdArgs.FontSize = Properties.Settings.Default.Font.SizeInPoints; EnvDTE.Properties props = IDEUtils.GetDtePropertiesFromHierarchy(); if (props == null) { runChangedHandler = false; CmdArgs.Text = DockableCLArgs.Resources.StartupMessage; runChangedHandler = true; } else { if (lang != IDEUtils.ProjLang.UNKNOWN) { runChangedHandler = false; CmdArgs.Text = IDEUtils.GetCommandArgs(); runChangedHandler = true; CmdArgs.IsEnabled = true; History.Init(); savedArgs.Path = Path.Combine(IDEUtils.GetStartupProjectDirectory(), "DockableCLArgsSavedArgs.user"); savedArgs.Load(); } else { runChangedHandler = false; CmdArgs.Text = DockableCLArgs.Resources.UnsupportedProjectType; runChangedHandler = true; } } SetTextBoxProperties(); }
public static string GetCommandArgs() { EnvDTE.Properties props = IDEUtils.GetDtePropertiesFromHierarchy(); if (props == null) { return(DockableCLArgs.Resources.StartupMessage); } string commandArgs = string.Empty; switch (lang) { case ProjLang.CPP: commandArgs = IDEUtils.GetProperty(props, "CommandArguments") as string ?? string.Empty; break; case ProjLang.CS: commandArgs = IDEUtils.GetProperty(props, "StartArguments") as string ?? string.Empty; break; } return(commandArgs); }