internal static XTransferableSupplier FindTransferableSupplier(XModel2 xModel2) { XTransferableSupplier result = null; try { if (xModel2 != null) { XEnumeration xEnumeration = xModel2.getControllers(); while (xEnumeration.hasMoreElements()) { XController xController = (XController)xEnumeration.nextElement().Value; if (xController is XTransferableSupplier) { result = xController as XTransferableSupplier; } } } } catch (Exception ex) { throw; } return(result); }
internal static void Copy(XController controller, Object selection) { XTransferableSupplier xTransferableSupplier = controller as XTransferableSupplier; Debug.GetAllInterfacesOfObject(controller); Copy(controller, selection, xTransferableSupplier); }
private static void Copy(XController controller, Object selection, XTransferableSupplier xTransferableSupplier) { if (xTransferableSupplier != null) { // get selection supplier XSelectionSupplier xSelectionSupplier = controller as XSelectionSupplier; if (xSelectionSupplier != null) { // select the objects to select try { xSelectionSupplier.select(Any.Get(selection)); } catch (Exception ex) { throw new ArgumentException("Object can't be set as selection", "selection", ex); } XTransferable transfarable = xTransferableSupplier.getTransferable(); } } }