Inheritance: UFControl
Ejemplo n.º 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;
                }
            }
        }
Ejemplo n.º 2
0
 public static void CreateNewProject()
 {
     current = new UFProject();
     UFCanvas canvas1 = new UFCanvas();
     canvas1.Text = "canvas1";
     canvas1.Name = "canvas1";
     current.Controls.Add(canvas1);
 }
Ejemplo n.º 3
0
        public static void CreateNewProject()
        {
            current = new UFProject();
            UFCanvas canvas1 = new UFCanvas();

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