Exemplo n.º 1
0
        /// <summary>
        /// Callback from WPF to tell us that one of the dependency properties has been changed.
        /// For the dependency properties that are registered here, this method updates the Elipse from the current values of the known dp objects
        /// </summary>
        protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e)
        {
            if (e.Property == PartBaseStateProperty)
            {
                lastPartBaseState = (IBaseState)e.NewValue;
            }
            else if (e.Property == ActionInfoProperty)
            {
                lastActionInfo = (IActionInfo)e.NewValue;
            }
            else if (e.Property == HighlightColorProperty)
            {
                lastHighlightColor = (Color)e.NewValue;
            }
            else if (e.Property == IncludeConnectionStateProperty)
            {
                lastIncludeConnectionState = (bool)e.NewValue;
            }
            else if (e.Property == BorderBrushProperty)
            {
                lastBorderBrush = (Brush)e.NewValue;
            }

            Update();

            base.OnPropertyChanged(e);
        }
Exemplo n.º 2
0
        public TagActionInfo SetFrom(IActionInfo actionInfo, string tagID, ITagPageContents[] pageArray)
        {
            ActionInfo        = actionInfo ?? Modular.Part.ActionInfo.EmptyActionInfo;
            TagID             = tagID ?? string.Empty;
            PageContentsArray = pageArray ?? emptyPageContentsArray;

            return(this);
        }
Exemplo n.º 3
0
 public async Task Call(
     IActionInfo actionInfo,
     InvocationInfo invocationInfo)
 {
     foreach (var actionInfoTransformer in _transformers)
     {
         await actionInfoTransformer.TransformAsync(actionInfo, invocationInfo);
     }
 }
Exemplo n.º 4
0
        /// <summary>
        /// アクションプロパティの選択アイテムが変更されたとき
        /// </summary>
        private void objectPropertyListView_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (objectPropertyListView.SelectedItems == null || objectPropertyListView.SelectedItems.Count == 0)
            {
                return;
            }

            //アクションプロパティの内容をハンドラにセットする
            Debug.WriteLine("アクションプロパティ選択項目変更: " + objectPropertyListView.SelectedItems[0].Text);
            IActionInfo actionInfo = m_infoTable[objectPropertyListView.SelectedItems[0].Text];

            actionHandlerPropetyGrid.SelectedObject = actionInfo;
            actionHandlerComboBox.SelectedItem      = actionInfo.GetHandlerName();
        }
Exemplo n.º 5
0
            public Task TransformAsync(
                IActionInfo actionInfo,
                InvocationInfo invocationInfo)
            {
                var bindedObject = invocationInfo.Arguments.FirstOrDefault(x => x is TestController.CountryCodeBinded);

                if (bindedObject == null)
                {
                    return(Task.CompletedTask);
                }

                actionInfo.RouteParams["countryCode"] = ((TestController.CountryCodeBinded)bindedObject).CountryCode;
                return(Task.CompletedTask);
            }
Exemplo n.º 6
0
 /// <summary>
 /// コンストラクタ
 /// </summary>
 /// <param name="name"></param>
 public ActionProperty(string name)
 {
     m_name    = name;
     m_handler = new NullActionInfo();
 }
 /// <summary>
 ///     Adds header to invocation.
 /// </summary>
 /// <param name="actionInfo"></param>
 /// <param name="invocationInfo"></param>
 public async Task TransformAsync(
     IActionInfo actionInfo,
     InvocationInfo invocationInfo)
 {
     actionInfo.Headers.Add(_key, _value);
 }
Exemplo n.º 8
0
        private static ElementLink ConnectSourceToTarget(ModelElement source, ModelElement target)
        {
            if (source is VDEventBase && target is VDActionBase)
            {
                VDEventBase  evt = source as VDEventBase;
                VDActionBase act = target as VDActionBase;
                evt.TargetComponents.Add(act);
                return(R_Event2Component.GetLink(evt, act));
            }
            else if (source is VDActionJoint && target is VDViewComponent)
            {
                VDActionJoint   joint = source as VDActionJoint;
                VDViewComponent tgt   = target as VDViewComponent;
                joint.TargetComponents.Add(tgt);
                return(R_ActionJoint2Component.GetLink(joint, tgt));
            }
            else if (source is VDViewComponent && target is VDActionBase)
            {
                VDViewComponent        srcComponent = source as VDViewComponent;
                VDActionBase           targetAction = target as VDActionBase;
                Component2ActionDialog dlg          = new Component2ActionDialog();
                dlg.SetComponentAndAction(srcComponent, targetAction);
                dlg.ShowDialog();

                if (dlg.DialogResult == System.Windows.Forms.DialogResult.OK)
                {
                    IEventInfo  evtInfo  = dlg.SelectedEvent;
                    VDEventBase newEvent = evtInfo.CreateEvent(srcComponent);
                    newEvent.Widget = srcComponent;
                    newEvent.TargetComponents.Add(targetAction);
                    return(R_Event2Component.GetLink(newEvent, targetAction));
                }
            }
            else if (source is VDEventBase && target is VDViewComponent) // create new action
            {
                VDEventBase               sourceEvent     = source as VDEventBase;
                VDViewComponent           targetComponent = target as VDViewComponent;
                Component2ComponentDialog dlg             = new Component2ComponentDialog(false);
                dlg.NewAction.SetSourceEvent(sourceEvent).SetTarget(targetComponent);
                dlg.ShowDialog();

                if (dlg.DialogResult == System.Windows.Forms.DialogResult.OK)
                {
                    IActionInfo  actInfo = dlg.NewAction.SelectedAction;
                    VDActionBase newAct  = actInfo.CreateAction(sourceEvent.Partition);
                    VDWidget.GetCommonParent(sourceEvent.Widget, targetComponent).Children.Add(newAct);
                    //sourceEvent.Widget.Parent.Children.Add(newAct);
                    sourceEvent.TargetComponents.Add(newAct);

                    IActionJointInfo jointInfo = dlg.NewAction.SelectedJoint;
                    VDActionJoint    newJoint  = jointInfo.CreateActionJoint(newAct, targetComponent);
                    newJoint.Widget = newAct;
                    newJoint.TargetComponents.Add(targetComponent);
                    return(R_ActionJoint2Component.GetLink(newJoint, targetComponent));
                }
            }
            else if (source is VDViewComponent && target is VDViewComponent) // create new action or target
            {
                VDViewComponent           srcComponent = source as VDViewComponent;
                VDViewComponent           tgtComponent = target as VDViewComponent;
                Component2ComponentDialog dlg          = new Component2ComponentDialog();
                dlg.NewAction.SetSource(srcComponent).SetTarget(tgtComponent);
                dlg.NewTarget.SetSource(srcComponent).SetTarget(tgtComponent);
                dlg.ShowDialog();

                if (dlg.DialogResult == System.Windows.Forms.DialogResult.OK)
                {
                    if (dlg.IfCreateNewAction)
                    {
                        IEventInfo  evtInfo  = dlg.NewAction.SelectedEvent;
                        VDEventBase newEvent = evtInfo.CreateEvent(srcComponent);
                        newEvent.Widget = srcComponent;

                        IActionInfo  actInfo = dlg.NewAction.SelectedAction;
                        VDActionBase newAct  = actInfo.CreateAction(srcComponent.Partition);
                        VDWidget.GetCommonParent(srcComponent, tgtComponent).Children.Add(newAct);
                        //srcComponent.Parent.Children.Add(newAct);
                        newEvent.TargetComponents.Add(newAct);

                        IActionJointInfo jointInfo = dlg.NewAction.SelectedJoint;
                        VDActionJoint    newJoint  = jointInfo.CreateActionJoint(newAct, tgtComponent);
                        newJoint.Widget = newAct;
                        newJoint.TargetComponents.Add(tgtComponent);
                        return(R_ActionJoint2Component.GetLink(newJoint, tgtComponent));
                    }
                    else
                    {
                        IActionJointInfo jointInfo = dlg.NewTarget.SelectedJoint;
                        VDActionJoint    joint     = jointInfo.CreateActionJoint(srcComponent, tgtComponent);
                        joint.Widget = srcComponent;
                        joint.TargetComponents.Add(tgtComponent);
                        return(R_ActionJoint2Component.GetLink(joint, tgtComponent));
                    }
                }
            }

            return(null);
        }