void IPersistable.SaveTo(IPersistency persistency) { string instance = DockItem.Id.ToString(); persistency.SaveSetting(instance, "ColorStraight", m_Properties.ColorStraight); persistency.SaveSetting(instance, "ColorLine", m_Properties.ColorLine); persistency.SaveSetting(instance, "ColorCircle", m_Properties.ColorCircle); persistency.SaveSetting(instance, "ColorClothoide", m_Properties.ColorClothoide); persistency.SaveSetting(instance, "ColorOther", m_Properties.ColorOther); persistency.SaveSetting(instance, "ColorNodes", m_Properties.ColorNodes); persistency.SaveSetting(instance, "ColorNodeSelected", m_Properties.ColorNodeSelected); persistency.SaveSetting(instance, "DrawConnections", m_Properties.DrawConnections); persistency.SaveSetting(instance, "DrawInformation", m_Properties.DrawInformation); persistency.SaveSetting(instance, "DrawWholeInnerCircle", m_Properties.DrawWholeInnerCircle); persistency.SaveSetting(instance, "DrawConstructionsPoints", m_Properties.DrawConstructionsPoints); persistency.SaveSetting(instance, "LineWidth", m_Properties.LineWidth); persistency.SaveSetting(instance, "NodeCount", m_Nodes.Count); for (int i = 0; i < m_Nodes.Count; i++) { var n = m_Nodes.ElementAt(i); persistency.SaveSetting(instance, "NodeX" + i.ToString(), n.X); persistency.SaveSetting(instance, "NodeY" + i.ToString(), n.Y); } }
void IPersistable.LoadFrom(IPersistency persistency) { string instance = DockItem.Id.ToString(); m_Properties = new MyProperties(); m_Properties.ColorStraight = persistency.LoadSetting(instance, "ColorStraight", Color.Brown); m_Properties.ColorLine = persistency.LoadSetting(instance, "ColorLine", Color.Beige); m_Properties.ColorCircle = persistency.LoadSetting(instance, "ColorCircle", Color.Red); m_Properties.ColorClothoide = persistency.LoadSetting(instance, "ColorClothoide", Color.Green); m_Properties.ColorOther = persistency.LoadSetting(instance, "ColorOther", Color.Brown); m_Properties.ColorNodes = persistency.LoadSetting(instance, "ColorNodes", Color.Blue); m_Properties.ColorNodeSelected = persistency.LoadSetting(instance, "ColorNodeSelected", Color.YellowGreen); m_Properties.DrawConnections = persistency.LoadSetting(instance, "DrawConnections", m_Properties.DrawConnections); m_Properties.DrawInformation = persistency.LoadSetting(instance, "DrawInformation", m_Properties.DrawInformation); m_Properties.DrawWholeInnerCircle = persistency.LoadSetting(instance, "DrawWholeInnerCircle", m_Properties.DrawWholeInnerCircle); m_Properties.DrawConstructionsPoints = persistency.LoadSetting(instance, "DrawConstructionsPoints", m_Properties.DrawConstructionsPoints); m_Properties.LineWidth = persistency.LoadSetting(instance, "LineWidth", 3); int count = persistency.LoadSetting(instance, "NodeCount", 0); for (int i = 0; i < count; i++) { var X = persistency.LoadSetting(instance, "NodeX" + i.ToString(), 0.0); var Y = persistency.LoadSetting(instance, "NodeY" + i.ToString(), 0.0); m_Nodes.Add(new PointF((float)X, (float)Y)); } }
void IPersistable.LoadFrom(IPersistency persistency) { string instance = DockItem.Id.ToString(); mColumnPersistence.Clear(); var columns = persistency.LoadSetting(instance, "Columns", ""); var sc = columns.Split(new char[] { '[', ']' }, StringSplitOptions.RemoveEmptyEntries); // NOTe: depending on initialization order (not determined) // persistency of column could be loaded before or after column creation // that behaviour is new since some last changes in component initialization // may this will be refurbished infuture foreach (var c in sc) { var v = c.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); if (v.Length >= 3) { int tag, visible, width; if (int.TryParse(v[0], out tag) && int.TryParse(v[1], out visible) && int.TryParse(v[2], out width)) { // store persistency for early persistency loading mColumnPersistence.Add(tag, new ColumnPersistence(visible != 0, width)); // perform persistency for late persistency loading mColumnControl.Update(tag, width, visible != 0); } } mColumnControl.ArangeColumns(); } bool loadedFindVisibility = persistency.LoadSetting(instance, "FindVisible", false); ShowFindBox(loadedFindVisibility, true); }
public TwitterMonitorCommand(ILogger <TwitterMonitorCommand> log, TwitterMonitorConfig config, IMonitoringStream monitoring, IPersistency persistency) { this.log = log ?? throw new ArgumentNullException(nameof(log)); this.monitoring = monitoring ?? throw new ArgumentNullException(nameof(monitoring)); this.config = config; this.persistency = persistency; }
void IPersistable.SaveTo(IPersistency persistency) { string instance = DockItem.Id.ToString(); VPanedPosition = vpaned1.Position; persistency.SaveSetting(instance, "VPanedPosition", VPanedPosition); }
void IPersistable.SaveTo(IPersistency persistency) { string instance = DockItem.Id.ToString(); persistency.SaveSetting(instance, "ShowHelp", this.propertygrid1.ShowHelp); persistency.SaveSetting(instance, "Sort", (int)this.propertygrid1.PropertySort); }
void IPersistable.LoadFrom(IPersistency persistency) { // string instance = DockItem.Id.ToString(); m_Properties = new MyProperties(); m_HeadingSmoother = new HeadingSmoother(); Update(); }
void IPersistable.SaveTo(IPersistency persistency) { // TODO: get instance string not in this way, may IPersistency need a new property string instance = ((Component)(this.Parent.Parent)).DockItem.Id.ToString(); persistency.SaveSetting(instance, "ActiveText", comboFind.ActiveText); persistency.SaveSetting(instance, "List", GetComboListEntries().ToList()); }
protected override void AfterCreateAfterCommit(CreateEventArgs e) { base.AfterCreateAfterCommit(e); string dataSourceTypeId = e.Values[dataSourceTypeFieldName].ToString(); string name = e.Values[nameFieldName].ToString(); System.Data.SqlClient.SqlConnectionStringBuilder builder = new System.Data.SqlClient.SqlConnectionStringBuilder(); builder.ConnectionString = Map.connectionString; string cleanName = GetCleanName(name); if (dataSourceTypeId == "1" || dataSourceTypeId == "4") // blank or template { SqlAccess sqlAccess = new SqlAccess(); Dictionary <string, object> values = new Dictionary <string, object>(); values.Add("Catalog", cleanName); values.Add("SysCatalog", Maps.DuradosAppSysPrefix + cleanName); //values.Add("ServerName", builder.DataSource); //values.Add("Username", builder.UserID); //values.Add("Password", builder.Password); //values.Add("IntegratedSecurity", builder.IntegratedSecurity); values.Add("DuradosUser", Map.Database.GetUserID()); sqlAccess.ExecuteNoneQueryStoredProcedure(Maps.Instance.ConnectionString, "durados_SetConnection", values); } if (dataSourceTypeId == "2") // existing { string sysConnection = e.Values["FK_durados_App_durados_SqlConnection_System_Parent"].ToString(); if (string.IsNullOrEmpty(sysConnection)) { SqlAccess sqlAccess = new SqlAccess(); Dictionary <string, object> values = new Dictionary <string, object>(); values.Add("Catalog", cleanName); values.Add("SysCatalog", Maps.DuradosAppSysPrefix + cleanName); values.Add("DuradosUser", Map.Database.GetUserID()); sqlAccess.ExecuteNoneQueryStoredProcedure(Maps.Instance.ConnectionString, "durados_SetSysConnection", values); } } if (dataSourceTypeId == "4") // template { IPersistency persistency = Maps.Instance.GetNewPersistency(); MapDataSet.durados_AppRow appRow = (MapDataSet.durados_AppRow)((View)e.View).GetDataRow(e.View.Fields[nameFieldName], name); if (!appRow.IsTemplateFileNull() && !string.IsNullOrEmpty(appRow.TemplateFile)) { TemplateGenerator TemplateGenerator = new TemplateGenerator(persistency.GetConnection(appRow, builder).ToString(), appRow.TemplateFile); } } //UpdateCache(name); CreateDns(cleanName); }
void IPersistable.LoadFrom(IPersistency persistency) { // TODO: get instance string not in this way, may IPersistency need a new property string instance = ((Component)(this.Parent.Parent)).DockItem.Id.ToString(); var list = persistency.LoadSetting(instance, "List", new List <string>()); foreach (var s in list) { comboFind.AppendText(s); } ((Entry)comboFind.Child).Text = persistency.LoadSetting(instance, "ActiveText", ""); }
void IPersistable.LoadFrom(IPersistency persistency) { string instance = DockItem.Id.ToString(); bool b = persistency.LoadSetting(instance, "ShowHelp", this.propertygrid1.ShowHelp); this.propertygrid1.ShowHelp = !b; // workaround: have to toggle this to have an effect... this.propertygrid1.ShowHelp = b; // int i = persistency.LoadSetting(instance, "Sort", (int)this.propertygrid1.PropertySort); if(i==(int)MonoDevelop.Components.PropertyGrid.PropertySort.Alphabetical || i==(int)MonoDevelop.Components.PropertyGrid.PropertySort.Categorized) this.propertygrid1.PropertySort = (MonoDevelop.Components.PropertyGrid.PropertySort)i; }
CommandLinePersistence mPersistence; // TODO early prototype - abolish, implement IPersistable instead! #region IPersistable void IPersistable.LoadFrom(IPersistency persistency) { string instance = DockItem.Id.ToString(); if (mPersistence == null) { mPersistence = new CommandLinePersistence(); } mPersistence.Script = persistency.LoadSetting(instance, "Script", ""); #region support old serializer for a while, replace by better implementation if (mPersistence.Script.Length == 0) { mPersistence = (CommandLinePersistence)ComponentManager.LoadObject("CommandLine", typeof(CommandLinePersistence), DockItem); } #endregion }
void IPersistable.LoadFrom(IPersistency persistency) { string instance = DockItem.Id.ToString(); bool b = persistency.LoadSetting(instance, "ShowHelp", this.propertygrid1.ShowHelp); this.propertygrid1.ShowHelp = !b; // workaround: have to toggle this to have an effect... this.propertygrid1.ShowHelp = b; // int i = persistency.LoadSetting(instance, "Sort", (int)this.propertygrid1.PropertySort); if (i == (int)MonoDevelop.Components.PropertyGrid.PropertySort.Alphabetical || i == (int)MonoDevelop.Components.PropertyGrid.PropertySort.Categorized) { this.propertygrid1.PropertySort = (MonoDevelop.Components.PropertyGrid.PropertySort)i; } }
public void LoadFrom(IPersistency persistency, string instance) { mColumnPersistence.Clear(); var columns = persistency.LoadSetting(instance, "Columns", ""); var sc = columns.Split(new char[] { '[', ']' }, StringSplitOptions.RemoveEmptyEntries); foreach (var c in sc) { var v = c.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); if (v.Length >= 3) { int tag, visible, width; if (int.TryParse(v[0], out tag) && int.TryParse(v[1], out visible) && int.TryParse(v[2], out width)) { mColumnPersistence.Add(tag, new ColumnPersistence(visible != 0, width)); } } } }
public void SaveTo(IPersistency persistency, string instance) { mColumnPersistence.Clear(); var columns = mColumnControl.GetColumns(); foreach (var c in columns) { mColumnPersistence.Add(c.Tag, new ColumnPersistence(c.Visible, c.Width)); } StringBuilder b = new StringBuilder(); foreach (var s in mColumnPersistence) { b.AppendFormat("[{0} {1} {2}]", s.Key, s.Value.Visible ? 1 : 0, s.Value.Width); } persistency.SaveSetting(instance, "Columns", b.ToString()); }
void IPersistable.LoadFrom(IPersistency persistency) { string instance = DockItem.Id.ToString(); mColumnPersistence.Clear(); var columns = persistency.LoadSetting(instance, "Columns", ""); var sc = columns.Split(new char[] { '[', ']' }, StringSplitOptions.RemoveEmptyEntries); // NOTe: depending on initialization order (not determined) // persistency of column could be loaded before or after column creation // that behaviour is new since some last changes in component initialization // may this will be refurbished infuture foreach (var c in sc) { var v = c.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); if (v.Length >= 3) { int tag, visible, width; if (int.TryParse(v[0], out tag) && int.TryParse(v[1], out visible) && int.TryParse(v[2], out width)) { // store persistency for early persistency loading mColumnPersistence.Add(tag, new ColumnPersistence(visible != 0, width)); // perform persistency for late persistency loading mColumnControl.Update(tag, width, visible != 0); } } mColumnControl.ArangeColumns(); } bool loadedFindVisibility = persistency.LoadSetting(instance, "FindVisible", false); ShowFindBox(loadedFindVisibility, true); }
void IPersistable.LoadFrom(IPersistency persistency) { string instance = DockItem.Id.ToString(); if (mPersistence == null) mPersistence = new CommandLinePersistence(); mPersistence.Script = persistency.LoadSetting(instance, "Script", ""); #region support old serializer for a while, replace by better implementation if (mPersistence.Script.Length == 0) mPersistence = (CommandLinePersistence)ComponentManager.LoadObject("CommandLine", typeof(CommandLinePersistence), DockItem); #endregion }
void IPersistable.SaveTo(IPersistency persistency) { string instance = DockItem.Id.ToString(); persistency.SaveSetting(instance, "Script", mPersistence.Script); }
void IPersistable.LoadFrom(IPersistency persistency) { string instance = DockItem.Id.ToString(); VPanedPosition = persistency.LoadSetting(instance, "VPanedPosition", VPanedPosition); }
void IPersistable.SaveTo(IPersistency persistency) { // string instance = DockItem.Id.ToString(); }
void IPersistable.SaveTo(IPersistency persistency) { string instance = DockItem.Id.ToString(); persistency.SaveSetting(instance, "ShowHelp", this.propertygrid1.ShowHelp); persistency.SaveSetting(instance, "Sort", (int)this.propertygrid1.PropertySort); }
void IPersistable.SaveTo(IPersistency persistency) { string instance = DockItem.Id.ToString(); VPanedPosition = vpaned1.Position; persistency.SaveSetting(instance, "VPanedPosition", VPanedPosition); }
private ApplicationSettings() { Persistency = new IPhonePersistency(); }
void IPersistable.LoadFrom(IPersistency persistency) { string instance = DockItem.Id.ToString(); VPanedPosition = persistency.LoadSetting(instance, "VPanedPosition", VPanedPosition); }
void IPersistable.SaveTo(IPersistency persistency) { // TODO: get instance string not in this way, may IPersistency need a new property string instance = ((Component)(this.Parent.Parent)).DockItem.Id.ToString(); persistency.SaveSetting(instance, "ActiveText", comboFind.ActiveText); persistency.SaveSetting(instance, "List", GetComboListEntries().ToList()); }
void IPersistable.SaveTo(IPersistency persistency) { string instance = DockItem.Id.ToString(); persistency.SaveSetting(instance, "Script", mPersistence.Script); }
void IPersistable.LoadFrom(IPersistency persistency) { string instance = DockItem.Id.ToString(); persistency.LoadColumnWidths(instance, treeview1); }
void IPersistable.LoadFrom(IPersistency persistency) { string instance = DockItem.Id.ToString(); persistency.LoadColumnWidths(instance, treeview1); }
void IPersistable.SaveTo(IPersistency persistency) { string instance = DockItem.Id.ToString(); persistency.SaveColumnWidths(instance, treeview1); }
void IPersistable.SaveTo(IPersistency persistency) { string instance = DockItem.Id.ToString(); mColumnPersistence.Clear(); var columns = mColumnControl.GetColumns(); foreach (var c in columns) mColumnPersistence.Add(c.Tag, new ColumnPersistence(c.Visible, c.Width)); StringBuilder b = new StringBuilder(); foreach (var s in mColumnPersistence) b.AppendFormat("[{0} {1} {2}]", s.Key, s.Value.Visible ? 1 : 0, s.Value.Width); persistency.SaveSetting(instance, "Columns", b.ToString()); persistency.SaveSetting(instance, "FindVisible", Find.Visible); }
void IPersistable.SaveTo(IPersistency persistency) { string instance = DockItem.Id.ToString(); persistency.SaveColumnWidths(instance, treeview1); }
void IPersistable.LoadFrom(IPersistency persistency) { // TODO: get instance string not in this way, may IPersistency need a new property string instance = ((Component)(this.Parent.Parent)).DockItem.Id.ToString(); var list = persistency.LoadSetting(instance, "List", new List<string>()); foreach (var s in list) comboFind.AppendText(s); ((Entry)comboFind.Child).Text = persistency.LoadSetting(instance, "ActiveText", ""); }