private void tvw_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) { Cursor.Current = Cursors.WaitCursor; switch (e.Button) { case System.Windows.Forms.MouseButtons.Right: if (ItemInfo.Type == MSVSS32.MSVSS.enmItemType.File) { ActualizarMenu(); tvw.ContextMenuStrip.Enabled = true; } else { tvw.ContextMenuStrip.Enabled = false; } break; case System.Windows.Forms.MouseButtons.Left: SelectedNode = e.Node; if (e.Node.Parent != null) PathPadreNodoSelecionado = e.Node.Parent.FullPath; ItemInfo = FVSSI.GetItemInfo(SelectedNode.FullPath); if (ItemInfo.Type == MSVSS32.MSVSS.enmItemType.File) { ObtenerCompartidos(); ObtenerHistorico(); ActualizarInformacion(ItemInfo); FVSSI.CurrentColorItem(SelectedNode); } else { txtInformacionItem.Text = ""; } break; } Cursor.Current = Cursors.Default; }
//private void rbtCompartidos_CheckedChanged(object sender, EventArgs e) //{ // Cursor.Current = Cursors.WaitCursor; // if (rbtCompartidos.Checked) // { // if (SelectedNode != null) // { // ItemInfo = FVSSI.GetItemInfo(SelectedNode.FullPath); // if (ItemInfo.Type == MSVSS32.MSVSS.enmItemType.File) // { // ObtenerCompartidos(); // } // } // } // Cursor.Current = Cursors.Default; //} //private void rbtHistorico_CheckedChanged(object sender, EventArgs e) //{ // Cursor.Current = Cursors.WaitCursor; // if (rbtHistorico.Checked) // { // ItemInfo = FVSSI.GetItemInfo(SelectedNode.FullPath); // if (ItemInfo.Type == MSVSS32.MSVSS.enmItemType.File) // { // ObtenerHistorico(); // } // } // Cursor.Current = Cursors.Default; //} void tvw_KeyUp(object sender, KeyEventArgs e) { Cursor.Current = Cursors.WaitCursor; switch (e.KeyCode) { case Keys.Up: case Keys.Down: SelectedNode = tvw.SelectedNode; ItemInfo = FVSSI.GetItemInfo(SelectedNode.FullPath); if (ItemInfo.Type == MSVSS32.MSVSS.enmItemType.File) { ObtenerCompartidos(); ObtenerHistorico(); ActualizarInformacion(ItemInfo); } else { txtInformacionItem.Text = ""; } break; } Cursor.Current = Cursors.Default; }
private void Editar(Boolean Desproteger) { Cursor.Current = Cursors.WaitCursor; ProcessStartInfo info; String Archivo = FVSSI.GetLocalSpect(SelectedNode.FullPath); try { if (Desproteger) { if (ItemInfo.IsCheckedOut == MSVSS32.MSVSS.enmFileState.UnCheckedFile) { if (FVSSI.CheckOutFile(SelectedNode.FullPath)) { InsertarDesprotegido(); SelectedNode.ForeColor = Color.Red; } else { Cursor.Current = Cursors.Default; msg.msgError("Se ha producido un error. La acción no se realizara.", "¡¡¡Atención!!!"); return; } } } else { if(!(ItemInfo.IsCheckedOut == MSVSS32.MSVSS.enmFileState.UnCheckedFile)) FVSSI.GetLastVersionFile(SelectedNode.FullPath); } switch (str.GetExtension(SelectedNode.FullPath).ToUpper()) { case "SQL": if (UsarRegsitro == CheckState.Checked) { //Obtener datos del registro para la empresa actual ServidorConexionSQL = reg.GetRegisterValue(eRootKeyType.LocalMachine, RutaRegistroConexionSQL, "Servidor"); //CatalogoConexionSQL = reg.GetRegisterValue(eRootKeyType.LocalMachine, RutaRegistroConexionSQL, "Catalogo"); if(ItemInfo.Spec.IndexOf("EMPGEN") == -1) CatalogoConexionSQL = "EMP" + String.Format("{0:0000}",colEmpresas.Item(lstEmpresas.SelectedIndex).CodigoEmpresa) + "01"; else CatalogoConexionSQL = "EMPGEN" + String.Format("{0:0000}",colEmpresas.Item(lstEmpresas.SelectedIndex).CodigoEmpresa) + "01"; UsuarioConexionSQL = reg.GetRegisterValue(eRootKeyType.LocalMachine, RutaRegistroConexionSQL, "Usuario Base Datos"); PasswordConexionSQL = reg.GetRegisterValue(eRootKeyType.LocalMachine, RutaRegistroConexionSQL, "Password Base Datos"); IntPtr nWnd = FindWindow(null, "Microsoft SQL Server Management Studio"); if (nWnd.Equals(new System.IntPtr(0))) { if (PasswordConexionSQL.Trim() != "") { info = new System.Diagnostics.ProcessStartInfo(RutaAplicacionSQL, "-S " + ServidorConexionSQL + " -d " + CatalogoConexionSQL + " -U " + UsuarioConexionSQL + " -P " + PasswordConexionSQL + " -E " + Archivo + " -nosplash"); } else { info = new System.Diagnostics.ProcessStartInfo(RutaAplicacionSQL, "-S " + ServidorConexionSQL + " -d " + CatalogoConexionSQL + " -U " + UsuarioConexionSQL + " -E " + Archivo + " -nosplash"); } Process.Start(info); } else { System.Diagnostics.Process.Start(Archivo); } } else { info = new System.Diagnostics.ProcessStartInfo(RutaAplicacionSQL, Archivo); Process.Start(info); } break; case "RPT": if (!(IsProcessOpen("crw32"))) { info = new System.Diagnostics.ProcessStartInfo(RutaAplicacionCrystalReports, Archivo); Process.Start(info); } else { System.Diagnostics.Process.Start(Archivo); } break; case "VBP": if (!(IsProcessOpen("VB6"))) { info = new System.Diagnostics.ProcessStartInfo(RutaAplicacionVB6, Archivo); Process.Start(info); } else { System.Diagnostics.Process.Start(Archivo); } break; default: msg.msgInformation("Tipo de archivo no editable.", "Información"); break; } ItemInfo = FVSSI.GetItemInfo(SelectedNode.FullPath); ActualizarInformacion(ItemInfo); FVSSI.CurrentColorItem(SelectedNode); } catch (Exception ex) { Cursor.Current = Cursors.Default; msg.msgError("Se ha producido un error.", "¡¡¡Atención!!!"); msg.msgInformation("Mensaje de error: " + ex.Message); } Cursor.Current = Cursors.Default; }
private void cm1Proteger_Click(object sender, EventArgs e) { Cursor.Current = Cursors.WaitCursor; ItemInfo = FVSSI.GetItemInfo(SelectedNode.FullPath); switch (FVSSI.GetItemType(SelectedNode.FullPath)) { case MSVSS32.MSVSS.enmItemType.File: if (FVSSI.CheckInFile(SelectedNode.FullPath)) { QuitarDesprotegido(); SelectedNode.ForeColor = Color.Black; } break; case MSVSS32.MSVSS.enmItemType.Proyect: if (FVSSI.CheckInProject(SelectedNode.FullPath)) { SelectedNode.ForeColor = Color.Black; } break; } //ItemInfo = FVSSI.GetItemInfo(SelectedNode.FullPath); ActualizarInformacion(ItemInfo); FVSSI.CurrentColorItem(SelectedNode); ObtenerHistorico(); Cursor.Current = Cursors.Default; }
private void cm1DeshacerDesproteccion_Click(object sender, EventArgs e) { if (msg.msgCuestionYesNo("Se desharán los cambios realizados. ¿Continuar?", "¡¡¡Atención!!!") == true) { Cursor.Current = Cursors.WaitCursor; ItemInfo = FVSSI.GetItemInfo(SelectedNode.FullPath); if (FVSSI.GetItemType(SelectedNode.FullPath) == MSVSS32.MSVSS.enmItemType.File) { if (FVSSI.UndoCheckoutFile(SelectedNode.FullPath)) { QuitarDesprotegido(); SelectedNode.ForeColor = Color.Black; } } //ItemInfo = FVSSI.GetItemInfo(SelectedNode.FullPath); ActualizarInformacion(ItemInfo); FVSSI.CurrentColorItem(SelectedNode); Cursor.Current = Cursors.Default; } }
private void cm1Bifurcar_Click(object sender, EventArgs e) { Cursor.Current = Cursors.WaitCursor; if (FVSSI.GetItemType(SelectedNode.FullPath) == MSVSS32.MSVSS.enmItemType.File) FVSSI.BranchFile(SelectedNode.FullPath); ItemInfo = FVSSI.GetItemInfo(SelectedNode.FullPath); ActualizarInformacion(ItemInfo); FVSSI.CurrentColorItem(SelectedNode); Cursor.Current = Cursors.Default; }