Ejemplo n.º 1
0
        //Deshace todos los cambios temporales que el usuario haya hecho sobre la interfaz del filtro y lo cierra
        private void Cancel_Filter(object sender, EventArgs e)
        {
            //if (backUpFilterList == null) { return; }



            int column = 0;

            if (sender is Popup)
            {
                column = ((DataGridColumnHeader)((Popup)sender).TemplatedParent).Column.DisplayIndex;
            }
            else if (sender is Button)
            {
                column = ((DataGridColumnHeader)((Control)sender).TemplatedParent).Column.DisplayIndex;
            }


            //backUpFilterList = null;
            if (sender is Button)
            {
                WPFForms.FindParent <Popup>((Button)sender).IsOpen = false;
            }
            for (int j = 0; j < copia[posicion][column].Filter.Count; j++)
            {
                if (!FilterHierarchy[column].Filter[j].NotFiltered == copia[posicion][column].Filter[j].NotFiltered)
                {
                    FilterHierarchy[column].Filter[j].NotFiltered = !(bool)FilterHierarchy[column].Filter[j].NotFiltered;
                }
            }
        }
Ejemplo n.º 2
0
        //Elimina control de la barra de tareas y pide a main window que elimine la instancia de la herramienta
        private void CloseThisApp(object sender, RoutedEventArgs e)
        {
            int index = window.toolBar.Children.IndexOf(WPFForms.FindParent <NavBarTile>((DependencyObject)sender));

            for (int i = index + 1; i < window.toolBar.Children.Count; i++)
            {
                ((NavBarTile)window.toolBar.Children[i]).Margin = new Thickness(0, ((NavBarTile)window.toolBar.Children[i]).Margin.Top - 100, 0, 0);
            }
            window.toolBar.Children.RemoveAt(index);
            window.RemoveApp(this.app);
        }
Ejemplo n.º 3
0
 //Evento generado al hacer click en una de las herramientas ya instanciadas de la barra
 //Vuelve a renderizarla en pantalla
 public void ReOpen_App_FromToolBar(object sender, RoutedEventArgs e)
 {
     visibleTool.Content    = WPFForms.FindParent <NavBarTile>((Tile)sender).app;
     visibleTool.Visibility = Visibility.Visible;
     toolsMenuFlyout.IsOpen = false;
 }
Ejemplo n.º 4
0
        //tras acabar el procesado en segundo plano se actualiza la interfaz con ellos
        private void BackGround_Completed(object sender, RunWorkerCompletedEventArgs e)
        {
            // Progress_Bar.Value = 100;
            if (e.Error == null)
            {
                //Paramos de girar el cursor
                Cursor = Cursors.Arrow;

                plotNodo.Visibility   = Visibility;
                plotceldas.Visibility = Visibility;


                bgwBlnOffResult output = (bgwBlnOffResult)e.Result;
                Copiaoutput = output;
                if (output.colindancias != null)
                {
                    colinGrid.WorkingData = output.colindancias;
                    WPFForms.FindParent <TabItem>(colinGrid).Visibility = Visibility.Visible;
                    tabColindancias.IsSelected = true;



                    //fc = new formColindancias(output.colindancias);

                    //fc.Show();
                }

                if (output.siteCoordErrors != "" && (bool)Is_BlnOFF_Enabled.IsChecked)
                {
                    WPFForms.ShowError("Faltan las coordenadas de los siguientes emplazamientos", output.siteCoordErrors);
                }

                if (output.candBl != null)
                {
                    candBLGrid.WorkingData = output.candBl;
                    WPFForms.FindParent <TabItem>(candBLGrid).Visibility = Visibility.Visible;
                }
                if (output.candOff != null)
                {
                    candOFFGrid.WorkingData = output.candOff;
                    WPFForms.FindParent <TabItem>(candOFFGrid).Visibility = Visibility.Visible;
                }
                if (output.error != null)
                {   //se genera la tabla de analis previo
                    errGrid.WorkingData = output.error;
                    WPFForms.FindParent <TabItem>(errGrid).Visibility = Visibility.Visible;

                    //se genera la gárafica por nodos
                    this.erroresAMejorar = output.error;

                    List <string> sites = erroresAMejorar.AsEnumerable().Select(col => (string)col[1]).Distinct().ToList();
                    siteListBox_1.ItemsSource  = sites;
                    siteListBox_1.SelectedItem = sites[0];

                    List <string> Tech = this.erroresAMejorar.AsEnumerable().Where(row => (string)row[1] == (string)siteListBox_1.SelectedItem).Select(col => (string)col[2]).Distinct().ToList <string>();
                    techListBox_1.ItemsSource  = Tech;
                    techListBox_1.SelectedItem = Tech[0];

                    UpdateGraph_1();
                }
                if (output.nirPlotData != null)
                {
                    this.nirPlotData = output.nirPlotData;

                    List <string> sites = erroresAMejorar.AsEnumerable().Select(col => (string)col[1]).Distinct().ToList();
                    siteListBox_2.ItemsSource  = sites;
                    siteListBox_2.SelectedItem = sites[0];

                    List <string> tech = this.nirPlotData.AsEnumerable().Where(row => (string)row[1] == (string)siteListBox_2.SelectedItem).Select(col => (string)col[3]).Distinct().ToList <string>();
                    techListBox_2.ItemsSource  = tech;
                    techListBox_2.SelectedItem = tech[0];

                    var cells2Plot = nirPlotData.AsEnumerable()
                                     .Where(row => (string)row[1] == (string)siteListBox_2.SelectedItem && (string)row[3] == (string)techListBox_2.SelectedItem)
                                     .Select(col => (string)col[2]).Distinct().Where(item => !item.Contains("="));

                    List <SectorListItem> sectors = new List <SectorListItem>();
                    foreach (var cell in cells2Plot)
                    {
                        sectors.Add(new SectorListItem()
                        {
                            Enabled = true, Sector = TECH_NUM.GetSectorFromLNCEL(cell)
                        });
                    }
                    this.Sectors = sectors;

                    Binding codeBinding = new Binding("Sectors");
                    codeBinding.Source = this;
                    sectorListBox.SetBinding(ListBox.ItemsSourceProperty, codeBinding);

                    UpdateGraph_2();
                }
            }
            else
            {
                //Paramos de girar el cursor
                Cursor = Cursors.Arrow;

                //control de errores en BackGround
                switch (e.Error.GetType().Name)
                {
                case "FileNotFoundException":
                    WPFForms.ShowError("Falta un archivo", e.Error.Message);
                    break;

                case "InvalidOperationException":
                    WPFForms.ShowError("Error critico", e.Error.Message);
                    break;

                case "ArgumentException":
                    WPFForms.ShowError("Error en los datos", e.Error.Message);
                    break;

                default:
                    WPFForms.ShowError("No controlado", e.Error.Message);
                    break;
                }
            }
        }