protected override Pen GetPen()
        {
            var businessObject = graphSource.GetBusinessObject(Edge);

            if (businessObject is MethodCallData)
            {
                // return gray pen for method call edges
                return(Pens.DimGray);
            }
            if (businessObject is EventRegistrationData)
            {
                // return red pen for event edges
                return(Pens.DarkRed);
            }
            return(base.GetPen());
        }
Ejemplo n.º 2
0
        public AddConnectionDialog(AdjacentEdgesGraphSource graphSource, CreationMode mode)
        {
            InitializeComponent();

            this.mode = mode;
            ApplyMode();

            dataItems = new List <EntityData>();
            // fill data items list with all the nodes available in the graph
            foreach (var node in graphSource.Graph.Nodes)
            {
                EntityData data = graphSource.GetBusinessObject(node) as EntityData;
                if (data != null)
                {
                    dataItems.Add(data);
                }
            }
            targetCombobox.SelectionChanged += TargetComboboxOnSelectionChanged;
            targetCombobox.ItemsSource       = dataItems;
            targetCombobox.SelectedIndex     = 0;
        }
 /// <summary>
 /// Returns the business data object from the current item, or <see langword="null"/> if no current item is set
 /// </summary>
 private EntityData GetCurrentItemData()
 {
     return(graphControl.CurrentItem != null?graphSource.GetBusinessObject(graphControl.CurrentItem) as EntityData : null);
 }