Esempio n. 1
0
        public async override Task <Types.Variable> Exec(CefPreter.IBrowser Browser)
        {
            string xpath = "";

            if (Parameters[0].Type == CefType.StringLiteral)
            {
                xpath = Parameters[0].Name;
            }
            else
            {
                throw new CefTypeException("Can't convert " + Parameters[0].Type.ToString() + " to String");
            }

            string text = "";

            if (Parameters[1].Type == CefType.StringLiteral)
            {
                text = Parameters[1].Name;
            }
            else
            {
                throw new CefTypeException("Can't convert " + Parameters[1].Type.ToString() + " to String");
            }


            var result = new Types.String(this.GetType().Name, xpath);
            await Browser.Enter(xpath, text);

            return(result);
        }
 public InfoDictionary(Dictionary info)
 {
     name = ((Types.String) info["name"]).ToString();
     pieceLength = ((Types.Integer) info["piece length"]).ToInt;
     pieces = (Types.String) info["pieces"];
     // Is it a single file ?
     isSingleFile = (info.ContainsKey("length"));
     if (isSingleFile) {
         length = ((Types.Integer) info["length"]).ToInt;
     }
     else
         length = 0;
     //buffer = (byte []) info["toSHA1info"];
 }
Esempio n. 3
0
        public async override Task <Types.Variable> Exec(CefPreter.IBrowser Browser = null)
        {
            Types.Variable result = null;
            if (Parameters[0].Type == CefType.NumberLiteral || Parameters[0].Type == CefType.StringLiteral)
            {
                result = new Types.String(this.GetType().Name, Parameters[0].ToString());
            }
            else
            {
                throw new CefTypeException("Can't convert " + Parameters[0].Type.ToString() + " to String");
            }

            return(result);
        }
Esempio n. 4
0
        public async override Task <Types.Variable> Exec(CefPreter.IBrowser Browser)
        {
            string url;

            if (Parameters[0].Type == CefType.StringLiteral)
            {
                url = Parameters[0].Name;
            }
            else
            {
                throw new CefTypeException("Can't convert " + Parameters[0].Type.ToString() + " to String");
            }
            var result = new Types.String(this.GetType().Name, url);
            await Browser.Click(url);

            return(result);
        }
Esempio n. 5
0
        internal Compare(int operation, int type, Expression left, Expression right)
            : base(left, right)
        {
            this.Operation = operation;
            Types.Base myType;
            switch (type)
            {
            case 0:
                myType = new Types.Integer();
                break;

            case 2:
                myType = new Types.Real();
                break;

            case 4:
                myType = new Types.String();
                break;

            case 6:
                myType = new Types.Boolean();
                break;

            //case 8:
            //    myType = new Set();
            //    break;
            case 10:
                myType = new Types.Byte();
                break;

            case 12:
                myType = new Types.Array();
                break;

            default:
                throw new DecompilationException();
            }
            var b = false;

            left.Type.MeetWith(myType, ref b);
            right.Type.MeetWith(myType, ref b);
        }