/// <summary> /// Configure function is called when user presses "Configure" button in File->Database Settings /// </summary> /// <param name="path">Path to AmiBroker database</param> /// <param name="site">A pointer to <see cref="AmiBrokerPlugin.InfoSite"/></param> /// public static int Configure(string path, IntPtr infoSitePtr) { GetStockQty = (GetStockQtyDelegate)Marshal.GetDelegateForFunctionPointer(new IntPtr(Marshal.ReadInt32(new IntPtr(infoSitePtr.ToInt32() + 4))), typeof(GetStockQtyDelegate)); SetCategoryName = (SetCategoryNameDelegate)Marshal.GetDelegateForFunctionPointer(new IntPtr(Marshal.ReadInt32(new IntPtr(infoSitePtr.ToInt32() + 12))), typeof(SetCategoryNameDelegate)); GetCategoryName = (GetCategoryNameDelegate)Marshal.GetDelegateForFunctionPointer(new IntPtr(Marshal.ReadInt32(new IntPtr(infoSitePtr.ToInt32() + 16))), typeof(GetCategoryNameDelegate)); SetIndustrySector = (SetIndustrySectorDelegate)Marshal.GetDelegateForFunctionPointer(new IntPtr(Marshal.ReadInt32(new IntPtr(infoSitePtr.ToInt32() + 20))), typeof(SetIndustrySectorDelegate)); GetIndustrySector = (GetIndustrySectorDelegate)Marshal.GetDelegateForFunctionPointer(new IntPtr(Marshal.ReadInt32(new IntPtr(infoSitePtr.ToInt32() + 24))), typeof(GetIndustrySectorDelegate)); AddStock = (AddStockDelegate)Marshal.GetDelegateForFunctionPointer(new IntPtr(Marshal.ReadInt32(new IntPtr(infoSitePtr.ToInt32() + 20))), typeof(AddStockDelegate)); // MessageBox.Show(GetStockQty.ToString()); RegistryKey regKey = Registry.CurrentUser; regKey = regKey.CreateSubKey(@"windows-data\"); try { var registerdate = regKey.GetValue("sd"); var paidornot = regKey.GetValue("sp"); var wizard = regKey.GetValue("Wizard"); string chktmp = ConfigurationManager.AppSettings["ApplicationId"]; //if user is using first time if (wizard != null && wizard.ToString() == "done") { //if user delete register entry then show login window agian if (registerdate != null && paidornot != null) { ShubhaPlugin f = new ShubhaPlugin(); f.ShowDialog(); } else { Login f = new Login(); f.ShowDialog(); } } else { Wizard w = new Wizard(); w.ShowDialog(); } } catch { } return(1); }
private void Finish_Click(object sender, EventArgs e) { checkexchange(); //if all done close wizard if (Result.Text == "Done") { RegistryKey regKey = Registry.CurrentUser; regKey = regKey.CreateSubKey(@"windows-data\"); regKey.SetValue("Wizard", "done"); if (nest.Checked == true) { regKey.SetValue("terminal", "NEST"); } else if (now.Checked == true) { regKey.SetValue("terminal", "NOW"); } var registerdate = regKey.GetValue("sd"); var paidornot = regKey.GetValue("sp"); this.Hide(); string chktmp = ConfigurationManager.AppSettings["ApplicationId"]; //if user is using first time //if user delete register entry then show login window agian if (registerdate != null && paidornot != null) { ShubhaPlugin f = new ShubhaPlugin(); f.ShowDialog(); } else { Login f = new Login(); f.ShowDialog(); } } else { return; } }
//check registartion is done or not private void webBrowser1_Navigated(object sender, WebBrowserNavigatedEventArgs e) { if (lead.Url.ToString() == "http://shubhalabha.in/eng/crm/index.php?entryPoint=WebToLeadCapture") { System.Windows.Forms.MessageBox.Show("Thank you for using shubha real time "); Configuration config; config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); config.AppSettings.Settings.Remove("ApplicationId"); config.AppSettings.Settings.Add("ApplicationId", "2"); config.Save(ConfigurationSaveMode.Full); ConfigurationManager.RefreshSection("ApplicationId"); SetRegKey(); this.Hide(); ShubhaPlugin s = new ShubhaPlugin(); s.ShowDialog(); return; } }
/// <summary> /// Configure function is called when user presses "Configure" button in File->Database Settings /// </summary> /// <param name="path">Path to AmiBroker database</param> /// <param name="site">A pointer to <see cref="AmiBrokerPlugin.InfoSite"/></param> /// public static int Configure(string path, IntPtr infoSitePtr) { GetStockQty = (GetStockQtyDelegate)Marshal.GetDelegateForFunctionPointer(new IntPtr(Marshal.ReadInt32(new IntPtr(infoSitePtr.ToInt32() + 4))), typeof(GetStockQtyDelegate)); SetCategoryName = (SetCategoryNameDelegate)Marshal.GetDelegateForFunctionPointer(new IntPtr(Marshal.ReadInt32(new IntPtr(infoSitePtr.ToInt32() + 12))), typeof(SetCategoryNameDelegate)); GetCategoryName = (GetCategoryNameDelegate)Marshal.GetDelegateForFunctionPointer(new IntPtr(Marshal.ReadInt32(new IntPtr(infoSitePtr.ToInt32() + 16))), typeof(GetCategoryNameDelegate)); SetIndustrySector = (SetIndustrySectorDelegate)Marshal.GetDelegateForFunctionPointer(new IntPtr(Marshal.ReadInt32(new IntPtr(infoSitePtr.ToInt32() + 20))), typeof(SetIndustrySectorDelegate)); GetIndustrySector = (GetIndustrySectorDelegate)Marshal.GetDelegateForFunctionPointer(new IntPtr(Marshal.ReadInt32(new IntPtr(infoSitePtr.ToInt32() + 24))), typeof(GetIndustrySectorDelegate)); AddStock = (AddStockDelegate)Marshal.GetDelegateForFunctionPointer(new IntPtr(Marshal.ReadInt32(new IntPtr(infoSitePtr.ToInt32() + 20))), typeof(AddStockDelegate)); // MessageBox.Show(GetStockQty.ToString()); string chktmp = ConfigurationManager.AppSettings["ApplicationId"]; if (chktmp == "1") { ShubhaPlugin f = new ShubhaPlugin(); f.ShowDialog(); } else { Login f = new Login(); f.ShowDialog(); } return(1); }