Пример #1
0
        public void TestToString( )
        {
            this.tracer.WriteLine("测试方法 TestToString(object)");

            try
            {
                this.tracer.WriteLine(string.Format("成功: {0}", StringConvert.ToString(SystemColors.ButtonFace)));
            }
            catch (Exception err)
            { this.tracer.WriteLine(string.Format("异常: {0}", err.Message)); }

            this.tracer.WaitPressEnter( );
        }
Пример #2
0
        /// <summary>
        /// 设置辅助类所表示 XmlNode 的属性值.
        /// </summary>
        /// <param name="node">XmlNode 类.</param>
        /// <param name="value">属性值.</param>
        /// <param name="name">属性的名称.</param>
        /// <returns>是否成功设置.</returns>
        public static bool FlushAttributeValue(XmlNode node, object value, string name)
#endif
        {
            if (null == value || null == node)
            {
                return(false);
            }

            if (null == name)
            {
                name = "value";
            }

            XmlAttribute attribute = node.Attributes[name];

            if (null == attribute)
            {
                return(false);
            }

            attribute.Value = StringConvert.ToString(value);
            return(true);
        }