Commit 9a45852d by liulongfei

扩展更新

parent 12108025
...@@ -85,9 +85,9 @@ namespace VIZ.Framework.Core ...@@ -85,9 +85,9 @@ namespace VIZ.Framework.Core
if (message == null) if (message == null)
return; return;
foreach (IMessageInfo i in this.list) for (int i = 0; i < this.list.Count; i++)
{ {
MessageInfo<T> info = i as MessageInfo<T>; MessageInfo<T> info = this.list[i] as MessageInfo<T>;
if (info == null) if (info == null)
continue; continue;
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
namespace VIZ.Framework.Core
{
/// <summary>
/// XML扩展
/// </summary>
public static class XmlExpand
{
/// <summary>
/// 当值不为空时设置Attribute
/// </summary>
/// <param name="element">元素</param>
/// <param name="name">字段名称</param>
/// <param name="value">字段值</param>
public static void SetAttributeValueIfValueNotNull(this XElement element, XName name, object value)
{
if (value == null)
return;
element.SetAttributeValue(name, value);
}
/// <summary>
/// 当值不为空时设置Attribute
/// </summary>
/// <param name="element">元素</param>
/// <param name="name">字段名称</param>
/// <param name="value">字段值</param>
public static void SetAttributeValueIfValueNotNull(this XElement element, XName name, string value)
{
if (string.IsNullOrWhiteSpace(value))
return;
element.SetAttributeValue(name, value);
}
}
}
...@@ -159,6 +159,7 @@ ...@@ -159,6 +159,7 @@
<Compile Include="Core\VIZ\Engine\VizEngineModel.cs" /> <Compile Include="Core\VIZ\Engine\VizEngineModel.cs" />
<Compile Include="Core\VIZ\Engine\VizEngineModelCommandExpand.cs" /> <Compile Include="Core\VIZ\Engine\VizEngineModelCommandExpand.cs" />
<Compile Include="Core\Win32\Win32Helper.cs" /> <Compile Include="Core\Win32\Win32Helper.cs" />
<Compile Include="Core\Xml\XmlExpand.cs" />
<Compile Include="Expand\GPIO\Core\USB2GPIO.cs" /> <Compile Include="Expand\GPIO\Core\USB2GPIO.cs" />
<Compile Include="Expand\GPIO\Core\USBDevice.cs" /> <Compile Include="Expand\GPIO\Core\USBDevice.cs" />
<Compile Include="Expand\GPIO\Core\USBDeviceStruct.cs" /> <Compile Include="Expand\GPIO\Core\USBDeviceStruct.cs" />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment