Пример #1
0
        /// <summary>A node has been dragged over another node. Allow drop?</summary>
        /// <param name="sender">Sending node</param>
        /// <param name="e">Node arguments</param>
        public void OnAllowDrop(object sender, AllowDropArgs e)
        {
            e.Allow = false;

            Model parentModel = Apsim.Get(this.ApsimXFile, e.NodePath) as Model;

            if (parentModel != null)
            {
                DragObject dragObject = e.DragObject as DragObject;
                e.Allow = Apsim.IsChildAllowable(parentModel, dragObject.ModelType);
            }
        }