Exemplo n.º 1
0
        /// <summary>
        /// Creates a new instance of the ScriptableEdgeEventArgs based
        /// on the event arguments provided
        /// </summary>
        /// <param name="originalArgs">The original event arguments</param>
        /// <returns>a configured ScriptableEdgeEventArgs instance</returns>
        public static ScriptableEdgeEventArgs Create(EdgeViewModelEventArgs originalArgs)
        {
            ScriptableEdgeEventArgs args = new ScriptableEdgeEventArgs();

            args.SourceId = originalArgs.EdgeViewModel.ParentEdge.Source.ID;
            args.TargetId = originalArgs.EdgeViewModel.ParentEdge.Target.ID;
            args.Visible  = !originalArgs.EdgeViewModel.IsHidden;

            // Determine if the edge is a data egde
            if (originalArgs.EdgeViewModel.ParentEdge is Model.DataEdge)
            {
                args.Attributes = (originalArgs.EdgeViewModel.ParentEdge as Model.DataEdge).Attributes.ToJSON();
            }
            else
            {
                args.Attributes = string.Empty;
            }

            return(args);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Creates a new instance of the ScriptableEdgeEventArgs based
        /// on the event arguments provided
        /// </summary>
        /// <param name="originalArgs">The original event arguments</param>
        /// <returns>a configured ScriptableEdgeEventArgs instance</returns>
        public static ScriptableEdgeEventArgs Create(EdgeViewModelEventArgs originalArgs)
        {
            ScriptableEdgeEventArgs args = new ScriptableEdgeEventArgs();

            args.SourceId = originalArgs.EdgeViewModel.ParentEdge.Source.ID;
            args.TargetId = originalArgs.EdgeViewModel.ParentEdge.Target.ID;
            args.Visible = !originalArgs.EdgeViewModel.IsHidden;

            // Determine if the edge is a data egde
            if (originalArgs.EdgeViewModel.ParentEdge is Model.DataEdge)
                args.Attributes = (originalArgs.EdgeViewModel.ParentEdge as Model.DataEdge).Attributes.ToJSON();
            else
                args.Attributes = string.Empty;

            return args;
        }
Exemplo n.º 3
0
 /// <summary>
 /// Raises the EdgeViewModelRemoved event
 /// </summary>
 /// <param name="e">The event arguments</param>
 protected virtual void OnEdgeViewModelRemoved(EdgeViewModelEventArgs args)
 {
     this.eventAggregator.GetEvent <EdgeViewModelRemovedEvent>().Publish(args);
 }
Exemplo n.º 4
0
 /// <summary>
 /// Handles the EdgeViewModelAdded event
 /// </summary>
 /// <param name="args">The arguments for the event</param>
 public void EdgeViewModelAddedEventHandler(EdgeViewModelEventArgs args)
 {
     AddEdgeView(args.EdgeViewModel);
 }
Exemplo n.º 5
0
 /// <summary>
 /// Handles the EdgeViewModelRemoved event
 /// </summary>
 /// <param name="args">The arguments for the event</param>
 public void EdgeViewModelRemovedEventHandler(EdgeViewModelEventArgs args)
 {
     RemoveEdgeView(args.EdgeViewModel);
 }