상속: 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
파일: UFProject.cs 프로젝트: hidakas/uForms
 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);
        }