Example #1
0
        /// <summary>
        /// 增加使用过的用户名
        /// </summary>
        /// <param name="userName">用户名</param>
        /// <returns></returns>
        public void AddUsedUserName(string userName)
        {
            for (var i = 0; i < UsedUserNames.Count; i++)
            {
                if (UsedUserNames[i].Value == userName)
                {
                    UsedUserNames.RemoveAt(i);
                    break;
                }
            }
            var node = new ClientConfigNode();

            node.Key   = "UserName";
            node.Value = userName;
            UsedUserNames.Add(node);
            if (UsedUserNames.Count > 6)
            {
                UsedUserNames.RemoveAt(0);
            }
        }
Example #2
0
        /// <summary>
        /// 增加曾经用过的用户控件节点
        /// </summary>
        /// <param name="key">关键字</param>
        /// <param name="attribute">属性名</param>
        /// <returns></returns>
        public void AddUsedUserControls(string tag, string caption)
        {
            for (var i = 0; i < UsedUserControls.Count; i++)
            {
                if (UsedUserControls[i].Key == tag)
                {
                    UsedUserControls.RemoveAt(i);
                    break;
                }
            }
            var node = new ClientConfigNode();

            node.Key   = tag;
            node.Value = caption;
            UsedUserControls.Add(node);
            if (UsedUserControls.Count > 12)
            {
                UsedUserControls.RemoveAt(0);
            }
        }
Example #3
0
        /// <summary>
        /// 设置配置文件的值
        /// </summary>
        /// <param name="key">关键字</param>
        /// <param name="attribute">属性名</param>
        /// <returns></returns>
        public void SetKeyValue(string key, string Value)
        {
            var exit = false;

            for (var i = 0; i < NodeList.Count; i++)
            {
                if (NodeList[i].Key == key)
                {
                    NodeList[i].Value = Value;
                    exit = true;
                    break;
                }
            }
            if (!exit)
            {
                var node = new ClientConfigNode();
                node.Key   = key;
                node.Value = Value;
                NodeList.Add(node);
            }
        }