private void SaveChanges()
        {
            // get the new expression
            string newExpression = Expression ?? "";

            // is it different?
            if (string.Compare(_origExpression, newExpression) != 0)
            {
                if (ArcGIS.Desktop.Framework.Dialogs.MessageBox.Show("Expression has changed. Do you wish to save it?", "Definition Query", System.Windows.MessageBoxButton.YesNo, System.Windows.MessageBoxImage.Question) == System.Windows.MessageBoxResult.Yes)
                {
                    // update internal var
                    _origExpression         = newExpression;
                    ControlProps.Expression = newExpression;
                    ThisDefinitionFilterItem.QueryExpression  = ControlProps.Expression;
                    ThisDefinitionFilterItem.DefinitionFilter = new CIMDefinitionFilter {
                        DefinitionExpression = ControlProps.Expression, Name = ThisDefinitionFilterItem.ExpressionName
                    };
                    Module1.Current.DefFilterVM.SelectedDefinitionFilter = ThisDefinitionFilterItem;
                    //We might be creating a new Filter. So we have to add the current filter to the collection of DefintionFilters
                    if (!Module1.Current.DefFilterVM.DefinitionFilters.Contains(ThisDefinitionFilterItem))
                    {
                        Module1.Current.DefFilterVM.DefinitionFilters.Add(ThisDefinitionFilterItem);
                    }
                    ApplyFilterChangesToLayer(ThisDefinitionFilterItem.ItemMapMember, Module1.Current.DefFilterVM.DefinitionFilters);

                    ThisQueryBuilderWindow.Close();
                }
            }
        }
Example #2
0
        private void SaveChanges()
        {
            // get the new expression
            string newExpression = Expression ?? "";

            // is it different?
            if (string.Compare(_origExpression, newExpression) != 0)
            {
                if (ArcGIS.Desktop.Framework.Dialogs.MessageBox.Show("Expression has changed. Do you wish to save it?", "Definition Query", System.Windows.MessageBoxButton.YesNo, System.Windows.MessageBoxImage.Question) == System.Windows.MessageBoxResult.Yes)
                {
                    // update internal var
                    _origExpression         = newExpression;
                    ControlProps.Expression = newExpression;
                    ThisDefinitionFilterItem.QueryExpression        = ControlProps.Expression;
                    ThisDefinitionFilterItem.CurrentDefinitionQuery = new DefinitionQuery {
                        WhereClause = ControlProps.Expression
                    };
                    Module1.Current.DefFilterVM.SelectedDefinitionFilter = ThisDefinitionFilterItem;
                    ApplyFilterChangesToLayer(ThisDefinitionFilterItem.ItemMapMember);

                    ThisQueryBuilderWindow.Close();
                }
            }
        }