Ejemplo n.º 1
0
        /// <summary>
        /// Stores the initial layout of the node in case the user cancels the resizing.
        /// </summary>
        /// <param name="inputModeContext"></param>
        public void InitializeDrag(IInputModeContext inputModeContext)
        {
            if (reshapeHandler != null)
            {
                // if there is a reshape handler: initialize to
                // ensure proper handling of a parent group node
                reshapeHandler.InitializeReshape(inputModeContext);
            }
            initialLayout.Reshape(GetNodeBasedOrientedRectangle());
            dummyLocation = initialLayout.GetAnchorLocation();
            dummySize     = initialLayout.GetSize();
            initialRect   = node.Layout.ToRectD();

            portHandles.Clear();
            var portContext = new DelegatingContext(inputModeContext);

            foreach (var port in node.Ports)
            {
                var portHandle = new DummyPortLocationModelParameterHandle(port);
                portHandle.InitializeDrag(portContext);
                portHandles.Add(portHandle);
            }
        }