コード例 #1
0
 public void Save()
 {
     foreach (Action SaveAction in SaveActions)
     {
         SaveAction?.Invoke();
     }
 }
コード例 #2
0
 public MessagingContext()
 {
     SaveCommand = new DelegateCommand(() =>
     {
         SaveAction?.Invoke();
     });
 }
コード例 #3
0
 public EmailContext()
 {
     SaveCommand = new DelegateCommand(() =>
     {
         SaveAction?.Invoke();
     });
 }
コード例 #4
0
 public UserContext()
 {
     GenderList  = new ObservableCollection <string>();
     CountryList = new ObservableCollection <string>();
     SaveCommand = new DelegateCommand(() =>
     {
         SaveAction?.Invoke();
     });
 }
コード例 #5
0
 void SaveToolBarItem_Clicked(object sender, EventArgs e)
 {
     if (string.IsNullOrWhiteSpace(_ProductSelectionEntry.Text))
     {
         OrderItemNotSelectedAction.Invoke();
     }
     else
     {
         SaveAction.Invoke();
     }
 }
コード例 #6
0
        public async Task SaveAsync()
        {
            SaveAction?.Invoke();

            // TODO: alternative solution?
            try
            {
                await TryCloseAsync(true);
            }
            catch (Exception)
            {
                await TryCloseAsync();
            }
        }
コード例 #7
0
ファイル: FileSave.cs プロジェクト: akatheater/Somagic
        public void WriteToFile <T>(string filePath, T toSave)
        {
            SaveAction <T> saveAction = null;

            switch (fileFormat)
            {
            case FileFormat.Binary:
                saveAction = WriteBinary;
                break;

            case FileFormat.Xml:
                saveAction = WriteXml;
                break;

            case FileFormat.Json:
                saveAction = WriteJson;
                break;
            }
            saveAction.Invoke(filePath, toSave);
        }
コード例 #8
0
ファイル: EasySave.cs プロジェクト: akatheater/Somagic
        public static void Save <T>(string key, T value)
        {
            SaveAction saveAction = null;

            #region COMMON TYPES
            if (value is int)
            {
                saveAction = SetInt;
            }
            else if (value is float)
            {
                saveAction = SetFloat;
            }
            else if (value is string)
            {
                saveAction = SetString;
            }

            else if (value is bool)
            {
                saveAction = SetBool;
            }
            else if (value is double)
            {
                saveAction = SetDouble;
            }
            else if (value is long)
            {
                saveAction = SetLong;
            }
            else if (value is byte)
            {
                saveAction = SetByte;
            }
            else if (value is short)
            {
                saveAction = SetShort;
            }
            else if (value is char)
            {
                saveAction = SetChar;
            }
            else if (value is DateTime)
            {
                saveAction = SetDateTime;
            }
            #endregion

            #region UNSIGNED TYPES
            else if (value is uint)
            {
                saveAction = SetUnsignedInt;
            }
            else if (value is ulong)
            {
                saveAction = SetUnsignedLong;
            }
            else if (value is ushort)
            {
                saveAction = SetUnsignedShort;
            }
            #endregion

            #region OBJECT
            else
            {
                saveAction = SetObject <T>;
            }
            #endregion

            saveAction.Invoke(key, value);
        }
コード例 #9
0
 private void button1_Click(object sender, EventArgs e)
 {
     SaveAction?.Invoke();
 }
コード例 #10
0
 private void saveMenuItem_Click(object sender, EventArgs e)
 {
     SaveAction?.Invoke();
 }
コード例 #11
0
 public WeatherContext()
 {
     SaveCommand = new DelegateCommand(() => { SaveAction?.Invoke(); });
 }
コード例 #12
0
        private void Btn_save_match_Click(object sender, EventArgs e)
        {
            var artworks = GetArtworks();

            SaveAction?.Invoke(artworks);
        }