Exemple #1
0
        //public event EventHandler<AdvanceOrRawArg> SearchDataDefined;

        //void SearchView_CommandExecuted(object sender, Arg_CommandExecuted e)
        //{
        //    (e.Command as I_Command).Execute(this);
        //}
        public void SetAreaInitializer(SearchEntityAreaInitializer newAreaInitializer)
        {
            SearchInitializer = newAreaInitializer;

            SearchView          = AgentUICoreMediator.GetAgentUICoreMediator.UIManager.GenerateViewOfSearchEntityArea();
            RawSearchEntityArea = new RawSearchEntityArea();
            RawSearchEntityArea.SetAreaInitializer(newAreaInitializer);
            RawSearchEntityArea.SearchDataDefined += RawSearchEntityArea_SearchDataDefined;
            SearchView.AddSimpleSearchView(RawSearchEntityArea.RawSearchView);


            AdvancedSearchEntityAre = new AdvancedSearchEntityArea();
            AdvancedSearchEntityAre.SetAreaInitializer(newAreaInitializer);
            AdvancedSearchEntityAre.SearchDataDefined += AdvancedSearchEntityAre_SearchDataDefined;
            SearchView.AddAdvancedSearchView(AdvancedSearchEntityAre.AdvancedSearchView);

            if (newAreaInitializer.EditSearchRepository != null)
            {
                if (newAreaInitializer.EditSearchRepository.Phrases.Any(x => !(x is SearchProperty)))
                {
                    SearchView.ActivateAdvancedView();
                }
                else
                {
                    SearchView.ActivateRawView();
                }
            }
        }