public override List <Shadow> GetSourceTargets() { List <Shadow> list = new List <Shadow>(); List <Connect> connects = GetShapeInputs(); if (connects.Count == 0) { list.Add(this); } else { foreach (Connect c in connects) { Shape sourceShape = c.FromSheet; Shadow sourceShadow = PathMaker.LookupShadowByShape(sourceShape); if (sourceShadow != null) { list.AddRange(sourceShadow.GetSourceTargets()); } else { list.Add(this); } } } return(list); }
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); }
/** * Returns a list of all the nicknames of the input target shapes for * this one. For most shadows, this is the NickName of the shape. For * things like connectors, on and off page refs, etc. this will work * backwards to get to the sources. */ virtual public List <string> GetEnteringFromTargetNames() { List <Connect> connects = GetShapeInputs(); List <string> list = new List <string>(); foreach (Connect connect in connects) { Shape input = connect.FromSheet; Shadow shadow = PathMaker.LookupShadowByShape(input); foreach (Shadow s in shadow.GetSourceTargets()) { list.Add(s.GetGotoName()); } } return(list); }
public override List <Shadow> GetSourceTargets() { List <Shadow> list = new List <Shadow>(); Connect c; c = GetConnect(false); if (c != null) { Shadow connectedToShadow = PathMaker.LookupShadowByShape(c.ToSheet); list.AddRange(connectedToShadow.GetSourceTargets()); } else { list.Add(this); } return(list); }
// this will be an empty list for a connector // it doesn't have any connectors pointing to it internal List <Shadow> GetInputs() { List <Connect> connects = GetShapeInputs(); List <Shadow> list = new List <Shadow>(); foreach (Connect connect in connects) { // The 1D connector is always the To and 2D shapes are always the From Shape fromShape = connect.FromSheet; Shadow shadow = PathMaker.LookupShadowByShape(fromShape); foreach (Shadow s in shadow.GetSourceTargets()) { list.Add(s); } } return(list); }