当前位置: 首页>>代码示例>>C#>>正文


C# ConfigItem类代码示例

本文整理汇总了C#中ConfigItem的典型用法代码示例。如果您正苦于以下问题:C# ConfigItem类的具体用法?C# ConfigItem怎么用?C# ConfigItem使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ConfigItem类属于命名空间,在下文中一共展示了ConfigItem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CoreSection

        public CoreSection()
        {
            StartPaused = new ConfigItem<bool>(false);
			WatchDirectories = new ConfigItem<string[]>(new string[] {});
            BuildExecutables = new ConfigItem<KeyValuePair<string, string>[]>(new KeyValuePair<string, string>[] {});
            NUnitTestRunner = new ConfigItem<KeyValuePair<string, string>[]>(new KeyValuePair<string, string>[] {});
            MSTestRunner = new ConfigItem<KeyValuePair<string, string>[]>(new KeyValuePair<string, string>[] {});
            XUnitTestRunner = new ConfigItem<KeyValuePair<string, string>[]>(new KeyValuePair<string, string>[] {});
            MSpecTestRunner = new ConfigItem<KeyValuePair<string, string>[]>(new KeyValuePair<string, string>[] {});
            CodeEditor = new ConfigItem<CodeEditor>(new CodeEditor("", ""));
            DebuggingEnabled = new ConfigItem<bool>(false);
			GrowlNotify = new ConfigItem<string>(null);
			NotifyOnRunStarted = new ConfigItem<bool>(true);
			NotifyOnRunCompleted = new ConfigItem<bool>(true);
			WatchIgnoreFile = new ConfigItem<string>("");
			TestAssembliesToIgnore = new ConfigItem<string[]>(new string[] {});
			TestCategoriesToIgnore = new ConfigItem<string[]>(new string[] {});
			FileChangeBatchDelay = new ConfigItem<int>(100);
			CustomOutputPath = new ConfigItem<string>("");
			RerunFailedTestsFirst = new ConfigItem<bool>(false);
            WhenWatchingSolutionBuildSolution = new ConfigItem<bool>(true);
            UseAutoTestTestRunner = new ConfigItem<bool>(true);
            UseLowestCommonDenominatorAsWatchPath = new ConfigItem<bool>(true);
            Keys = new List<KeyValuePair<string, string>>();
        }
开发者ID:jeremywiebe,项目名称:AutoTest.Net,代码行数:25,代码来源:CoreSection.cs

示例2: CoreSection

        public CoreSection()
        {
            StartPaused = new ConfigItem<bool>(false);
			WatchDirectories = new ConfigItem<string[]>(new string[] {});
            BuildExecutables = new ConfigItem<KeyValuePair<string, string>[]>(new KeyValuePair<string, string>[] {});
            NUnitTestRunner = new ConfigItem<KeyValuePair<string, string>[]>(new KeyValuePair<string, string>[] {});
            MSTestRunner = new ConfigItem<KeyValuePair<string, string>[]>(new KeyValuePair<string, string>[] {});
            XUnitTestRunner = new ConfigItem<KeyValuePair<string, string>[]>(new KeyValuePair<string, string>[] {});
            MSpecTestRunner = new ConfigItem<KeyValuePair<string, string>[]>(new KeyValuePair<string, string>[] {});
            CodeEditor = new ConfigItem<CodeEditor>(new CodeEditor("", ""));
            DebuggingEnabled = new ConfigItem<bool>(false);
            MSBuildAdditionalParameters = new ConfigItem<string>("");
            MSBuildParallelBuildCount = new ConfigItem<int>(0);
			GrowlNotify = new ConfigItem<string>(null);
			NotifyOnRunStarted = new ConfigItem<bool>(true);
			NotifyOnRunCompleted = new ConfigItem<bool>(true);
			WatchIgnoreFile = new ConfigItem<string>("");
			TestAssembliesToIgnore = new ConfigItem<string[]>(new string[] {});
			TestCategoriesToIgnore = new ConfigItem<string[]>(new string[] {});
			FileChangeBatchDelay = new ConfigItem<int>(100);
			CustomOutputPath = new ConfigItem<string>("");
			RerunFailedTestsFirst = new ConfigItem<bool>(false);
            WhenWatchingSolutionBuildSolution = new ConfigItem<bool>(true);
            UseAutoTestTestRunner = new ConfigItem<bool>(true);
            UseLowestCommonDenominatorAsWatchPath = new ConfigItem<bool>(true);
            WatchAllFiles = new ConfigItem<bool>(false);
            RunAssembliesInParallel = new ConfigItem<bool>(false);
            TestRunnerCompatibilityMode = new ConfigItem<bool>(false);
            LogRecycleSize = new ConfigItem<long>(1024000);
            ProjectsToIgnore = new ConfigItem<string[]>(new string[] {});
            Keys = new List<KeyValuePair<string, string>>();
            DataGathererServiceUrl = new ConfigItem<string>("");
        }
开发者ID:Vernathic,项目名称:ic-AutoTest.NET4CTDD,代码行数:33,代码来源:CoreSection.cs

示例3: Grid2DConfig

        public Grid2DConfig(ConfigNode config)
        {
            _config = config;

            _all2allEn = new ConfigItem<bool>(_config, "All2AllEnable", true);
            _verticalLinesEn = new ConfigItem<bool>(_config, "VerticalLinesEnable", true);
            _horizontalLinesEn = new ConfigItem<bool>(_config, "HorizontalLinesEnable", true);
            _ringsEn = new ConfigItem<bool>(_config, "RingsEnable", true);
            _littleSquaresEn = new ConfigItem<bool>(_config, "LittleSquaresEnable", true);
        }
开发者ID:sagarbatchu,项目名称:rssilocalizer,代码行数:10,代码来源:GridConfig.cs

示例4: TrainingConfig

        public TrainingConfig(ConfigNode config)
        {
            _config = config;
            _gaussian = new NormalGenerator(0.0, 0.5);
            _basic = new BasicConfig(config);

            _autoTrainingEpochs = new ConfigItem<int>(_config, "AutoTrainingEpochs", 400);
            _autoTrainingAttempts = new ConfigItem<int>(_config, "AutoTrainingAttempts", 1);
            _autoTrainingPercentSuccessful = new ConfigItem<double>(_config, "AutoTrainingPercentSuccessful", 1.0);

            _shuffleSwapProbability = new ConfigItem<double>(_config, "ShuffleSwapProbability", 0.05);
            _shuffleNoiseSigma = new ConfigItem<double>(_config, "ShuffleNoiseSigma", 0.5);
            _shuffleEn = new ConfigItem<bool>(_config, "ShuffleEnable", false);
        }
开发者ID:sagarbatchu,项目名称:rssilocalizer,代码行数:14,代码来源:TrainingConfig.cs

示例5: Configuration

        public Configuration()
        {
            GraphProvider = new ConfigItem<string>();
            MinimizerDebug = new ConfigItem<bool>();
            MinimizerAssemblies = new List<ConfigItem<string>>();
            MinimizerLevel = new ConfigItem<string>();
            ProfilerSetup = new ConfigItem<string>();
            ProfilerNamespaces = new List<ConfigItem<string>>();
            IgnoreWarmup = new ConfigItem<bool>();
            IgnoreThisUpgrade = new ConfigItem<string>();
            RealtimeFeedback = new ConfigItem<bool>();
            AllDisabled = new ConfigItem<bool>();
            AnonFeedback = new ConfigItem<bool>();

            BuildErrorsInFeedbackWindow = new ConfigItem<bool>();
            BuildWarningsInFeedbackWindow = new ConfigItem<bool>();
            FailingTestsInFeedbackWindow = new ConfigItem<bool>();
            IgnoredTestsInFeedbackWindow = new ConfigItem<bool>();

            StartPaused = new ConfigItem<bool>();

            MSBuild = new List<ConfigItem<VersionConfig>>();
            BuildSolution = new ConfigItem<bool>();

            NUnit = new List<ConfigItem<VersionConfig>>();
            MSTest = new List<ConfigItem<VersionConfig>>();
            XUnit = new List<ConfigItem<VersionConfig>>();

            IgnoreFile = new ConfigItem<IgnoreFile> { Item = new IgnoreFile() };

            IgnoredAssemblies = new List<ConfigItem<string>>();
            IgnoredCategories = new List<ConfigItem<string>>();

            ChangeDelay = new ConfigItem<string>();

            BuildOutputPath = new ConfigItem<string>();
            GrowlNotifyPath = new ConfigItem<string>();

            NotifyOnStartup = new ConfigItem<bool>();
            NotifyOnFinish = new ConfigItem<bool>();
            Debug = new ConfigItem<bool>();
            CatMode = new ConfigItem<bool>();
            OverlayNotifications = new ConfigItem<bool>();
            RunAssembliesInParallel = new ConfigItem<bool>();
            RunTestsInCompatibilityMode = new ConfigItem<bool>();
            RiscEnabled = new ConfigItem<bool>();
            MSBuildParallelBuildCount = new ConfigItem<int>();
        }
开发者ID:jeroldhaas,项目名称:ContinuousTests,代码行数:48,代码来源:Configuration.cs

示例6: InitVariables

 private bool InitVariables()
 {
     if (_actionType == "edit")
     {
         _configItem = ConfigServer.GetConfigItem(_id);
         if (_configItem == null)
             return false;
     }
     if (!string.IsNullOrEmpty(_parentId))
     {
         _parentConfigItem = ConfigServer.GetConfigItem(_parentId);
         if (_parentConfigItem == null)
             return false;
     }
     return true;
 }
开发者ID:yhhno,项目名称:Adhesive,代码行数:16,代码来源:EditConfigItem.aspx.cs

示例7: CoreSection

        public CoreSection()
        {
			WatchDirectories = new ConfigItem<string[]>(new string[] {});
            BuildExecutables = new ConfigItem<KeyValuePair<string, string>[]>(new KeyValuePair<string, string>[] {});
            NUnitTestRunner = new ConfigItem<KeyValuePair<string, string>[]>(new KeyValuePair<string, string>[] {});
            MSTestRunner = new ConfigItem<KeyValuePair<string, string>[]>(new KeyValuePair<string, string>[] {});
            XUnitTestRunner = new ConfigItem<KeyValuePair<string, string>[]>(new KeyValuePair<string, string>[] {});
            CodeEditor = new ConfigItem<CodeEditor>(new CodeEditor("", ""));
            DebuggingEnabled = new ConfigItem<bool>(false);
			GrowlNotify = new ConfigItem<string>(null);
			NotifyOnRunStarted = new ConfigItem<bool>(true);
			NotifyOnRunCompleted = new ConfigItem<bool>(true);
			WatchIgnoreFile = new ConfigItem<string>("");
			TestAssembliesToIgnore = new ConfigItem<string[]>(new string[] {});
			TestCategoriesToIgnore = new ConfigItem<string[]>(new string[] {});
			FileChangeBatchDelay = new ConfigItem<int>(100);
        }
开发者ID:jstclair,项目名称:AutoTest.Net,代码行数:17,代码来源:CoreSection.cs

示例8: ReadConfig

        public string ReadConfig(ConfigItem Item,out string a,out bool b)
        {
            try
            {
                HasConfig();//没有配置文件就新建

                AMSystemConfig tmpConfig = new AMSystemConfig();
                AuthDao.ADSecret ads = new AuthDao.ADSecret();
                string FileName = Environment.CurrentDirectory + "\\Config.dat";
                Stream fStr = new FileStream(FileName, FileMode.Open);
                fStr.Position = 0;
                BinaryFormatter bf = new BinaryFormatter();
                tmpConfig = (AMSystemConfig)bf.Deserialize(fStr);
                fStr.Close();
                tmpConfig.ConnectionString = ads.DesDecrypt(tmpConfig.ConnectionString, "JinDi123");
                switch (Item)
                {
                    case ConfigItem.ConnectionString:
                        a = tmpConfig.ConnectionString;
                        b = false;
                        break;
                    case ConfigItem.LoginUserName:
                        a = tmpConfig.LoginUserNames;
                        b = false;
                        break;
                    case ConfigItem.LoginPassword:
                        a = tmpConfig.LoginPassword;
                        b = tmpConfig.LoginSavePass;
                        break;
                    default:
                        a = "";
                        b = false;
                        break;
                }
                return "true";
            }
            catch (Exception x)
            {
                a = "";
                b = false;
                return "ReadConfig:" + x.Message;
            }
        }
开发者ID:alwcelgit,项目名称:AuthSystem,代码行数:43,代码来源:ADConfig.cs

示例9: writeIgnoreFileSetting

 private void writeIgnoreFileSetting(ConfigItem<IgnoreFile> item)
 {
     RemoveNode("IgnoreFile");
     if (item.Exists)
         writeSimpleSetting(item.Item.File, true, item.ShouldExclude, "IgnoreFile");
     try
     {
         if (item.Item.WriteContent)
         {
             if (Directory.Exists(Path.GetDirectoryName(item.Item.File)) && Path.IsPathRooted(item.Item.File))
                 File.WriteAllText(item.Item.File, item.Item.Content);
             else if (Directory.Exists(item.Item.ContentPath))
                 File.WriteAllText(Path.Combine(item.Item.ContentPath, item.Item.File), item.Item.Content);
         }
     }
     catch (Exception ex)
     {
         Logging.Logger.Write(ex);
     }
 }
开发者ID:jeroldhaas,项目名称:ContinuousTests,代码行数:20,代码来源:ConfigWriter.cs

示例10: AddExtTreeNode

    /// <summary>
    /// 返回节点
    /// </summary>
    /// <param name="psType"></param>
    /// <param name="psName"></param>
    /// <param name="psValue"></param>
    /// <returns></returns>
    private void AddExtTreeNode(Node nd, DataTable dt)
    {
        Node nd1 = new Node();
        string typeS = dt.Rows[0]["PSType2"].ToString();
        double PDTotalData = 0;

        for (int i = 0; i < dt.Rows.Count; i++)
        {
            Node ndx = new Node();
            ndx.Leaf = true;
            string PSType2 = dt.Rows[i]["PSType2"].ToString();
            string PSName = dt.Rows[i]["PSName"].ToString();

            double db1 = Convert.ToDouble(dt.Rows[i]["PDBaseData"]);
            double db2 = Convert.ToDouble(dt.Rows[i]["PDProjectData"]);
            double PDData = db1 + db2;
            PDTotalData += PDData;
            ConfigItem cf1 = new ConfigItem("PSType2", PSType2, ParameterMode.Value);
            ConfigItem cf2 = new ConfigItem("PSName", PSName, ParameterMode.Value);
            ConfigItem cf3 = new ConfigItem("PDData", PDData.ToString("f8").TrimEnd('0'), ParameterMode.Value);
            ndx.CustomAttributes.Add(cf1);
            ndx.CustomAttributes.Add(cf2);
            ndx.CustomAttributes.Add(cf3);

            nd1.Children.Add(ndx);
        }

        ConfigItem cft1 = new ConfigItem("PSType2", typeS, ParameterMode.Value);
        ConfigItem cft2 = new ConfigItem("PSName", "", ParameterMode.Value);
        ConfigItem cft3 = new ConfigItem("PDData", PDTotalData.ToString("f8").TrimEnd('0'), ParameterMode.Value);
        nd1.CustomAttributes.Add(cft1);
        nd1.CustomAttributes.Add(cft2);
        nd1.CustomAttributes.Add(cft3);

        nd.Children.Add(nd1);
    }
开发者ID:randianb,项目名称:Budget-jinzhou-server-,代码行数:43,代码来源:BEBudgetSubject.aspx.cs

示例11: mergeValueItem

 private int mergeValueItem(ConfigItem<int> settingToMerge, int defaultValue)
 {
     if (settingToMerge.ShouldExclude)
         return defaultValue;
     return settingToMerge.Value;
 }
开发者ID:forki,项目名称:AutoTest.Net,代码行数:6,代码来源:Config.cs

示例12: QueryItemFromServerAsync

        private static IAsyncResult QueryItemFromServerAsync(string key, ConfigType type, Action<ConfigItem, Exception> callback)
        {
            string url = new UrlBuilder()
                .SetPath("/ActiveConfig/v1/GetKey")
                .AddParam("appid", _appKey)
                .AddParam("secretkey", _appSecret)
                .AddParam("key", key + ":" + (int)type)
                .GetUrl();

            return Http.GetStringAsync(url, (s, e) =>
            {
                ConfigItem result = null;
                if (e == null)
                {
                    result = null;

                    try
                    {
                        var dict = JSON.Parse(s);
                        if (dict != null)
                        {
                            string code = dict["code"].Value;
                            string msg = dict["msg"].Value;
                            string data = dict["data"].Value;

                            if (code != "0")
                            {
                                Debug.WriteLine("Server return error {0}: {1}", code, msg);
                                e = new ActiveConfigException(msg);
                            }
                            else
                            {
                                if (dict["data"].Count == 1)
                                {
                                    var item = dict["data"][0];
                                    result = new ConfigItem();
                                    result.Key = item["key"].Value;
                                    result.Value = item["value"].Value;
                                    result.Type = (ConfigType)Enum.Parse(typeof(ConfigType), item["type"].Value, true);
                                    result.ExpireTime = Helper.ConvertTime(item["endtime"].Value);
                                    result.MD5 = item["md5"].Value;
                                    result.ID = string.Format("{0}:{1}", (int)result.Type, result.Key);
                                    if (result.Status == ItemStatus.KeyNotFound)
                                    {
                                        e = new KeyNotFoundException(key);
                                    }
                                }
                                else
                                {
                                    e = new KeyNotFoundException(key);
                                }
                            }
                        }
                        else
                        {
                            e = new ActiveConfigException("Parsing json failed");
                        }
                    }
                    catch (Exception err)
                    {
                        e = new ActiveConfigException("Parsing json failed", err);
                    }
                }

                callback(result, e);
            });
        }
开发者ID:sdgdsffdsfff,项目名称:duducat_sdk_winphone,代码行数:67,代码来源:ActiveConfig.cs

示例13: RegisterCustomAttribute

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        protected virtual void RegisterCustomAttribute(string key, string value)
        {
            bool isDefaults = key.IndexOf("Default", StringComparison.CurrentCultureIgnoreCase) == 0;
            bool isOverride = key.IndexOf("X", StringComparison.CurrentCultureIgnoreCase) == 0;

            if (isDefaults)
            {
                key = key.Substring(7);
            }
            else if (isOverride)
            {
                key = key.Substring(1);
            }

            var item = new ConfigItem
                           {
                               Name = key.ToLowerCamelCase(), 
                               Mode = ParameterMode.Value
                           };

            if (value.StartsWith("<raw>"))
            {
                item.Mode = ParameterMode.Raw;
                value = value.Remove(0, 5);
            }
            else if (value.StartsWith("<string>"))
            {
                item.Mode = ParameterMode.Value;
                value = value.Remove(0, value.StartsWith("<string><raw>") ? 13 : 8);
            }
            else
            {
                bool boolTest;
                double doubleTest;
                DateTime dateTest;

                if (bool.TryParse(value, out boolTest) || double.TryParse(value, NumberStyles.Any, NumberFormatInfo.InvariantInfo, out doubleTest))
                {
                    item.Mode = ParameterMode.Raw;
                    value = value.ToLowerInvariant();
                }
                else if (DateTime.TryParse(value, CultureInfo.CurrentCulture, DateTimeStyles.None, out dateTest))
                {
                    item.Mode = ParameterMode.Raw;
                    value = DateTimeUtils.DateNetToJs(dateTest);
                }
            }

            item.Value = value;

            if (this is AbstractContainer && isDefaults)
            {
                ((AbstractContainer)this).Defaults.Add(new Parameter(item.Name, item.Value, item.Mode));
            }
            else
            {
                this.CustomConfig.Add(item);
            }
        }
开发者ID:rajjan,项目名称:Ext.NET.Community,代码行数:64,代码来源:Observable.cs

示例14: getValue

        private ConfigItem<string> getValue(string xpath, bool isLocal)
        {
            var node = _xml.SelectSingleNode(xpath);
            if (node == null)
                return new ConfigItem<string>() { Item = "", IsLocal = isLocal, Exists = false };

            var item = new ConfigItem<string>() { Item = node.InnerText, IsLocal = isLocal, Exists = true };
            var overrideIfno = "";
            if (node.Attributes.GetNamedItem("override") != null)
                overrideIfno = node.Attributes.GetNamedItem("override").InnerText;
            if (overrideIfno == "exclude")
                item.ShouldExclude = true;
            if (overrideIfno == "merge")
                item.ShouldMerge = true;

            return item;
        }
开发者ID:jeroldhaas,项目名称:ContinuousTests,代码行数:17,代码来源:ConfigParser.cs

示例15: mergeVersionedItem

		private void mergeVersionedItem(List<KeyValuePair<string, string>> setting, ConfigItem<KeyValuePair<string, string>[]> settingToMerge)
		{
			if (!settingToMerge.WasReadFromConfig)
				return;
			if (settingToMerge.ShouldExclude)
			{
				setting.Clear();
				return;
			}
			if (settingToMerge.ShouldMerge)
			{
				foreach (var mergedItem in settingToMerge.Value)
				{
					setting.RemoveAll(x => x.Key.Equals(mergedItem.Key));
					setting.Add(mergedItem);
				}
				return;
			}
			setting.Clear();
			setting.AddRange(settingToMerge.Value);
		}
开发者ID:jstclair,项目名称:AutoTest.Net,代码行数:21,代码来源:Config.cs


注:本文中的ConfigItem类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。