BudgetAnalyser.Engine.Widgets.SaveWidget.Update C# (CSharp) Method

Update() public method

Updates the widget with new input.
public Update ( ) : void
return void
        public override void Update(params object[] input)
        {
            Enabled = false;
            Clickable = false;
            if (input == null)
            {
                throw new ArgumentNullException(nameof(input));
            }

            if (!ValidateUpdateInput(input))
            {
                return;
            }

            var appDbService = (IApplicationDatabaseService) input[0];
            if (appDbService == null) return;

            Enabled = appDbService.HasUnsavedChanges;
            Clickable = Enabled;
            DetailedText = Enabled ? "Save" : "No changes";
        }
    }