Esempio n. 1
0
        void menuitem_添加描述_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            InputBox frm = new InputBox("请输入内容", "添加描述", 200);

            frm.Owner = MainWindow.instance;
            if (frm.ShowDialog() == true)
            {
                EJ.InterfaceInModule data = new EJ.InterfaceInModule()
                {
                    ModuleID = InterfaceItemNode.Module.id,
                    x        = (int)m_RightButtonDownPoint.X,
                    y        = (int)m_RightButtonDownPoint.Y,
                    Type     = typeof(DescriptionView).FullName,
                };
                try
                {
                    DescriptionView desc = new DescriptionView(frm.Value, data);

                    data.JsonData = desc.GetJsonData();
                    data.id       = Helper.Client.InvokeSync <int>("UpdateInterfaceInModule", data);
                    data.ChangedProperties.Clear();

                    desc.Margin = new Thickness(m_RightButtonDownPoint.X, m_RightButtonDownPoint.Y, 0, 0);
                    m_Grid.Children.Add(desc);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(MainWindow.instance, ex.Message);
                }
            }
        }
Esempio n. 2
0
        internal ClassView(EJ.InterfaceInModule interfaceInModule)
        {
            this.InterfaceInModule = interfaceInModule;
            InitializeComponent();
            this.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
            this.VerticalAlignment   = System.Windows.VerticalAlignment.Top;

            m_jsonObj    = interfaceInModule.JsonData.ToJsonObject <JsonObject>();
            m_DataSource = Forms.InterfaceCenter.DllClassLoader.GetClass(m_jsonObj.FilePath, m_jsonObj.FullName);
            this.DataBind();
        }
Esempio n. 3
0
        internal ClassView(string fullname, string filepath, EJ.InterfaceInModule interfaceInModule)
        {
            this.InterfaceInModule = interfaceInModule;
            m_jsonObj.FilePath     = filepath;
            m_jsonObj.FullName     = fullname;
            m_DataSource           = Forms.InterfaceCenter.DllClassLoader.GetClass(filepath, fullname);
            InitializeComponent();
            this.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
            this.VerticalAlignment   = System.Windows.VerticalAlignment.Top;

            this.DataBind();
        }
Esempio n. 4
0
        internal ClassView(Forms.InterfaceCenter.Nodes.ClassNode source, string filepath, EJ.InterfaceInModule interfaceInModule)
        {
            this.InterfaceInModule = interfaceInModule;
            m_DataSource           = source;
            m_jsonObj.FilePath     = filepath;
            m_jsonObj.FullName     = source.FullName;
            InitializeComponent();
            this.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
            this.VerticalAlignment   = System.Windows.VerticalAlignment.Top;

            this.DataBind();
        }
Esempio n. 5
0
        public DescriptionView(string content, EJ.InterfaceInModule interfaceInModule)
        {
            m_jsonObj.Content      = content;
            this.InterfaceInModule = interfaceInModule;

            this.BorderBrush         = Brushes.Black;
            this.Background          = new SolidColorBrush(Color.FromRgb(211, 225, 251));
            this.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
            this.VerticalAlignment   = System.Windows.VerticalAlignment.Top;
            this.BorderThickness     = new System.Windows.Thickness(1);
            this.CornerRadius        = new System.Windows.CornerRadius(5);


            mText                     = new TextBlock();
            mText.Text                = content;
            mText.IsHitTestVisible    = false;
            mText.Margin              = new Thickness(10);
            mText.HorizontalAlignment = System.Windows.HorizontalAlignment.Center;
            mText.VerticalAlignment   = System.Windows.VerticalAlignment.Center;

            Grid grid = new Grid();

            grid.Children.Add(mText);

            ellipse                     = new Ellipse();
            ellipse.Stroke              = Brushes.Black;
            ellipse.StrokeThickness     = 1;
            ellipse.Fill                = Brushes.White;
            ellipse.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
            ellipse.VerticalAlignment   = System.Windows.VerticalAlignment.Top;
            ellipse.Width               = 8;
            ellipse.Height              = 8;
            ellipse.Visibility          = System.Windows.Visibility.Hidden;
            ellipse.MouseDown          += ellipse_MouseDown;
            grid.Children.Add(ellipse);


            m_grid     = grid;
            this.Child = grid;

            CreateContextMenu();

            m_ArrowMenu = new ContextMenu();
            MenuItem menuitem = new MenuItem();

            menuitem.Header = "删除";
            menuitem.Click += menuitem_deleteArrow_Click;
            m_ArrowMenu.Items.Add(menuitem);
        }
Esempio n. 6
0
        void menuitem_添加class_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            ClassSelector frm = new ClassSelector(this.InterfaceItemNode.Module.ProjectID.Value);

            if (frm.ShowDialog() == true)
            {
                var          value  = frm.SelectedValue;
                TreeNodeBase parent = value.Parent;
                while (!(parent is EJClient.Forms.InterfaceCenter.Nodes.DLLNode))
                {
                    parent = parent.Parent;
                }
                string filepath = ((EJClient.Forms.InterfaceCenter.Nodes.DLLNode)parent).FilePath;


                EJ.InterfaceInModule data = new EJ.InterfaceInModule()
                {
                    ModuleID = InterfaceItemNode.Module.id,
                    x        = (int)m_RightButtonDownPoint.X,
                    y        = (int)m_RightButtonDownPoint.Y,
                    Type     = typeof(ClassView).FullName,
                };
                UI.ClassView view = new ClassView(value, filepath, data);
                try
                {
                    data.JsonData = view.GetJsonData();
                    data.id       = Helper.Client.InvokeSync <int>("UpdateInterfaceInModule", data);
                    data.ChangedProperties.Clear();

                    view.Margin = new Thickness(m_RightButtonDownPoint.X, m_RightButtonDownPoint.Y, 0, 0);
                    m_Grid.Children.Add(view);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(MainWindow.instance, ex.Message);
                }
            }
        }