private static void Showall() { Sql = File.Exists(Appdatadir + "\\contacts.sdf") ? new Sqlmanager(Appdatadir) : new Sqlmanager("|DataDirectory|"); if (List.InvokeRequired) { var d = new Additem(UpdateList); List.Invoke(d, new object[] { Sql.GetData(), true }); } else { UpdateList(Sql.GetData()); } }
internal Main() { InitializeComponent(); List = list; Icon = Resources.icon; Appdatadir = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\SwizzContact"; Directory.CreateDirectory(Appdatadir); if(!File.Exists(Appdatadir + "\\contacts.sdf") || !File.Exists(Path.GetDirectoryName(Application.ExecutablePath) + "\\contacts.sdf")) Generatedb(); Sql = File.Exists(Appdatadir + "\\contacts.sdf") ? new Sqlmanager(Appdatadir) : new Sqlmanager("|DataDirectory|"); if(GetAutoloadState()) return; var worker = new Thread(Showall); worker.Start(); }
internal Main() { InitializeComponent(); List = list; Icon = Resources.icon; Appdatadir = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\SwizzContact"; Directory.CreateDirectory(Appdatadir); if (!File.Exists(Appdatadir + "\\contacts.sdf") || !File.Exists(Path.GetDirectoryName(Application.ExecutablePath) + "\\contacts.sdf")) { Generatedb(); } Sql = File.Exists(Appdatadir + "\\contacts.sdf") ? new Sqlmanager(Appdatadir) : new Sqlmanager("|DataDirectory|"); if (GetAutoloadState()) { return; } var worker = new Thread(Showall); worker.Start(); }
private static void Showall() { Sql = File.Exists(Appdatadir + "\\contacts.sdf") ? new Sqlmanager(Appdatadir) : new Sqlmanager("|DataDirectory|"); if(List.InvokeRequired) { var d = new Additem(UpdateList); List.Invoke(d, new object[] { Sql.GetData(), true }); } else UpdateList(Sql.GetData()); }