private void SendCustomProgramInfoToApi(ProgramData progData) { AnonymousDownloading.< > c__DisplayClass30_0 expr_05 = new AnonymousDownloading.< > c__DisplayClass30_0(); expr_05.< > 4__this = this; expr_05.progData = progData; new Task(delegate { try { CgApiProgram expr_05 = new CgApiProgram(); expr_05.set_ExeName(expr_05.progData.ExeName); expr_05.set_RegName(expr_05.progData.RegName); expr_05.PostProgramInfo().ConfigureAwait(false); } catch (Exception ex) { McExceptionLogItem expr_3B = new McExceptionLogItem(); expr_3B.set_RelatingException(ex); expr_3B.set_ExceptionMessage("Failed to trigger Post Program Info" + ex.Message); McExceptionLogItem aEvent = expr_3B; ObjectHolder.EventLogger.LogLocalEvent(aEvent); CgApiProgram expr_05; HelperFunctions.DebugLine(string.Format("{0}::{1} PostProgramInfo FAILED {2}", expr_05.< > 4__this.GetType().Name, MethodBase.GetCurrentMethod().Name, ex.Message)); } }).Start();
private void SendCustomProgramInfoToApi() { new Task(delegate { try { foreach (ProgramData current in this.ProgramDataList) { if (current.Visible) { CgApiProgram expr_23 = new CgApiProgram(); expr_23.set_ExeName(current.ExeName); expr_23.set_RegName(current.RegName); expr_23.PostProgramInfo().ConfigureAwait(false); } } } catch (Exception ex) { McExceptionLogItem expr_63 = new McExceptionLogItem(); expr_63.set_RelatingException(ex); expr_63.set_ExceptionMessage("Failed to trigger Post Program Info" + ex.Message); McExceptionLogItem aEvent = expr_63; ObjectHolder.EventLogger.LogLocalEvent(aEvent); HelperFunctions.DebugLine(string.Format("{0}::{1} PostProgramInfo FAILED {2}", base.GetType().Name, MethodBase.GetCurrentMethod().Name, ex.Message)); } }).Start(); }
public static async Task LoadProgramsFromCsv() { try { string path = Path.Combine(HelperFunctions.GetUserDataAppPath("CyberGhost", true), "programs"); if (!File.Exists(path)) { await CgApiHelper.FetchProgramList(); } string[] arg_CE_0 = CgApiHelper.Base64Decode(File.ReadAllText(path)).Split(new char[] { '\n' }); ObjectHolder.ProgramList = new CgApiProgramList(); ObjectHolder.ProgramList.get_Items().Clear(); for (int var_3_D0 = 0; var_3_D0 < arg_CE_0.Length; var_3_D0++) { string var_4_D6 = arg_CE_0[var_3_D0]; if (!string.IsNullOrEmpty(var_4_D6)) { string[] var_5_F3 = var_4_D6.Split(new char[] { ';' }); CgApiProgram expr_FA = new CgApiProgram(); expr_FA.set_Id(int.Parse(var_5_F3[0])); expr_FA.set_ExeName(var_5_F3[1]); expr_FA.set_RegName(var_5_F3[2]); ObjectHolder.ProgramList.get_Items().Add(expr_FA); } } path = null; } catch (Exception var_7_143) { HelperFunctions.DebugLine(string.Format("CgApiHelper::{0} COULD NOT LOAD PROGS FROM CSV {1}", MethodBase.GetCurrentMethod().Name, var_7_143.Message)); } }