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


C# IVariable.GetObject方法代码示例

本文整理汇总了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, "");
                    }
                }
            }
        }
开发者ID:slluis,项目名称:monodevelop-prehistoric,代码行数:46,代码来源:LocalsPad.cs

示例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);
            }
        }
开发者ID:slluis,项目名称:monodevelop-prehistoric,代码行数:22,代码来源:LocalsPad.cs


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