Example #1
0
        public VersionUpdater(VersionUpdateRule majorVersionUpdateRule, VersionUpdateRule minorVersionUpdateRule, VersionUpdateRule buildNumberUpdateRule, VersionUpdateRule revisionUpdateRule)
        {
            MajorVersionUpdateRule = majorVersionUpdateRule ?? throw new ArgumentNullException(nameof(majorVersionUpdateRule));
            MinorVersionUpdateRule = minorVersionUpdateRule ?? throw new ArgumentNullException(nameof(minorVersionUpdateRule));
            BuildNumberUpdateRule  = buildNumberUpdateRule ?? throw new ArgumentNullException(nameof(buildNumberUpdateRule));
            RevisionUpdateRule     = revisionUpdateRule ?? throw new ArgumentNullException(nameof(revisionUpdateRule));

            MajorVersionUpdateRule.PropertyChanged += (sender, e) => OnRuleChanged((VersionUpdateRule)sender);
            MinorVersionUpdateRule.PropertyChanged += (sender, e) => OnRuleChanged((VersionUpdateRule)sender);
            BuildNumberUpdateRule.PropertyChanged  += (sender, e) => OnRuleChanged((VersionUpdateRule)sender);
            RevisionUpdateRule.PropertyChanged     += (sender, e) => OnRuleChanged((VersionUpdateRule)sender);
        }
Example #2
0
 protected virtual void OnRuleChanged(VersionUpdateRule rule) => RuleChanged?.Invoke(rule);