예제 #1
0
        public static string FormatBranchAssignment(IVariable lVal, IVariable rVal, eFormat format)
        {
            bool hasLVal = !lVal.Empty;
            bool hasRVal = !rVal.Empty;

            if (!hasLVal && !hasRVal)
            {
                return("");
            }

            string result = "";

            result = FormatVariable(lVal, hasRVal);

            switch (format)
            {
            case eFormat.assign:
                if (hasRVal)
                {
                    result += lVal.Variable != null ? " := " : " (";
                }
                else
                {
                    result += " := ";
                }
                break;

            case eFormat.equals:
                if (!hasRVal)
                {
                    result += " = ";
                }
                else
                {
                    result += lVal.Variable != null ? " = " : " (";
                }
                break;
            }

            result += hasRVal ? FormatVariable(rVal) : lVal.Value;

            if (hasRVal && lVal.Variable == null)
            {
                result += ")";
            }

            return(result);
        }
예제 #2
0
파일: AniFile.cs 프로젝트: zeta1999/Vrmac
            internal ImageFormat(ref ICONDIRECTORY icd, uint bmp)
            {
                size        = icd.size;
                colorsCount = icd.colorsCount;
                planes      = icd.planes;
                bitCount    = icd.bitCount;
                switch (bmp)
                {
                case 40:
                    format = eFormat.Bitmap;
                    break;

                case PngSignature:
                    format = eFormat.PNG;
                    break;

                default:
                    throw new ArgumentException("The image format is not supported");
                }
            }