コード例 #1
0
        public override List <Shadow> GetSourceTargets()
        {
            List <Shadow>  list     = new List <Shadow>();
            List <Connect> connects = GetShapeInputs();

            if (connects.Count == 0)
            {
                // no inbound connectors, find the partner and go from there
                OffPageRefShadow partnerShadow = GetPartnerOffPageRefShadow() as OffPageRefShadow;
                if (partnerShadow != null)
                {
                    List <Connect> partnerConnects = partnerShadow.GetShapeInputs();
                    if (partnerConnects.Count == 0)
                    {
                        if (GetShapeOutputs().Count == 0)
                        {
                            Common.ErrorMessage("No inputs for off-page connector " + shape.Text + " on page " + shape.ContainingPage.Name);
                        }
                        else
                        {
                            Common.ErrorMessage("No inputs for off-page connector " + partnerShadow.shape.Text + " on page " + partnerShadow.shape.ContainingPage.Name);
                        }
                        list.Add(this);
                    }
                    else
                    {
                        list.AddRange(partnerShadow.GetSourceTargets());
                    }
                }
                else
                {
                    list.Add(this);
                }
            }
            else
            {
                foreach (Connect c in connects)
                {
                    // always the from sheet = connector (fromsheet = 1D, tosheet = 2D)
                    Shape  sourceShape  = c.FromSheet;
                    Shadow sourceShadow = PathMaker.LookupShadowByShape(sourceShape);
                    if (sourceShadow != null)
                    {
                        list.AddRange(sourceShadow.GetSourceTargets());
                    }
                    else
                    {
                        list.Add(this);
                    }
                }
            }
            return(list);
        }
コード例 #2
0
        public override Shadow GetDestinationTarget()
        {
            List <Connect> list = GetShapeOutputs();

            System.Diagnostics.Debug.WriteLine("offpage - " + shape.Text + " page - " + shape.ContainingPage.Name);

            if (list.Count == 0 && GetShapeInputs().Count == 0)
            {
                // no in or outbound connectors
                return(this);
            }
            else if (list.Count > 0)
            {
                // find outbound link (should only be one)
                if (list.Count != 1)
                {
                    return(this);
                }

                // the FromSheet is the outgoing connector (always from = 1D, to = 2D)
                Shadow connectedToShadow = PathMaker.LookupShadowByShape(list[0].FromSheet);
                if (connectedToShadow != null)
                {
                    return(connectedToShadow.GetDestinationTarget());
                }
                else
                {
                    return(this);
                }
            }
            else
            {
                OffPageRefShadow partnerShadow = GetPartnerOffPageRefShadow() as OffPageRefShadow;

                if (partnerShadow != null && partnerShadow.GetShapeOutputs().Count > 0)
                {
                    return(partnerShadow.GetDestinationTarget());
                }
                else
                {
                    if (partnerShadow != null && partnerShadow.GetShapeInputs().Count > 0)
                    {
                        Common.ErrorMessage("Off page connector " + shape.Text + " on page " + shape.ContainingPage.Name + " and it's partner both have inputs");
                    }
                    return(this);
                }
            }
        }
コード例 #3
0
        // Creates a shadow from a shape.  Should only be called from PathMaker
        // event handlers when things are loaded, added, etc.
        public static Shadow MakeShapeShadow(Shape shape)
        {
            ShapeTypes shapeType = Common.GetShapeType(shape);
            Shadow shadow = null;

            switch (shapeType) {
                case ShapeTypes.CallSubDialog:
                    shadow = new CallSubDialogShadow(shape);
                    break;
                case ShapeTypes.ChangeLog:
                    shadow = new ChangeLogShadow(shape);
                    break;
                case ShapeTypes.AppDesc:
                    shadow = new AppDescShadow(shape);
                    break;
                case ShapeTypes.PrefixList:
                    shadow = new PrefixListShadow(shape);
                    break;
                case ShapeTypes.Comment:
                    shadow = new IgnoredShadow(shape);
                    break;
                case ShapeTypes.Connector:
                    shadow = new ConnectorShadow(shape);
                    break;
                case ShapeTypes.Data:
                    shadow = new DataShadow(shape);
                    break;
                case ShapeTypes.Decision:
                    shadow = new DecisionShadow(shape);
                    break;
                case ShapeTypes.DocTitle:
                    shadow = new DocTitleShadow(shape);
                    break;
                case ShapeTypes.HangUp:
                    shadow = new HangUpShadow(shape);
                    break;
                case ShapeTypes.Interaction:
                    shadow = new InteractionShadow(shape);
                    break;
                case ShapeTypes.None:
                    break;
                case ShapeTypes.OffPageRef:
                    shadow = new OffPageRefShadow(shape);
                    break;
                case ShapeTypes.OnPageRefIn:
                    shadow = new OnPageRefInShadow(shape);
                    break;
                case ShapeTypes.OnPageRefOut:
                    shadow = new OnPageRefOutShadow(shape);
                    break;
                case ShapeTypes.Page:
                    break;
                case ShapeTypes.Placeholder:
                    shadow = new IgnoredShadow(shape);
                    break;
                case ShapeTypes.Play:
                    shadow = new PlayShadow(shape);
                    break;
                case ShapeTypes.Return:
                    shadow = new ReturnShadow(shape);
                    break;
                case ShapeTypes.Start:
                    shadow = new StartShadow(shape);
                    break;
                case ShapeTypes.SubDialog:
                    shadow = new SubDialogShadow(shape);
                    break;
                case ShapeTypes.Transfer:
                    shadow = new TransferShadow(shape);
                    break;
            }
            return shadow;
        }
コード例 #4
0
        // Creates a shadow from a shape.  Should only be called from PathMaker
        // event handlers when things are loaded, added, etc.
        public static Shadow MakeShapeShadow(Shape shape)
        {
            ShapeTypes shapeType = Common.GetShapeType(shape);
            Shadow     shadow    = null;

            switch (shapeType)
            {
            case ShapeTypes.CallSubDialog:
                shadow = new CallSubDialogShadow(shape);
                break;

            case ShapeTypes.ChangeLog:
                shadow = new ChangeLogShadow(shape);
                break;

            case ShapeTypes.AppDesc:
                shadow = new AppDescShadow(shape);
                break;

            case ShapeTypes.PrefixList:
                shadow = new PrefixListShadow(shape);
                break;

            case ShapeTypes.Comment:
                shadow = new IgnoredShadow(shape);
                break;

            case ShapeTypes.Connector:
                shadow = new ConnectorShadow(shape);
                break;

            case ShapeTypes.Data:
                shadow = new DataShadow(shape);
                break;

            case ShapeTypes.Decision:
                shadow = new DecisionShadow(shape);
                break;

            case ShapeTypes.DocTitle:
                shadow = new DocTitleShadow(shape);
                break;

            case ShapeTypes.HangUp:
                shadow = new HangUpShadow(shape);
                break;

            case ShapeTypes.Interaction:
                shadow = new InteractionShadow(shape);
                break;

            case ShapeTypes.None:
                break;

            case ShapeTypes.OffPageRef:
                shadow = new OffPageRefShadow(shape);
                break;

            case ShapeTypes.OnPageRefIn:
                shadow = new OnPageRefInShadow(shape);
                break;

            case ShapeTypes.OnPageRefOut:
                shadow = new OnPageRefOutShadow(shape);
                break;

            case ShapeTypes.Page:
                break;

            case ShapeTypes.Placeholder:
                shadow = new IgnoredShadow(shape);
                break;

            case ShapeTypes.Play:
                shadow = new PlayShadow(shape);
                break;

            case ShapeTypes.Return:
                shadow = new ReturnShadow(shape);
                break;

            case ShapeTypes.Start:
                shadow = new StartShadow(shape);
                break;

            case ShapeTypes.SubDialog:
                shadow = new SubDialogShadow(shape);
                break;

            case ShapeTypes.Transfer:
                shadow = new TransferShadow(shape);
                break;
            }
            return(shadow);
        }