Beispiel #1
0
        private void CheckBox_ResourceTypes_All_Click(object sender, RoutedEventArgs e)
        {
            CheckBox CheckBox_AllResourceTypes = (CheckBox)sender;

            if (CheckBox_AllResourceTypes.IsChecked == true)
            {
                foreach (TreeViewItem tvi in TreeView_ResourceType.GetContainers())
                {
                    ResourceTypeTree current = tvi.Header as ResourceTypeTree;
                    if (current.isSelected != true)
                    {
                        current.isSelected = true;
                    }
                    if (current.Children != null && current.Children.Count > 0)
                    {
                        selecteAllChildItem(current);
                    }
                }
            }
            else
            {
                foreach (TreeViewItem tvi in TreeView_ResourceType.GetContainers())
                {
                    ResourceTypeTree current = tvi.Header as ResourceTypeTree;
                    if (current.isSelected != false)
                    {
                        current.isSelected = false;
                    }
                    if (current.Children != null && current.Children.Count > 0)
                    {
                        unSelecteAllChildItem(current);
                    }
                }
            }
        }
Beispiel #2
0
        private ResourceType createResourceType(ResourceTypeTree resourceType)
        {
            ResourceType root = new ResourceType();

            root.Name       = resourceType.Name;
            root.isSelected = resourceType.isSelected;
            if (root.isSelected == true)
            {
                isNoResourceTypeSelected = false;
            }
            else
            {
                isAllResourceTypeSelected = false;
            }
            root.ResourceTypeID = resourceType.ResourceTypeID;
            if (resourceType.Children != null)
            {
                root.Children = new ObservableCollection <ResourceType>();
                foreach (ResourceTypeTree rtt in resourceType.Children)
                {
                    ResourceType rt = createResourceType(rtt);
                    root.Children.Add(rt);
                }
            }
            return(root);
        }
Beispiel #3
0
 void unSelecteAllAncestorItem(ResourceTypeTree resourceType)
 {
     if (resourceType.Parent != null)
     {
         resourceType.Parent.isSelected = false;
         unSelecteAllAncestorItem(resourceType.Parent);
     }
 }
    /// <summary>
    /// Resets selected filters.
    /// </summary>
    /// <param name="sender">Sender object</param>
    /// <param name="e">Event Arguments</param>
    protected void btnResetFilters_Click(object sender, EventArgs e)
    {
        YearMonthtree.ClearSelection();
        CategoryNodeTree.ClearSelection();
        AuthorsView.ClearSelection();
        ResourceTypeTree.ClearSelection();
        txtFilter.Text = string.Empty;

        ResourceListView_OnSortButtonClicked(sender, e);
    }
Beispiel #5
0
        public AdvancedSearchPage()
        {
            InitializeComponent();
            allResourceTypes = ResourceTypeTree.getResourceTypeList();
            TreeView_ResourceType.ItemsSource = allResourceTypes;

            RetrieveNumber rn = new RetrieveNumber();

            rn.TotalNumber   = int.Parse(ConstantCollection.maxRecords);
            rn.firstNumber   = int.Parse(ConstantCollection.firstTimeSearchNum);
            rn.regularNumber = ConstantCollection.eachInvokeSearchNum_ExceptFirstTime;
            Grid_RetrieveNumber.DataContext = rn;

            CheckBox_QueryQoS.IsChecked = ConstantCollection.isQueryServicePerformanceScore;
            if (CheckBox_QueryQoS.IsChecked == true)
            {
                CheckBox_QueryQoS_AtServerSide.IsEnabled = true;
                CheckBox_QueryQoS_AtClientSide.IsEnabled = true;
            }
            else
            {
                CheckBox_QueryQoS_AtServerSide.IsEnabled = false;
                CheckBox_QueryQoS_AtClientSide.IsEnabled = false;
            }
            if (ConstantCollection.queryServicePerformanceScoreAtServerSide)
            {
                CheckBox_QueryQoS_AtServerSide.IsChecked = true;
            }
            else
            {
                CheckBox_QueryQoS_AtClientSide.IsChecked = true;
            }

            CheckBox_CalculateRelevance.IsChecked = ConstantCollection.isCalculateRelevance;
            if (CheckBox_CalculateRelevance.IsChecked == true)
            {
                CheckBox_CalculateRelevance_AtServerSide.IsEnabled = true;
                CheckBox_CalculateRelevance_AtClientSide.IsEnabled = false;
            }
            else
            {
                CheckBox_CalculateRelevance_AtServerSide.IsEnabled = false;
                CheckBox_CalculateRelevance_AtClientSide.IsEnabled = false;
            }
            CheckBox_CalculateRelevance_AtServerSide.IsChecked = true;
            setContentHeightWidthToFixBrowserWindowSize();
            App.Current.Host.Content.Resized += new EventHandler(content_Resized);
        }
Beispiel #6
0
        void unSelecteAllChildItem(ResourceTypeTree resourceType)
        {
            if (resourceType.Children != null && resourceType.Children.Count > 0)
            {
                foreach (ResourceTypeTree type1 in resourceType.Children)
                {
                    if (type1.isSelected != false)
                    {
                        type1.isSelected = false;
                    }

                    if (type1.Children != null && type1.Children.Count > 0)
                    {
                        unSelecteAllChildItem(type1);
                    }
                }
            }
        }
Beispiel #7
0
        private void Checkbox_Unchecked(object sender, RoutedEventArgs e)
        {
            CheckBox button = sender as CheckBox;

            button.IsChecked = false;
            ResourceTypeTree resourceType = button.DataContext as ResourceTypeTree;

            if (resourceType != null)
            {
                if (resourceType.isSelected != false)
                {
                    resourceType.isSelected = false;
                }

                //just unselect all the child treeviewItem of current selected treeviewItem, and the root treeViewItem "All"
                if (TreeView_ResourceType.GetSelectedContainer() != null)
                {
                    CheckBox_ResourceTypes_All.IsChecked = false;
                    foreach (ResourceTypeTree r in allResourceTypes)
                    {
                        if (r.ResourceTypeID.Equals(ConstantCollection.resourceType_PickID_All))
                        {
                            r.isSelected = false;
                        }
                    }

                    TreeViewItem     tvi     = TreeView_ResourceType.GetSelectedContainer();
                    ResourceTypeTree current = tvi.Header as ResourceTypeTree;
                    if (current == resourceType)
                    {
                        if (resourceType.Children != null && resourceType.Children.Count > 0)
                        {
                            unSelecteAllChildItem(resourceType);
                        }
                    }
                }

                //if (resourceType.ParentResourceType != null)
                //{
                //    resourceType.ParentResourceType.isSelected = false;
                //    unSelecteAllAncestorItem(resourceType.ParentResourceType);
                //}

                //if all child treeViemItem of Parent treeviewItem of current treeviewItem are unselect, the parent should be unselected
                if (resourceType.Parent != null)
                {
                    bool allUnSelect = true;
                    foreach (ResourceTypeTree type1 in resourceType.Parent.Children)
                    {
                        if (type1.isSelected != false)
                        {
                            allUnSelect = false;
                        }
                    }

                    if (allUnSelect == true)
                    {
                        resourceType.Parent.isSelected = false;
                    }
                }
            }
            ObservableCollection <ResourceTypeTree> a = TreeView_ResourceType.ItemsSource as ObservableCollection <ResourceTypeTree>;
        }
Beispiel #8
0
        private void CheckBox_Checked(object sender, RoutedEventArgs e)
        {
            CheckBox button = sender as CheckBox;

            button.IsChecked = true;
            ResourceTypeTree resourceType = button.DataContext as ResourceTypeTree;

            if (resourceType != null)
            {
                if (resourceType.isSelected != true)
                {
                    resourceType.isSelected = true;
                }

                if (TreeView_ResourceType.GetSelectedContainer() != null)
                {
                    TreeViewItem     tvi     = TreeView_ResourceType.GetSelectedContainer();
                    ResourceTypeTree current = tvi.Header as ResourceTypeTree;
                    if (current == resourceType)
                    {
                        if (resourceType.Children != null && resourceType.Children.Count > 0)
                        {
                            selecteAllChildItem(resourceType);
                        }
                    }
                }
                //if all child treeViemItem of Parent treeviewItem of current treeviewItem are select, the parent should be selected
                if (resourceType.Parent != null)
                {
                    if (resourceType.Parent.ResourceTypeID != ConstantCollection.resourceType_PickID_All)
                    {
                        resourceType.Parent.isSelected = true;
                    }

                    bool allSelect = true;
                    foreach (ResourceTypeTree type1 in resourceType.Parent.Children)
                    {
                        if (type1.isSelected != true)
                        {
                            allSelect = false;
                        }
                    }

                    if (allSelect == true)
                    {
                        resourceType.Parent.isSelected = true;
                    }
                }

                bool allSelect1 = true;
                foreach (ResourceTypeTree rt in allResourceTypes)
                {
                    if (rt.isSelected == false)
                    {
                        allSelect1 = false;
                    }
                }
                if (allSelect1)
                {
                    CheckBox_ResourceTypes_All.IsChecked = true;
                }
            }
            ObservableCollection <ResourceTypeTree> a = TreeView_ResourceType.ItemsSource as ObservableCollection <ResourceTypeTree>;
        }