Beispiel #1
0
 private void ListViewItem_MouseDown(object sender, MouseButtonEventArgs e)
 {
     if (!CheckHasDuplicateAlias())
     {
         ColumnEntity currentItem = (ColumnEntity)((ListViewItem)sender).DataContext;
         Collection <ColumnEntity> columnItems = (Collection <ColumnEntity>)ColumnList.ItemsSource;
         foreach (var item in columnItems)
         {
             if (currentItem != item)
             {
                 item.RenameVisibility = System.Windows.Visibility.Collapsed;
                 item.ViewVisibility   = System.Windows.Visibility.Visible;
             }
         }
     }
     else
     {
         ColumnEntity item = ((Collection <ColumnEntity>)ColumnList.ItemsSource).FirstOrDefault(v => v.RenameVisibility == Visibility.Visible);
         if (item != null)
         {
             item.RenameVisibility = System.Windows.Visibility.Collapsed;
             item.ViewVisibility   = System.Windows.Visibility.Visible;
             item.EditedColumnName = tempOriginalName;
         }
     }
 }
Beispiel #2
0
 internal void InitColumns()
 {
     columnEntities = new Collection <ColumnEntity>();
     if (SelectedFeatureLayer != null)
     {
         SelectedFeatureLayer.SafeProcess(() =>
         {
             var columns = SelectedFeatureLayer.FeatureSource.GetColumns();
             foreach (var column in columns)
             {
                 string editedName = column.ColumnName;
                 if (column.ColumnName.Contains("."))
                 {
                     int index  = column.ColumnName.IndexOf(".") + 1;
                     editedName = column.ColumnName.Substring(index, column.ColumnName.Length - index);
                 }
                 ColumnEntity entity     = new ColumnEntity();
                 entity.MaxLength        = column.MaxLength;
                 entity.ColumnName       = column.ColumnName;
                 entity.EditedColumnName = editedName;
                 entity.ColumnType       = column.TypeName;
                 entity.IsChecked        = true;
                 columnEntities.Add(entity);
             }
         });
     }
 }
Beispiel #3
0
        private void ListViewItem_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            ColumnEntity item = (ColumnEntity)((ListViewItem)sender).DataContext;

            tempOriginalName      = item.EditedColumnName;
            item.RenameVisibility = System.Windows.Visibility.Visible;
            item.ViewVisibility   = System.Windows.Visibility.Collapsed;
        }
Beispiel #4
0
        private void SetRenameVisibility(object sender)
        {
            TextBox      textBox = (TextBox)sender;
            ColumnEntity item    = (ColumnEntity)textBox.DataContext;

            if (CheckHasDuplicateAlias())
            {
                item.EditedColumnName = tempOriginalName;
            }
            item.RenameVisibility = System.Windows.Visibility.Collapsed;
            item.ViewVisibility   = System.Windows.Visibility.Visible;
        }