Exemple #1
0
 private void MainWindow_Loaded(object sender, RoutedEventArgs e)
 {
     if (ReadFromFile)
     {
         Retrieve.ReadFromFile(SmallGraph);
     }
 }
Exemple #2
0
        /// <summary>
        /// Retrieves items from pocket
        /// with the given filters
        /// </summary>
        /// <param name="state">The state.</param>
        /// <param name="favorite">The favorite.</param>
        /// <param name="tag">The tag.</param>
        /// <param name="contentType">Type of the content.</param>
        /// <param name="sort">The sort.</param>
        /// <param name="search">The search.</param>
        /// <param name="domain">The domain.</param>
        /// <param name="since">The since.</param>
        /// <param name="count">The count.</param>
        /// <param name="offset">The offset.</param>
        /// <param name="cancellationToken">The cancellation token.</param>
        /// <returns></returns>
        /// <exception cref="PocketException"></exception>
        public async Task <List <PocketItem> > Get(
            State?state             = null,
            bool?favorite           = null,
            string tag              = null,
            ContentType?contentType = null,
            Sort?sort      = null,
            string search  = null,
            string domain  = null,
            DateTime?since = null,
            int?count      = null,
            int?offset     = null,
            CancellationToken cancellationToken = default(CancellationToken)
            )
        {
            RetrieveParameters parameters = new RetrieveParameters()
            {
                State       = state,
                Favorite    = favorite,
                Tag         = tag,
                ContentType = contentType,
                Sort        = sort,
                DetailType  = DetailType.complete,
                Search      = search,
                Domain      = domain,
                Since       = since,
                Count       = count,
                Offset      = offset
            };

            Retrieve response = await Request <Retrieve>("get", cancellationToken, parameters.Convert());

            return(response.Items);
        }
Exemple #3
0
        public void _04_InitialDisclosures()
        {
            AttachToProcess(Processes.Encompass, 5);

            Order_eDisclosures.Initialize().InitialDisclosures_SelectTopPlanCode().btn_Order_eDisclosures_Click();

            DisclosuresAudit.Initialize().btn_Order_eDisclosures_Click();

            SelectDocumentsInitial.Initialize().btn_Send_Click();

            SendDisclosuresInitial.Initialize().txt_BorrowerAuthorization_SendKeys(AuthorizationCode).btn_Send_Click();

            DisclosuresDialog.Initialize().btn_No_Click(); EncompassDialog.Initialize().btn_OK_Click();

            BaseSeleniumPage.CreateDriver(BaseSeleniumPage.WebDrivers.Chrome); BaseSeleniumPage.NavigateToURL(@"https://encompass.mortgage-application.net/EncompassAccount/AccountLogin.aspx");

            LoanOfficerLoanCenterLogIn.Initialize().txt_ClientID_SendKeys(ClientID).txt_UserID_SendKeys(LoanOfficer).txt_Password_SendKeys(LoanCenterPassword).btn_Login_Click();

            CheckLoanStatus.Initialize().fn_SelectFirstRow(); LoanDetail.Initialize().btn_View_Click(); DocuSign.Initialize().fn_ESignWholeDocument();

            BaseSeleniumPage.NavigateToURL(@"https://www.mortgage-application.net/myaccount/accountlogin.aspx");

            BorrowerLoanCenterLogIn.Initialize().txt_Email_SendKeys(BorrowerEmail).txt_Password_SendKeys(LoanCenterPassword).btn_Login_Click();

            CheckLoanStatus.Initialize().fn_SelectFirstRow(); LoanDetail.Initialize().btn_View_Click(); AgreeToReceiveDisclosuresElectronically.Initialize().btn_Agree_Click();

            VerifyIdentity.Initialize().txt_AuthorizationCode_SendKeys(AuthorizationCode).btn_Next_Click();

            DocuSign.Initialize().fn_ESignWholeDocument(); BaseSeleniumPage.CloseDriver();

            Retrieve.OpenFrom_eFolder().btn_Download_Click(); FileManager.Initialize().btn_Close_Click(); Encompass_eFolder.Initialize().btn_Close_Click();
        }
 private static bool GetBeamDumpStatusAsync(out Bitmap beamDumpImg)
 {
     if (!Retrieve.GetBitMap("https://vistar-capture.web.cern.ch/vistar-capture/lhcbds.png", out beamDumpImg))
     {
         return(false);
     }
     return(true);
 }
Exemple #5
0
 private static bool GetPage1PageAsync(out Bitmap lhc1Img)
 {
     if (!Retrieve.GetBitMap("https://vistar-capture.web.cern.ch/vistar-capture/lhc1.png", out lhc1Img))
     {
         return(false);
     }
     return(true);
 }
Exemple #6
0
        public void _13_DocsBack()
        {
            AttachToProcess(Processes.Encompass, 5);

            Encompass_eFolder.Open_eFolder(); Retrieve.OpenFrom_eFolder().btn_Download_Click(); Encompass_eFolder.Initialize().btn_Close_Click();

            DocsBack.Open_FromLogTab().chk_Finish_Check();
        }
Exemple #7
0
 private static bool GetVistarPageAsync(string webpage, out Bitmap lhc1Img)
 {
     if (!Retrieve.GetBitMap(webpage, out lhc1Img))
     {
         return(false);
     }
     return(true);
 }
Exemple #8
0
 private static bool GetMagnetStatusPageAsync(out Bitmap expMagnetImg)
 {
     if (!Retrieve.GetBitMap("https://vistar-capture.web.cern.ch/vistar-capture/lhcexpmag.png", out expMagnetImg))
     {
         return(false);
     }
     return(true);
 }
        public ActionResult PopularProducts()
        {
            SAPO.BrandInput brand = new SAPO.BrandInput();
            Retrieve <SAPO.BrandInput, SAPO.Brands> retrieve = new Retrieve <SAPO.BrandInput, SAPO.Brands>(new SmartBAL.Brands());
            List <SAPO.Brands> lstbrands = new List <SAPO.Brands>();

            lstbrands = retrieve.ListRetreive(brand);
            return(PartialView("_PopularProducts", lstbrands));
        }
        public ActionResult FeaturedCategory()
        {
            SAPO.BrandInput brand = new SAPO.BrandInput();
            Retrieve <SAPO.BrandInput, SAPO.Brands> retrieve = new Retrieve <SAPO.BrandInput, SAPO.Brands>(new SmartBAL.Brands());
            List <SAPO.Brands> lstbrands = new List <SAPO.Brands>();

            lstbrands = retrieve.ListRetreive(brand);
            return(PartialView("_FeaturedCategory", lstbrands));
        }
Exemple #11
0
        protected string Retention(string code)
        {
            foreach (string retention in code.Substring(0, 3).Equals("101") ? Retrieve.Get().ReadCSV(Array.Find(Directory.GetFiles(Path.Combine(Application.StartupPath, @"..\"), "*.csv", SearchOption.AllDirectories), o => o.Contains("Tick")), new List <string>(2097152)) : Retrieve.Get().ReadCSV(Array.Find(Directory.GetFiles(Path.Combine(Application.StartupPath, @"..\"), string.Concat(code, ".csv"), SearchOption.AllDirectories), o => o.Contains(code)), new List <string>(1280)))
            {
                code = retention.Substring(0, 12);
            }

            return(code);
        }
        public ActionResult Header()
        {
            SAPO.MenuRequest menu = new SAPO.MenuRequest();
            Retrieve <SAPO.MenuRequest, SAPO.Category> retrieve = new Retrieve <SAPO.MenuRequest, SAPO.Category>(new Categories());
            List <SAPO.Category> categories = new List <SAPO.Category>();

            categories = retrieve.ListRetreive(menu);
            return(PartialView("_Header", categories));
        }
Exemple #13
0
        public ActionResult Index(string CategoryName)
        {
            SAPO.GetProduct getProduct = new SAPO.GetProduct();
            getProduct.CategoryName = CategoryName.Replace("-", " ").Replace(".", "_");
            Retrieve <SAPO.GetProduct, SAPO.ProductsPro> retrieve = new Retrieve <SAPO.GetProduct, SAPO.ProductsPro>(new Products());
            List <SAPO.ProductsPro> products = new List <SAPO.ProductsPro>();

            products = retrieve.ListRetreive(getProduct);
            return(View(products));
        }
        private Game RetrieveData()
        {
            // Get the game
            Retrieve retrieve = new Retrieve();
            Dictionary <string, object> getGame = new Dictionary <string, object>();

            getGame.Add("GameID", GameId.ToString());

            return((Game)WorkflowInvoker.Invoke(retrieve, getGame));
        }
Exemple #15
0
        public ActionResult Index(string brandName)
        {
            SAPO.GetProduct getProduct = new SAPO.GetProduct();
            getProduct.BrandName = brandName.Replace("-", " ").Replace(".", "_");
            Retrieve <SAPO.GetProduct, SAPO.ProductsPro> retrieve = new Retrieve <SAPO.GetProduct, SAPO.ProductsPro>(new Products());
            List <SAPO.ProductsPro> products = new List <SAPO.ProductsPro>();

            products = retrieve.ListRetreive(getProduct);
            return(View("~/Views/ProductList/Index.cshtml", products));
        }
Exemple #16
0
        public ActionResult Index(string productName)
        {
            SAPO.GetProduct getProduct = new SAPO.GetProduct();
            getProduct.Name = productName.Replace("-", " ").Replace("_", ".");
            var retrieve = new Retrieve <SAPO.GetProduct, SAPO.ProductsPro>(new Products());
            var products = new SAPO.ProductsPro();

            products = retrieve.Retreive(getProduct);
            return(View(products));
        }
        public ActionResult ProductList(string CategoryName, string BrandName)
        {
            SAPO.GetProduct getProduct = new SAPO.GetProduct();
            getProduct.CategoryName = CategoryName;
            getProduct.BrandName    = BrandName;
            Retrieve <SAPO.GetProduct, SAPO.ProductsPro> retrieve = new Retrieve <SAPO.GetProduct, SAPO.ProductsPro>(new Products());
            List <SAPO.ProductsPro> products = new List <SAPO.ProductsPro>();

            products = retrieve.ListRetreive(getProduct);
            return(Json(products, JsonRequestBehavior.AllowGet));
        }
Exemple #18
0
        public MainWindow()
        {
            InitializeComponent();
            WriteToFile.Write();
            Retrieve.Initialise(PacketBox, SmallGraph);
            Display.Initialise(NodeIDBox, EdgeBox, WeightBox, Map);
            Display.Edges();
            Display.Nodes();

            Loaded += MainWindow_Loaded;
        }
 public static bool?NullSafe_IsForm(this Retrieve retrieved)
 {
     if (retrieved == null)
     {
         return(false);
     }
     else
     {
         return(retrieved.IsForm);
     }
 }
Exemple #20
0
        public void Retrieve(int width, Retrieve retrieve)
        {
            if (p1.X == p2.X)
            {
                if (p1.Y < p2.Y)
                {
                    Vector2 increment = new Vector2(0, width);
                    float   angle     = (float)Math.PI / 2;

                    for (Vector2 point = p1; point.Y <= p2.Y; point += increment)
                    {
                        retrieve(point, angle);
                    }
                }
                else
                {
                    Vector2 increment = new Vector2(0, -width);
                    float   angle     = (float)-Math.PI / 2;

                    for (Vector2 point = p1; point.Y >= p2.Y; point += increment)
                    {
                        retrieve(point, angle);
                    }
                }
            }
            else
            {
                float k     = (p1.Y - p2.Y) / (p1.X - p2.X);
                float b     = p1.Y - k * p1.X;
                float angle = (float)Math.Atan((double)k);
                if (p1.X > p2.X)
                {
                    angle += (float)Math.PI;
                }
                Vector2 increment = new Vector2(width * (float)Math.Cos(angle), width * (float)Math.Sin(angle));

                if (p1.X < p2.X)
                {
                    for (Vector2 point = p1; point.X <= p2.X; point += increment)
                    {
                        retrieve(point, angle);
                    }
                }
                else
                {
                    for (Vector2 point = p1; point.X >= p2.X; point += increment)
                    {
                        retrieve(point, angle);
                    }
                }
            }
        }
Exemple #21
0
        public void TestHtmlGen()
        {
            HttpContext.Current = FakeContext.FakeHttpContext();
            HttpContext.Current.Session.Add("guid", "12345");
            HttpContext.Current.Session.Add("timestamps", "11:11,04:04");
            HttpContext.Current.Session.Add("windows", "30,40");
            HttpContext.Current.Session.Add("snipsNum", "2");

            String html = Retrieve.GenerateHtml();

            String expected_html = "<div class='snippet row'>" +
                                   "<div class='col-md-6 text-center'>" +
                                   "<video class='video' width='320' height='240' controls>" +
                                   "<source src='/videos/12345/Snippet_1.mp4' type='video/mp4'>" +
                                   "Your browser does not support the video tag." +
                                   "</video>" +
                                   "</div>" +
                                   "<div class='details col-md-6 text-center'>" +
                                   "<dl class='snippet-info dl-horizontal'>" +
                                   "<dt><strong>Title:</strong></dt><dd class='text-left'>Snippet_1.mp4</dd>" +
                                   "<dt><strong>Timestamp:</strong></dt><dd class='text-left'>11:11</dd>" +
                                   "<dt><strong>Window Size:</strong></dt><dd class='text-left'>30</dd>" +
                                   "</dl>" +
                                   "<div style='float:left; padding-left:40px;'>" +
                                   "<input type='checkbox' id='chkSnippet1' name='1' runat='server' style='margin-right:5px;'>" +
                                   "<label for='chkSnippet1'>  Select snippet</label>" +
                                   "</div>" +
                                   "</div>" +
                                   "</div>" +
                                   "<div class='snippet row'>" +
                                   "<div class='col-md-6 text-center'>" +
                                   "<video class='video' width='320' height='240' controls>" +
                                   "<source src='/videos/12345/Snippet_2.mp4' type='video/mp4'>" +
                                   "Your browser does not support the video tag." +
                                   "</video>" +
                                   "</div>" +
                                   "<div class='details col-md-6 text-center'>" +
                                   "<dl class='snippet-info dl-horizontal'>" +
                                   "<dt><strong>Title:</strong></dt><dd class='text-left'>Snippet_2.mp4</dd>" +
                                   "<dt><strong>Timestamp:</strong></dt><dd class='text-left'>04:04</dd>" +
                                   "<dt><strong>Window Size:</strong></dt><dd class='text-left'>40</dd>" +
                                   "</dl>" +
                                   "<div style='float:left; padding-left:40px;'>" +
                                   "<input type='checkbox' id='chkSnippet2' name='2' runat='server' style='margin-right:5px;'>" +
                                   "<label for='chkSnippet2'>  Select snippet</label>" +
                                   "</div>" +
                                   "</div>" +
                                   "</div>";

            Assert.AreEqual(expected_html, html);
        }
Exemple #22
0
        public void Retrieve(int width, Retrieve retrieve)
        {
            if (p1.X == p2.X)
            {
                if (p1.Y < p2.Y)
                {
                    Vector2 increment = new Vector2(0, width);
                    float angle = (float)Math.PI / 2;

                    for (Vector2 point = p1; point.Y <= p2.Y; point += increment)
                    {
                        retrieve(point, angle);
                    }
                }
                else
                {
                    Vector2 increment = new Vector2(0, -width);
                    float angle = (float)-Math.PI / 2;

                    for (Vector2 point = p1; point.Y >= p2.Y; point += increment)
                    {
                        retrieve(point, angle);
                    }
                }
            }
            else
            {
                float k = (p1.Y - p2.Y) / (p1.X - p2.X);
                float b = p1.Y - k * p1.X;
                float angle = (float)Math.Atan((double)k);
                if (p1.X > p2.X)
                    angle += (float)Math.PI;
                Vector2 increment = new Vector2(width * (float)Math.Cos(angle), width * (float)Math.Sin(angle));

                if (p1.X < p2.X)
                {
                    for (Vector2 point = p1; point.X <= p2.X; point += increment)
                    {
                        retrieve(point, angle);
                    }
                }
                else
                {
                    for (Vector2 point = p1; point.X >= p2.X; point += increment)
                    {
                        retrieve(point, angle);
                    }
                }
            }
        }
Exemple #23
0
        protected override void OnStart(string[] args)
        {
            isError = false;

            Util.CJLog("OnStart()", "Service started.", EventLogEntryType.Information);

            cjJobSchedulerTimer = new System.Timers.Timer(Retrieve.GetHeartbeatInterval());

            cjJobSchedulerTimer.Elapsed += new System.Timers.ElapsedEventHandler(timer_Elapsed);

            cjJobSchedulerTimer.Start();

            Util.SendEmail("Started: " + DateTime.Now.ToString(), "Started");
        }
        public void Retrieve()
        {
            Game game = new Game()
            {
                Id = Guid.Parse("3fd5acca-3b65-4383-b334-2f79d8f6c0db"),
            };

            Retrieve retrieve = new Retrieve();
            Dictionary <string, object> input = new Dictionary <string, object>();

            input.Add("GameID", game.Id.ToString());

            var result = (Game)WorkflowInvoker.Invoke(retrieve, input);

            Assert.IsNotNull(result, "Check failed");
        }
Exemple #25
0
        public ActionResult Products(Models.CalculatorModel calculatorModel)
        {
            var retrieve = new Retrieve <SAPO.CalculatorCategory, SAPO.CalculatorCategory>(new Calculator());
            var products = new List <SAPO.CalculatorCategory>();

            products = retrieve.ListRetreive(new SAPO.CalculatorCategory());
            //var getProduct = new SAPO.GetProduct();
            //if (calculatorModel.Categories.Count > 0)
            //    getProduct.CategoryName = calculatorModel.Categories[0].Name;
            //if (calculatorModel.Brands.Count > 0)
            //    getProduct.BrandIds = calculatorModel.Brands;
            //Retrieve<SAPO.GetProduct, SAPO.ProductsPro> retrieve = new Retrieve<SAPO.GetProduct, SAPO.ProductsPro>(new Products());
            //List<SAPO.ProductsPro> products = new List<SAPO.ProductsPro>();
            //products = retrieve.ListRetreive(getProduct);
            return(Json(products, JsonRequestBehavior.AllowGet));
        }
        public void _01_Check_CrmPluginRegistration()
        {
            var @class = new Retrieve();

            foreach (var attribute in System.Attribute.GetCustomAttributes(@class.GetType()))
            {
                if (attribute.GetType().Equals(typeof(CrmPluginRegistrationAttribute)))
                {
                    var check = attribute as CrmPluginRegistrationAttribute;
                    Assert.IsNotNull(check);
                }
                else
                {
                    Assert.Fail();
                }
            }
        }
 public void GetBitMapTest()
 {
     try
     {
         if (Retrieve.GetBitMap("https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png", out Bitmap bitmap))
         {
             Assert.IsNotNull(bitmap);
         }
         else
         {
             Assert.Fail("Was Unable to retrieve a bitmap.");
         }
     }
     catch (Exception ex)
     {
         Assert.Fail("Expected no exception, but got: " + ex.Message);
     }
 }
        // GET: Calculator
        public ActionResult Index()
        {
            var calculatorModel = new Models.CalculatorModel();
            var menu            = new SAPO.MenuRequest();

            menu.IsShowOnCalculator = true;

            var retrieveCategories = new Retrieve <SAPO.MenuRequest, SAPO.Category>(new Categories());

            calculatorModel.Categories = retrieveCategories.ListRetreive(menu);

            var brand         = new SAPO.BrandInput();
            var retrievebrand = new Retrieve <SAPO.BrandInput, SAPO.Brands>(new SmartBAL.Brands());

            calculatorModel.Brands = retrievebrand.ListRetreive(brand);


            return(View(calculatorModel));
        }
Exemple #29
0
        /// <summary>
        /// Retrieves all items by a given filter
        /// </summary>
        /// <param name="filter">The filter.</param>
        /// <param name="cancellationToken">The cancellation token.</param>
        /// <returns></returns>
        /// <exception cref="PocketException"></exception>
        public async Task <List <PocketItem> > Get(RetrieveFilter filter, CancellationToken cancellationToken = default(CancellationToken))
        {
            RetrieveParameters parameters = new RetrieveParameters();

            switch (filter)
            {
            case RetrieveFilter.Article:
                parameters.ContentType = ContentType.article;
                break;

            case RetrieveFilter.Image:
                parameters.ContentType = ContentType.image;
                break;

            case RetrieveFilter.Video:
                parameters.ContentType = ContentType.video;
                break;

            case RetrieveFilter.Favorite:
                parameters.Favorite = true;
                break;

            case RetrieveFilter.Unread:
                parameters.State = State.unread;
                break;

            case RetrieveFilter.Archive:
                parameters.State = State.archive;
                break;

            case RetrieveFilter.All:
                parameters.State = State.all;
                break;
            }

            parameters.DetailType = DetailType.complete;

            Retrieve response = await Request <Retrieve>("get", cancellationToken, parameters.Convert());

            return(response.Items);
        }
Exemple #30
0
        internal BackTesting(long assets)
        {
            Retrieve.GetInstance(Code = GetRecentFuturesCode(GetRegister()));
            var list = new List <Specify>();
            int i, j;

            for (j = 15; j <= 120; j += 5)
            {
                for (i = 2; i < 10; i++)
                {
                    foreach (string strategy in Strategy)
                    {
                        foreach (int time in Time)
                        {
                            list.Add(new Specify
                            {
                                Time     = time,
                                Code     = Code,
                                Assets   = assets,
                                Strategy = strategy,
                                Short    = time < 0 ? i * 15 : i,
                                Long     = time < 0 ? j * 10 : j
                            });
                        }
                    }
                }
            }
            Parallel.ForEach(list, new ParallelOptions
            {
                MaxDegreeOfParallelism = (int)(Environment.ProcessorCount * 1.2)
            },
                             new Action <Specify>(param =>
            {
                if (GetRecentAnalysis(param) == false)
                {
                    new Analysize(param);
                }
            }));
            new BackTesting();
        }
        private void Interpret()
        {
            object[] operation;
            object   akkumulator;
            object   register;

            scopes = new Scopes();
            scopes.PushScope(external);
            scopes.PushScope();

            int startTime = Environment.TickCount;

            Cancel  = false;
            running = true;

            pc = 0;

            bool accepted;
            // bool continues;
            object xPos;
            object defaultRenamed;
            object yPos;


            while ((pc < code.Count - 1) & running)
            {
                akkumulator = null;
                register    = null;

                operation = (Object[])code[pc];

                switch ((Opcodes)operation.GetValue(0))
                {
                // Konstante allozieren
                case Opcodes.opAllocConst:
                {
                    // Parameter:    Name der Konstanten; Wert
                    scopes.Allocate(operation.GetValue(1).ToString(), operation.GetValue(2).ToString(), Identifier.IdentifierTypes.idConst);
                    break;
                }

                // Variable allozieren
                case Opcodes.opAllocVar:
                {
                    // Parameter:    Name der Variablen
                    scopes.Allocate(operation.GetValue(1).ToString());
                    break;
                }

                // Wert auf den Stack schieben
                case Opcodes.opPushValue:
                {
                    // Parameter:    Wert
                    scopes.Push(operation.GetValue(1));
                    break;
                }

                // Wert einer Variablen auf den Stack schieben
                case Opcodes.opPushVariable:
                {
                    // Parameter:    Variablenname
                    string name;
                    try
                    {
                        var tmp = operation.GetValue(1);
                        if (tmp.GetType() == typeof(Identifier))
                        {
                            name = ((Identifier)tmp).value.ToString();
                        }
                        else
                        {
                            name = tmp.ToString();
                        }
                        register = scopes.Retrieve(name);
                    }
                    catch (Exception)
                    {
                        // Variable nicht alloziert, also bei Host nachfragen
                        accepted = false;
                        Retrieve?.Invoke(operation.GetValue(1).ToString(), register.ToString(), accepted);
                        if (!accepted)
                        {
                            // der Host weiss nichts von der Var. Implizit anlegen tun wir
                            // sie aber nicht, da sie hier auf sie sofort lesend zugegriffen
                            // würde

                            running = false;
                            ErrorObject.Raise((int)InterpreterError.runErrors.errUnknownVar, "Code.Run", "Unknown variable '" + operation.GetValue(1) + "'", 0, 0, 0);
                        }
                    }

                    if (register == null)
                    {
                        running = false;
                        ErrorObject.Raise((int)InterpreterError.runErrors.errUninitializedVar, "Code.Run", "Variable '" + operation.GetValue(1) + "' not hasn´t been assigned a Value yet", 0, 0, 0);
                    }
                    else
                    {
                        if (register.GetType() == typeof(Identifier))
                        {
                            scopes.Push(((Identifier)register).value);
                        }
                        else
                        {
                            scopes.Push(register.ToString());
                        }
                    }

                    break;
                }

                // entfernt obersten Wert vom Stack
                case Opcodes.opPop:
                {
                    scopes.PopScopes();
                    break;
                }

                // legt den n-ten Stackwert zuoberst auf den Stack
                case Opcodes.opPopWithIndex:
                {
                    // Parameter:    Index in den Stack (von oben an gezählt: 0..n)
                    object result;
                    register = scopes.Pop(Convert.ToInt32(operation.GetValue(1)));
                    if (register is Identifier)
                    {
                        result = ((Identifier)register).value;
                    }
                    else
                    {
                        result = register;
                    }
                    scopes.Push(result);
                    break;
                }

                // Wert auf dem Stack einer Variablen zuweisen
                case Opcodes.opAssign:
                {
                    // Parameter:    Variablenname
                    // Stack:        der zuzuweisende Wert

                    object result;
                    register = scopes.Pop();
                    if (register is Identifier)
                    {
                        result = ((Identifier)register).value;
                    }
                    else
                    {
                        result = register;
                    }
                    if (!scopes.Assign(operation.GetValue(1).ToString(), result))
                    {
                        ;
                    }
                    {
                        // Variable nicht alloziert, also Host anbieten
                        accepted = false;


                        Assign?.Invoke(operation.GetValue(1).ToString(), result.ToString(), ref accepted);
                        if (!accepted)
                        {
                            // Host hat nicht mit Var am Hut, dann legen wir
                            // sie eben selbst an
                            scopes.Allocate(operation.GetValue(1).ToString(), result.ToString());
                        }
                    }

                    break;
                }

                case Opcodes.opAdd:
                case Opcodes.opSub:
                case Opcodes.opMultiplication:
                case Opcodes.opDivision:
                case Opcodes.opDiv:
                case Opcodes.opMod:
                case Opcodes.opPower:
                case Opcodes.opStringConcat:
                case Opcodes.opOr:
                case Opcodes.opAnd:
                case Opcodes.opEq:
                case Opcodes.opNotEq:
                case Opcodes.oplt:
                case Opcodes.opLEq:
                case Opcodes.opGt:
                case Opcodes.opGEq:
                    BinaryMathOperators(operation, akkumulator, register);
                    break;

                case Opcodes.opNegate:
                case Opcodes.opNot:
                case Opcodes.opFactorial:
                case Opcodes.opSin:
                case Opcodes.opCos:
                case Opcodes.opTan:
                case Opcodes.opATan:
                    UnaryMathOperators(operation);
                    break;

                case Opcodes.opDebugPrint:
                {
                    string msg = string.Empty;


                    register = scopes.PopScopes();
                    if (register != null)
                    {
                        msg = ((Identifier)register).value.ToString();
                    }

                    DebugPrint?.Invoke(msg);


                    break;
                }

                case Opcodes.opDebugClear:
                {
                    DebugClear?.Invoke();
                    break;
                }

                case Opcodes.opDebugShow:
                {
                    DebugShow?.Invoke();
                    break;
                }

                case Opcodes.opDebugHide:
                {
                    DebugHide?.Invoke();
                    break;
                }

                case Opcodes.opMessage:
                {
                    try
                    {
                        string msg  = string.Empty;
                        int    type = 0;
                        register    = scopes.PopScopes();       // Message
                        akkumulator = scopes.PopScopes().value; // Type
                        if (register is Identifier)
                        {
                            if (register != null)
                            {
                                if (register.GetType() == typeof(Identifier))
                                {
                                    msg = ((Identifier)register).value.ToString();
                                }
                                else
                                {
                                    msg = register.ToString();
                                }
                            }
                        }


                        if (akkumulator != null)
                        {
                            if (akkumulator.GetType() == typeof(Identifier))
                            {
                                type = Convert.ToInt32(((Identifier)akkumulator).value);
                            }
                            else
                            {
                                type = Convert.ToInt32(akkumulator);
                            }
                        }


                        Message?.Invoke(type, msg);
                    }
                    catch (Exception)
                    {
                        Message?.Invoke(-1, string.Empty);
                    }

                    break;
                }

                case Opcodes.opMsgbox:
                {
                    if (!AllowUi)
                    {
                        running = false;
                        ErrorObject.Raise((int)InterpreterError.runErrors.errNoUIallowed, "Code.Run", "MsgBox-Statement cannot be executed when no UI-elements are allowed", 0, 0, 0);
                    }

                    register    = scopes.PopScopes().value; // Title
                    akkumulator = scopes.PopScopes().value; // Buttons

                    try
                    {
                        // TODO:InputBox  // scopes.Push(MsgBox(scopes.Pop, (MsgBoxStyle)Akkumulator.ToString(), Register));
                    }
                    catch (Exception ex)
                    {
                        running = false;
                        ErrorObject.Raise((int)InterpreterError.runErrors.errMath, "Code.Run", "Error during MsgBox-call: " + ex.HResult + " (" + ex.Message + ")", 0, 0, 0);
                    }

                    break;
                }

                case Opcodes.opDoEvents:
                {
                    break;
                }

                case Opcodes.opInputbox:
                {
                    if (!AllowUi)
                    {
                        running = false;
                        ErrorObject.Raise((int)InterpreterError.runErrors.errNoUIallowed, "Code.Run", "Inputbox-Statement cannot be executed when no UI-elements are allowed", 0, 0, 0);
                    }

                    yPos           = scopes.PopScopes().value;
                    xPos           = scopes.PopScopes().value;
                    defaultRenamed = scopes.PopScopes().value;
                    register       = scopes.PopScopes().value;
                    akkumulator    = scopes.PopScopes().value;

                    try
                    {
                        // TODO:InputBox
                        //string Anwert = Microsoft.VisualBasic.Interaction.InputBox(Akkumulator.ToString(), Register.ToString(), defaultRenamed.ToString(), Convert.ToInt32(xPos), Convert.ToInt32(yPos));
                        //scopes.Push(Anwert);
                    }
                    catch (Exception ex)
                    {
                        running = false;
                        ErrorObject.Raise((int)InterpreterError.runErrors.errMath, "Code.Run", "Error during MsgBox-call: " + ex.HResult + " (" + ex.Message + ")", 0, 0, 0);
                    }

                    break;
                }

                case Opcodes.opJump:
                {
                    pc = Convert.ToInt32(operation.GetValue(1)) - 1;
                    break;
                }

                case Opcodes.opJumpTrue:
                {
                    akkumulator = scopes.PopScopes().value;
                    if (Convert.ToBoolean(akkumulator))
                    {
                        pc = Convert.ToInt32(operation.GetValue(1)) - 1;
                    }
                    break;
                }

                case Opcodes.opJumpFalse:
                {
                    akkumulator = scopes.PopScopes().value;
                    if (!Convert.ToBoolean(akkumulator))
                    {
                        pc = Convert.ToInt32(operation.GetValue(1)) - 1;
                    }
                    break;
                }

                case Opcodes.opJumpPop:
                {
                    pc = Convert.ToInt32(scopes.PopScopes().value) - 1;
                    break;
                }

                case Opcodes.opPushScope:
                {
                    scopes.PushScope();
                    break;
                }

                case Opcodes.opPopScope:
                {
                    scopes.PopScopes();
                    break;
                }

                case Opcodes.opCall:
                {
                    scopes.Allocate("~RETURNADDR", (pc + 1).ToString(), Identifier.IdentifierTypes.idConst);
                    pc = Convert.ToInt32(operation.GetValue(1)) - 1;
                    break;
                }

                case Opcodes.opReturn:
                {
                    pc = Convert.ToInt32(Convert.ToDouble(scopes.Retrieve("~RETURNADDR").value, CultureInfo.InvariantCulture) - 1);
                    break;
                }
                }


                pc = pc + 1; // zum nächsten Befehl

                // wurde Interpretation unterbrochen?
                if (Cancel)
                {
                    running = false;
                    ErrorObject.Raise((int)InterpreterError.runErrors.errCancelled, "Code.Run", "Code execution aborted", 0, 0, 0);
                }

                // Timeout erreicht?
                var tickPassed = (Environment.TickCount - startTime);
                if (CodeTimeout > 0 && tickPassed >= CodeTimeout)
                {
                    running = false;
                    ErrorObject.Raise((int)InterpreterError.runErrors.errTimedOut, "Code.Run", "Timeout reached: code execution has been aborted", 0, 0, 0);
                }
            }

            running = false;
        }