public void CollectPropertyLinks(Dictionary <IPropertyValueLinkHolder, Dictionary <IPropertyValueLink, CodeExpression> > links)
        {
            string[] names = _links.GetLinkablePropertyNames();
            Dictionary <IPropertyValueLink, CodeExpression> kv = new Dictionary <IPropertyValueLink, CodeExpression>();

            for (int k = 0; k < names.Length; k++)
            {
                IPropertyValueLink pvk = GetPropertyLink(names[k]);
                if (pvk != null && pvk.IsValueLinkSet())
                {
                    //TreeViewX {this}.GetNodeTemplate(int level) to set link to names[k]
                    CodeMethodInvokeExpression mie = new CodeMethodInvokeExpression();
                    mie.Method.MethodName = "GetNodeTemplateBase";
                    mie.Parameters.Add(new CodePrimitiveExpression(this.Level));
                    mie.UserData.Add("name", names[k]);
                    kv.Add(pvk, mie);
                }
            }
            if (kv.Count > 0)
            {
                links.Add(this, kv);
            }
            if (Nodes.Count > 0)
            {
                for (int i = 0; i < Nodes.Count; i++)
                {
                    TreeNodeXTemplate tt = Nodes[i] as TreeNodeXTemplate;
                    if (tt != null)
                    {
                        tt.CollectPropertyLinks(links);
                        break;
                    }
                }
            }
        }
Пример #2
0
 public string[] GetLinkablePropertyNames()
 {
     return(_links.GetLinkablePropertyNames());
 }