private void SetClassicModeParameter(CmdLineInfo cmdLineInfo)
        {
            cmdLineInfo.ClassicApplicationPoolPipeline = Properties.Settings.Default.ClassicApplicationPoolPipeline;
            cmdLineInfo.NoEveryone            = Properties.Settings.Default.NoEveryone;
            cmdLineInfo.NoShares              = Properties.Settings.Default.NoShares;
            cmdLineInfo.NoShortcuts           = Properties.Settings.Default.NoShortcuts;
            cmdLineInfo.SkipClickOnceDeployer = Properties.Settings.Default.SkipClickOnceDeployer;
            cmdLineInfo.NoEnvVar              = Properties.Settings.Default.NoEnvVar;

            //    var feature = cmdLineInfo
            //        .Features
            //        .Where(f => String.Compare(f.Description, description, StringComparison.InvariantCultureIgnoreCase) == 0)
            //        .FirstOrDefault();


            var clonedCollection = new List <Feature>(cmdLineInfo.Features);

            foreach (Feature feature in clonedCollection)
            {
                if (!Properties.Settings.Default.KeepFeatures.Contains(feature.Description))
                {
                    if (FixedFeatures.Contains(feature.Description))
                    {
                        continue;
                    }

                    cmdLineInfo.Features.Remove(feature);
                }
            }
        }
        public static CmdLineInfo GetCmdLineInfo(char keyPrefix = '/')
        {
            CmdLineInfo cmdLineInfo = new CmdLineInfo();

            //コマンドラインを配列で取得する
            string[] args = System.Environment.GetCommandLineArgs();
            cmdLineInfo.Args = args;

            // アプリケーションパス
            cmdLineInfo.AppPath = args[0];
            // 引数解析
            if (args.Length > 1)
            {
                Hashtable paramHash = cmdLineInfo.ParamHash;
                List<string> paramValueList = new List<string>();
                string paramKey = "";
                string paramValue = "";
                for (int i = 1; i < args.Length; i++)
                {
                    string arg = args[i];
                    if (arg == null || arg.Length == 0)
                    {
                        continue;
                    }
                    if (arg[0] == keyPrefix)
                    {
                        // キー
                        paramKey = arg;
                        paramHash[paramKey] = null;
                    }
                    else
                    {
                        // 値
                        paramValue = arg;
                        if (paramKey != "")
                        {
                            // キー付きパラメータ値
                            paramHash[paramKey] = paramValue;
                            paramKey = "";
                        }
                        else
                        {
                            // キーなしパラメータ値
                            paramValueList.Add(paramValue);
                        }
                    }
                }
                if (paramValueList.Count > 0)
                {
                    cmdLineInfo.ParamValues = paramValueList.ToArray();
                }
            }
            return cmdLineInfo;
        }
Example #3
0
        public static CmdLineInfo GetCmdLineInfo(char keyPrefix = '/')
        {
            CmdLineInfo cmdLineInfo = new CmdLineInfo();

            //コマンドラインを配列で取得する
            string[] args = System.Environment.GetCommandLineArgs();
            cmdLineInfo.Args = args;

            // アプリケーションパス
            cmdLineInfo.AppPath = args[0];
            // 引数解析
            if (args.Length > 1)
            {
                Hashtable     paramHash      = cmdLineInfo.ParamHash;
                List <string> paramValueList = new List <string>();
                string        paramKey       = "";
                string        paramValue     = "";
                for (int i = 1; i < args.Length; i++)
                {
                    string arg = args[i];
                    if (arg == null || arg.Length == 0)
                    {
                        continue;
                    }
                    if (arg[0] == keyPrefix)
                    {
                        // キー
                        paramKey            = arg;
                        paramHash[paramKey] = null;
                    }
                    else
                    {
                        // 値
                        paramValue = arg;
                        if (paramKey != "")
                        {
                            // キー付きパラメータ値
                            paramHash[paramKey] = paramValue;
                            paramKey            = "";
                        }
                        else
                        {
                            // キーなしパラメータ値
                            paramValueList.Add(paramValue);
                        }
                    }
                }
                if (paramValueList.Count > 0)
                {
                    cmdLineInfo.ParamValues = paramValueList.ToArray();
                }
            }
            return(cmdLineInfo);
        }
 public override void OnUpdating(CmdLineInfo cmdLineInfo)
 {
     SetClassicModeParameter(cmdLineInfo);
 }