コード例 #1
0
    /// <summary>
    /// Initializes control due to settings
    /// </summary>
    private void SetupControl(Type enumType)
    {
        chkEnum.Visible = false;
        drpEnum.Visible = false;
        radEnum.Visible = false;

        var ctrl = CurrentSelector;

        ctrl.Visible = true;
        ctrl.Items.Clear();

        // Fill special items
        SpecialItems.FillItems(ctrl.Items);

        // Fill the control with enumeration values
        var excludedValues     = !string.IsNullOrEmpty(ExcludedValues) ? ExcludedValues.Split(';').ToList() : null;
        var selectedCategories = !string.IsNullOrEmpty(SelectedCategories) ? SelectedCategories.Split(';').ToList() : null;

        ControlsHelper.FillListControlWithEnum(ctrl, enumType, null, Sort, UseStringRepresentation, excludedValues, selectedCategories);

        if (!String.IsNullOrEmpty(CssClass))
        {
            ctrl.AddCssClass(CssClass);
        }
    }
コード例 #2
0
        public void RestoreSnapshot(string name)
        {
            int index = Snapshots.IndexOf(name);

            if (index == -1)
            {
                return;
            }
            bool prev = Board.EatExceptions;

            Board.EatExceptions = true;
            try
            {
                Board.LoadExcludedValues(ExcludedValues.ElementAt(index));
                Board.LoadValues(Values.ElementAt(index));
                Board.LoadNotes(Notes.ElementAt(index));
            }
            finally
            {
                Board.EatExceptions = prev;
            }
            if (AutoRemove)
            {
                Values.RemoveAt(index);
                Notes.RemoveAt(index);
                ExcludedValues.RemoveAt(index);
                Snapshots.RemoveAt(index);
            }
        }
コード例 #3
0
 public void TakeSnapshot(string name)
 {
     Values.Add(Board.CopyValues());
     Notes.Add(Board.CopyNotes());
     ExcludedValues.Add(Board.CopyExcludedValues());
     Snapshots.Add(name);
 }
コード例 #4
0
        /// <summary>
        /// Gets the key to determine if a transaction must be included or excluded based on
        /// the value a field.
        /// </summary>
        /// <param name="transaction">The bank transaction.</param>
        /// <returns>
        /// The include key if the transaction must be included in the final list,
        /// or the exclude key if the transaction matches an excluded value and must not be included in the final list.
        /// </returns>
        public bool GetBucketKeyFromFieldValue(BankTransaction transaction)
        {
            if (transaction == null)
            {
                // An empty transaction does not match the excluded criteria because it has no values.
                return(IncludeKey);
            }

            string value = GetFieldValue(transaction).ToLowerInvariant();

            return(!ExcludedValues.Contains(value));
        }
コード例 #5
0
        private void AddExcludedValues(ISet <string> excludedValues)
        {
            if (excludedValues == null)
            {
                throw new ArgumentNullException("excludedValues");
            }

            ExcludedValues.Clear();

            foreach (var merchant in excludedValues)
            {
                ExcludedValues.Add(merchant.ToLowerInvariant());
            }
        }