예제 #1
0
        /// <summary>
        /// Handles the marker events.
        /// </summary>
        /// <param name="context">Parsed event context.</param>
        private void HandleMarkerEvent(NameValueCollection context)
        {
            Shape shape = VisioUtils.GetShape(_application, context);

            if (shape == null)
            {
                return;
            }

            string shapeName = VisioUtils.GetProperty(shape, "User", "Midgard");

            if (shapeName == null)
            {
                // se for um visio desenhado com a versão antiga (sem os layers)
                shapeName = VisioUtils.GetShapeType(shape);
                if (shapeName == null)
                {
                    return;
                }
            }
            string command = context["cmd"];

            if (command == null)
            {
                return;
            }

            /*
             *
             */
            string mode = "live";// GetMode();

            using (XmlForm form = new XmlForm())
            {
                form.LoadDefinition(shapeName, shape);
                form.Design(mode, Application.ActivePage);

                IShapeHandler   shapeHandler = (IShapeHandler)form.Tag;
                DisplaySettings newSettings  = shapeHandler.Execute(command, context, _displaySettings, _forceFormChange);
                if (newSettings != null)
                {
                    _displaySettings = newSettings;
                }
            }
        }
예제 #2
0
        /// <summary>
        /// Handles the shape disconnect event.
        /// </summary>
        /// <param name="connection">Disconnection event.</param>
        private void HandleShapeDisconnect(Connects connection)
        {
            // connection.FromSheet is always the connector shape.
            // connection.ToSheet is always the shape to which the connector was previously connected.

            Shape  connect   = connection.FromSheet;
            string shapeName = VisioUtils.GetProperty(connect, "User", VisioUtils.GetShapeType(Application));

            if (shapeName == null)
            {
                return;
            }

            if (shapeName == "Event" || shapeName == "EventProcess")
            {
                VisioUtils.PaintShape(connection.FromSheet, "2");
            }
        }