public ResultadosBusqueda_viewmodel(List <Familia> familiasEncontradas, ProcesadorDeComandosRevit procesadorDeComandosRevit, Autodesk.Revit.UI.ExternalEvent lanzarProcesadorDeComandosRevit) { this.procesadorDeComandosRevit = procesadorDeComandosRevit; procesadorDeComandosRevit.comandoAEjecutar = ProcesadorDeComandosRevit.ComandosDisponibles.noHacerNada; this.lanzarProcesadorDeComandosRevit = lanzarProcesadorDeComandosRevit; // ALBERTO. Que solo muestre las familias .rfa que tengan imagen asociada. //if (opciones == null) { opciones = Opciones.getOpcionesAlmacenadas(mostrarAvisoEnCasoDeError: false); }; //if (familiasimg == null) { familiasimg = new List<Familia>(); }; //familiasimg.Clear(); //for (int x = 0; x < familiasEncontradas.Count - 1; x++) //{ // //if (System.IO.Path.Combine(pathDeLaCarpetaPersonalDeImagenesThumbnail, _familias[x].nombreArchivo)) // if (File.Exists(System.IO.Path.Combine(opciones.pathDeLaCarpetaBaseDeArchivosDeFamilia, familiasEncontradas[x].nombreArchivo))) // { // familiasimg.Add(familiasEncontradas[x]); // } //} //familiasEncontradas.Clear(); //familiasEncontradas = familiasimg; // ************************************************************************ _familias = familiasEncontradas; NotifyPropertyChanged("familias"); opciones = Opciones.getOpcionesAlmacenadas(mostrarAvisoEnCasoDeError: false); }
public void Accion_SalirYGuardarOpciones() { string orientacionGrupos; if (gruposEnVertical == true) { orientacionGrupos = "V"; } else { orientacionGrupos = "H"; } bool nombresCortos; if (usarNombresCortosEnLosGrupos == true) { nombresCortos = true; } else { nombresCortos = false; } bool nombresDeArchivo; if (usarNombresDeArchivoEnLasFamilias == true) { nombresDeArchivo = true; } else { nombresDeArchivo = false; } Opciones opciones = Opciones.getOpcionesAlmacenadas(mostrarAvisoEnCasoDeError: false); opciones.idFilialConLaQueTrabajar = filialSeleccionada; opciones.modoDeObtenerLosDatosBDI = modoDeObtenerLosDatosBDI; opciones.pathDeLaCarpetaConLosXMLParaOffline = pathDeLaCarpetaConLosXMLParaOffline; opciones.idiomaParaLosNombres = idiomaSeleccionado; opciones.pathDeLaCarpetaBaseDeArchivosDeFamilia = pathDeLaCarpetaBaseDeArchivosDeFamilia; opciones.pathDeLaCarpetaBaseDeImagenesThumbnail = pathDeLaCarpetaBaseDeImagenesThumbnail; opciones.pathDeLaCarpetaPersonalDeArchivosDeFamilia = pathDeLaCarpetaPersonalDeArchivosDeFamilia; opciones.pathDeLaCarpetaPersonalDeImagenesThumbnail = pathDeLaCarpetaPersonalDeImagenesThumbnail; opciones.orientacionParaLaListaDeGrupos = orientacionGrupos; opciones.limiteDeTamainoElementoGrupo = limiteDeTamainoElementoGrupo; opciones.usarNombresCortosEnLosGrupos = nombresCortos; opciones.usarNombresDeArchivoEnLasFamilias = nombresDeArchivo; opciones.AlmacenarOpciones(); enlaceConLaVentanaUCBrowser.InicializarDatos(); }
internal void InicializarDatos() { Mouse.OverrideCursor = Cursors.Wait; try { _lineasDeProducto = new List <LineaDeProducto>(); NotifyPropertyChanged("lineasDeProducto"); _grupos = new List <GrupoDeFamilias>(); NotifyPropertyChanged("grupos"); _familias = new List <Familia>(); NotifyPropertyChanged("familias"); opciones = Opciones.getOpcionesAlmacenadas(mostrarAvisoEnCasoDeError: true); tituloDeLaVentana = "Browser"; // [" + opciones.modoDeObtenerLosDatosBDI + "] [" + opciones.idFilialConLaQueTrabajar //+ "] [" + opciones.idiomaParaLosNombres + "] " //+ " (v" + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.Major.ToString() //+ "." + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.Minor.ToString() //+ " c" + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.Build.ToString() + ") "; biblioteca = new BibliotecaDeFamilias(idCompaniaBaan: opciones.idFilialConLaQueTrabajar, modoDeObtenerLosDatosBDI: opciones.modoDeObtenerLosDatosBDI, pathDeLaCarpetaConLosXMLParaOffline: opciones.pathDeLaCarpetaConLosXMLParaOffline, idiomaParaLosNombres: opciones.idiomaParaLosNombres, pathDeLaCarpetaBaseDeArchivosDeFamilia: opciones.pathDeLaCarpetaBaseDeArchivosDeFamilia, pathDeLaCarpetaBaseDeImagenesThumbnail: opciones.pathDeLaCarpetaBaseDeImagenesThumbnail, pathDeLaCarpetaPersonalDeArchivosDeFamilia: opciones.pathDeLaCarpetaPersonalDeArchivosDeFamilia, pathDeLaCarpetaPersonalDeImagenesThumbnail: opciones.pathDeLaCarpetaPersonalDeImagenesThumbnail); NotifyPropertyChanged("familias"); if (opciones.usarNombresCortosEnLosGrupos) { biblioteca.UsarNombresCortosEnLosGrupos(); } else { biblioteca.UsarNombresNormalesEnLosGrupos(); } if (opciones.usarNombresDeArchivoEnLasFamilias) { biblioteca.UsarNombresDeArchivoEnLasFamilias(); } else { biblioteca.UsarNombresNormalesEnLasFamilias(); } //_lineasDeProducto = biblioteca.getLineasDeProducto(); _lineasDeProducto = biblioteca.getLineasDeProductoFiltrado(); NotifyPropertyChanged("lineasDeProducto"); //if (BibliotecaDeFamilias.familiasimg == null) { BibliotecaDeFamilias.familiasimg = new List<Familia>(); }; //BibliotecaDeFamilias.familiasimg.Clear(); //for (int x = 0; x < _familias.Count - 1; x++) //{ // if (_familias[x].thumbnail != null && _familias[x].thumbnail != Properties.Resources._default) // { // BibliotecaDeFamilias.familiasimg.Add(_familias[x]); // } //} //_familias.Clear(); //_familias = BibliotecaDeFamilias.familiasimg; //BibliotecaDeFamilias.familiasimg.Clear(); //NotifyPropertyChanged("familiasimg"); //Main_window.mWindows.actualizar(); favoritos = new Favoritos(); favoritos.RecuperarDelDisco(opciones.pathDeLaCarpetaPersonalDeImagenesThumbnail, opciones.pathDeLaCarpetaBaseDeImagenesThumbnail); filtroAll = true; filtroDyn = false; filtroSET = false; filtroUnit = false; filtroAnnSymb = false; filtroANN_ = false; filtroDET_ = false; if (opciones.orientacionParaLaListaDeGrupos == "V") { anguloDeRotacionTextBlockGrupos = -90; } else { anguloDeRotacionTextBlockGrupos = 0; } } finally { Mouse.OverrideCursor = null; } }
public Opciones_viewmodel(Main_viewmodel enlaceConLaVentanaUCBrowser) { this.enlaceConLaVentanaUCBrowser = enlaceConLaVentanaUCBrowser; Opciones opciones = Opciones.getOpcionesAlmacenadas(mostrarAvisoEnCasoDeError: false); pathDeLaCarpetaConLosXMLParaOffline = opciones.pathDeLaCarpetaConLosXMLParaOffline; pathDeLaCarpetaBaseDeArchivosDeFamilia = opciones.pathDeLaCarpetaBaseDeArchivosDeFamilia; pathDeLaCarpetaBaseDeImagenesThumbnail = opciones.pathDeLaCarpetaBaseDeImagenesThumbnail; pathDeLaCarpetaPersonalDeArchivosDeFamilia = opciones.pathDeLaCarpetaPersonalDeArchivosDeFamilia; pathDeLaCarpetaPersonalDeImagenesThumbnail = opciones.pathDeLaCarpetaPersonalDeImagenesThumbnail; Mouse.OverrideCursor = System.Windows.Input.Cursors.Wait; try { _filiales = BibliotecaDeFamilias.getFilialesDirectamenteDeLaBDI(opciones.modoDeObtenerLosDatosBDI); NotifyPropertyChanged("filiales"); filialSeleccionada = opciones.idFilialConLaQueTrabajar; _idiomas = new ReadOnlyObservableCollection <string>(new ObservableCollection <string>(BibliotecaDeFamilias.getIdiomasDirectamenteDeLaBDI(opciones.modoDeObtenerLosDatosBDI))); NotifyPropertyChanged("idiomas"); idiomaSeleccionado = opciones.idiomaParaLosNombres; } finally { Mouse.OverrideCursor = null; } if (opciones.modoDeObtenerLosDatosBDI == ConsultarBDI.CONSULTAS.ModoDeObtenerLosDatos.online) { leerBDIonline = true; leerBDIoffline = false; } else { leerBDIonline = false; leerBDIoffline = true; } if (opciones.orientacionParaLaListaDeGrupos == "V") { gruposEnVertical = true; gruposEnHorizontal = false; } else { gruposEnVertical = false; gruposEnHorizontal = true; } double limite; if (double.TryParse(opciones.limiteDeTamainoElementoGrupo, out limite)) { limitarTamainoElementoGrupo = true; limiteDeTamainoElementoGrupo = opciones.limiteDeTamainoElementoGrupo; } else { limitarTamainoElementoGrupo = false; limiteDeTamainoElementoGrupo = ""; } usarNombresCortosEnLosGrupos = opciones.usarNombresCortosEnLosGrupos; if (opciones.usarNombresDeArchivoEnLasFamilias) { mostrarNombresDescriptivosEnLasFamilias = false; mostrarNombresDeArchivoEnLasFamilias = true; } else { mostrarNombresDescriptivosEnLasFamilias = true; mostrarNombresDeArchivoEnLasFamilias = false; } }