private void btnSair_Click(object sender, EventArgs e) { try { DirectoryInfo dinfo = new DirectoryInfo(txtCaminho.Text); if (dinfo.Exists) { if (!belStatic.bClickOnce) { belRegedit.SalvarRegistro("Config_xml", "Caminho_xmls", txtCaminho.Text); } else { belIsolated objIsolated = new belIsolated(); objIsolated.SalvarArquivo(_LOCAL_XML, txtCaminho.Text, belIsolated.Lugar.Local); } belStatic.Pasta_xmls_Configs = txtCaminho.Text; this.Close(); } else { KryptonMessageBox.Show(null, "Caminho não encontrado", "A V I S O", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (Exception) { throw; } }
public frmGerarXml() { InitializeComponent(); try { belStaticPastas.Pasta_StartupPath = Application.StartupPath; belStatic.bClickOnce = false; if (ApplicationDeployment.IsNetworkDeployed) { belStatic.bClickOnce = true; } string sVisualGera = ""; if (belStatic.bClickOnce) { belIsolated objIsolated = new belIsolated(); sVisualGera = objIsolated.BuscarArquivo(_VISUAL, belIsolated.Lugar.Local); } else { sVisualGera = belRegedit.BuscaNomeSkin(); } SetVisualandBackColor(sVisualGera); } catch (Exception ex) { throw ex; } }
public static bool VerificaConfiguracaoPastasXml() { try { belIsolated objbelIsolated = new belIsolated(); RegistryKey key = Registry.CurrentConfig.OpenSubKey("hlp\\Config_xml"); if (belStatic.bClickOnce) { if (key != null) { if (objbelIsolated.BuscarArquivo("LOCAL_XML", belIsolated.Lugar.Local) == "") { belStatic.Pasta_xmls_Configs = key.GetValue("Caminho_xmls", "").ToString(); objbelIsolated.SalvarArquivo("LOCAL_XML", belStatic.Pasta_xmls_Configs, belIsolated.Lugar.Local); } else { belStatic.Pasta_xmls_Configs = objbelIsolated.BuscarArquivo("LOCAL_XML", belIsolated.Lugar.Local); } return true; } else { if (objbelIsolated.BuscarArquivo("LOCAL_XML", belIsolated.Lugar.Local) == "") { return false; } else { belStatic.Pasta_xmls_Configs = objbelIsolated.BuscarArquivo("LOCAL_XML", belIsolated.Lugar.Local); return true; } } } else { if (key != null) { belStatic.Pasta_xmls_Configs = key.GetValue("Caminho_xmls", "").ToString(); return true; } else { return false; } } } catch (Exception) { return false; } }
private void VisualToolStripMenuItem_Click(object sender, EventArgs e) { try { ToolStripMenuItem menu = (ToolStripMenuItem)sender; belIsolated objIsolated = new belIsolated(); SetVisualandBackColor(menu.Text); if (belStatic.bClickOnce) { objIsolated.SalvarArquivo(_VISUAL, menu.Text, belIsolated.Lugar.Local); } else { belRegedit.SalvarRegistro("Skin", _VISUAL, menu.Text); } } catch (Exception ex) { throw ex; } }