public static bool SetLayoutData(object avmObj, IMgaObject cyphyObj) { if (cyphyObj is IMgaFCO) { var cyphyFCO = cyphyObj as IMgaFCO; if (cyphyFCO.ParentModel == null) { return(false); } var objWrapper = new LayoutDataWrapper(avmObj); if (objWrapper.hasLayoutData) { // Look for all aspects, and set our layout data. foreach (IMgaPart part in cyphyFCO.Parts) { part.SetGmeAttrs(null, System.Convert.ToInt32(objWrapper.xpos), System.Convert.ToInt32(objWrapper.ypos)); } return(true); } } return(false); }
private static void SetLayoutData(object avmObj, IMgaObject cyphyObj) { if (cyphyObj is IMgaFCO) { var cyphyFCO = cyphyObj as IMgaFCO; var objWrapper = new LayoutDataWrapper(avmObj); // Look for layout data associated with the All aspect. // If we find that aspect, set all the values. // Otherwise, we expect that avmObj's positional values will remain unset. Boolean hasAllAspect = false; foreach (IMgaPart part in cyphyFCO.Parts) { if (part.MetaAspect.Name == "All") { hasAllAspect = true; break; } } foreach (IMgaPart part in cyphyFCO.Parts) { if (part.MetaAspect.Name == "All" || hasAllAspect == false) { String icon; int xpos = 0; int ypos = 0; part.GetGmeAttrs(out icon, out xpos, out ypos); if (xpos >= 0 && ypos >= 0) { objWrapper.xpos = System.Convert.ToUInt32(xpos); objWrapper.ypos = System.Convert.ToUInt32(ypos); } // We got what we came for. Terminate the loop. break; } } } }
public static bool SetLayoutData(object avmObj, IMgaObject cyphyObj) { if (cyphyObj is IMgaFCO) { var cyphyFCO = cyphyObj as IMgaFCO; if (cyphyFCO.ParentModel == null) { return false; } var objWrapper = new LayoutDataWrapper(avmObj); if (objWrapper.hasLayoutData) { // Look for all aspects, and set our layout data. foreach (IMgaPart part in cyphyFCO.Parts) { part.SetGmeAttrs(null, System.Convert.ToInt32(objWrapper.xpos), System.Convert.ToInt32(objWrapper.ypos)); } return true; } } return false; }