Inheritance: ICustomAction, IHasCheckerAction
コード例 #1
0
ファイル: IfView.xaml.cs プロジェクト: noant/Pyrite
 public IfView(IfAction ifAction)
 {
     if (ifAction == null)
         return;
     var context = new IfViewContext(ifAction);
     this.DataContext = context;
     InitializeComponent();
     var ifControl = new ComplexActionView(context.If) { RootControlsVisibility = Visibility.Collapsed };
     ifControl.Changed += (o, e) => RaiseChanged();
     this.gridIfHolder.Children.Add(ifControl);
     var elseControl = new ComplexActionView(context.Else) { RootControlsVisibility = Visibility.Collapsed };
     elseControl.Changed += (o, e) => RaiseChanged();
     this.gridElseHolder.Children.Add(elseControl);
     var checkerControl = new ComplexCheckerView(new OperatorCheckerPair() { Checker = context.Checker }) { RootControlsVisibility = Visibility.Collapsed };
     checkerControl.Changed += (o, e) => RaiseChanged();
     this.gridCheckerHolder.Children.Add(checkerControl);
     this.btRemove.Click += (o, e) =>
     {
         if (Utils.IsUserSureToDeleteCurrentOperator())
             if (Remove != null)
             {
                 Remove(this, new EventArgs());
                 RaiseChanged();
             }
     };
 }
コード例 #2
0
ファイル: IfViewContext.cs プロジェクト: noant/Pyrite
 public void ProcessIfAction()
 {
     if (_ifAction == null)
         _ifAction = new IfAction();
     if (_ifAction.ActionIf == null)
         _ifAction.ActionIf = new ComplexAction();
     if (_ifAction.ActionElse == null)
         _ifAction.ActionElse = new ComplexAction();
     if (_ifAction.Checker == null)
         _ifAction.Checker = new ComplexChecker();
 }
コード例 #3
0
ファイル: IfViewContext.cs プロジェクト: noant/Pyrite
 public IfViewContext(IfAction ifAction)
 {
     _ifAction = ifAction;
     ProcessIfAction();
 }
コード例 #4
0
 private void AddIfControl(IfAction action)
 {
     var view = new IfView(action);
     view.Remove += (o, e) =>
     {
         ((ComplexActionViewContext)this.DataContext).RemoveAction(action);
         this.spActions.Children.Remove(view);
     };
     view.Changed += (o, e) => RaiseChanged();
     spActions.Children.Add(view);
     RaiseChanged();
 }