Exemplo n.º 1
0
        public override void OnConnectDeleteOutput(Shadow shadow)
        {
            base.OnConnectDeleteOutput(shadow);
            Table table = GetTransitions();

            for (int r = 0; r < table.GetNumRows(); r++)
            {
                string data = table.GetData(r, (int)TableColumns.Transitions.Goto);
                string uid  = shadow.GetUniqueId();

                if (data.Equals(uid))
                {
                    // cleanup the connector label
                    ConnectorShadow connectorShadow = PathMaker.LookupShadowByUID(uid) as ConnectorShadow;
                    if (connectorShadow != null)
                    {
                        connectorShadow.SetLabelName(String.Empty);
                    }

                    table.DeleteRow(r);
                    SetTransitionsWithoutRemovingOutputsForDeletedTransitions(table);
                    // only one per link possible
                    return;
                }
            }
        }
Exemplo n.º 2
0
        /**
         * Because SetTransitions calls RemoveOutputsForDeletedTransitions, it can result in
         * a shape delete.  When it's being called because of a connector delete, we can end
         * up with an error because we try to delete the same shape twice.  This avoids that.
         **/
        private void SetTransitionsWithoutRemovingOutputsForDeletedTransitions(Table table)
        {
            List <Connect> connects = GetShapeOutputs();

            for (int r = 0; r < table.GetNumRows(); r++)
            {
                string          uid    = table.GetData(r, (int)TableColumns.Transitions.Goto);
                ConnectorShadow shadow = PathMaker.LookupShadowByUID(uid) as ConnectorShadow;
                if (shadow != null)
                {
                    shadow.SetLabelName(table.GetData(r, (int)TableColumns.Transitions.Condition));
                }
            }

            Common.SetCellTable(shape, ShapeProperties.Transitions, table);
        }
Exemplo n.º 3
0
        public override void OnBeforeShapeDelete()
        {
            base.OnBeforeShapeDelete();
            List <Connect> connects = GetShapeOutputs();

            Table table = GetTransitions();

            for (int r = 0; r < table.GetNumRows(); r++)
            {
                string          uid    = table.GetData(r, (int)TableColumns.Transitions.Goto);
                ConnectorShadow shadow = PathMaker.LookupShadowByUID(uid) as ConnectorShadow;
                if (shadow != null)
                {
                    shadow.SetLabelName(string.Empty);
                }
            }
        }