public void Save <T>(IList <T> persons, SaveDelegate <T> save) { foreach (T person in persons) { Console.WriteLine(save(person)); } }
public ArticuloView(object id) : base(WindowType.Toplevel) { articulo=ArticuloPersister.Load(id); init(); save=ArticuloPersister.Update; }
public ArticuloView(object id) : base(WindowType.Toplevel) { this.id = id; load(); init(); save = update; }
public CategoriaView(object id) : base(Gtk.WindowType.Toplevel) { this.id = id; load(); init(); save = update; }
/// <summary> /// Initializes a new instance of the <see cref="InnerPlugin{T}" /> class. /// </summary> /// <param name="openDelegate">Open method delegate.</param> /// <param name="saveDelegate">Save method delegate.</param> public InnerPlugin(OpenDelegate <string, T> openDelegate, SaveDelegate <string, T> saveDelegate) { this._openDelegate = openDelegate; this._saveDelegate = saveDelegate; this.ConfigObjectType = typeof(T); }
public ArticuloView() : base(Gtk.WindowType.Toplevel) { articulo = new Articulo (); init (); save=ArticuloPersister.Insert; }
// public static void SaveSum(uint siteNum, uint sensorNum, double dataSum,DateTime time) // { // MySqlConnection connection = new MySqlConnection(); // connection.ConnectionString = connString; // connection.Open(); // MySqlCommand cmd = connection.CreateCommand(); // cmd.CommandText = @"INSERT INTO datas_day (num_site,num_sensor,data_sum,data_avg,data_count,time_create,time_update) // VALUES('?site','?sensor','?_data_sum','?_data_avg','?_data_count','?curr_day','?curr');"; // cmd.Parameters.Add("?site", MySqlDbType.Int32).Value = siteNum; // cmd.Parameters.Add("?sensor", MySqlDbType.Int32).Value = sensorNum; // cmd.Parameters.Add("?_data_sum", MySqlDbType.Double).Value = dataSum; // cmd.Parameters.Add("?_data_avg", MySqlDbType.Double).Value = dataSum; // cmd.Parameters.Add("?_data_count", MySqlDbType.Double).Value = 1; // cmd.Parameters.Add("?curr_day", MySqlDbType.Double).Value = time; // cmd.Parameters.Add("?curr", MySqlDbType.DateTime).Value = time; // } public static void SaveAsync(uint siteNum, uint sensorNum, double dataOrigion, double data, double dataSum, double weight, DateTime time) { SaveDelegate sd = new SaveDelegate(Save); //sd.BeginInvoke(siteNum, sensorNum, data, weight,time, null, sd); sd.Invoke(siteNum, sensorNum, dataOrigion, data, dataSum, weight, time); }
public ArticuloView(object id) : base(WindowType.Toplevel) { this.id = id; load(); init (); save = update; }
/// <summary> /// Add configuration editor plugin. /// </summary> /// <typeparam name="T">Type of configuration object.</typeparam> /// <param name="openDelegate">How to get configuration object from a file.</param> /// <param name="saveDelegate">How to save configuration object to a file.</param> /// <param name="configEditorPluginName">IWinFormConfigEditorPlugin PluginName.</param> public void AddPlugin <T>(OpenDelegate <string, T> openDelegate, SaveDelegate <string, T> saveDelegate, string configEditorPluginName = null) { IWinFormConfigEditorPlugin configEditorPlugin = new InnerPlugin <T>(openDelegate, saveDelegate); configEditorPlugin.PluginName = configEditorPluginName; this._configEditorPluginList.Add(configEditorPlugin); this.toolStripComboBoxConfigEditorPlugin.Items.Add(configEditorPlugin.PluginName); this.toolStripComboBoxConfigEditorPlugin.SelectedIndex = this._configEditorPluginList.IndexOf(configEditorPlugin); }
public static void Mainw() { Subject sub = new Subject(); SaveDelegate savedelegate = sub.SaveCourse; savedelegate += Student.SaveStudent; savedelegate(); Console.WriteLine("==============="); savedelegate -= Student.SaveStudent; savedelegate(); }
public static void Mainyt() { Subjects sub = new Subjects(); SaveDelegate <int> savedelegate = sub.SaveCourse; savedelegate += Students.SaveStudent; var data = new Data { Title = "Testing data" }; savedelegate(data); Console.WriteLine("==============="); savedelegate -= Students.SaveStudent; savedelegate(data); }
public FileEditor(string title, string content, SaveDelegate save = null) { InitializeComponent(); try { this.Text = title; txtContent.Text = content; btnSave.Visible = save != null; Save = save; InitEvent(); } catch (Exception ex) { Logger.WriteEx2LogFile(ex); } }
public RenameDialog(string name, SaveDelegate save) { Save = save; InitializeComponent(); try { txtName.Text = name; btnSave.Click += btnSave_Click; btnCancel.Click += btnCancel_Click; txtName.KeyDown += RenameDialog_KeyDown; } catch (Exception ex) { Logger.WriteEx2LogFile(ex); } }
public ArticuloView() : base(Gtk.WindowType.Toplevel) { init (); save = insert; }
public CategoriaView() : base(Gtk.WindowType.Toplevel) { init(); save = insert; }
/// <summary> /// Invoke all registered Save methods. /// </summary> public void SaveAll(bool suppressException = true) { SaveDelegate?.Invoke(suppressException); }
public ArticuloView() : base(Gtk.WindowType.Toplevel) { articulo = new Articulo(); init(); save = ArticuloPersister.Insert; }
public ArticuloView(object id) : base(WindowType.Toplevel) { articulo = ArticuloPersister.Load(id); init(); save = ArticuloPersister.Update; }
public ArticuloView() : base(Gtk.WindowType.Toplevel) { init(); save = insert; }