Ejemplo n.º 1
0
        partial void AddFloatValue_WPF(Action <CodeGenerateSystem.Base.LinkPinControl> inAction, Action <CodeGenerateSystem.Base.LinkPinControl> outAction, string keyName)
        {
            var param    = CSParam as VectorConstructionParams;
            var numberic = new EditorCommon.FloatNumericTypeEditor()
            {
                HorizontalAlignment = HorizontalAlignment.Stretch,
                VerticalAlignment   = VerticalAlignment.Center,
                Margin   = new System.Windows.Thickness(4, 3, 4, 3),
                MinWidth = 60,
            };

            if (param != null)
            {
                BindingOperations.SetBinding(numberic, EditorCommon.FloatNumericTypeEditor.NumericObjectProperty, new Binding(keyName)
                {
                    Source = this, Mode = BindingMode.TwoWay, UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged
                });
            }
            StackPanel_Value.Children.Add(numberic);

            var inCtrl = new CodeGenerateSystem.Controls.LinkInControl()
            {
                BackBrush           = TryFindResource("Link_ValueBrush") as Brush,
                Margin              = new System.Windows.Thickness(8, 3.5, 4, 3.5),
                HorizontalAlignment = HorizontalAlignment.Left,
                VerticalAlignment   = VerticalAlignment.Center,
                NameString          = keyName,
                Direction           = CodeGenerateSystem.Base.enBezierType.Left,
            };

            StackPanel_In.Children.Add(inCtrl);
            inAction?.Invoke(inCtrl);

            var outCtrl = new CodeGenerateSystem.Controls.LinkOutControl()
            {
                BackBrush           = TryFindResource("Link_ValueBrush") as Brush,
                Margin              = new System.Windows.Thickness(4, 3.5, 8, 3.5),
                HorizontalAlignment = HorizontalAlignment.Right,
                VerticalAlignment   = VerticalAlignment.Center,
                NameString          = keyName,
                Direction           = CodeGenerateSystem.Base.enBezierType.Right,
            };

            StackPanel_Out.Children.Add(outCtrl);
            outAction?.Invoke(outCtrl);
        }
Ejemplo n.º 2
0
        partial void InitConstruction()
        {
            Grid grid = new Grid();

            AddChild(grid);

            mParamEllipse = new CodeGenerateSystem.Controls.LinkInControl()
            {
                Name                = "ParamEllipse",
                Margin              = new System.Windows.Thickness(-15, 0, 0, 0),
                Width               = 10,
                Height              = 10,
                BackBrush           = new SolidColorBrush(System.Windows.Media.Color.FromRgb(243, 146, 243)),
                HorizontalAlignment = HorizontalAlignment.Left,
                Direction           = CodeGenerateSystem.Base.enBezierType.Left,
            };
            grid.Children.Add(mParamEllipse);

            var stackPanel = new StackPanel()
            {
                Orientation = Orientation.Horizontal,
                Name        = "ParamStackPanel",
            };

            grid.Children.Add(stackPanel);

            TextBlock label = new TextBlock()
            {
                Name       = "ParamNameTextBlock",
                Text       = mParamName,
                Foreground = Brushes.White,
                Margin     = new System.Windows.Thickness(2, 3, 2, 3)
            };

            stackPanel.Children.Add(label);

            TextBlock textBlockType = new TextBlock()
            {
                Text       = mParamFlag + (string.IsNullOrEmpty(mParamFlag) ? "" : " ") + mParamType,
                Foreground = new SolidColorBrush(System.Windows.Media.Color.FromRgb(160, 160, 160)),
                Margin     = new System.Windows.Thickness(2)
            };

            stackPanel.Children.Add(textBlockType);
        }
Ejemplo n.º 3
0
        partial void InitConstruction()
        {
            Visibility = Visibility.Visible;
            Grid grid = new Grid();

            AddChild(grid);

            mParamsMethod = new CodeGenerateSystem.Controls.LinkInControl()
            {
                Margin              = new System.Windows.Thickness(0, 0, 0, 0),
                Width               = 10,
                Height              = 10,
                BackBrush           = new SolidColorBrush(System.Windows.Media.Color.FromRgb(130, 130, 216)),
                HorizontalAlignment = HorizontalAlignment.Right,
                Direction           = CodeGenerateSystem.Base.enBezierType.Top,
            };

            grid.Children.Add(mParamsMethod);
        }
Ejemplo n.º 4
0
        //public bool m_bIsElseIf = false;

        partial void InitConstruction()
        {
            var resDic = new ResourceDictionary();

            resDic.Source  = new Uri($"/CodeGenerateSystem;component/Themes/Generic.xaml", UriKind.Relative);
            this.Resources = resDic;

            //m_IsOneInLink = false;
            NodeType = enNodeType.ChildNode;

            Grid grid = new Grid();

            grid.ColumnDefinitions.Add(new ColumnDefinition()
            {
                Width = new GridLength(1.0f, GridUnitType.Auto)
            });
            grid.ColumnDefinitions.Add(new ColumnDefinition()
            {
                Width = new GridLength(1.0f, GridUnitType.Auto)
            });
            grid.ColumnDefinitions.Add(new ColumnDefinition()
            {
                Width = new GridLength(1.0f, GridUnitType.Star)
            });
            AddChild(grid);

            mConditionPin = new CodeGenerateSystem.Controls.LinkInControl()
            {
                Margin     = new System.Windows.Thickness(8, 8, 3, 8),
                NameString = "条件",
                //BackBrush = TryFindResource("Link_BoolBrush") as Brush,//new SolidColorBrush(Color.FromRgb(243, 146, 243)),
                HorizontalAlignment = HorizontalAlignment.Left,
                Direction           = CodeGenerateSystem.Base.enBezierType.Left,
            };
            grid.Children.Add(mConditionPin);
            Grid.SetColumn(mConditionPin, 0);
            //m_conditionEllipse.MouseLeftButtonUp += new MouseButtonEventHandler(Condition_MouseLeftButtonUp);

            var cb = new CheckBox()
            {
                IsChecked         = ConditionDefaultValue,
                Margin            = new System.Windows.Thickness(0, 8, 8, 8),
                VerticalAlignment = VerticalAlignment.Center,
            };

            cb.SetBinding(CheckBox.IsCheckedProperty, new Binding("ConditionDefaultValue")
            {
                Source = this, Mode = BindingMode.TwoWay
            });
            grid.Children.Add(cb);
            Grid.SetColumn(cb, 1);

            mResultMethod = new CodeGenerateSystem.Controls.LinkOutControl()
            {
                Margin     = new Thickness(8),
                NameString = "True",
                //BackBrush = new SolidColorBrush(Color.FromRgb(130, 130, 216)),
                HorizontalAlignment = HorizontalAlignment.Right,
                Direction           = CodeGenerateSystem.Base.enBezierType.Right,
                PinType             = LinkPinControl.enPinType.Exec,
            };
            grid.Children.Add(mResultMethod);
            Grid.SetColumn(mResultMethod, 2);
            //methodEll.MouseLeftButtonDown += new MouseButtonEventHandler(ResultTrue_MouseLeftButtonDown);
        }