async void Save_Clicked(object sender, EventArgs e)
 {
     Event.IsRepeat     = this.SelectedRepeatType.Equals("No Repeat") ? true : false;
     Event.RepeatTypeId = RepeatTypes.Where(x => x.Name.Equals(this.SelectedRepeatType)).Select(x => x.Id).FirstOrDefault();
     MessagingCenter.Send(this, "AddEvent", Event);
     await Navigation.PopModalAsync();
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Default constructor
 /// </summary>
 /// <param name="automationId"></param>
 /// <param name="repeatType"></param>
 /// <param name="validator"></param>
 /// <param name="countCircuitBreaker"></param>
 public RepeatPreviousAction(Guid automationId, RepeatTypes repeatType, Func <TEntity, bool> validator, int countCircuitBreaker = 100)
     : base(automationId)
 {
     RepeatType          = repeatType;
     RepeatValidator     = validator;
     CountCircuitBreaker = countCircuitBreaker;
 }
Ejemplo n.º 3
0
        public static DateTime Next(this DateTime self, Context context, RepeatTypes type)
        {
            var now   = DateTime.Now.ToLocal(context: context);
            var start = now > self
                ? now
                : self;

            switch (type)
            {
            case RepeatTypes.Daily:
                return(self.NextDaily(start));

            case RepeatTypes.Weekly:
                return(self.NextWeek(start));

            case RepeatTypes.NumberWeekly:
                return(self.NextNumberWeekly(start));

            case RepeatTypes.Monthly:
                return(self.NextMonthly(start));

            case RepeatTypes.EndOfMonth:
                return(self.NextEndOfMonth(start));

            case RepeatTypes.Yearly:
                return(self.NextYearly(start));

            default:
                return(Parameters.General.MaxTime);
            }
        }
Ejemplo n.º 4
0
        protected override void OnNodeInspectorGUI()
        {
            repeatType = (RepeatTypes)UnityEditor.EditorGUILayout.EnumPopup("Repeat Type", repeatType);

            if (repeatType == RepeatTypes.RepeatTimes)
            {
                repeatTimes = (BBInt)EditorUtils.BBVariableField("Repeat Times", repeatTimes);
            }
            else if (repeatType == RepeatTypes.RepeatUntil)
            {
                repeatUntil = (RepeatUntil)UnityEditor.EditorGUILayout.EnumPopup("Repeat Until", repeatUntil);
            }
        }
Ejemplo n.º 5
0
        public override void DrawNodeInspectorGUI()
        {
            base.DrawNodeInspectorGUI();
            this.Type = (RepeatTypes)UnityEditor.EditorGUILayout.EnumPopup("Type", Type);
            switch (this.Type)
            {
            case RepeatTypes.RepeatTimes:
                this.Times = UnityEditor.EditorGUILayout.IntField("Times", this.Times);
                this.Times = this.Times < 1 ? 1 : this.Times;
                break;

            case RepeatTypes.RepeatUntil:
                this.Until = (RepeatUntil)UnityEditor.EditorGUILayout.EnumPopup("Until", this.Until);
                break;
            }
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Create a new AnimationState.
 /// </summary>
 /// <param name="cell_indices"></param>
 /// <param name="wait_times"></param>
 /// <param name="repeat_type"></param>
 public AnimationState(int[] cell_indices, int[] wait_times, RepeatTypes repeat_type)
 {
     // currentIndex always starts at 0.
     currentIndex = 0;
     // If we have more cells than wait times, fill in the remaining wait times
     // with zeros.
     if (cell_indices.Length > wait_times.Length)
     {
         int[] new_cells = new int[cell_indices.Length];
         wait_times.CopyTo(cell_indices, 0);
         cell_indices = new_cells;
     }
     this.cell_indices = cell_indices;
     this.wait_times   = wait_times;
     this.repeat_type  = repeat_type;
     // INTERNAL OPTIMIZATION: Store the number of cells.
     // This is probably a miniscule optimization.
     num_cells = cell_indices.Length;
 }
Ejemplo n.º 7
0
        public void CreateNew(string title, double value, DateTime date, string note, Guid accountId, Guid categoryId, bool isRepeatable = false, DateTime?dateFrom = null, DateTime?dateTo = null, RepeatTypes repeatType = RepeatTypes.Non)
        {
            var transaction = new Transaction()
            {
                Title        = title,
                Value        = value,
                Date         = date,
                Note         = note,
                FK_Account   = accountId,
                FK_Categoty  = categoryId,
                IsRepeatable = isRepeatable
            };

            if (isRepeatable)
            {
                transaction.DateFrom   = dateFrom;
                transaction.DateTo     = dateTo;
                transaction.RepeatType = repeatType.ToString();
            }

            _unitOfWork.Repository <Transaction>().Add(transaction);
            var result = _unitOfWork.SaveChanges();

            if (!result.Item1)
            {
                throw new Exception(result.Item2);
            }
        }
Ejemplo n.º 8
0
 public EventDetailViewModel(Event item = null)
 {
     Title          = item?.Name;
     Item           = item;
     RepeatTypeName = RepeatTypes.Where(x => x.Id == item.RepeatTypeId).Select(x => x.Name).FirstOrDefault();
 }