예제 #1
0
        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;
            }
        }
예제 #2
0
        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();
        }
예제 #3
0
        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);
        }