コード例 #1
0
        private void Control_MouseRightButtonUp(object sender, MouseButtonEventArgs e)
        {
            ExpressionVertex expv = (ExpressionVertex)(sender as Grid).Tag;
            ArrayList        list = new ArrayList(expv.exp.DataMembers.OfType <EnvDTE.Expression>().ToList());

            SelectList(list);
        }
コード例 #2
0
 void MakeVertexTooltips()
 {
     foreach (var gr_vert in graph.vertices)
     {
         ExpressionVertex vert    = gr_vert.data as ExpressionVertex;
         Expression       exp     = vert.exp;
         string           tooltip = exp.Value;
         foreach (Expression f in exp.DataMembers)
         {
             tooltip += "\n (" + f.Type + ")" + f.Name + "=" + f.Value;
         }
         vert.tooltip = tooltip;
     }
 }
コード例 #3
0
        void MakeVertexCaptions()
        {
            bool found = false;

            foreach (Expression field in root_expression.DataMembers)
            {
                if (field.Type == root_expression.Type)
                {
                    continue;
                }
                if (field.DataMembers.OfType <Expression>().
                    Where(e => e.Type == root_expression.Type).Any())
                {
                    continue;
                }
                if (graph.vertices.OfType <Vertex <object> >().
                    Select(v => v.data as ExpressionVertex).
                    Select(expv => expv.exp.DataMembers.OfType <Expression>()).
                    Select(m => m.FirstOrDefault(f => f.Name == field.Name)).
                    Select(f => f.Value).
                    Distinct().Count() == graph.vertices.Count)
                {
                    found = true;
                    foreach (var gr_vert in graph.vertices)
                    {
                        ExpressionVertex vert = gr_vert.data as ExpressionVertex;
                        Expression       exp  = vert.exp;
                        vert.name = exp.Value + "\n{ ERROR }";
                        foreach (Expression f in exp.DataMembers)
                        {
                            if (f.Name == field.Name)
                            {
                                vert.name = exp.Value + "\n" + "{ " + f.Name + " = " + f.Value + " }";
                                break;
                            }
                        }
                    }
                    break;
                }
            }
            if (!found)
            {
                foreach (var gr_vert in graph.vertices)
                {
                    ExpressionVertex vert = gr_vert.data as ExpressionVertex;
                    vert.name = vert.exp.Value;
                }
            }
        }