public ProgramData(CgApiProgram program, bool visible = false) { string uriString = this.IconFromFilePath(program.GetApplicationExe()); this.ExeImage = new Uri(uriString); this.ExeName = program.GetApplicationDescription(); this.ToolTip = program.get_ExeName(); this.ApplicationExe = program.GetApplicationExe(); this.Visible = visible; }
public static async Task FetchProgramList() { try { StringBuilder stringBuilder = new StringBuilder(); ObjectHolder.ProgramList = new CgApiProgramList(); await ObjectHolder.ProgramList.Fetch(); List <CgApiProgram> .Enumerator var_2 = ObjectHolder.ProgramList.get_Items().GetEnumerator(); try { while (var_2.MoveNext()) { CgApiProgram expr_A2 = var_2.Current; stringBuilder.AppendLine(string.Format("{0};{1};{2}", expr_A2.get_Id().ToString(), expr_A2.get_ExeName(), expr_A2.get_RegName())); } } finally { int num; if (num < 0) { var_2.Dispose(); } } File.WriteAllText(Path.Combine(HelperFunctions.GetUserDataAppPath("CyberGhost", true), "programs"), CgApiHelper.Base64Encode(stringBuilder.ToString())); stringBuilder = null; } catch (Exception var_8_130) { HelperFunctions.DebugLine(string.Format("CgApiHelper::{0} COULD NOT FETCH PROGRAM {1}", MethodBase.GetCurrentMethod().Name, var_8_130.Message)); } }