Ejemplo n.º 1
0
        /// <summary>
        /// Filters the grid based on tool.
        /// </summary>
        /// <param name="tool">The tool.</param>
        private void FilterGridBasedOnTool(RadialMenuTool tool)
        {
            string       key = tool.Key;
            CategoryType category;

            try
            {
                // get the CategoryType from the Tag
                if (tool.Tag is CategoryType)
                {
                    category = (CategoryType)tool.Tag;

                    // if the currentGridData is still the defualt data, bind the Inventory data to the grid
                    if (this.currentGridData == MainForm.DefaultGridData)
                    {
                        this.gridInventory.DataSource = AutoPartsCatalog.Instance.InventoryTable;
                        this.currentGridData          = UI.Inventory;
                    }

                    // apply a filter to the Category column based on the CategoryType
                    UltraGridBand band   = this.gridInventory.DisplayLayout.Bands["Inventory"];
                    ColumnFilter  filter = band.ColumnFilters["Category"];
                    if (filter.FilterConditions.Count > 0)
                    {
                        filter.FilterConditions[0].CompareValue = (int)category;
                    }
                    else
                    {
                        filter.FilterConditions.Add(FilterComparisionOperator.Equals, (int)category);
                    }

                    // add secondary filter to the Components column
                    filter = band.ColumnFilters["Component"];
                    if (string.IsNullOrEmpty(key) == false)
                    {
                        if (filter.FilterConditions.Count > 0)
                        {
                            filter.FilterConditions[0].CompareValue = key;
                        }
                        else
                        {
                            filter.FilterConditions.Add(FilterComparisionOperator.Equals, key);
                        }
                    }
                    else
                    {
                        filter.ClearFilterConditions();
                    }

                    this.ChangeHeader(category, key);
                }
            }
            finally
            {
                this.gridInventory.DisplayLayout.PerformAutoResizeColumns(false, PerformAutoSizeType.VisibleRows);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Initializes the UI controls.
        /// </summary>
        private void InitializeUI()
        {
            // Assign the images
            Image background = Utilities.GetCachedImage(CachedImages.Background);

            this.lblLogo.Appearance.ImageBackground = background;
            this.ultraToolbarsManager1.Ribbon.CaptionAreaAppearance.ImageBackground = background;
            this.MainForm_Fill_Panel.Appearance.ImageBackground         = background;
            this.tcSchedule.TabHeaderAreaAppearance.ImageBackground     = background;
            this.gridInventory.DisplayLayout.Appearance.ImageBackground = background;
            this.dvSchedule.Appearance.ImageBackground       = background;
            this.wvSchedule.Appearance.ImageBackground       = background;
            this.mvSchedule.Appearance.ImageBackground       = background;
            this.ultraPanel1.Appearance.ImageBackground      = background;
            this.lblLogo.Appearance.ImageBackground          = Utilities.GetCachedImage(CachedImages.Logo);
            this.btnInventory.Appearance.Image               = Utilities.GetCachedImage(CachedImages.Inventory);
            this.btnSchedule.Appearance.Image                = Utilities.GetCachedImage(CachedImages.Schedule);
            this.tcSchedule.Tabs["Daily"].Appearance.Image   = Utilities.GetCachedImage(CachedImages.Daily);
            this.tcSchedule.Tabs["Weekly"].Appearance.Image  = Utilities.GetCachedImage(CachedImages.Weekly);
            this.tcSchedule.Tabs["Monthly"].Appearance.Image = Utilities.GetCachedImage(CachedImages.Monthly);
            this.ultraRadialMenu1.ToolSettings.CenterButtonAppearance.Image = Utilities.GetCachedImage(CachedImages.RadialCenter);

            // assign UIElement filters
            this.ultraToolbarsManager1.CreationFilter = new Showcase.INGear.ToolbarsManagerUIElementFilter();
            this.dvSchedule.CreationFilter            = new Showcase.INGear.DayViewUIElementFilter();

            // create the radial menu tools
            foreach (CategoryType category in Enum.GetValues(typeof(CategoryType)))
            {
                RadialMenuTool tool = new RadialMenuTool();
                tool.Tag         = category;
                tool.ToolTipText = Utilities.LocalizeString(Utilities.CategoryTypeToString(category));
                tool.ToolSettings.Appearance.Image = Utilities.GetCachedImage(Utilities.CachedImagesFromCategory(category));
                foreach (string sub in AutoPartsCatalog.GetSubCategories(category))
                {
                    RadialMenuTool childTool = new RadialMenuTool(sub);
                    childTool.Tag  = category;
                    childTool.Text = Utilities.LocalizeString(sub);
                    tool.Tools.Add(childTool);
                }
                this.ultraRadialMenu1.CenterTool.Tools.Add(tool);
            }

            this.LocalizeStrings();
        }