Ejemplo n.º 1
0
        protected void AddTest(Test Test)
        {
            this.Test = Test;

            Test.PrepareFinalize();

            Test.CategoryList.ForEach(x =>
            {
                if (!CategoryMap.ContainsKey(x.Name))
                {
                    CategoryMap.Add(x.Name, new List <Test>()
                    {
                        Test
                    });
                }
                else
                {
                    CategoryMap[x.Name].Add(Test);
                }
            });

            _reporterList.ForEach(x => x.AddTest());

            UpdateReportStatus(Test.Status);
        }
        public int?GetCategory(int category)
        {
            if (CategoryMap.ContainsKey(category))
            {
                return(CategoryMap[category]);
            }

            return(null);
        }
Ejemplo n.º 3
0
        public override void ChangeCategory(UIElement elem)
        {
            foreach (var btn in CategoryMap.Keys)
            {
                btn.Selected = false;
            }
            InventoryButton.Selected = false;

            UIButton button = (UIButton)elem;

            button.Selected = true;
            SetMode((elem == InventoryButton) ? 2 : 1);
            if (elem == InventoryButton)
            {
                if (CurrentCategory != CurrentInventory && LotController.ObjectHolder.DonateMode)
                {
                    UIAlert.Alert(GameFacade.Strings.GetString("f114", "2"), GameFacade.Strings.GetString("f114", "3"), true);
                }
                CurrentCategory = CurrentInventory;
            }
            else
            {
                if (!CategoryMap.ContainsKey(button))
                {
                    return;
                }
                CurrentCategory = UICatalog.Catalog[CategoryMap[button]];
            }
            Catalog.SetCategory(CurrentCategory);

            int total = Catalog.TotalPages();

            OldSelection = -1;

            ProductCatalogSlider.MaxValue = total - 1;
            ProductCatalogSlider.Value    = 0;

            InventoryCatalogRoommateSlider.MaxValue = total - 1;
            InventoryCatalogRoommateSlider.Value    = 0;

            InventoryCatalogVisitorSlider.MaxValue = total - 1;
            InventoryCatalogVisitorSlider.Value    = 0;

            ProductCatalogNextPageButton.Disabled           = (total == 1);
            InventoryCatalogRoommateNextPageButton.Disabled = (total == 1);
            InventoryCatalogVisitorNextPageButton.Disabled  = (total == 1);

            ProductCatalogPreviousPageButton.Disabled           = true;
            InventoryCatalogRoommatePreviousPageButton.Disabled = true;
            InventoryCatalogVisitorPreviousPageButton.Disabled  = true;

            return;
        }
Ejemplo n.º 4
0
        public override void ChangeCategory(UIElement elem)
        {
            QueryPanel.InInventory = false;
            foreach (var btn in CategoryMap.Keys)
            {
                btn.Selected = false;
            }

            UIButton button = (UIButton)elem;

            button.Selected = true;
            if (!CategoryMap.ContainsKey(button))
            {
                return;
            }
            CurrentCategory = UICatalog.Catalog[CategoryMap[button]];
            Catalog.SetCategory(CurrentCategory);

            var isRoof = CategoryMap[button] == 6;

            RoofShallowBtn.Visible = isRoof;
            RoofSteepBtn.Visible   = isRoof;
            RoofSlider.Visible     = isRoof;
            RoofSlider.Value       = 1.25f - LotController.vm.Context.Architecture.RoofPitch;

            int total = Catalog.TotalPages();

            OldSelection = -1;

            SubtoolsSlider.MaxValue = total - 1;
            SubtoolsSlider.Value    = 0;

            NextPageButton.Disabled = (total == 1);

            if (LotController.CustomControl != null)
            {
                LotController.CustomControl.Release();
                LotController.CustomControl = null;
            }

            PreviousPageButton.Disabled = true;

            var showsubtools = CategoryMap[button] != 10;

            SubToolBg.Visible          = showsubtools;
            SubtoolsSlider.Visible     = showsubtools;
            PreviousPageButton.Visible = showsubtools;
            NextPageButton.Visible     = showsubtools;

            return;
        }
Ejemplo n.º 5
0
        protected void AddTest(Test Test)
        {
            EndTime = DateTime.Now;

            this.Test = Test;

            Test.PrepareFinalize();

            Test.CategoryList.ForEach(x =>
            {
                if (!CategoryMap.ContainsKey(x.Name))
                {
                    CategoryMap.Add(x.Name, new List <Test>()
                    {
                        Test
                    });
                }
                else
                {
                    CategoryMap[x.Name].Add(Test);
                }
            });

            Test.ExceptionList.ForEach(x =>
            {
                var ex = ExceptionUtil.GetExceptionHeadline(x);

                if (!ExceptionMap.ContainsKey(ex))
                {
                    ExceptionMap.Add(ex, new List <Test>()
                    {
                        Test
                    });
                }
                else
                {
                    ExceptionMap[ex].Add(Test);
                }
            });

            _reporterList.ForEach(x =>
            {
                x.AddTest(Test);
            });

            UpdateReportStatus(Test.Status);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// </summary>
        protected override void ProcessRecord()
        {
            GetCategoryMap();
            List <ShellFolderItem> items = GetControlPanelItemByCategory(AllControlPanelItems);

            if (_nameSpecified)
            {
                items = GetControlPanelItemByName(items, _categorySpecified);
            }
            else if (_canonicalNameSpecified)
            {
                items = GetControlPanelItemByCanonicalName(items, _categorySpecified);
            }

            List <ControlPanelItem> results = new List <ControlPanelItem>();

            foreach (ShellFolderItem item in items)
            {
                string name          = item.Name;
                string path          = item.Path;
                string description   = (string)item.ExtendedProperty("InfoTip");
                string canonicalName = (string)item.ExtendedProperty("System.ApplicationName");
                canonicalName = canonicalName != null
                                        ? canonicalName.Substring(0, canonicalName.IndexOf("\0", StringComparison.OrdinalIgnoreCase))
                                        : null;

                int[]    categories  = (int[])item.ExtendedProperty("System.ControlPanel.Category");
                string[] cateStrings = new string[categories.Length];
                for (int i = 0; i < categories.Length; i++)
                {
                    string catStr = (string)LanguagePrimitives.ConvertTo(categories[i], typeof(string), CultureInfo.InvariantCulture);
                    Dbg.Assert(CategoryMap.ContainsKey(catStr), "the category should be contained in CategoryMap");
                    cateStrings[i] = CategoryMap[catStr];
                }

                ControlPanelItem controlPanelItem = new ControlPanelItem(name, canonicalName, cateStrings, description, path);
                results.Add(controlPanelItem);
            }

            // Sort the results by Canonical Name
            results.Sort(CompareControlPanelItems);
            foreach (ControlPanelItem controlPanelItem in results)
            {
                WriteObject(controlPanelItem);
            }
        }