📄 datarow.cs
字号:
using System;
using System.Linq;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace Microsoft.Mobile.Data
{
/// <summary>
/// Object that represents a row of columns. The columns can be retrieved
/// by name.
/// </summary>
[SuppressMessage("Microsoft.Naming",
"CA1710:IdentifiersShouldHaveCorrectSuffix",
Justification = "More readable as DataRow")]
public class DataRow : Dictionary<string, object>
{
#region Methods
/// <summary>
/// This method allows for safe setting of a byte array from the
/// database. The value could be null.
/// </summary>
/// <typeparam name="T">type to be converted</typeparam>
/// <param name="newValue">new value</param>
/// <returns>a type or null</returns>
[SuppressMessage("Microsoft.Design",
"CA1004:GenericMethodsShouldProvideTypeParameter",
Justification = "This is deliberate as the method ensures that the object is of the generic type.")]
public static T SetValue<T>(object newValue)
{
T result = default(T);
// Check to see if value is null or not
if ((newValue != null) && (newValue != DBNull.Value))
{
result = (T)newValue;
}
return result;
}
#endregion
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -