コード例 #1
0
 public static void ConnectorMainViewRefreshControls(IDocumentTemplateSelection documentTemplateSelection, ISearchExplorer searchExplorer, IConnectorExplorer connectorExplorer,
                                                     IWorkflowExplorer workflowExplorer, TabControl tabControl, TabItem workflowTabItem,
                                                     TabItem templateTabItem, TabItem searchTabItem, TabItem navigatorTabItem
                                                     )
 {
     if (tabControl.SelectedItem == workflowTabItem)
     {
         workflowExplorer.RefreshControls();
     }
     else if (tabControl.SelectedItem == templateTabItem)
     {
         documentTemplateSelection.RefreshControls();
     }
     else if (tabControl.SelectedItem == searchTabItem)
     {
         searchExplorer.RefreshControls();
     }
     else if (tabControl.SelectedItem == navigatorTabItem)
     {
         connectorExplorer.RefreshControls();
     }
 }
コード例 #2
0
        public static void ConnectorMainViewInitialize(IDocumentTemplateSelection documentTemplateSelection, ISearchExplorer searchExplorer, IConnectorExplorer connectorExplorer,
                                                       IWorkflowExplorer workflowExplorer, TabControl tabControl, TabItem workflowTabItem, TabItem emptyConfigurationTabItem,
                                                       TabItem templateTabItem, TabItem searchTabItem, TabItem navigatorTabItem, object inspector, StatusBar statusBar
                                                       )
        {
            if (inspector != null)
            {
                statusBar.Visibility = System.Windows.Visibility.Collapsed;
            }

            try
            {
                workflowTabItem.Visibility           = System.Windows.Visibility.Collapsed;
                emptyConfigurationTabItem.Visibility = System.Windows.Visibility.Collapsed;
                templateTabItem.Visibility           = System.Windows.Visibility.Collapsed;
                searchTabItem.Visibility             = System.Windows.Visibility.Collapsed;
                navigatorTabItem.Visibility          = System.Windows.Visibility.Collapsed;
                documentTemplateSelection.Initialize(ConfigurationManager.GetInstance().GetSiteSettings(), ConfigurationManager.GetInstance().GetDocumentTemplates(ApplicationContext.Current.GetApplicationType()));
                searchExplorer.Initialize(ConfigurationManager.GetInstance().GetSiteSettings(), ConfigurationManager.GetInstance().GetDocumentTemplates());
                connectorExplorer.Initialize(ConfigurationManager.GetInstance().GetSiteSettings(), ConfigurationManager.GetInstance().GetExplorerLocations(ApplicationContext.Current.GetApplicationType()));
                workflowExplorer.Initialize(ConfigurationManager.GetInstance().GetSiteSettings(), ConfigurationManager.GetInstance().GetWorkflowConfigurations());
                if (documentTemplateSelection.HasAnythingToDisplay == true ||
                    searchExplorer.HasAnythingToDisplay == true ||
                    workflowExplorer.HasAnythingToDisplay == true ||
                    connectorExplorer.HasAnythingToDisplay == true)
                {
                    bool isTabSelected = false;
                    if (documentTemplateSelection.HasAnythingToDisplay == true)
                    {
                        isTabSelected = true;
                        templateTabItem.Visibility = System.Windows.Visibility.Visible;
                        tabControl.SelectedItem    = templateTabItem;
                    }

                    if (connectorExplorer.HasAnythingToDisplay == true)
                    {
                        navigatorTabItem.Visibility = System.Windows.Visibility.Visible;
                        if (isTabSelected == false)
                        {
                            tabControl.SelectedItem = navigatorTabItem;
                            isTabSelected           = true;
                        }
                    }

                    if (searchExplorer.HasAnythingToDisplay == true)
                    {
                        searchTabItem.Visibility = System.Windows.Visibility.Visible;
                        if (isTabSelected == false)
                        {
                            tabControl.SelectedItem = searchTabItem;
                        }
                    }

                    if (workflowExplorer.HasAnythingToDisplay == true)
                    {
                        workflowTabItem.Visibility = System.Windows.Visibility.Visible;
                        if (isTabSelected == false)
                        {
                            tabControl.SelectedItem = workflowTabItem;
                        }
                    }
                }
                else
                {
                    emptyConfigurationTabItem.Visibility = System.Windows.Visibility.Visible;
                    tabControl.SelectedItem = emptyConfigurationTabItem;
                }
            }
            catch (Exception e)
            {
                MessageBox.Show(e.ToString());
            }
        }