Пример #1
0
        /// <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));
        }
Пример #2
0
        private SettingStatus GetOrCreateStatus(AvaloniaProperty property)
        {
            if (!SetRecords.TryGetValue(property, out var status))
            {
                status = new SettingStatus();
                SetRecords.Add(property, status);
            }

            return(status);
        }
Пример #3
0
        public override object Clone()
        {
            SettingStatus clone = new SettingStatus
            {
                OperationStatus = OperationStatus,
                SettingName     = SettingName,
                Value           = Value
            };

            if (Amount != null)
            {
                clone.Amount = (SettingAmount)Amount.Clone();
            }

            return(clone);
        }
Пример #4
0
        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;
        }
Пример #5
0
 internal NotifyDisposable(SettingStatus status)
 {
     this.status      = status;
     status.Notifying = true;
 }