69 lines
1.9 KiB
C#
69 lines
1.9 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 OliviaAddInPro.Helper;
|
|
using ArcGIS.Core.Data;
|
|
using System.Collections.ObjectModel;
|
|
using ArcGIS.Desktop.Internal.Framework.Controls;
|
|
|
|
namespace OliviaAddInPro.View
|
|
{
|
|
/// <summary>
|
|
/// Interaction logic for ProWndSelectFields.xaml
|
|
/// </summary>
|
|
public partial class ProWndSelectFields : ArcGIS.Desktop.Framework.Controls.ProWindow
|
|
{
|
|
private bool ok = false;
|
|
public FeatureClass fc = null;
|
|
public string err_st = string.Empty;
|
|
public ProWndSelectFields()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void comboBoxFields_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
{
|
|
if(comboBoxFields.SelectedIndex>0)
|
|
{
|
|
ObservableCollection<string> attribs_st =
|
|
HelperGdb.GetAttributes(fc, comboBoxFields.SelectedItem.ToString()).Result;
|
|
if (attribs_st.Count==0)
|
|
{
|
|
OliviaGlob.ponMsg(HelperGdb.out_st, MessageType.Error);
|
|
}
|
|
listBoxAttributes.ItemsSource = attribs_st;
|
|
}
|
|
}
|
|
|
|
private void Button_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
ok = true;
|
|
Close();
|
|
}
|
|
|
|
private void ProWindow_Closed(object sender, EventArgs e)
|
|
{
|
|
|
|
}
|
|
|
|
private void ProWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
|
{
|
|
if (ok)
|
|
DialogResult = true;
|
|
else
|
|
DialogResult = false;
|
|
}
|
|
}
|
|
}
|