本文整理汇总了C#中DataObject.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# DataObject.ToString方法的具体用法?C# DataObject.ToString怎么用?C# DataObject.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataObject
的用法示例。
在下文中一共展示了DataObject.ToString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleCompletion
/// <summary>
/// Hande task completion with task output data passed as NameValueCollection
/// </summary>
/// <param name="correlationId"></param>
/// <param name="taskOutputData"></param>
private void HandleCompletion(string correlationId, NameValueCollection taskOutputData)
{
try
{
IApplicationContext ctx = Spring.Context.Support.ContextRegistry.GetContext();
INGEnvironment env = (INGEnvironment)ctx.GetObject("NGEnvironment");
IProcessPackageRepository pdr = (IProcessPackageRepository)ctx.GetObject("PackageRepository");
TaskInstanceInfo ti = env.GetTaskInstanceInfo(correlationId);
NG.ProcessDefinition pd = pdr.GetProcess(ti.ProcessDefinitionId);
NG.Task ntsk = pd.GetTask(ti.TaskId);
StructDef sd = ntsk.GetTaskOutputDataSchema();
DataObject completionData = new DataObject();
foreach (MemberDef md in sd.Members)
{
string s = taskOutputData[md.Name];
if (s != null)
{
completionData[md.Name] = s;
}
}
log.Info("Completing task {0} with data {1}", correlationId, completionData.ToString());
env.ReportTaskFinished(correlationId, completionData, Context.User.Identity.Name);
}
catch (Exception ex)
{
log.Error("Error completing task {0}: {1}", correlationId, ex);
throw;
}
}
示例2: BuildParameterString
private string BuildParameterString(DataObject argName, DataObject argType, DataObject inOut)
{
var sb = new StringBuilder();
sb.Append(argName.ToString());
sb.Append(" ");
sb.Append(argType.ToString());
if (!inOut.IsNull)
sb.Append(" ")
.Append(inOut.Value);
return sb.ToString();
}
示例3: RestoreState
/// <summary>
/// Restore task state using NGinn custom persistence.
/// Override this method in your class if you have data fields to restore.
/// Call base method for default persistence of task data.
/// </summary>
/// <param name="dob"></param>
public virtual void RestoreState(DataObject dob)
{
if (_activated) throw new Exception("Task should not be activated when restoring state");
_taskData = (DataObject)dob["TaskData"];
if (_taskData == null)
{
log.Warn("No task data for task {0}: {1}", this.CorrelationId, dob.ToString());
_taskData = new DataObject();
}
_correlationId = (string)dob["CorrelationId"];
if (_correlationId == null) throw new Exception("Missing CorrelationId");
}
示例4: SelectFromPattern
public static IEnumerable<int> SelectFromPattern(this ITable table, int column, SqlExpressionType op, DataObject ob)
{
if (ob.IsNull)
return new List<int>();
if (op == SqlExpressionType.NotLike) {
// How this works:
// Find the set or rows that are like the pattern.
// Find the complete set of rows in the column.
// Sort the 'like' rows
// For each row that is in the original set and not in the like set,
// add to the result list.
// Result is the set of not like rows ordered by the column.
var likeSet = (List<int>)table.Search(column, ob.ToString());
// Don't include NULL values
var nullCell = DataObject.Null(ob.Type);
IList<int> originalSet = table.SelectRows(column, SqlExpressionType.IsNot, nullCell).ToList();
int listSize = System.Math.Max(4, (originalSet.Count - likeSet.Count) + 4);
List<int> resultSet = new List<int>(listSize);
likeSet.Sort();
int size = originalSet.Count;
for (int i = 0; i < size; ++i) {
int val = originalSet[i];
// If val not in like set, add to result
if (likeSet.BinarySearch(val) == 0) {
resultSet.Add(val);
}
}
return resultSet;
}
// if (op.is("like")) {
return table.Search(column, ob.ToString());
}
示例5: RestoreTaskState
/// <summary>
/// Restore task's state from DataObject.
/// Use INGinnPersistent if supported. If not, use binary serialization.
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
protected IActiveTask RestoreTaskState(DataObject data, Task definition)
{
string bs = (string)data["NGINN_BINARY_DATA"];
if (bs != null)
{
//binary restore here
}
//restore activetask here...
IActiveTask at = EnvironmentContext.ActiveTaskFactory.CreateActiveTask(definition);
INGinnPersistent pers = at as INGinnPersistent;
if (pers != null)
{
pers.RestoreState(data);
return at;
}
log.Error("Don't know how to restore state of task {0} from {1}", at.GetType().FullName, data.ToString());
throw new Exception(string.Format("Don't know how to restore state of task {0}", at.GetType().FullName));
}