コード例 #1
0
        private object CellValue(int col)
        {
            switch (col)
            {
            case 0:
                return(VBD.userdevice);

            case 1:
                return(VDI.Name);

            case 2:
                return(VDI.Description);

            case 3:
                return(SR.Name);

            case 4:
                if (Helpers.BostonOrGreater(VDI.Connection))
                {
                    string name;
                    if (VDI.sm_config.TryGetValue("displayname", out name))
                    {
                        return(name);
                    }
                    return(string.Empty);
                }
                StorageLinkVolume vol = VDI.StorageLinkVolume(Program.StorageLinkConnections.GetCopy());
                return(vol == null ? string.Empty : vol.Name);

            case 5:
                return(VDI.SizeText);

            case 6:
                return(VBD.read_only ? Messages.YES : Messages.NO);

            case 7:
                return(GetPriorityString(VBD.IONice));

            case 8:
                return(VBD.currently_attached ? Messages.YES : Messages.NO);

            case 9:
                return(VBD.device == "" ? Messages.STORAGE_PANEL_UNKNOWN : string.Format("/dev/{0}", VBD.device));

            default:
                throw new ArgumentException(String.Format("Invalid column number {0} in VBDRenderer.CellValue()", col));
            }
        }