Exemplo n.º 1
0
        public AzureApplicationQueue(params string[] names)
        {
            // Create a storage account
            CloudStorageAccount storageAccount = CloudStorageAccount.Parse(AzureOnlyStrings.GetNamedString("QueueConnection"));
            CloudQueueClient    queueClient    = storageAccount.CreateCloudQueueClient();

            queue_ = queueClient.GetQueueReference(string.Join("/", names).ToLowerInvariant());
            queue_.CreateIfNotExists();
        }
Exemplo n.º 2
0
        private void WinWrapExecute(bool debug)
        {
            TheIncident = new Incident();
            using (var basicNoUIObj = new WinWrap.Basic.BasicNoUIObj())
            {
                basicNoUIObj.Begin         += basicNoUIObj_Begin;
                basicNoUIObj.DoEvents      += basicNoUIObj_DoEvents;
                basicNoUIObj.End           += basicNoUIObj_End;
                basicNoUIObj.ErrorAlert    += basicNoUIObj_ErrorAlert;
                basicNoUIObj.Pause_        += basicNoUIObj_Pause_;
                basicNoUIObj.Resume        += basicNoUIObj_Resume;
                basicNoUIObj.Synchronizing += basicNoUIObj_Synchronizing;
                basicNoUIObj.Secret         = new Guid(AzureOnlyStrings.GetNamedString("Guid", "00000000-0000-0000-0000-000000000000"));
                basicNoUIObj.Initialize();
                basicNoUIObj.AddScriptableObjectModel(typeof(ScriptingLanguage));

                if (debug)
                {
                    // prepare for debugging
                    basicNoUIObj.Synchronized = true;
                    Log("Debugging...");
                }

                try
                {
                    if (!basicNoUIObj.LoadModule(ScriptPath("Globals.bas")))
                    {
                        throw basicNoUIObj.Error.Exception;
                    }

                    using (var module = basicNoUIObj.ModuleInstance(ScriptPath(Script), false))
                    {
                        if (module == null)
                        {
                            throw basicNoUIObj.Error.Exception;
                        }

                        if (debug)
                        {
                            // step into the script event handler
                            module.StepInto = true;
                            timelimit_      = DateTime.Now + new TimeSpan(0, 0, 30); // timeout in 30 seconds
                        }

                        // Execute script code via an event
                        ScriptingLanguage.TheIncident.Start("Default.aspx");
                    }
                }
                catch (Exception ex)
                {
                    if (debug)
                    {
                        // report error and allow remote to catch up
                        basicNoUIObj.ReportError(ex);
                        basicNoUIObj.Wait(3);
                    }

                    basicNoUIObj.ReportError(ex);
                }

                if (debug)
                {
                    basicNoUIObj.Wait(3);
                    Log("Debugging complete.");
                }
            }
            TheIncident = null;
        }