本文整理汇总了C#中IVariable.GetObject方法的典型用法代码示例。如果您正苦于以下问题:C# IVariable.GetObject方法的具体用法?C# IVariable.GetObject怎么用?C# IVariable.GetObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IVariable
的用法示例。
在下文中一共展示了IVariable.GetObject方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdateVariable
void UpdateVariable(IVariable variable)
{
TreeRowReference row = (TreeRowReference)variable_rows[variable];
if (row == null) {
/* the variable isn't presently displayed */
if (!variable.IsAlive (current_frame.TargetAddress))
/* it's not displayed and not alive, just return */
return;
AddVariable (variable);
}
else {
/* the variable is presently displayed */
// XXX we need a obj.IsValid check in this branch
if (!variable.IsAlive (current_frame.TargetAddress)) {
/* it's in the display but no longer alive. remove it */
RemoveVariable (variable);
return;
}
/* it's still alive - make sure the display is up to date */
TreeIter iter;
if (store.GetIter (out iter, row.Path)) {
try {
ITargetObject obj = variable.GetObject (current_frame);
/* make sure the Value column is correct */
string current_value = (string)store.GetValue (iter, VALUE_COL);
string new_value = GetObjectValueString (obj);
if (current_value != new_value)
store.SetValue (iter, VALUE_COL, new_value);
/* update the children */
UpdateVariableChildren (variable, obj, row.Path, iter);
} catch (Exception e) {
Console.WriteLine ("can't update variable: {0} {1}", variable, e);
store.SetValue (iter, VALUE_COL, "");
}
}
}
}
示例2: AddVariable
void AddVariable(IVariable variable)
{
try {
/* it's alive, add it to the display */
ITargetObject obj = variable.GetObject (current_frame);
TreeIter iter;
if (!obj.IsValid)
return;
store.Append (out iter);
variable_rows.Add (variable, new TreeRowReference (store, store.GetPath (iter)));
AddObject (variable.Name, GetIcon (obj), obj, iter);
} catch (LocationInvalidException) {
// Do nothing
} catch (Exception e) {
Console.WriteLine ("can't add variable: {0} {1}", variable, e);
}
}