当前位置: 首页>>代码示例>>C#>>正文


C# DataObject.TryGet方法代码示例

本文整理汇总了C#中DataObject.TryGet方法的典型用法代码示例。如果您正苦于以下问题:C# DataObject.TryGet方法的具体用法?C# DataObject.TryGet怎么用?C# DataObject.TryGet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataObject的用法示例。


在下文中一共展示了DataObject.TryGet方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RestoreState

 public override void RestoreState(DataObject dob)
 {
     base.RestoreState(dob);
     if (dob.ContainsKey("DelayAmount"))
         DelayAmount = (string)dob["DelayAmount"];
     if (dob.ContainsKey("CompletedDate"))
     {
         _actualExpiration = (DateTime) Convert.ChangeType(dob["CompletedDate"], typeof(DateTime));
     }
     dob.TryGet("ExpirationDate", ref _setExpiration);
 }
开发者ID:alasdairhurst,项目名称:nginn,代码行数:11,代码来源:TimerTaskActive.cs

示例2: RestoreState

 /// <summary>
 /// Restore process state from a DataObject (obtained by calling SaveProcessState).
 /// This is the preferred way of storing process state in NGinn. Of course
 /// process instance can be binary serialized and saved, but the binary format
 /// causes problems when upgrading class versions.
 /// </summary>
 /// <param name="dob"></param>
 public void RestoreState(DataObject dob)
 {
     if (this._activated) throw new ApplicationException("Restore is not possible after activation");
     string v = (string) dob["APIVersion"];
     if (!APIVERSION.Equals(v))
     {
         log.Warn("Trying to restore process state from version {0}. API version is {1}", v, APIVERSION);
     }
     DateTime dt = DateTime.MinValue;
     _instId = (string) dob["InstanceId"];
     _definitionId = (string) dob["ProcessDefinitionId"];
     _status = (ProcessStatus)Enum.Parse(typeof(ProcessStatus), (string) dob["Status"]);
     _persistedVersion = Convert.ToInt32(dob["PersistedVersion"]);
     _startedBy = (string)dob["StartedBy"];
     dob.TryGet("StartDate", ref _startDate);
     if (dob.TryGet("FinishDate", ref dt)) FinishDate = dt;
     DataObject vars = (DataObject)dob["InstanceData"];
     _processInstanceData = new DataObject();
     _processInstanceData["variables"] = vars;
     _correlationId = (string)dob["CorrelationId"];
     _transitionNumber = Convert.ToInt32(dob["TransitionNumber"]);
     _currentMarking = new Dictionary<string, int>();
     IList l = dob.GetArray("Marking");
     if (l != null)
     {
         foreach (DataObject d2 in l)
         {
             string plid = (string)d2["Place"];
             int n = Convert.ToInt32(d2["Tokens"]);
             _currentMarking[plid] = n;
         }
     }
     _activeTransitions = new Dictionary<string, TaskShell>();
     IList l2 = dob.GetArray("Transition");
     if (l2 != null)
     {
         foreach (DataObject dob2 in l2)
         {
             TaskShell ts = TaskShell.RestoreTaskShell(dob2);
             _activeTransitions[ts.CorrelationId] = ts;
         }
     }
 }
开发者ID:alasdairhurst,项目名称:nginn,代码行数:50,代码来源:ProcessInstance.cs

示例3: RestoreState

 public override void RestoreState(DataObject dob)
 {
     base.RestoreState(dob);
     if (!dob.TryGet("Url", ref _url)) throw new Exception("Missing Url");
 }
开发者ID:alasdairhurst,项目名称:nginn,代码行数:5,代码来源:XmlHttpTaskActiveCurl.cs

示例4: RestoreState

 public override void RestoreState(DataObject dob)
 {
     base.RestoreState(dob);
     dob.TryGet("msgid", ref _msgid);
 }
开发者ID:alasdairhurst,项目名称:nginn,代码行数:5,代码来源:NotificationTaskActive.cs

示例5: RestoreState

 public override void RestoreState(DataObject dob)
 {
     base.RestoreState(dob);
     if (!dob.TryGet("MessageCorrelationId", ref _messageCorrelationId)) throw new Exception("MessageCorrelationId required");
 }
开发者ID:alasdairhurst,项目名称:nginn,代码行数:5,代码来源:ReceiveMessageTaskActive.cs

示例6: RestoreState

 public override void RestoreState(DataObject dob)
 {
     base.RestoreState(dob);
     Title = (string)dob["Title"];
     Description = (string)dob["Description"];
     AssigneeGroup = (string)dob["AssigneeGroup"];
     AssigneeId = (string)dob["AssigneeId"];
     CompletedBy = (string)dob["CompletedBy"];
     dob.TryGet("CompletedDate", ref _completedDate);
 }
开发者ID:alasdairhurst,项目名称:nginn,代码行数:10,代码来源:ManualTaskActive.cs


注:本文中的DataObject.TryGet方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。