private void ButtonDownloadJar_OnClick(object sender, RoutedEventArgs e)
        {
            if (CheckBoxManual.IsChecked == false)
            {
                Build = "latest";
            }

            if (!TextBoxPath.Text.Equals(string.Empty))
            {
                Projects.DownloadJar(ProjectType, Version, Build);
            }
            else
            {
                MessageBox.Show("Please provide a valid path", "Invalid Path!",
                                MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }

            if (CheckBoxGenerateBatch.IsChecked == true)
            {
                var batch = new Batch(ProjectType, Version, Build, Projects.DownloadPath, "launch.bat");
                batch.Create();
            }
            if (CheckBoxGenerateEula.IsChecked == true)
            {
                var eula = new Eula(Projects.DownloadPath, true);
                eula.Create();
            }
        }
        /// <summary>Gets the license agreements from the selected updates.</summary>
        void GetLicenseAgreements()
        {
            this.licenseInformation = new Collection <Eula>();

            if (Core.Applications == null)
            {
                return;
            }

            for (int x = 0; x < Core.Applications.Count; x++)
            {
                for (int y = 0; y < Core.Applications[x].Updates.Count; y++)
                {
                    if (Core.Applications[x].Updates[y].LicenseUrl == null)
                    {
                        continue;
                    }

                    if (Core.Applications[x].Updates[y].LicenseUrl.Length <= 0)
                    {
                        continue;
                    }

                    var sla = new Eula
                    {
                        LicenseUrl  = Core.Applications[x].Updates[y].LicenseUrl,
                        Title       = Utilities.GetLocaleString(Core.Applications[x].Updates[y].Name),
                        AppIndex    = x,
                        UpdateIndex = y
                    };

                    this.licenseInformation.Add(sla);
                }
            }
        }
示例#3
0
        private Eula AddEulaBoxToEulaMenu()
        {
            var eula = new Eula(new Rectangle(0.45f, 0.325f, 0.3f, 0.05f), CreateEula())
            {
                MaxDisplayCount = 4,
                RenderLayer     = 4
            };

            eulaMenu.Add(eula);
            return(eula);
        }
示例#4
0
        private void AddExitButtonToEulaMenu(Eula eula)
        {
            var exit = new InteractiveButton(new Rectangle(0.5f, 0.575f, 0.2f, 0.05f), "Exit")
            {
                RenderLayer = 4
            };

            exit.Clicked += () =>             //ncrunch: no coverage start
            {
                if (eula.WasRead)
                {
                    eulaMenu.Hide();
                    mainMenu.ToForeground();
                }
                else
                {
                    eulaMenu.ToBackground();
                    errorWindow.Show();
                }
            };             //ncrunch: no coverage end
            eulaMenu.Add(exit);
        }
		private void AddExitButtonToEulaMenu(Eula eula)
		{
			var exit = new InteractiveButton(new Rectangle(0.5f, 0.575f, 0.2f, 0.05f), "Exit")
			{
				RenderLayer = 4
			};
			exit.Clicked += () => //ncrunch: no coverage start
			{
				if (eula.WasRead)
				{
					eulaMenu.Hide();
					mainMenu.ToForeground();
				}
				else
				{
					eulaMenu.ToBackground();
					errorWindow.Show();
				}
			}; //ncrunch: no coverage end
			eulaMenu.Add(exit);
		}
		private Eula AddEulaBoxToEulaMenu()
		{
			var eula = new Eula(new Rectangle(0.45f, 0.325f, 0.3f, 0.05f), CreateEula())
			{
				MaxDisplayCount = 4,
				RenderLayer = 4
			};
			eulaMenu.Add(eula);
			return eula;
		}
示例#7
0
        /// <summary>
        /// Change eula properties Set eula as visualized and/or accepted
        /// </summary>
        /// <exception cref="TorizonRestAPI.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="eulaId">Id of an eula</param>
        /// <param name="e"> (optional)</param>
        /// <param name="cancellationToken">Cancellation Token to cancel request (optional) </param>
        /// <returns>Task of ApiResponse (Eula)</returns>
        public async System.Threading.Tasks.Task <ApiResponse <Eula> > EulaModifyWithHttpInfoAsync(string eulaId, Eula e = default(Eula), CancellationToken cancellationToken = default(CancellationToken))
        {
            // verify the required parameter 'eulaId' is set
            if (eulaId == null)
            {
                throw new ApiException(400, "Missing required parameter 'eulaId' when calling EulasApi->EulaModify");
            }

            var    localVarPath         = "/eulas/{eula_id}";
            var    localVarPathParams   = new Dictionary <String, String>();
            var    localVarQueryParams  = new List <KeyValuePair <String, String> >();
            var    localVarHeaderParams = new Dictionary <String, String>(this.Configuration.DefaultHeader);
            var    localVarFormParams   = new Dictionary <String, String>();
            var    localVarFileParams   = new Dictionary <String, FileParameter>();
            Object localVarPostBody     = null;

            // to determine the Content-Type header
            String[] localVarHttpContentTypes = new String[] {
                "application/json"
            };
            String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
                "application/json"
            };
            String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);

            if (localVarHttpHeaderAccept != null)
            {
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
            }

            if (eulaId != null)
            {
                localVarPathParams.Add("eula_id", this.Configuration.ApiClient.ParameterToString(eulaId));                 // path parameter
            }
            if (e != null && e.GetType() != typeof(byte[]))
            {
                localVarPostBody = this.Configuration.ApiClient.Serialize(e); // http body (model) parameter
            }
            else
            {
                localVarPostBody = e; // byte array
            }


            // make the HTTP request
            IRestResponse localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath,
                                                                                                            Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
                                                                                                            localVarPathParams, localVarHttpContentType, cancellationToken);

            int localVarStatusCode = (int)localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("EulaModify", localVarResponse);
                if (exception != null)
                {
                    throw exception;
                }
            }

            return(new ApiResponse <Eula>(localVarStatusCode,
                                          localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)),
                                          (Eula)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Eula))));
        }
示例#8
0
        /// <summary>
        /// Change eula properties Set eula as visualized and/or accepted
        /// </summary>
        /// <exception cref="TorizonRestAPI.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="eulaId">Id of an eula</param>
        /// <param name="e"> (optional)</param>
        /// <param name="cancellationToken">Cancellation Token to cancel request (optional) </param>
        /// <returns>Task of Eula</returns>
        public async System.Threading.Tasks.Task <Eula> EulaModifyAsync(string eulaId, Eula e = default(Eula), CancellationToken cancellationToken = default(CancellationToken))
        {
            ApiResponse <Eula> localVarResponse = await EulaModifyWithHttpInfoAsync(eulaId, e, cancellationToken);

            return(localVarResponse.Data);
        }
示例#9
0
        /// <summary>
        /// Change eula properties Set eula as visualized and/or accepted
        /// </summary>
        /// <exception cref="TorizonRestAPI.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="eulaId">Id of an eula</param>
        /// <param name="e"> (optional)</param>
        /// <returns>Eula</returns>
        public Eula EulaModify(string eulaId, Eula e = default(Eula))
        {
            ApiResponse <Eula> localVarResponse = EulaModifyWithHttpInfo(eulaId, e);

            return(localVarResponse.Data);
        }