116 lines
3.7 KiB
C#
116 lines
3.7 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows;
|
|
using System.Windows.Controls;
|
|
using System.Windows.Data;
|
|
using System.Windows.Documents;
|
|
using System.Windows.Input;
|
|
using System.Windows.Media;
|
|
using System.Windows.Media.Imaging;
|
|
using System.Windows.Navigation;
|
|
using System.Windows.Shapes;
|
|
using ArcGIS.Core.Data;
|
|
using ArcGIS.Desktop.Core;
|
|
using OliviaAddInPro.Helper;
|
|
using OliviaAddInPro.View;
|
|
using OliviaAddInPro.Model;
|
|
using ArcGIS.Core.Geometry;
|
|
using ArcGIS.Desktop.Mapping;
|
|
using ArcGIS.Desktop.Internal.Framework.Controls;
|
|
|
|
namespace OliviaAddInPro
|
|
{
|
|
/// <summary>
|
|
/// Interaction logic for PaneLimpiezaSub2View.xaml
|
|
/// </summary>
|
|
public partial class PaneLimpiezaSub2View : UserControl
|
|
{
|
|
public PaneLimpiezaSub2View()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void TextBox_PreviewTextInput(object sender, TextCompositionEventArgs e)
|
|
{
|
|
e.Handled = !PanelGlobal.IsValid(((TextBox)sender).Text + e.Text,0,9999);
|
|
}
|
|
|
|
private ArcGIS.Core.Geometry.Geometry selecGeom(FeatureClass fc, out string _texto, bool multisel)
|
|
{
|
|
ArcGIS.Core.Geometry.Geometry geomsal = null;
|
|
string texto = "";
|
|
|
|
if (fc != null)
|
|
{
|
|
//saca la ventana de selección de campo
|
|
ShowProWndSelectFields selfwnd = new ShowProWndSelectFields(fc, multisel);
|
|
if (selfwnd.SelFieldVals.Count > 0)
|
|
{
|
|
geomsal = HelperGdb.GetGeomSel(fc, selfwnd.SelField, selfwnd.SelFieldVals).Result;
|
|
texto = HelperGdb.TextoSal;
|
|
}
|
|
}
|
|
if (geomsal==null)
|
|
{
|
|
texto = Resource1.String_selec_capa;
|
|
if (HelperGdb.OutStr.Length > 0)
|
|
HelperGlobal.ponMsg(HelperGdb.OutStr, System.Windows.MessageBoxImage.Error);
|
|
}
|
|
|
|
_texto = texto;
|
|
return geomsal;
|
|
}
|
|
|
|
private void button_caparestr_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
FeatureClass fc = HelperGdb.OpenFtClassDialog(HelperGdb.TiposOpenFileDlg.OpenFtrClassPolygon);
|
|
string texto="";
|
|
|
|
OliviaGlob.Limp.GeomRestr = selecGeom(fc, out texto, true);
|
|
|
|
label_caparestr.Content = texto;
|
|
HelperGdb.Free(fc);
|
|
}
|
|
|
|
private void button_capaniv_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
FeatureClass fc = HelperGdb.OpenFtClassDialog(HelperGdb.TiposOpenFileDlg.OpenFtrClassPolygon);
|
|
string texto = "";
|
|
|
|
OliviaGlob.Limp.GeomNiv = selecGeom(fc, out texto, true);
|
|
|
|
label_capaniv.Content = texto;
|
|
HelperGdb.Free(fc);
|
|
|
|
}
|
|
|
|
private void button_capazon_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
FeatureClass fc = HelperGdb.OpenFtClassDialog(HelperGdb.TiposOpenFileDlg.OpenFtrClassPolygon);
|
|
string texto = "";
|
|
|
|
OliviaGlob.Limp.GeomZon = selecGeom(fc, out texto, true);
|
|
|
|
label_capazon.Content = texto;
|
|
HelperGdb.Free(fc);
|
|
|
|
}
|
|
|
|
private void button_capainst_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
FeatureClass fc = HelperGdb.OpenFtClassDialog(HelperGdb.TiposOpenFileDlg.OpenFtrClassPoint);
|
|
string texto = "";
|
|
ArcGIS.Core.Geometry.Geometry geomsal = selecGeom(fc, out texto, false);
|
|
if (geomsal != null && geomsal is MapPoint mp)
|
|
{
|
|
OliviaGlob.Limp.CoordsInstal = mp.Coordinate2D;
|
|
}
|
|
label_capainst.Content = texto;
|
|
HelperGdb.Free(fc);
|
|
}
|
|
}
|
|
}
|