예제 #1
0
        private void HandleTreeItemChanged(object sender, RoutedPropertyChangedEventArgs <object> e)
        {
            object item = TreeViewCategories.SelectedItem;

            if (item is Filter)
            {
                ItemFilterGrid.Visibility = Visibility.Visible;
                CategoryGrid.Visibility   = Visibility.Collapsed;

                CategoryGrid.DataContext   = null;
                ItemFilterGrid.DataContext = Filter;

                TreeViewCategories.ContextMenu = TreeViewCategories.Resources["FilterMenu"] as ContextMenu;
            }
            else
            {
                ItemFilterGrid.Visibility = Visibility.Collapsed;
                CategoryGrid.Visibility   = Visibility.Visible;


                CategoryGrid.DataContext   = Category;
                ItemFilterGrid.DataContext = null;

                TreeViewCategories.ContextMenu = TreeViewCategories.Resources["CategoryMenu"] as ContextMenu;
            }

            TreeViewCategories.UpdateLayout();
        }
예제 #2
0
    /// <summary>
    /// Reloads tree content.
    /// </summary>
    protected override void OnLoadComplete(EventArgs e)
    {
        base.OnLoadComplete(e);

        // Reload tree after selected site has changed.
        if (RequestHelper.IsPostBack())
        {
            TreeViewCategories.ReloadData();
        }
    }
예제 #3
0
        private void DisableFilterHandler(object sender, RoutedEventArgs e)
        {
            var filter = Filter;

            if (filter == null)
            {
                return;
            }

            filter.Enabled = false;
            TreeViewCategories.UpdateLayout();
        }
예제 #4
0
 private void LoadCategories()
 {
     TreeViewCategories.Nodes.Clear();
     foreach (Category cat in m_doc.Settings.Categories)
     {
         if (cat.AllowsBoundParameters == true)
         {
             if (!(string.IsNullOrEmpty(TxbFilterCat.Text)))
             {
                 if (!cat.Name.ToLower().Contains(TxbFilterCat.Text.ToLower()))
                 {
                     continue;
                 }
             }
             TreeNode tn = TreeViewCategories.Nodes.Add(cat.Name, cat.Name);
             tn.Tag = cat;
         }
     }
     TreeViewCategories.Sort();
 }
예제 #5
0
        private void Categories_Load(object sender, EventArgs e)
        {
            try
            {
                Util.WriteMethodInfoToConsole();
                myAdminTool.OTCSDocumentManagement.Node categoriesNode = fCWSClient.GetRootNode("CategoriesWS");// fCWSClient.GetNode(2006);

                if (categoriesNode != null)
                {
                    OTCS.LLTreeNode categNode = new OTCS.LLTreeNode();

                    if (categNode != null)
                    {
                        categNode.Data               = categoriesNode;
                        categNode.ImageIndex         = (int)frmMain.IconTypes.FOLDER_ICON;
                        categNode.SelectedImageIndex = (int)frmMain.IconTypes.FOLDER_ICON;

                        // Add the root level node

                        TreeViewCategories.Nodes.Add(categNode);
                        TreeViewCategories.SelectedNode = categNode;

                        // Add the first level of children

                        addLLNodes(categNode);
                    }
                    TreeViewCategories.ExpandAll();
                }
            }
            catch (Exception ex)
            {
                frmMain.category = -999;
                MessageBox.Show(string.Format("FEHLER Frm Categories\n{0}", ex.Message), "FEHLER - frmCategories Categories_Load", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.Close();
            }
        }