using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ArcGIS.Core.CIM;
using ArcGIS.Core.Data;
using ArcGIS.Core.Geometry;
using ArcGIS.Desktop.Catalog;
using ArcGIS.Desktop.Core;
using ArcGIS.Desktop.Editing;
using ArcGIS.Desktop.Extensions;
using ArcGIS.Desktop.Framework;
using ArcGIS.Desktop.Framework.Contracts;
using ArcGIS.Desktop.Framework.Dialogs;
using ArcGIS.Desktop.Framework.Threading.Tasks;
using ArcGIS.Desktop.Internal.Framework.Controls;
using ArcGIS.Desktop.Mapping;
using OliviaAddInPro.Helper;
using OliviaAddInPro.Model;

namespace OliviaAddInPro
{
    internal class ButtonRec : Button
    {
        protected override void OnClick()
        {
            if (OliviaGlob.TipoView == TiposEjecucion.Ninguno)
            {
                ///Comprueba que existe la red navegable configurada
                /*if (!OliviaGlob.CompruebaNwYCampos())
                {
                    HelperGlobal.ponMsg("No se encuentra red navegable, cambie Configuración: " + HelperGdb.OutStr,
                        System.Windows.MessageBoxImage.Warning);
                }
                else
                {*/
                    OliviaGlob.SetFlagTipEjec(TiposEjecucion.Reco);
                    OliviaGlob.ViewSetFlagTipEjec(TiposEjecucion.Reco);

                    if (OliviaGlob.Reco==null)
                        OliviaGlob.Reco = new Recogida();
                    DockpaneRecogidaViewModel.Reset();
                    DockpaneRecogidaViewModel.Show();
                //}
            }
            else if (OliviaGlob.ViewIsProps())
            {
                HelperGlobal.ponMsg(Resource1.String_estaenprops, System.Windows.MessageBoxImage.Warning);
            }
            else
            {
                HelperGlobal.ponMsg(Resource1.String_existe_ejec, System.Windows.MessageBoxImage.Warning);
            }
        }
    }
}
