/// <summary> /// Mark the property as currently notifying. /// </summary> /// <param name="property">The property to mark as notifying.</param> /// <returns>Returns a disposable that when disposed, marks the property as done notifying.</returns> private NotifyDisposable MarkNotifying(AvaloniaProperty property) { Contract.Requires <InvalidOperationException>(!IsNotifying(property)); SettingStatus status = GetOrCreateStatus(property); return(new NotifyDisposable(status)); }
private SettingStatus GetOrCreateStatus(AvaloniaProperty property) { if (!SetRecords.TryGetValue(property, out var status)) { status = new SettingStatus(); SetRecords.Add(property, status); } return(status); }
public override object Clone() { SettingStatus clone = new SettingStatus { OperationStatus = OperationStatus, SettingName = SettingName, Value = Value }; if (Amount != null) { clone.Amount = (SettingAmount)Amount.Clone(); } return(clone); }
public void SwitchModeSetting(bool switchOn) { SwitchModeNormal(!switchOn); SwitchUIHeader(switchOn); SwitchUISetting(switchOn); SettingStatus status = getActor(SubObjectTag.Setting) .GetComponent <SettingStatus>(); if (switchOn) { status.IsModified = false; } if (!switchOn && status.IsModified) { GetComponent <GameSetting>().SaveXML(); } getActor(SubObjectTag.Setting).GetComponent <SettingStatus>() .SetIsActive(switchOn); getActor(SubObjectTag.Setting).GetComponent <SettingAction>() .enabled = switchOn; }
internal NotifyDisposable(SettingStatus status) { this.status = status; status.Notifying = true; }