상속: MonoBehaviour
예제 #1
0
        public void Start(StartLaunchRequest request)
        {
            if (StartTask != null)
            {
                throw new InsufficientExecutionStackException("The launch is already scheduled for starting.");
            }

            if (!_isExternalLaunchId)
            {
                // start new launch item
                StartTask = Task.Run(async() =>
                {
                    var id = (await _service.StartLaunchAsync(request)).Id;

                    LaunchInfo = new Launch
                    {
                        Id        = id,
                        Name      = request.Name,
                        StartTime = request.StartTime
                    };
                });
            }
            else
            {
                // get launch info
                StartTask = Task.Run(async() =>
                {
                    LaunchInfo = await _service.GetLaunchAsync(LaunchInfo.Id);
                });
            }
        }
        public async Task <IActionResult> Edit(int id, [Bind("L_Id,Name,Rout")] Launch launch)
        {
            if (id != launch.L_Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(launch);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!LaunchExists(launch.L_Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(launch));
        }
        public void testIfLaunchRequestCreateProperLaunchObjectInList()
        {
            apiResponse = File.ReadAllText("ApiTypicalResponse.txt");
            if (apiResponse == null)
            {
                throw new AssertFailedException();
            }
            var parser     = new APIParser();
            var launchList = parser.parseLaunchRequest(apiResponse);

            Launch launch = new Launch();

            launch.name        = "Vostok-K | Sputnik 10";
            launch.status      = "Success";
            launch.windowStart = DateTime.ParseExact("1961-03-25T05:54:00Z", "yyyy-MM-ddTHH:mm:ssZ",
                                                     System.Globalization.CultureInfo.InvariantCulture);
            launch.windowEnd = DateTime.ParseExact("1961-03-25T05:54:00Z", "yyyy-MM-ddTHH:mm:ssZ",
                                                   System.Globalization.CultureInfo.InvariantCulture);
            launch.launchProvider        = "Strategic Missile Troops";
            launch.rocketFullName        = "Vostok-K";
            launch.location              = "Baikonur Cosmodrome, Republic of Kazakhstan";
            launch.locationGoogleMapsUrl = "https://www.google.com/maps/place/45°55'12.0\"N+63°20'31.2\"E";

            Assert.IsTrue(launchList.Contains(launch));
        }
예제 #4
0
        private void LaunchOnDisconnected(object sender, Exception exception)
        {
            _launch.Disconnected -= LaunchOnDisconnected;
            _launch = null;

            OverlayText.SetText("Launch Disconnected", TimeSpan.FromSeconds(1));
        }
        public async Task <Launch> CleanAsync(Launch launch)
        {
            if (launch is null)
            {
                throw new ArgumentNullException(nameof(launch));
            }

            var testItems = await GetTestItems(launch.Id).ConfigureAwait(false);

            foreach (var testItem in GetTestsMarkedForDeletion(testItems))
            {
                try
                {
                    var message = await _service.DeleteTestItemAsync(testItem).ConfigureAwait(false);

                    _logger?.LogDebug(message.Info);
                }
                catch (Exception ex)
                {
                    _logger?.LogError(ex.Message);
                }
            }

            return(launch);
        }
예제 #6
0
        private void LaunchConnectOnDeviceFound(object sender, Launch device)
        {
            _launch = device;
            _launch.Disconnected += LaunchOnDisconnected;

            OverlayText.SetText("Launch Connected", TimeSpan.FromSeconds(1));
        }
    void Start() {
        accessPose = GetComponent<Launch> ();
		posesFromJSON = accessPose.GetPoses();
		generatedPoses = new List<Pose> ();
		poseGameObjects = new List<GameObject> ();
		//Generate ();
    }
 // Use this for initialization
 void Start()
 {
     m_currentScene = SceneManager.GetActiveScene().buildIndex;
     m_rb           = GetComponent <Rigidbody> ();
     m_grav         = Physics.gravity.magnitude;
     m_Launch       = GetComponent <Launch>();
 }
예제 #9
0
        public ActionResult Details(int?id)
        {
            string json = SendRequest("https://api.spacexdata.com/v3/launches");
            JArray data = JArray.Parse(json);

            Launch launchDetails = new Launch();

            id--;
            launchDetails.missionName   = (string)data[id]["mission_name"];
            launchDetails.launchSuccess = (string)data[id]["launch_success"];
            launchDetails.flightNum     = (int)data[id]["flight_number"];
            launchDetails.launchTime    = (string)data[id]["launch_date_utc"];
            launchDetails.launchYear    = (int)data[id]["launch_year"];

            launchDetails.rocketName    = (string)data[id]["rocket"]["rocket_name"];
            launchDetails.rocketType    = (string)data[id]["rocket"]["rocket_type"];
            launchDetails.rocketID      = (string)data[id]["rocket"]["rocket_id"];
            launchDetails.launchDetails = (string)data[id]["details"];

            ViewBag.Success = true;

            LaunchViewModel viewModel = new LaunchViewModel(launchDetails);

            return(View(viewModel));
        }
예제 #10
0
 private static void PrepareAndInject()
 {
     FileChecks();
     SettingsCheck();
     _mutexEvent.Close();
     Launch.Run();
 }
예제 #11
0
        private void LanMakerButtonSave_Click(object sender, EventArgs e)
        {
            using var dialog = new SaveFileDialog()
                  {
                      AddExtension                 = true,
                      AutoUpgradeEnabled           = true,
                      CheckPathExists              = true,
                      DefaultExt                   = ".end",
                      Filter                       = "Endscript Files|*.end",
                      OverwritePrompt              = true,
                      SupportMultiDottedExtensions = true,
                      Title = "Select directory and filename of the endscript to be saved",
                  };

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                var directory = this.LanMakerTextBoxDir.Text;
                var game      = this.LanMakerGame.Text;
                var usage     = this.LanMakerUsage.Text;
                var launch    = Utils.GenerateSample(directory, game, usage);
                Launch.Serialize(dialog.FileName, launch);
                MessageBox.Show($"File {dialog.FileName} has been saved.", "Success",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);

                this.WasCreated = true;
                this.NewLanPath = dialog.FileName;
            }
        }
예제 #12
0
파일: Form1.cs 프로젝트: e-semenyuk/Calc
 private void button1_Click(object sender, EventArgs e)
 {
     if (textBox1.Text != "")
     {
         Launch?.Invoke(textBox1.Text);
     }
 }
예제 #13
0
        public async Task <IActionResult> Edit(int id, [Bind("LaunchID,providerIdent,launchDate,launchName,padStatusIdenet,rocketIdentID")] Launch launch) // edits the afformentioned attributes
        {
            if (id != launch.LaunchID)
            {
                return(NotFound()); // checks there is a record to edit
            }

            if (ModelState.IsValid) // if there is then it checks the update of the database
            {
                try
                {
                    _context.Update(launch);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!LaunchExists(launch.LaunchID))
                    {
                        return(NotFound()); // returns error if there is no file there once they selected to delete
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index))); // edits
            }
            return(View(launch));                        // returns to index
        }
        public ActionResult <LaunchDto> Update(Launch launch)
        {
            var result = _launchService.UpdateDetachedEntity(launch, launch.LaunchId);

            return(result.IsSuccess ? Ok(new LaunchDto(result.Value))
                : (ActionResult)NotFound());
        }
예제 #15
0
        public LaunchViewModelOutput Update(int id, LaunchViewModelInput launchModel)
        {
            Launch launchUpdate = _launchRepository.GetById(id);

            if (launchUpdate == null)
            {
                throw new UnregisteredLaunch();
            }

            launchUpdate.AccountId  = launchModel.AccountId;
            launchUpdate.Date       = launchModel.Date;
            launchUpdate.LaunchType = launchModel.LaunchType;
            launchUpdate.Value      = launchModel.Value;

            _launchRepository.Update(launchUpdate);

            return(new LaunchViewModelOutput
            {
                LaunchId = launchUpdate.LaunchId,
                AccountId = launchUpdate.AccountId,
                Date = launchUpdate.Date,
                LaunchType = launchUpdate.LaunchType,
                Value = launchUpdate.Value
            });
        }
예제 #16
0
        public async Task <IActionResult> PutLaunch(Launch launch)
        {
            var id = launch.Id;

            if (id != launch.Id)
            {
                return(BadRequest());
            }

            _context.Entry(launch).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!LaunchExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
예제 #17
0
        public async Task <ActionResult <Launch> > PostLaunch(Launch launch)
        {
            _context.Launches.Add(launch);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetLaunch", new { id = launch.Id }, launch));
        }
예제 #18
0
        static void DelegateFactory(CommandLine command, string[] args)
        {
            var output   = Launch.GetPath("-output", "-o");
            var dll      = command.GetValue("-dll");
            var assembly = dll.isNullOrWhiteSpace() ? null : Assembly.LoadFile(Path.Combine(CurrentDirectory, dll));
            var strClass = command.GetValue("-class");

            if (strClass.isNullOrWhiteSpace())
            {
                throw new Exception("找不到 -class 参数");
            }
            var generate   = new GenerateScorpioDelegate();
            var classNames = strClass.Split(";");

            foreach (var className in classNames)
            {
                var clazz = GetType(assembly, className, null);
                if (clazz == null)
                {
                    throw new Exception($"找不到 class, 请输入完整类型或检查类名是否正确 : {className}");
                }
                generate.AddType(clazz);
            }
            FileUtil.CreateFile(output, generate.Generate(0));
            Logger.info($"生成Delegate仓库 {output}");
        }
예제 #19
0
        public JsonResult SearchDefined(string launchSuccess, string launchSite, string rocketUsed, string year, string landSuccess, string shipUsed)
        {
            string json = SendRequest("https://api.spacexdata.com/v3/launches");

            JArray        data = JArray.Parse(json);
            List <Launch> list = new List <Launch>();

            for (int i = 0; i < data.Count; i++)
            {
                Launch launch = new Launch();
                launch.missionName   = (string)data[i]["mission_name"];
                launch.missionDate   = (string)data[i]["launch_date_utc"];
                launch.launchSuccess = (string)data[i]["launch_success"];
                launch.flightNum     = (int)data[i]["flight_number"];

                launch.launchSite  = (string)data[i]["launch_site"]["site_name"];
                launch.rocketUsed  = (string)data[i]["rocket"]["rocket_name"];
                launch.year        = (string)data[i]["launch_year"];
                launch.landSuccess = (string)data[i]["rocket"]["first_stage"]["cores"][0]["land_success"];

                int?temp = (int)data[i]["ships"].Count();
                if (temp != null)
                {
                    for (int j = 0; j < temp; j++)
                    {
                        string name = (string)data[i]["ships"][j];
                        launch.shipsUsed.Add(name);
                    }
                }
                list.Add(launch);
            }

            if (!launchSuccess.IsNullOrWhiteSpace())
            {
                RefineSuccess(launchSuccess, ref list);
            }
            if (!landSuccess.IsNullOrWhiteSpace())
            {
                RefineLand(landSuccess, ref list);
            }
            if (!launchSite.IsNullOrWhiteSpace())
            {
                RefineSite(launchSite, ref list);
            }
            if (!rocketUsed.IsNullOrWhiteSpace())
            {
                RefineRocket(rocketUsed, ref list);
            }
            if (!year.IsNullOrWhiteSpace())
            {
                RefineYear(year, ref list);
            }
            if (!shipUsed.IsNullOrWhiteSpace())
            {
                RefineShip(shipUsed, ref list);
            }


            return(Json(list, JsonRequestBehavior.AllowGet));
        }
        public void Start(StartLaunchRequest request)
        {
            TraceLogger.Verbose($"Scheduling request to start new '{request.Name}' launch in {GetHashCode()} proxy instance");

            if (StartTask != null)
            {
                throw new InsufficientExecutionStackException("The launch is already scheduled for starting.");
            }

            if (!_isExternalLaunchId)
            {
                // start new launch item
                StartTask = Task.Run(async() =>
                {
                    var id = (await _service.StartLaunchAsync(request)).Id;

                    LaunchInfo = new Launch
                    {
                        Id        = id,
                        Name      = request.Name,
                        StartTime = request.StartTime
                    };
                });
            }
            else
            {
                // get launch info
                StartTask = Task.Run(async() =>
                {
                    LaunchInfo = await _service.GetLaunchAsync(LaunchInfo.Id);
                });
            }
        }
예제 #21
0
        public JsonResult ViewLaunches()
        {
            string json = SendRequest("https://api.spacexdata.com/v3/launches");

            JArray        data     = JArray.Parse(json);
            List <Launch> launches = new List <Launch>();

            for (int i = 0; i < data.Count; i++)
            {
                Launch launch = new Launch();

                launch.missionName   = (string)data[i]["mission_name"];
                launch.launchSuccess = (string)data[i]["launch_success"];
                launch.flightNum     = (int)data[i]["flight_number"];
                launch.launchTime    = (string)data[i]["launch_date_utc"];
                launch.launchYear    = (int)data[i]["launch_year"];

                launch.rocketName    = (string)data[i]["rocket"]["rocket_name"];
                launch.rocketType    = (string)data[i]["rocket"]["rocket_type"];
                launch.rocketID      = (string)data[i]["rocket"]["rocket_id"];
                launch.launchDetails = (string)data[i]["details"];

                launches.Add(launch);
            }

            return(Json(launches, JsonRequestBehavior.AllowGet));
        }
예제 #22
0
    private IEnumerator LaunchAfterDownloadingAvatar(Launch launch)
    {
        User user = launch.PlayerInfo;

        if (knownUsers.ContainsKey(user.Id) == false)
        {
            knownUsers.Add(user.Id, user);
        }

        if (string.IsNullOrEmpty(user.AvatarUrl))
        {
            // no Avatar url was sent with the launch
            InitiateLaunch(launch);
        }
        else
        {
            Texture2D tex = new Texture2D(300, 300, TextureFormat.DXT5, false);
            using (WWW www = new WWW(user.AvatarUrl))
            {
                yield return(www);

                www.LoadImageIntoTexture(tex);
                knownUsers[user.Id].Avatar = tex;

                launch.PlayerInfo = knownUsers[user.Id];
                InitiateLaunch(launch);
            }
        }
    }
        public ActionResult <LaunchDto> Add(Launch launch)
        {
            var result = _launchService.Add(launch);

            return(result.IsSuccess ? Ok(new LaunchDto(result.Value))
                : (ActionResult)NotFound());
        }
예제 #24
0
        static void MainTwo()
        {
            // Setting culture for float etc (. instead of ,)
            CultureInfo.DefaultThreadCurrentCulture   = CultureInfo.InvariantCulture;
            CultureInfo.DefaultThreadCurrentUICulture = CultureInfo.InvariantCulture;
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            // ClassicFramework cant be run alone!
            if (Process.GetCurrentProcess().ProcessName.StartsWith("ClassicFramework"))
            {
                if (!Assembly.GetExecutingAssembly().Location.ToLower().Contains("internal"))
                {
                    MessageBox.Show("Your file structure is corrupt. Please redownload ClassicFramework");
                    Environment.Exit(-1);
                }
                // Do the settings exist?
                if (!File.Exists(".\\Settings.xml"))
                {
                    OpenFileDialog loc = new OpenFileDialog();
                    loc.CheckFileExists = true;
                    loc.CheckPathExists = true;
                    loc.Filter          = "executable (*.exe)|*.exe";
                    loc.FilterIndex     = 1;
                    loc.Title           = "Please locate your WoW.exe";
                    if (loc.ShowDialog() == DialogResult.OK)
                    {
                        OOP.Settings.Recreate(loc.FileName);
                    }
                }
                Launch.Run();
                Environment.Exit(0);
            }
            WinImports.LoadLibrary(
                Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\FastCallDll.dll"
                );
            //WinImports.AllocConsole();
            //Logger.Append("We are injected now!");

            string    path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
            XDocument doc  = XDocument.Load(path + "\\Settings.xml");
            XElement  loot = doc.Element("Settings").Element("AutoLoot");

            LuaFunctions.CustomFuncs.AutoLoot.enabled = Convert.ToBoolean(loot.Value);
            Memory.Init();
            RegisterFunctionHook.Init();
            UnregisterFunctionHook.Init();
            if (LuaFunctions.CustomFuncs.AutoLoot.enabled)
            {
                OnRightClickUnitHook.Apply();
                OnRightClickObjectHook.Apply();
            }
            Singleton.Initialise();
            while (true)
            {
                Thread.Sleep(250);
            }
            // Run the GUI
            //Application.Run(new Main());
        }
예제 #25
0
        public void SaveTree(TreeViewEx srcFileTree, TreeViewEx srcRegTree, TreeViewEx destFileTree, TreeViewEx destRegTree, TreeViewEx appInfoTree, TreeViewEx launchTree)
        {
            foreach (TreeNode item in destFileTree.Nodes)
            {
                if (item.Text.StartsWith("["))
                {
                    Launch.SaveNode(item);
                }
                else if (item.Text == "App")
                {
                    foreach (TreeNode appNode in item.Nodes)
                    {
                        if (appNode.Text != "AppInfo")
                        {
                            SaveFileNode(appNode);
                        }
                    }
                }
            }
            List <string> listOfComFile = new List <string>();

            foreach (TreeNode item in destRegTree.Nodes)
            {
                Launch.SaveNode(item);

                if (item.Text == LaunchINI.LaunchINI.RegistryKeys_Tag && IsGenerateRegFile)
                {
                    GenerateRegFile(item);
                }
                else if (item.Text == LaunchINI.LaunchINI.RegistrationFreeCOM_Tag)
                {
                    foreach (TreeNode subItem in item.Nodes)
                    {
                        INIKeyValuePairBase tempVal = new INIKeyValuePairBase();
                        tempVal.FullValue = subItem.Text;
                        listOfComFile.Add(tempVal.IniValue);
                    }
                }
            }

            Launch.Save();
            AppInfo.Save();

            GenerateIcons();

            if (listOfComFile.Count > 0 && IsGenerateManifest)
            {
                List <string> tempAllFiles = new List <string>();
                tempAllFiles.AddRange(Directory.GetFiles(RootFolder, "*.dll", SearchOption.AllDirectories));
                tempAllFiles.AddRange(Directory.GetFiles(RootFolder, "*.ocx", SearchOption.AllDirectories));
                tempAllFiles.AddRange(Directory.GetFiles(RootFolder, "*.exe", SearchOption.AllDirectories));

                Model.COM.ComRegInfo.Inst.Clear();
                Model.COM.ComRegInfo.Inst.ParseComInfo(srcRegTree);
                Model.COM.ComRegInfo.Inst.UpdateTypeInfo(listOfComFile, tempAllFiles);
                GenerateManifestInternal(Model.ExeFileNameListStringConverter.ExeFileNameList.ToList(),
                                         listOfComFile, tempAllFiles);
            }
        }
예제 #26
0
        static void Pack(CommandLine command, string[] args)
        {
            var source = Launch.GetPath("-source", "-s");
            var output = Launch.GetPath("-output", "-o");

            File.WriteAllBytes(output, Serializer.Serialize(source, FileUtil.GetFileString(source)).ToArray());
            Logger.info($"生成IL文件  {source} -> {output}");
        }
예제 #27
0
 static void Main(string[] args)
 {
     Launch.AddExecute("register", HelpRegister, Register);
     Launch.AddExecute("install", HelpInstall, Install);
     Launch.AddExecute("reset", HelpReset, Reset);
     Launch.AddExecute("", HelpExecute, Execute);
     Launch.Start(args, null, null);
 }
        public LaunchReporter(Service service, string launchId) : this(service)
        {
            _isExternalLaunchId = true;

            LaunchInfo = new Launch
            {
                Id = launchId
            };
        }
예제 #29
0
    void Awake()
    {
        instance            = this;
        forceStopSimulation = false;

        simulationsCompleted = false;
        showError            = false;
        MultiThreadSim       = false;
    }
예제 #30
0
        public async Task AddLaunchInProductAsync(string productKey, Launch launch, DateTime modifiedOn)
        {
            var product = await _dataAccess.SelectByKeyAsync <Domain.Entities.Product>(productKey);

            product.Launches.Add(launch);
            product.ModifiedOn = modifiedOn;

            await _dataAccess.UpdateAsync(product, productKey);
        }
예제 #31
0
 private void _launchButton_Click(object sender, EventArgs e)
 {
     if (Launch != null)
     {
         Cursor = Cursors.WaitCursor;
         Launch.Invoke(_addin, null);
         Cursor = Cursors.Default;
     }
 }
예제 #32
0
 private async void GetInfo(Launch.Login.IAuth author) {
     info = await author.LoginAsync(System.Threading.CancellationToken.None);
     progressbar.Visibility = Visibility.Collapsed;
     if (info != null)
     {
         if (string.IsNullOrWhiteSpace(info.ErrorMsg) & info.Pass)
         {
             lblName.Content = info.DisplayName;
             lblUUID.Content = info.UUID;
             butNext.IsEnabled = true;
         }
         else
         {
             lblName.Content = Lang.LangManager.GetLangFromResource("Error");
             lblUUID.Content = Lang.LangManager.GetLangFromResource("Error");
         }
     }
     else
     {
         lblName.Content = Lang.LangManager.GetLangFromResource("Error");
         lblUUID.Content = Lang.LangManager.GetLangFromResource("Error");
     }
 }
예제 #33
0
 public LaunchMCThread (Launch.LaunchGameInfo options)
 {
     _LaunchOptions = options;
 }
예제 #34
0
        public PageGuideAuthTry(Launch.Login.IAuth author)
        {
            InitializeComponent();
            GetInfo(this.author = author);

        }
	// Use this for initialization
	void Start () {
		launchHandler = GameObject.Find ("BackgroundImage").GetComponent<Launch> ();
		generateMove = GameObject.Find ("BackgroundImage").GetComponent<GenerateMove> ();
		poseArrayCounter = -1; // Indicating it hasn't generated new poses yet
	}