示例#1
0
        protected override VendorImageInfo GetImageInfo(string imageName)
        {
            VendorImageInfo info = new VendorImageInfo();


            string[] filearray = imageName.Split('_');
            var      reg       = "^\\w+_\\d+_[f|b|F|B|L|l|H|h]$";

            if (!Regex.IsMatch(imageName, reg))
            {
                log.InfoFormat("{0} is not correct", imageName);
                log.InfoFormat("ERROR!! File name is not in the right format... .");

                return(null);
            }

            info.Name        = imageName;
            info.Description = filearray[0];
            var imageDiscriminator = filearray[2].ToLower();

            try
            {
                info.Sequence = ATMediaHelper.GetImageSequence(filearray[2].ToLower());
            }
            catch (Exception e)
            {
                log.Warn("Invalid image " + imageName);
                info.Sequence = 7;
            }

            info.IsThumbnail = false;
            return(info);
        }
        protected override VendorImageInfo GetImageInfo(string imageName)
        {
            VendorImageInfo info = new VendorImageInfo();

            string[] filearray = imageName.Split('_');

            if (filearray.Length < 3)
            {
                log.InfoFormat("{0} is not correct", imageName);
                log.InfoFormat("ERROR!! File name is not in the right format... File name needs two underscores.");

                return(null);
            }

            if (filearray[2].ToLower().Equals("f") || filearray[2].ToLower().Equals("b"))
            {
                return(null);
            }

            info.Name        = imageName;
            info.Description = filearray[0];
            info.Sequence    = 2;
            info.IsThumbnail = true;

            return(info);
        }
        protected override VendorImageInfo GetImageInfo(string imageName)
        {
            VendorImageInfo info = new VendorImageInfo();

            String[] filearray = imageName.Split('_');

            if (filearray.Length < 3)
            {
                log.InfoFormat("{0} is not correct", imageName);

                log.InfoFormat("ERROR!! File name is not in the right format... File name needs two underscores.");

                return(null);
            }

            int seq = 0;

            switch (filearray[2].ToLower())
            {
            case "m":
                seq = 1;
                break;

            case "b1":
                seq = 2;
                break;

            case "d1":
                seq = 3;
                break;

            case "f":
                seq = 4;
                break;

            case "b":
                seq = 5;
                break;

            case "d":
                seq = 6;
                break;

            case "d2":
                seq = 7;
                break;

            default:
                seq = 9;
                break;
            }

            info.Name        = imageName;
            info.Description = filearray[0];
            info.Sequence    = seq;
            info.IsThumbnail = false;

            return(info);
        }
        protected override VendorImageInfo GetImageInfo(string imageName)
        {
            var info = new VendorImageInfo {
                Name = imageName, Description = "Color palette", Sequence = 5, IsThumbnail = true
            };

            return(info);
        }
示例#5
0
        protected override VendorImageInfo GetImageInfo(string imageName)
        {
            VendorImageInfo info = new VendorImageInfo();

            string[] filearray = imageName.Split('_');
            var      reg       = "^\\w+_\\w+_\\d+_[f|b|F|B|i|I]$";

            if (!Regex.IsMatch(imageName, reg))
            {
                log.InfoFormat("{0} is not correct", imageName);
                log.InfoFormat("ERROR!! File name is not in the right format... File name needs three underscores.");

                return(null);
            }

            info.Name        = imageName;
            info.Description = filearray[0];

            //Determine sequence
            switch (filearray[3].ToLower())
            {
            case "f":
                info.Sequence = 0;
                break;

            case "b":
                info.Sequence = 1;
                break;

            case "i":
                info.Sequence = 2;
                break;

            default:
                info.Sequence = 1;
                break;
            }

            return(info);
        }