Esempio n. 1
0
 protected FlowCommand(FlowAreaControl areaControl, ArrowControl arrowControl, SourceItemControl src,
                       SourceItemControl dest)
 {
     this.areaControl  = areaControl;
     this.arrowControl = arrowControl;
     this.src          = src;
     this.dest         = dest;
 }
Esempio n. 2
0
 public ScopeJoinManager(FlowAreaControl flowAreaControl, Command.CommandManager commandManager, MoveManager moveManager)
 {
     this.flowAreaControl        = flowAreaControl;
     this.commandManager         = commandManager;
     this.moveManager            = moveManager;
     commandSet                  = new CommandSet();
     moveManager.ControlPressed += moveManager_ControlPressed;
     moveManager.MoveEnd        += moveManager_MoveEnd;
 }
Esempio n. 3
0
 public AddBoundCommentBommand(FlowAreaControl areaControl, SourceControl sourceControl)
     : base(areaControl, sourceControl,
            new BoundCommentControl {
     DataContext = new Model.Comment {
         Text = "Comment"
     }
 })
 {
 }
Esempio n. 4
0
 public CopyData(FlowAreaControl areaControl, Source[] sources, Connection[] connections,
                 Connection[] externalConnections, Comment[] comments)
 {
     AreaControl         = areaControl;
     Sources             = sources;
     Connections         = connections;
     ExternalConnections = externalConnections;
     Comments            = comments;
 }
Esempio n. 5
0
        public void Initialize()
        {
            controls[0].IsMoved = false;
            mouseDownPos        = controls[0].PointToScreen(Mouse.GetPosition(controls[0]));
            moveInfos           = controls.Select(c => new MoveInfo
            {
                OffsetX = c.CurrentPositionable.Position.X,
                OffsetY = c.CurrentPositionable.Position.Y
            }).ToArray();

            areaControl             = Utility.GetParent <FlowAreaControl>(controls[0]);
            areaControl.MouseMove  += areaControl_MouseMove;
            areaControl.MouseUp    += areaControl_MouseUp;
            areaControl.MouseLeave += areaControl_MouseLeave;
            areaControl.KeyDown    += areaControl_KeyDown;
            areaShift = new Point(areaControl.CurrentShiftX, areaControl.CurrentShiftY);
        }
Esempio n. 6
0
 public AddSourceCommand(FlowAreaControl areaControl, SourceControl sourceControl)
 {
     this.areaControl = areaControl;
     SourceControl    = sourceControl;
 }
Esempio n. 7
0
 public RemoveScopeCommand(FlowAreaControl flowAreaControl, ScopeControl scopeControl, ScopeControl parentScopeControl) :
     base(flowAreaControl, scopeControl, parentScopeControl)
 {
 }
Esempio n. 8
0
 public RemoveSelectableFromScopeCommand(FlowAreaControl flowAreaControl, ScopeControl scopeControl, PositionableControl positionableControl)
     : base(flowAreaControl, scopeControl, positionableControl)
 {
 }
Esempio n. 9
0
 public AddCommentCommand(FlowAreaControl areaControl, double posX, double posY)
 {
     this.areaControl = areaControl;
     CommentControl   = areaControl.CreateComment();
     CommentControl.CurrentComment.Position = new Point(posX, posY);
 }
Esempio n. 10
0
 protected EditScopeCommandBase(FlowAreaControl flowAreaControl, ScopeControl scopeControl, PositionableControl positionableControl)
 {
     this.flowAreaControl     = flowAreaControl;
     this.scopeControl        = scopeControl;
     this.positionableControl = positionableControl;
 }
Esempio n. 11
0
        private void FlowDrawPanel_Load(object sender, EventArgs e)
        {
            if (sourceCache == null)
            {
                sourceCache = new Dictionary <string, AssemblyAndTypeAndSource[]>();
                foreach (IGrouping <string, AssemblyAndTypeAndSource> ss in flowSources.Select(a => new AssemblyAndTypeAndSource(a)).GroupBy(a => a.Source.Name).ToArray())
                {
                    var sources = ss.ToArray();
                    Array.Sort(sources, (a1, a2) =>
                    {
                        int count1 = a1.Source.InProperties.Count + a1.Source.InMethods.Count + a1.Source.OutProperties.Count + a1.Source.OutMethods.Count;
                        int count2 = a2.Source.InProperties.Count + a2.Source.InMethods.Count + a2.Source.OutProperties.Count + a2.Source.OutMethods.Count;
                        if (count1 > count2)
                        {
                            return(1);
                        }
                        if (count1 < count2)
                        {
                            return(-1);
                        }

                        if (a1.Source.InProperties.Count > a2.Source.InProperties.Count)
                        {
                            return(1);
                        }
                        if (a1.Source.InProperties.Count < a2.Source.InProperties.Count)
                        {
                            return(-1);
                        }

                        if (a1.Source.OutProperties.Count > a2.Source.OutProperties.Count)
                        {
                            return(1);
                        }
                        if (a1.Source.OutProperties.Count < a2.Source.OutProperties.Count)
                        {
                            return(-1);
                        }

                        if (a1.Source.InMethods.Count > a2.Source.InMethods.Count)
                        {
                            return(1);
                        }
                        if (a1.Source.InMethods.Count < a2.Source.InMethods.Count)
                        {
                            return(-1);
                        }

                        if (a1.Source.OutMethods.Count > a2.Source.OutMethods.Count)
                        {
                            return(1);
                        }
                        if (a1.Source.OutMethods.Count < a2.Source.OutMethods.Count)
                        {
                            return(-1);
                        }

                        int point = 0;
                        foreach (CustomMemberInfo <PropertyInfo> propertyInfo1 in a1.Source.InProperties)
                        {
                            var propertyInfo2 = a2.Source.InProperties.FirstOrDefault(c => c.MemberInfo.Name == propertyInfo1.MemberInfo.Name);
                            if (propertyInfo2 != null && propertyInfo1.MemberInfo.PropertyType != propertyInfo2.MemberInfo.PropertyType)
                            {
                                if (TypeConverterManager.CanConvert(propertyInfo2.MemberInfo.PropertyType, propertyInfo1.MemberInfo.PropertyType))
                                {
                                    point--;
                                }
                                else
                                {
                                    point++;
                                }
                            }
                        }

                        return(point);
                    });
                    sourceCache.Add(ss.Key, sources);
                }
            }

            foreach (KeyValuePair <string, AssemblyAndTypeAndSource[]> group in sourceCache)
            {
                foreach (AssemblyAndTypeAndSource source in group.Value)
                {
                    try
                    {
                        CreateToolStripMenuItem(source);
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
#if DEBUG
                        MessageBox.Show(ex.StackTrace);
#endif
                    }
                }
            }

            areaControl                   = new FlowAreaControl();
            areaControl.DragEnter        += areaControl_DragEnter;
            areaControl.Drop             += areaControl_Drop;
            elementHost1.Child            = areaControl;
            areaControl.SelectionChanged += areaControl_SelectionChanged;
            areaControl.CanConvert       += areaControl_CanConvert;
            areaControl.Modified         += areaControl_Modified;
            areaControl.GetSource        += areaControl_GetSource;

            FinishInitialize();
        }
Esempio n. 12
0
 protected ScopeCommandBase(FlowAreaControl flowAreaControl, ScopeControl scopeControl, ScopeControl parentScopeControl)
 {
     this.flowAreaControl    = flowAreaControl;
     this.scopeControl       = scopeControl;
     this.parentScopeControl = parentScopeControl;
 }
Esempio n. 13
0
 protected BoundCommentCommandBase(FlowAreaControl areaControl, SourceControl sourceControl, BoundCommentControl commentControl)
 {
     this.areaControl    = areaControl;
     this.sourceControl  = sourceControl;
     this.commentControl = commentControl;
 }
Esempio n. 14
0
 public RemoveBoundCommentCommand(FlowAreaControl areaControl, SourceControl sourceControl, BoundCommentControl commentControl) :
     base(areaControl, sourceControl, commentControl)
 {
 }
Esempio n. 15
0
 public RemoveSelectablesCommand(FlowAreaControl flowAreaControl, SelectableControl[] controls)
 {
     this.flowAreaControl = flowAreaControl;
     this.controls        = controls;
 }
Esempio n. 16
0
 public AddSelectableToScopeCommand(FlowAreaControl flowAreaControl, ScopeControl scopeControl,
                                    PositionableControl positionableControl)
     : base(flowAreaControl, scopeControl, positionableControl)
 {
 }
Esempio n. 17
0
 public RemoveFlowCommand(FlowAreaControl areaControl, ArrowControl arrowControl)
     : base(areaControl, arrowControl, arrowControl.SrcItem, arrowControl.DestItem)
 {
 }
Esempio n. 18
0
 public AddFlowCommand(FlowAreaControl areaControl, ArrowControl arrowControl, SourceItemControl src,
                       SourceItemControl dest)
     : base(areaControl, arrowControl, src, dest)
 {
 }