コード例 #1
0
 internal EditedValues(EditedValues cloneFrom = null)
 {
     if (cloneFrom == null)
     {
         return; //leave everyting to default
     }
     this.TransactionReason = cloneFrom.TransactionReason;
     this.TransactionDate   = cloneFrom.TransactionDate;
     this.Amount            = cloneFrom.Amount;
     this.EntityName        = cloneFrom.EntityName;
     this.IsFlagged         = cloneFrom.IsFlagged;
     this.Note         = cloneFrom.Note;
     this.CategoryPath = cloneFrom.CategoryPath;
 }
コード例 #2
0
            internal void Merge(EditedValues other)
            {
                // There are 3 possibilities for user intent:
                // 1. Apply my new value to existing edit.
                // 2. Leave current edited value alone.
                // 3. Remove any existing edited value and restore to original.
                //
                // #1 is covered when EditValue is not null and IsVoided is false.
                // #2 is covered when EditValue object is null.
                // #3 is covered when EditValue is not null and IsVoided is true.

                if (other.TransactionReason != null)
                {
                    this.TransactionReason = other.TransactionReason.IsVoided ? null : other.TransactionReason;
                }

                if (other.TransactionDate != null)
                {
                    this.TransactionDate = other.TransactionDate.IsVoided ? null : other.TransactionDate;
                }

                if (other.Amount != null)
                {
                    this.Amount = other.Amount.IsVoided ? null : other.Amount;
                }

                if (other.EntityName != null)
                {
                    this.EntityName = other.EntityName.IsVoided ? null : other.EntityName;
                }

                if (other.IsFlagged != null)
                {
                    this.IsFlagged = other.IsFlagged.IsVoided ? null : other.IsFlagged;
                }

                if (other.Note != null)
                {
                    this.Note = other.Note.IsVoided ? null : other.Note;
                }

                if (other.CategoryPath != null)
                {
                    this.CategoryPath = other.CategoryPath.IsVoided ? null : other.CategoryPath;
                }
            }
コード例 #3
0
        public PartController(string name, GameObject part, InputField inputField, Slider slider, Button button, Bone bone, EditedValues editedValue, float minValue, float maxValue)
        {
            _minValue = minValue;
            _maxValue = maxValue;

            if (_maxValue <= _minValue)
            {
                throw new ArgumentException("minValue has to larger than maxValue.");
            }

            Name        = name;            Bone = bone;
            Part        = part;
            InputField  = inputField;
            Slider      = slider;
            Button      = button;
            EditedValue = editedValue;

            AddListeners();

            UpdateGUI();
        }
コード例 #4
0
 internal TransactionEdit(IEnumerable <ScopeFilter> scopeFilters, string sourceId, EditedValues editValues = null)
 {
     this.AuditInfo    = new AuditInfo();
     this.ScopeFilters = scopeFilters.ToArray();
     this.SourceId     = sourceId;
     this.Values       = new EditedValues(editValues);
     this.Id           = Guid.NewGuid().ToBase64String();
 }