Пример #1
0
        override public string SetLabel()
        {
            switch (selectedCheckMethod)
            {
            case SelectedCheckMethod.NoneSelected:
                return("Nothing");

            case SelectedCheckMethod.SpecificItem:
                if (inventoryManager)
                {
                    return(inventoryManager.GetLabel(invID));
                }
                break;

            case SelectedCheckMethod.InSpecificCategory:
                if (inventoryManager)
                {
                    InvBin category = inventoryManager.GetCategory(binID);
                    if (category != null)
                    {
                        return(category.label);
                    }
                }
                break;
            }
            return(string.Empty);
        }
            public string GetCellText(InvItem invItem, InventoryManager inventoryManager)
            {
                string cellText = " ";

                switch (columnType)
                {
                case ColumnType.InternalName:
                    cellText = invItem.label;
                    break;

                case ColumnType.Label:
                    cellText = invItem.altLabel;
                    break;

                case ColumnType.MainGraphic:
                    cellText = (invItem.tex) ? invItem.tex.name : "";
                    break;

                case ColumnType.Category:
                    if (invItem.binID >= 0)
                    {
                        InvBin invBin = inventoryManager.GetCategory(invItem.binID);
                        cellText = (invBin != null) ? invBin.label : "";
                    }
                    break;

                case ColumnType.CategoryID:
                    cellText = (invItem.binID >= 0) ? invItem.binID.ToString() : "";
                    break;

                case ColumnType.CarryOnStart:
                    cellText = (invItem.carryOnStart) ? "True" : "False";
                    break;

                case ColumnType.CanCarryMultiple:
                    cellText = (invItem.canCarryMultiple) ? "True" : "False";
                    break;
                }

                if (cellText == "")
                {
                    cellText = " ";
                }
                return(RemoveLineBreaks(cellText));
            }