Beispiel #1
0
        public ExpressionEditorControl()
        {
            InitializeComponent();

            _subscriptions.Add(_options.SubscribeToUpdated(() => Options.Assign(_options)));
            _subscriptions.Add(_textEditorOptions.SubscribeToUpdated(() => TextEditorOptions.Assign(_textEditorOptions)));
            _subscriptions.Add(_textEditorSqlOptions.SubscribeToUpdated(() => TextEditorSqlOptions.Assign(_textEditorSqlOptions)));

            var il = new ImageList();

            il.Images.Add(ActiveQueryBuilder.View.WPF.Images.Metadata.Field.Value);            // 0
            il.Images.Add(ActiveQueryBuilder.View.WPF.Images.Metadata.UserTable.Value);        // 1
            il.Images.Add(ActiveQueryBuilder.View.WPF.Images.Metadata.UserView.Value);         // 2
            il.Images.Add(ActiveQueryBuilder.View.WPF.Images.Metadata.UserProcedure.Value);    // 3
            il.Images.Add(ActiveQueryBuilder.View.WPF.Images.Metadata.UserSynonym.Value);      // 4
            il.Images.Add(ActiveQueryBuilder.View.WPF.Images.TextEditor.Function.Value);       // 5

            SetImageList(il);

            Localize();

            var langProperty = DependencyPropertyDescriptor.FromProperty(LanguageProperty, GetType());

            langProperty.AddValueChanged(this, LanguaheChanged);

            Assign(_options);

            SqlEditor.Options = _textEditorOptions;

            TreeObjects.Options.SortingType      = ObjectsSortingType.NameExceptFields;
            TreeQueryObjects.Options.SortingType = ObjectsSortingType.NameExceptFields;

            TreeQueryObjects.SQLGenerationOptions.UseAltNames = true;

            TreeObjects.SQLContext      = SQLContext;
            TreeQueryObjects.SQLContext = SQLContext;

            TreeObjects.ValidateItemContextMenu      += TreeObjects_ValidateItemContextMenu;
            TreeQueryObjects.ValidateItemContextMenu += TreeQueryObjects_ValidateItemContextMenu;

            Assign(_options);
            AssignSqlTextEditorOptions(_textEditorSqlOptions);
            AssignTextEditorOptions(_textEditorOptions);

            DockPanelSqlContext.AutoHide    = !QueryObjectsTreePinned;
            DockPanelDatabaseShema.AutoHide = !ObjectsTreePinned;
        }
 public void SetOptions(Options options)
 {
     AddObjectDialogOptions.Assign(options.AddObjectDialogOptions);
     BehaviorOptions.Assign(options.BehaviorOptions);
     MainForm.DBView.Options.Assign(options.DatabaseSchemaViewOptions);
     DataSourceOptions.Assign(options.DataSourceOptions);
     DesignPaneOptions.Assign(options.DesignPaneOptions);
     ExpressionEditorOptions.Assign(options.ExpressionEditorOptions);
     QueryColumnListOptions.Assign(options.QueryColumnListOptions);
     QueryNavBarOptions.Assign(options.QueryNavBarOptions);
     SqlFormattingOptions.Assign(options.SqlFormattingOptions);
     SqlGenerationOptions.Assign(options.SqlGenerationOptions);
     TextEditorOptions.Assign(options.TextEditorOptions);
     TextEditorSqlOptions.Assign(options.TextEditorSqlOptions);
     UserInterfaceOptions.Assign(options.UserInterfaceOptions);
     VisualOptions.Assign(options.VisualOptions);
 }