本文整理汇总了C#中System.Runtime.Serialization.SerializationInfo.GetUInt32方法的典型用法代码示例。如果您正苦于以下问题:C# SerializationInfo.GetUInt32方法的具体用法?C# SerializationInfo.GetUInt32怎么用?C# SerializationInfo.GetUInt32使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Runtime.Serialization.SerializationInfo
的用法示例。
在下文中一共展示了SerializationInfo.GetUInt32方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Block
public Block(SerializationInfo info, StreamingContext context)
{
// built-in value
_bits = info.GetUInt32("built-int");
// cutom bits
_customBits = new uint[info.GetUInt16("cBitCount")];
int length = _customBits.Length;
for (int i = 0; i < length; i++)
{
_customBits[i] = info.GetUInt32("cBit" + i);
}
// custom floats
length = info.GetUInt16("cFloatCount");
_customFloats = new ConcurrentDictionary<int, float>(3, length * 2);
for (int i = 0; i < length; i++)
{
_customFloats[info.GetInt32("cFloatKey" + i)] = info.GetSingle("cFloatValue" + i);
}
// custom strings
length = info.GetUInt16("cStringCount");
_customStrings = new ConcurrentDictionary<int, string>(3, length * 2);
for (int i = 0; i < length; i++)
{
_customStrings[info.GetInt32("cStringKey" + i)] = info.GetString("cStringValue" + i);
}
}
示例2: Key
private Key(SerializationInfo info, StreamingContext context)
{
KeyDownStrokes = new List<KeyStroke>();
KeyUpStrokes = new List<KeyStroke>();
//int version = info.GetInt32("Version");
Name = info.GetString("keyName");
InfoWindowsKeys = info.GetString("InfoWindowsKeys");
int totalKeyDown = info.GetInt32("TotalKeyDown");
for (int i = 0; i < totalKeyDown; i++)
{
var ks = new KeyStroke();
ks.code = info.GetUInt16("kd_c_" + i);
ks.information = info.GetUInt32("kd_i_" + i);
ks.state = (Keyboard.States)info.GetUInt16("kd_s_" + i);
KeyDownStrokes.Add(ks);
}
int totalKeyUp = info.GetInt32("TotalKeyUp");
for (int i = 0; i < totalKeyUp; i++)
{
var ks = new KeyStroke();
ks.code = info.GetUInt16("ku_c_" + i);
ks.information = info.GetUInt32("ku_i_" + i);
ks.state = (Keyboard.States)info.GetUInt16("ku_s_" + i);
KeyUpStrokes.Add(ks);
}
}
示例3: StarMapFeature
public StarMapFeature(SerializationInfo info, StreamingContext context)
{
//m_Stride = info.GetInt32("m_Stride");
//m_BytesPerPixel = info.GetInt32("m_BytesPerPixel");
m_MaxBrightness = info.GetByte("m_MaxBrightness");
m_MaxBrightnessFirstKey = info.GetUInt64("m_MaxBrightnessFirstKey");
m_MaxBrightnessPixels = info.GetInt32("m_MaxBrightnessPixels");
m_Generation = info.GetInt32("m_Generation");
m_Merges = info.GetInt32("m_Merges");
m_FeatureId = info.GetInt32("FeatureId");
m_Intencity = info.GetUInt32("m_Intencity");
int count = info.GetInt32("m_Pixels.Count");
int idx = -1;
m_Pixels = new SortedDictionary<ulong, uint>();
for (int i = 0; i < count; i++)
{
idx++;
ulong key = info.GetUInt64(string.Format("m_Pixels.{0}.Key", idx));
uint val = info.GetUInt32(string.Format("m_Pixels.{0}.Value", idx));
m_Pixels.Add(key, val);
}
}
示例4: Credentials
public Credentials(SerializationInfo info, StreamingContext context)
{
int version = 0;
try
{
version = info.GetInt32("version");
}
catch { }
if (version == 0)
{
Host = info.GetString("m_Host");
Port = info.GetInt32("m_Port");
WorkspaceID = info.GetUInt64("m_ID");
WorkspaceName = info.GetString("m_Name");
UserName = info.GetString("m_UserName");
UserSmtp = info.GetString("m_UserSmtp");
Nonce = (byte[])info.GetValue("m_Nonce", (new byte[] { }).GetType());
Type = (Credentials.CredType)Enum.Parse(typeof(CredType), info.GetString("m_type"));
Password = info.GetString("m_pwd");
Ticket = (byte[])info.GetValue("m_ticket", (new byte[] { }).GetType());
IsAdmin = info.GetBoolean("m_IsAdmin");
UserID = info.GetUInt32("m_UserId");
}
else
{
Host = info.GetString("Host");
Port = info.GetInt32("Port");
WorkspaceID = info.GetUInt64("ID");
WorkspaceName = info.GetString("Name");
UserName = info.GetString("UserName");
UserSmtp = info.GetString("UserSmtp");
Nonce = (byte[])info.GetValue("Nonce", (new byte[] { }).GetType());
Type = (Credentials.CredType)Enum.Parse(typeof(CredType), info.GetString("Type"));
Password = info.GetString("Password");
Ticket = (byte[])info.GetValue("Ticket", (new byte[] { }).GetType());
IsAdmin = info.GetBoolean("IsAdmin");
UserID = info.GetUInt32("UserID");
if (version == 2) IsPublic = info.GetBoolean("IsPublic");
}
newCreds.KasID = new KasIdentifier(Host, (UInt16)Port);
newCreds.ExternalID = WorkspaceID;
newCreds.KwsName = WorkspaceName;
newCreds.UserName = UserName;
newCreds.UserEmailAddress = UserSmtp;
newCreds.AdminFlag = IsAdmin;
newCreds.PublicFlag = IsPublic;
newCreds.UserID = UserID;
newCreds.Ticket = Ticket;
newCreds.Pwd = Password;
}
示例5: FrequencyDefinitionBase
/// <summary>
/// Creates a new <see cref="FrequencyDefinitionBase"/> from serialization parameters.
/// </summary>
/// <param name="info">The <see cref="SerializationInfo"/> with populated with data.</param>
/// <param name="context">The source <see cref="StreamingContext"/> for this deserialization.</param>
protected FrequencyDefinitionBase(SerializationInfo info, StreamingContext context)
: base(info, context)
{
// Deserialize frequency definition
m_dfdtScale = info.GetUInt32("dfdtScale");
m_dfdtOffset = info.GetDouble("dfdtOffset");
}
示例6: JsException
/// <summary>
/// Initializes a new instance of the <see cref="JsException"/> class with serialized data
/// </summary>
/// <param name="info">The object that holds the serialized data</param>
/// <param name="context">The contextual information about the source or destination</param>
protected JsException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
if (info != null)
{
_errorCode = (JsErrorCode)info.GetUInt32("ErrorCode");
}
}
示例7: Gpu
protected Gpu(SerializationInfo info, StreamingContext ctx)
{
_isEnabled = info.GetBoolean("IsEnabled");
_isLineRendered = info.GetBoolean("IsLineRendered");
_clocks = info.GetUInt32("Clocks");
_currentLine = info.GetUInt32("CurrentLine");
_delay = info.GetInt32("Delay");
_mode = (Mode)info.GetValue("Mode", typeof(Mode));
_frameBuffer = ((List<int>)info.GetValue("FrameBuffer", typeof(List<int>)))
.Select(i => i.FromArgb()).ToList();
_defaultPalette = ((List<int>)info.GetValue("DefaultPalette", typeof(List<int>)))
.Select(i => i.FromArgb()).ToList();
_bgPalette = ((List<int>)info.GetValue("BackgroundPalette", typeof(List<int>)))
.Select(i => i.FromArgb()).ToList();
_spritePalette = ((List<int>)info.GetValue("SpritePalette", typeof(List<int>)))
.Select(i => i.FromArgb()).ToList();
}
示例8: JavaScriptException
/// <summary>
/// Initializes a new instance of the <see cref="JavaScriptException"/> class.
/// </summary>
/// <param name="info">The serialization info.</param>
/// <param name="context">The streaming context.</param>
protected JavaScriptException(SerializationInfo info, StreamingContext context) :
base(info, context)
{
if (info != null)
{
code = (JavaScriptErrorCode) info.GetUInt32("code");
}
}
示例9: Pkcs11Exception
/// <summary>
/// Initializes new instance of Pkcs11Exception class with serialized data
/// </summary>
/// <param name="info">SerializationInfo that holds the serialized object data about the exception being thrown</param>
/// <param name="context">StreamingContext that contains contextual information about the source or destination</param>
protected Pkcs11Exception(SerializationInfo info, StreamingContext context)
: base(info, context)
{
if (info != null)
{
_method = info.GetString("Method");
_rv = (CKR)info.GetUInt32("RV");
}
}
示例10: ChannelDefinitionBase
/// <summary>
/// Creates a new <see cref="ChannelDefinitionBase"/> from serialization parameters.
/// </summary>
/// <param name="info">The <see cref="SerializationInfo"/> with populated with data.</param>
/// <param name="context">The source <see cref="StreamingContext"/> for this deserialization.</param>
protected ChannelDefinitionBase(SerializationInfo info, StreamingContext context)
{
// Deserialize channel definition
m_parent = (IConfigurationCell)info.GetValue("parent", typeof(IConfigurationCell));
m_index = info.GetInt32("index");
Label = info.GetString("label");
m_scale = info.GetUInt32("scale");
m_offset = info.GetDouble("offset");
}
示例11: Url
protected Url(SerializationInfo info,StreamingContext context)
{
this.uri = info.GetValue("uri", typeof(Uri)) as Uri;
this.uriEscape = info.GetBoolean("escape");
this.checkSum = info.GetUInt32("checkSum");
this.hostCheckSum = info.GetUInt32("hostCheckSum");
this.checkSumAlgorith = info.GetValue("checkSumAlgorith", typeof(IUrlCheckSum)) as IUrlCheckSum;
this.httpMethod = info.GetString("httpMethod");
this.appendParams = info.GetValue("appendParams", typeof(NameValueCollection)) as NameValueCollection;
this.ignoreParams = info.GetValue("ignoreParams", typeof(NameValueCollection)) as NameValueCollection;
this.maxTryTimes = info.GetInt32("maxTryTimes");
this.hasTriedTimes = info.GetInt32("hasTriedTimes");
this.hasError = info.GetBoolean("hasError");
this.errorMsg = info.GetString("errorMsg");
this.contentHandlers = info.GetValue("contentHandlers", typeof(ContentHandlerCollection)) as ContentHandlerCollection;
this.text = info.GetString("text");
this.domainSuffixProvider = info.GetValue("domainSuffixProvider", typeof(IDomainSuffixPrivoder)) as IDomainSuffixPrivoder;
this.allowExtractUrl = info.GetBoolean("allowExtractUrl");
}
示例12: DPin
/// <summary>
/// Initializes a new instance of the <see cref="PrototypeBackend.DPin"/> class.
/// </summary>
/// <param name="info">Info.</param>
/// <param name="context">Context.</param>
public DPin(SerializationInfo info, StreamingContext context)
{
Type = (PinType)info.GetByte ("Type");
Mode = (PinMode)info.GetByte ("Mode");
Name = info.GetString ("Name");
Number = info.GetUInt32 ("Number");
AnalogNumber = info.GetInt32 ("AnalogNumber");
SDA = info.GetBoolean ("SDA");
SCL = info.GetBoolean ("SCL");
RX = info.GetBoolean ("RX");
TX = info.GetBoolean ("TX");
PlotColor = new Gdk.Color (info.GetByte ("RED"), info.GetByte ("GREEN"), info.GetByte ("BLUE"));
}
示例13: Item
public Item(SerializationInfo info, StreamingContext context)
{
Path = info.GetString("Path");
_tags = (List<Tag>) info.GetValue("_tags", typeof (List<Tag>));
_filesize = (long) info.GetValue("_filesize", typeof (long));
_hash = info.GetUInt32("_hash");
_dimensions = (Size) info.GetValue("_dimensions", typeof (Size));
_links = (HashSet<string>) info.GetValue("_links", typeof (HashSet<string>));
_invalidated = info.GetBoolean("_invalidated");
_externalUrl = info.GetString("_externalUrl");
_uploaded = info.GetBoolean("_uploaded");
_tagRenameStateChanged = info.GetBoolean("_tagRenameStateChanged");
}
示例14: DataOperation
/// <summary>
/// Construct from a stream of serialized data
/// </summary>
/// <param name="info"></param>
/// <param name="con"></param>
public DataOperation(SerializationInfo info, StreamingContext con)
{
m_ClassId = info.GetUInt32("_ClassId");
m_ClassName = info.GetString("_ClassName");
// WARNING:: enum deserialize causes an exception
// serialization of an enum prints the string
// representation of the enum value, so we need to
// deserialize to a string and convert to the relvant
// enum value.
// ENUM Deserialization - read as string and convert string to ENUM value
String s = info.GetString("_OperationType");
m_OperationType = (OperationType)Enum.Parse(typeof(OperationType), s, true);
m_InstanceId = info.GetUInt64("_OperationUID");
m_ExecuteId = info.GetUInt64("_ExecuteUID");
String dt = info.GetString("_Created");
DateTime.TryParse(dt, null
, System.Globalization.DateTimeStyles.AssumeLocal
, out m_InstanceCreated);
dt = info.GetString("_Executed");
DateTime.TryParse(dt, null
, System.Globalization.DateTimeStyles.AssumeLocal
, out m_OperationExecuted);
dt = info.GetString("_Completed");
DateTime.TryParse(dt, null
, System.Globalization.DateTimeStyles.AssumeLocal
, out m_OperationCompleted);
// deserialization resets the static instance count
// from the input stream, all previous data is overwritten
lock (myMutex)
{
if (s_InstanceId < m_InstanceId)
{
s_InstanceId = m_InstanceId;
}
}
}
示例15: ClassicFactoryException
protected ClassicFactoryException(SerializationInfo info, StreamingContext context) : base(info, context)
{
idxdatInfo = info.GetString("IdxdatInfo");
muldatInfo = info.GetString("MuldatInfo");
dataidInfo = info.GetUInt32("DataidInfo");
}