public static void SaveOptions3(Options3 option) { try { Options3 o3; using (fsbDB FSBDB = new fsbDB()) { o3 = (from Options3 g2 in FSBDB.Options3 where g2.ID == option.ID select g2).FirstOrDefault(); if (o3 != null) { foreach (PropertyInfo pi in option.GetType().GetProperties()) { if (pi.CanWrite) { pi.SetValue(o3, pi.GetValue(option, null), null); } } } else { FSBDB.Options3.Add(option); } FSBDB.SaveChanges(); } } catch (Exception ex) { ClsError.CoreError(Name, MethodBase.GetCurrentMethod().ToString(), ex); } }
private void Save_PosSiz() { FormWindowState wstate = this.WindowState; if (wstate == FormWindowState.Minimized) { return; } StringBuilder sb = new StringBuilder(); sb.Append(this.Location.X.ToString()).Append(","); sb.Append(this.Location.Y.ToString()).Append(","); sb.Append(this.Size.Width.ToString()).Append(","); sb.Append(this.Size.Height.ToString()); Options3 o = ClsOptionsControler.Options3("MainPosSiz"); o.Value = sb.ToString(); ClsOptionsControler.SaveOptions3(o); Options3 s = ClsOptionsControler.Options3("MainWindowState"); s.Value = this.WindowState.ToString(); ClsOptionsControler.SaveOptions3(s); }
static async Task CreateBuildTarget(List <Options2> optionList) { var buildTargetsApi = new UnityCloudBuildApi.IO.Swagger.Api.BuildtargetsApi(config); // Get BuildTargets for list BuildTargetId var buildTargets = await ConsideringRateLimitWith(async() => await buildTargetsApi.GetBuildTargetsAsync(OrgId, ProjectId)); var existsTargetIdByName = buildTargets.ToDictionary(x => x.Name); for (int i = 0; i < optionList.Count;) { var opt2 = optionList[i]; if (existsTargetIdByName.ContainsKey(opt2.Name)) { //Update build target var target = existsTargetIdByName[opt2.Name]; Debug.WriteLine("Update build target: " + opt2.Name + ", " + target.Buildtargetid); var opt3 = new Options3(); opt3.Name = opt2.Name; opt3.Platform = opt2.Platform; opt3.Enabled = opt2.Enabled; opt3.Settings = opt2.Settings; opt3.Credentials = opt2.Credentials; await ConsideringRateLimitWith(async() => await buildTargetsApi.UpdateBuildTargetAsync(OrgId, ProjectId, target.Buildtargetid, opt3)); } else { // Add Build Target Debug.WriteLine("Add build target: " + opt2.Name); await ConsideringRateLimitWith(async() => await buildTargetsApi.AddBuildTargetAsync(OrgId, ProjectId, opt2)); } i++; } }
public static void ChangeTextVariable(string Variable, string Wert) { // Abbruch wenn richtiger Wert bereits in Variable if (ClsDBVariablen.Instance.GetTextVariableWert(Variable) == Wert) { return; } // Wert setzten ClsDBVariablen.Instance.SetTextVariableWert(Variable, Wert); // Prüfen ob Torschütze erfasst werden muß if (new[] { "S05", "S06" }.Contains(Variable)) { Options3 o3 = ClsOptionsControler.Options3("Torschütze"); if (Convert.ToBoolean(o3.Value)) { } } // Prüfen ob Foulspieler erfasst werden muß if (new[] { "S18", "S19" }.Contains(Variable)) { Options3 o3 = ClsOptionsControler.Options3("Foulspieler"); if (Convert.ToBoolean(o3.Value)) { } } // Prüfen ob Ereignis geschrieben werden muß bool log = ClsVariablenControler.LogChange(Variable); if (log) { } }
private static void SaveToDB(ClsOptionen Optionen) { List <HotKey> o1 = ClsHotkeyControler.hotkeys(); for (int i = 0; i < Optionen.HotKey.Count; i++) { HotKey h = (from x in o1 where x.Befehl == Optionen.HotKey[i].Befehl select x).FirstOrDefault(); if (h != null) { o1[i].Hotkey1 = Optionen.HotKey[i].Hotkey1; ClsHotkeyControler.SaveHotKey(o1[i]); } } List <Kontrols> o2 = ClsKontrolControler.Kontrols(); for (int i = 0; i < Optionen.Kontrols.Count; i++) { Kontrols h = (from x in o2 where x.Name == Optionen.Kontrols[i].Name select x).FirstOrDefault(); if (h != null) { o2[i].Ort = Optionen.Kontrols[i].Ort; o2[i].Sort = Optionen.Kontrols[i].Sort; ClsKontrolControler.SaveKontrol(o2[i]); } } List <Options3> o3 = ClsOptionsControler.Options3(); for (int i = 0; i < Optionen.Options3.Count; i++) { Options3 h = (from x in o3 where x.Prop == Optionen.Options3[i].Prop select x).FirstOrDefault(); if (h != null) { o3[i].Value = Optionen.Options3[i].Value; ClsOptionsControler.SaveOptions3(o3[i]); } } List <Strafen> s = ClsOptionsControler.Strafen(); if (s.Any()) { for (int i = 0; i < s.Count; i++) { ClsOptionsControler.DelStrafe(s[i].Bezeichnung); } } if (Optionen.Strafen.Any()) { for (int i = 0; i < Optionen.Strafen.Count; i++) { ClsOptionsControler.AddStrafe(Optionen.Strafen[i]); } } List <TabellenSort> o4 = ClsOptionsControler.Tabellensortierung(); for (int i = 0; i < Optionen.TabellenSort.Count; i++) { TabellenSort h = (from x in o4 where x.Feld == Optionen.TabellenSort[i].Feld select x).FirstOrDefault(); if (h != null) { o4[i].Prio = Optionen.TabellenSort[i].Prio; o4[i].absteigend = Optionen.TabellenSort[i].absteigend; ClsOptionsControler.SaveTabellensortierung(o4[i]); } } List <Timer> o5 = ClsTimerControler.Timers(); for (int i = 0; i < Optionen.Timer.Count; i++) { Timer h = (from x in o5 where x.Nr == Optionen.Timer[i].Nr select x).FirstOrDefault(); if (h != null) { bool ats1 = o5[i].AbhaengigeTimerStatus == 0 ? false : true; bool ats2 = Optionen.Timer[i].AbhaengigeTimerStatus == 0 ? false : true; o5[i].AbhängigeTimerNr = Optionen.Timer[i].AbhängigeTimerNr; ats1 = ats2; o5[i].AutoReset = Optionen.Timer[i].AutoReset; o5[i].Countdown = Optionen.Timer[i].Countdown; o5[i].DisplayDynamisch = Optionen.Timer[i].DisplayDynamisch; o5[i].Kontrolanzeige = Optionen.Timer[i].Kontrolanzeige; o5[i].MinutenDarstellung = Optionen.Timer[i].MinutenDarstellung; o5[i].StartSekunden = Optionen.Timer[i].StartSekunden; ClsOptionsControler.SaveTabellensortierung(o4[i]); } } List <Timerevent> s2 = ClsTimerControler.TimerEvents(); if (s2.Any()) { for (int i = 0; i < s2.Count; i++) { ClsTimerControler.DelTimerEvent((int)s2[i].ID); } } if (Optionen.Timerevent.Any()) { for (int i = 0; i < Optionen.Timerevent.Count; i++) { ClsTimerControler.AddTimerEvent(Optionen.Timerevent[i]); } } }
public ActionResult Example3(Options3 options) { this.options3.Value.CompanyNameRequired = options.CompanyNameRequired; return(this.Process <Model3>(this.options3.Value)); }
/// <summary> /// Update build target details /// </summary> /// <param name="orgid">Organization identifier</param> /// <param name="projectid">Project identifier</param> /// <param name="buildtargetid">unique id auto-generated from the build target name</param> /// <param name="options">Options for build target create/update</param> /// <returns>ApiResponse of InlineResponse2003</returns> public ApiResponse< InlineResponse2003 > UpdateBuildTargetWithHttpInfo (string orgid, string projectid, string buildtargetid, Options3 options) { // verify the required parameter 'orgid' is set if (orgid == null) throw new ApiException(400, "Missing required parameter 'orgid' when calling BuildtargetsApi->UpdateBuildTarget"); // verify the required parameter 'projectid' is set if (projectid == null) throw new ApiException(400, "Missing required parameter 'projectid' when calling BuildtargetsApi->UpdateBuildTarget"); // verify the required parameter 'buildtargetid' is set if (buildtargetid == null) throw new ApiException(400, "Missing required parameter 'buildtargetid' when calling BuildtargetsApi->UpdateBuildTarget"); // verify the required parameter 'options' is set if (options == null) throw new ApiException(400, "Missing required parameter 'options' when calling BuildtargetsApi->UpdateBuildTarget"); var path_ = "/orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}"; var pathParams = new Dictionary<String, String>(); var queryParams = new Dictionary<String, String>(); var headerParams = new Dictionary<String, String>(Configuration.DefaultHeader); var formParams = new Dictionary<String, String>(); var fileParams = new Dictionary<String, FileParameter>(); Object postBody = null; // to determine the Content-Type header String[] httpContentTypes = new String[] { "application/json" }; String httpContentType = Configuration.ApiClient.SelectHeaderContentType(httpContentTypes); // to determine the Accept header String[] httpHeaderAccepts = new String[] { "application/json", "text/plain", "text/html" }; String httpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(httpHeaderAccepts); if (httpHeaderAccept != null) headerParams.Add("Accept", httpHeaderAccept); // set "format" to json by default // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json pathParams.Add("format", "json"); if (orgid != null) pathParams.Add("orgid", Configuration.ApiClient.ParameterToString(orgid)); // path parameter if (projectid != null) pathParams.Add("projectid", Configuration.ApiClient.ParameterToString(projectid)); // path parameter if (buildtargetid != null) pathParams.Add("buildtargetid", Configuration.ApiClient.ParameterToString(buildtargetid)); // path parameter if (options.GetType() != typeof(byte[])) { postBody = Configuration.ApiClient.Serialize(options); // http body (model) parameter } else { postBody = options; // byte array } // authentication (apikey) required // http basic authentication required if (!String.IsNullOrEmpty(Configuration.Username) || !String.IsNullOrEmpty(Configuration.Password)) { headerParams["Authorization"] = "Basic " + Base64Encode(Configuration.Username + ":" + Configuration.Password); } // authentication (permissions) required // oauth required if (!String.IsNullOrEmpty(Configuration.AccessToken)) { headerParams["Authorization"] = "Bearer " + Configuration.AccessToken; } // make the HTTP request IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, pathParams, httpContentType); int statusCode = (int) response.StatusCode; if (statusCode >= 400) throw new ApiException (statusCode, "Error calling UpdateBuildTarget: " + response.Content, response.Content); else if (statusCode == 0) throw new ApiException (statusCode, "Error calling UpdateBuildTarget: " + response.ErrorMessage, response.ErrorMessage); return new ApiResponse<InlineResponse2003>(statusCode, response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (InlineResponse2003) Configuration.ApiClient.Deserialize(response, typeof(InlineResponse2003))); }
/// <summary> /// Update build target details /// </summary> /// <param name="orgid">Organization identifier</param> /// <param name="projectid">Project identifier</param> /// <param name="buildtargetid">unique id auto-generated from the build target name</param> /// <param name="options">Options for build target create/update</param> /// <returns>InlineResponse2003</returns> public InlineResponse2003 UpdateBuildTarget (string orgid, string projectid, string buildtargetid, Options3 options) { ApiResponse<InlineResponse2003> response = UpdateBuildTargetWithHttpInfo(orgid, projectid, buildtargetid, options); return response.Data; }
/// <summary> /// Update build target details /// </summary> /// <param name="orgid">Organization identifier</param> /// <param name="projectid">Project identifier</param> /// <param name="buildtargetid">unique id auto-generated from the build target name</param> /// <param name="options">Options for build target create/update</param> /// <returns>Task of InlineResponse2003</returns> public async System.Threading.Tasks.Task<InlineResponse2003> UpdateBuildTargetAsync (string orgid, string projectid, string buildtargetid, Options3 options) { ApiResponse<InlineResponse2003> response = await UpdateBuildTargetAsyncWithHttpInfo(orgid, projectid, buildtargetid, options); return response.Data; }