Exemple #1
0
        public PropertyWidget(UserType parent, UserType.Field field, Point location, int index)
        {
            InitializeComponent();
            m_parent = parent;
            m_field  = field;

            Location = new Point(location.X, location.Y + (Size.Height + 10) * index);

            Initialize();
        }
        private void Click_NewProperty(object sender, EventArgs e)
        {
            var field = new UserType.Field();

            m_type.Properties.Add(field);

            NewProperty(field, m_type.Properties.Count - 1);

            MainWindow.Instance.Panel.Refresh();
        }
        private void NewProperty(UserType.Field field, int index)
        {
            var widget = new UsertypeDefTools.Widget.PropertyWidget(m_type, field, new Point(Location.X + Size.Width + 30, Location.Y + Size.Height), index);

            widget.Location = new Point(Location.X + Size.Width + 30, Location.Y + Size.Height + (widget.Size.Height + 10) * index);

            MainWindow.Instance.Panel.Controls.Add(widget);

            MainWindow.Instance.AddLineToPanel(
                () => { return(PointToScreen(Point.Add(m_label_properties.Location, m_label_properties.Size))); },
                () => { return(widget.PointToScreen(Point.Empty)); });
        }
        public static string GetFileCode(this UserType.Field filed)
        {
            string typeStr = filed.Type.GetCSharpTypeString();

            return(string.Format("\t\tpublic {0} {1};", typeStr, filed.FieldName));
        }