Inheritance: UFControl
示例#1
0
        private void OnMenuAdd(object type)
        {
            string typeString = (string)type;

            var current = UFSelection.ActiveControl;

            if (current == null)
            {
                if (typeString == "UFCanvas")
                {
                    var canvas = new UFCanvas();
                    canvas.Name = "canvas";
                    canvas.Text = "canvas";
                    UFProject.Current.Controls.Add(canvas);
                }

                return;
            }
            else
            {
                var  assembly  = Assembly.GetAssembly(typeof(UFControl));
                Type childType = assembly.GetType(typeString);
                if (childType != null)
                {
                    UFControl child = Activator.CreateInstance(childType) as UFControl;
                    child.Name = child.DefaultName;
                    child.Text = child.DefaultName;
                    current.Add(child);
                    UFSelection.ActiveControl = child;
                }
            }
        }
示例#2
0
 public static void CreateNewProject()
 {
     current = new UFProject();
     UFCanvas canvas1 = new UFCanvas();
     canvas1.Text = "canvas1";
     canvas1.Name = "canvas1";
     current.Controls.Add(canvas1);
 }
示例#3
0
        public static void CreateNewProject()
        {
            current = new UFProject();
            UFCanvas canvas1 = new UFCanvas();

            canvas1.Text = "canvas1";
            canvas1.Name = "canvas1";
            current.Controls.Add(canvas1);
        }