示例#1
0
    protected override void UpdateAnimator()
    {
        if (GetValue == null)
        {
            throw new Exception("GetValue Function undefined");
        }

        animator.SetInteger(ParamName, GetValue.Invoke(_Obj));
    }
示例#2
0
 private void ChangeValueButton_Click(object sender, RoutedEventArgs e)
 {
     if (ValueDisplayer.Text.Length == 0)
     {
         GetValue?.Invoke(0);
         return;
     }
     GetValue?.Invoke(uint.Parse(ValueDisplayer.Text));
 }
 private static T SetValue <T>(GetValue <T> action, T defaultValue)
 {
     try
     {
         return(action.Invoke());
     }
     catch (Exception)
     {
         return(defaultValue);
     }
 }
 /// <summary>
 /// Raises the GetValue event, if ValueGetterFunc is left null, otherwise it will call ValueGetterFunc instead.
 /// </summary>
 /// <param name="e">A PropertySpecEventArgs that contains the event data.</param>
 protected internal virtual void OnGetValue(PropertySpecificationEventArgs e)
 {
     if (this.ValueGetterFunc == null)
     {
         Trap.trap(GetValue != null);
         GetValue?.Invoke(this, e);
     }
     else
     {
         Trap.trap();
         e.Value = this.ValueGetterFunc(e.Property.Name);
     }
 }
示例#5
0
 private void ChangeValueButton_Click(object sender, RoutedEventArgs e)
 {
     if (IsMailValid())
     {
         GetValue?.Invoke(ValueDisplayer.Text);
     }
     else
     {
         if (MessageBox.Show("Почта введена не корректно!\nЗакрыть поле ввода?", "", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
         {
             GetValue.Invoke("");
         }
     }
 }
        /*
         * protected override bool IsValid(JsonMappingTo item)
         * {
         *  try
         *  {
         *      if (string.IsNullOrEmpty(JsonMappingCompoundTo.IsValidJsonMappingInput(
         *          item.SourceName,
         *          item.DestinationName)))
         *          return true;
         *
         *  }
         *  catch (Exception)
         *  {
         *      return false;
         *  }
         *
         *  return true;
         * }
         * */

        public override IActionableErrorInfo Check()
        {
            var to = GetValue.Invoke();

            ErrorText = JsonMappingCompoundTo.IsValidJsonMappingInput(to.SourceName, to.DestinationName);
            if (string.IsNullOrEmpty(ErrorText))
            {
                return(null);
            }
            return(new ActionableErrorInfo
            {
                ErrorType = ErrorType.Critical,
                Message = ErrorText,
            });
        }
示例#7
0
    protected override void UpdateAnimator()
    {
        if (GetValue == null)
        {
            throw new Exception("GetValue Function undefined");
        }

        if (GetValue.Invoke(_Obj))
        {
            animator.SetTrigger(ParamName);
        }
        else
        {
            animator.ResetTrigger(ParamName);
        }
    }
示例#8
0
        protected override void OnCellValueNeeded(DataGridViewCellValueEventArgs e)
        {
            try
            {
                var propriedade = Columns[e.ColumnIndex].DataPropertyName;

                if (ErroPaginacao)
                {
                    return;
                }
                if (propriedade == ColunaInfo.COLUNA_ALTERACAO)
                {
                    return;
                }
                e.Value = GetValue?.Invoke(e.RowIndex, propriedade);
            }
            catch (Exception)
            {
                ErroPaginacao = true;
                RowCount      = 0;
                ErroPagincaoAction?.Invoke();
            }
        }
示例#9
0
 public int RaiseGetValue() => GetValue?.Invoke() ?? 0;
示例#10
0
 private void NoButton_Click(object sender, RoutedEventArgs e)
 {
     GetValue?.Invoke(false);
 }
示例#11
0
 private void YesButton_Click(object sender, RoutedEventArgs e)
 {
     GetValue?.Invoke(true);
 }