Ejemplo n.º 1
0
        /// <summary>
        /// Initalizes a new instance of the <see cref="ElasticIndexController"/> class.
        /// </summary>
        public ElasticIndexController()
        {
            TargetObjectType = typeof(IElasticSearchIndex);
            SimpleAction tempAction = null;

            try
            {
                tempAction = new SimpleAction(this, "ElasticSearchReIndex", PredefinedCategory.Edit)
                {
                    Caption                 = "Rebuild",
                    ConfirmationMessage     = "Do you want to rebuild the ElasticSearch Index?",
                    SelectionDependencyType = SelectionDependencyType.RequireMultipleObjects,
                };
                tempAction.Execute += ReIndexAction_Execute;
                ReIndexAction       = tempAction;
                tempAction          = null;
            }
            finally
            {
                if (tempAction != null)
                {
                    tempAction.Dispose();
                }
            }

            tempAction = null;
            try
            {
                tempAction = new SimpleAction(this, "ElasticSearchFullReIndex", PredefinedCategory.Edit)
                {
                    Caption             = "Rebuild all",
                    ConfirmationMessage = "Do you want to rebuild all ElasticSearch Indexes?",
                    TargetViewType      = ViewType.ListView,
                    TypeOfView          = typeof(DevExpress.ExpressApp.ListView),
                };
                tempAction.Execute            += ElasticSearchFullReIndex_Execute;
                ElasticSearchFullReIndexAction = tempAction;
                tempAction = null;
            }
            finally
            {
                if (tempAction != null)
                {
                    tempAction.Dispose();
                }
            }

            RegisterActions(ReIndexAction, ElasticSearchFullReIndexAction);
        }
        /// <summary>
        /// Initalizes a new instance of the <see cref="ElasticIndexController"/> class.
        /// </summary>
        public ElasticIndexController()
        {
            TargetObjectType = typeof(IElasticSearchIndex);

#pragma warning disable CC0009 // Use object initializer
            SimpleAction tempAction = null;
            try
            {
                tempAction                         = new SimpleAction(this, "ElasticSearchReIndex", PredefinedCategory.Edit);
                tempAction.Caption                 = "Rebuild";
                tempAction.ConfirmationMessage     = "Do you want to rebuild the ElasticSearch Index?";
                tempAction.SelectionDependencyType = SelectionDependencyType.RequireMultipleObjects;
                tempAction.Execute                += ReIndexAction_Execute;
                ReIndexAction                      = tempAction;
                tempAction                         = null;
            }
            finally
            {
                if (tempAction != null)
                {
                    tempAction.Dispose();
                }
            }

            tempAction = null;
            try
            {
                tempAction                     = new SimpleAction(this, "ElasticSearchFullReIndex", PredefinedCategory.Edit);
                tempAction.Caption             = "Rebuild all";
                tempAction.ConfirmationMessage = "Do you want to rebuild all ElasticSearch Indexes?";
                tempAction.TargetViewType      = ViewType.ListView;
                tempAction.TypeOfView          = typeof(DevExpress.ExpressApp.ListView);
                tempAction.Execute            += ElasticSearchFullReIndex_Execute;
                ElasticSearchFullReIndexAction = tempAction;
                tempAction                     = null;
            }
            finally
            {
                if (tempAction != null)
                {
                    tempAction.Dispose();
                }
            }
#pragma warning restore CC0009 // Use object initializer

            RegisterActions(ReIndexAction, ElasticSearchFullReIndexAction);
        }
Ejemplo n.º 3
0
        public FilterPanelListViewController()
        {
#pragma warning disable CC0009 // Use object initializer
#pragma warning disable S2583  // Conditionally executed blocks should be reachable
            ParametrizedAction tempAction = null;
            try
            {
                tempAction                 = new ParametrizedAction(this, "FilterPanelSearchEdit", FilterPanelGroup, typeof(string));
                tempAction.Caption         = "Search";
                tempAction.ToolTip         = "Search entries that contain the specified words";
                tempAction.NullValuePrompt = "Text to search";
                tempAction.PaintStyle      = ActionItemPaintStyle.Image;
                tempAction.Execute        += SearchTextActionExecute;
                searchTextAction           = tempAction;
                tempAction                 = null;
            }
            finally
            {
                if (tempAction != null)
                {
                    tempAction.Dispose();
                }
            }

            SimpleAction tempSimpleAction = null;
            try
            {
                tempSimpleAction            = new SimpleAction(this, "FilterPanelFuzzySearch", FilterPanelGroup);
                tempSimpleAction.Caption    = "Fuzzy Search";
                tempSimpleAction.PaintStyle = ActionItemPaintStyle.Caption;
                tempSimpleAction.Execute   += FuzzySearchActionExecute;
                fuzzySearchAction           = tempSimpleAction;
                tempSimpleAction            = null;
            }
            finally
            {
                if (tempSimpleAction != null)
                {
                    tempSimpleAction.Dispose();
                }
            }

            SingleChoiceAction tempChoiceAction = null;
            try
            {
                tempChoiceAction            = new SingleChoiceAction(this, "FilterPanelFilterFields", FilterPanelGroup);
                tempChoiceAction.Caption    = "Search in";
                tempChoiceAction.ImageName  = "Action_ParametrizedAction";
                tempChoiceAction.PaintStyle = ActionItemPaintStyle.Caption;
                newFilterFieldsAction       = tempChoiceAction;
                tempChoiceAction            = null;
            }
            finally
            {
                if (tempChoiceAction != null)
                {
                    tempChoiceAction.Dispose();
                }
            }

            RegisterActions(searchTextAction, fuzzySearchAction, newFilterFieldsAction);

            Forms.Timer tempTimer = null;
            try
            {
                tempTimer          = new Forms.Timer();
                tempTimer.Interval = 500;
                tempTimer.Tick    += SearchTextTimer_TickAsync;
                searchTextTimer    = tempTimer;
                tempTimer          = null;
            }
            finally
            {
                if (tempTimer != null)
                {
                    tempTimer.Dispose();
                }
            }
#pragma warning restore S2583  // Conditionally executed blocks should be reachable
#pragma warning restore CC0009 // Use object initializer
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="FilterPanelListViewController"/> class.
        /// </summary>
        public FilterPanelListViewController()
        {
            ParametrizedAction tempAction = null;

            try
            {
                tempAction = new ParametrizedAction(this, "FilterPanelSearchEdit", FilterPanelGroup, typeof(string))
                {
                    Caption         = "Search",
                    ToolTip         = "Search entries that contain the specified words",
                    NullValuePrompt = "Text to search",
                    PaintStyle      = ActionItemPaintStyle.Image
                };
                tempAction.Execute += SearchTextActionExecute;
                searchTextAction    = tempAction;
                tempAction          = null;
            }
            finally
            {
                if (tempAction != null)
                {
                    tempAction.Dispose();
                }
            }

            SimpleAction tempSimpleAction = null;

            try
            {
                tempSimpleAction = new SimpleAction(this, "FilterPanelFuzzySearch", FilterPanelGroup)
                {
                    Caption    = "Fuzzy Search",
                    PaintStyle = ActionItemPaintStyle.Caption
                };
                tempSimpleAction.Execute += FuzzySearchActionExecute;
                fuzzySearchAction         = tempSimpleAction;
                tempSimpleAction          = null;
            }
            finally
            {
                if (tempSimpleAction != null)
                {
                    tempSimpleAction.Dispose();
                }
            }

            SingleChoiceAction tempChoiceAction = null;

            try
            {
                tempChoiceAction = new SingleChoiceAction(this, "FilterPanelFilterFields", FilterPanelGroup)
                {
                    Caption    = "Search in",
                    ImageName  = "Action_ParametrizedAction",
                    PaintStyle = ActionItemPaintStyle.Caption
                };
                newFilterFieldsAction = tempChoiceAction;
                tempChoiceAction      = null;
            }
            finally
            {
                if (tempChoiceAction != null)
                {
                    tempChoiceAction.Dispose();
                }
            }

            RegisterActions(searchTextAction, fuzzySearchAction, newFilterFieldsAction);

            Forms.Timer tempTimer = null;
            try
            {
                tempTimer = new Forms.Timer
                {
                    Interval = 500
                };
                tempTimer.Tick += SearchTextTimer_TickAsync;
                searchTextTimer = tempTimer;
                tempTimer       = null;
            }
            finally
            {
                if (tempTimer != null)
                {
                    tempTimer.Dispose();
                }
            }
        }