Exemplo n.º 1
0
        public static void AddEditableList <T>(this TreeNodeCollection coll,
                                               EditableEnvironment env, List <T> list)
            where T : class
        {
            var me = new ListMultiEditable <T>(list);

            foreach (var item in list)
            {
                coll.Add(EditableNodeGenerator.Create <T>(env, item, me));
            }
            coll.Add(EditableNodeGenerator.Create <T>(env, me));
        }
Exemplo n.º 2
0
            protected override void SetupCommon()
            {
                if (Data == null)
                {
                    Text = MakeText("select");
                }
                else
                {
                    var type = Data.GetType();
                    var dn   = type.GetCustomAttribute <DisplayNameAttribute>();
                    if (dn != null)
                    {
                        Text = MakeText(dn.DisplayName);
                    }
                    else
                    {
                        Text = MakeText(type.Name);
                    }
                }

                EditableNodeGenerator.SetupChildren <T>(this, Env, Data);
            }