/// <summary> /// Load test suite. /// </summary> /// <param name="filename">Filename of the profile</param> public void LoadTestSuite(string filename) { TestSuiteInfo tsinfo; using (ProfileUtil profile = ProfileUtil.LoadProfile(filename)) { tsinfo = testSuites.Find(ts => ts.TestSuiteName == profile.Info.TestSuiteName); if (tsinfo == null) { throw new ArgumentException(String.Format(StringResources.UnknownTestSuiteMessage, profile.Info.TestSuiteName)); } } util.LoadTestSuiteConfig(tsinfo); util.LoadTestSuiteAssembly(); string newProfile; if (util.TryUpgradeProfileSettings(filename, out newProfile)) { Console.WriteLine(String.Format(StringResources.PtmProfileUpgraded, newProfile)); filename = newProfile; } util.LoadProfileSettings(filename); }
/// <summary> /// Load test suite. /// </summary> /// <param name="filename">Filename of the profile</param> /// <param name="testSuiteFolder">Path of the specified test suite</param> public void LoadTestSuite(string filename, string testSuiteFolder) { Logger.AddLog(LogLevel.Information, "Load Test Suite"); TestSuiteInfo tsinfo; using (ProfileUtil profile = ProfileUtil.LoadProfile(filename)) { tsinfo = testSuites.Find(ts => ts.TestSuiteName == profile.Info.TestSuiteName); if (tsinfo == null) { throw new ArgumentException(String.Format(StringResources.UnknownTestSuiteMessage, profile.Info.TestSuiteName)); } string testSuiteFolderBin = Path.Combine(testSuiteFolder, "Bin"); tsinfo.TestSuiteFolder = testSuiteFolder; tsinfo.TestSuiteVersion = LoadTestsuiteVersion(testSuiteFolderBin); } util.LoadTestSuiteConfig(tsinfo); util.LoadTestSuiteAssembly(); string newProfile; if (util.TryUpgradeProfileSettings(filename, out newProfile)) { Console.WriteLine(String.Format(StringResources.PtmProfileUpgraded, newProfile)); filename = newProfile; } util.LoadProfileSettings(filename); }
public override void OnActionExecuting(ActionExecutingContext context) { UserManager <IdentityUser> userManager = (UserManager <IdentityUser>)context.HttpContext.RequestServices.GetService(typeof(UserManager <IdentityUser>)); var username = context.HttpContext.User.Identity.Name; var userId = context.HttpContext.User.FindFirstValue(ClaimTypes.NameIdentifier); //var user = await userManager.FindByEmailAsync(username); var consented = ProfileUtil.IsConsented(userId, roles); if (!consented && roles == "client") { context.Result = new RedirectToRouteResult( new RouteValueDictionary { { "Controller", "Profile" }, { "Action", "Consent" } }); } else if (!consented && roles == "clinician") { context.Result = new RedirectToRouteResult( new RouteValueDictionary { { "Controller", "Clinician" }, { "Action", "Consent" } }); } base.OnActionExecuting(context); }
public void ProcessRequest(HttpContext context) { switch (context.Request.QueryString["tp"]) { case "UserBrowseView": ProfileUtil.ToggleUserBrowseMode(int.Parse(context.Request.QueryString["i"])); this.ResponseDummyImage(context); break; default: break; } }
public ReferralModel(mp_referral referral) { id = referral.id; clinician_id = referral.clinician_id; profile_id = referral.profile_id; created_at = referral.created_at; created_by = referral.created_by; profile_match_id = referral.profile_match_id; referred_by = ProfileUtil.get_profile_name(referral.created_by, "role"); clinician = new DoctorModel(referral.clinician_); profile = new MemberModel(referral.profile_); profile_match = new ProfileMatchModel(referral.profile_match_); }
public static void UpdateKeyValues(ContentProfile profile) { Assert.ArgumentNotNull(profile, "profile"); Assert.IsFalse(profile.ProfileID == ID.Null, "profile ID"); if (profile.Presets == null || profile.Presets.Count == 0) { return; } Item profileItem = profile.GetProfileItem(); if (profileItem == null) { return; } Item presetsFolder = ProfileUtil.GetPresetsFolder(profileItem); if (presetsFolder == null) { return; } SimpleProfileKeyCalculator profileKeyCalculator = null; string strA = presetsFolder["Authoring Selection"]; if (string.Compare(strA, "{C4960DD5-8B07-4025-8E48-57C3BC578CE1}", StringComparison.InvariantCultureIgnoreCase) == 0) { profileKeyCalculator = new SimpleProfileKeyCalculator(profile); } else if (string.Compare(strA, "{DF9486E3-C239-406E-83DD-7A30BEF2599D}", StringComparison.InvariantCultureIgnoreCase) == 0) { profileKeyCalculator = new MultipleProfileKeyCalculator(profile); } else if (string.Compare(strA, "{2DE135D7-FB39-42B2-B10A-13CB4285E5C5}", StringComparison.InvariantCultureIgnoreCase) == 0) { profileKeyCalculator = new MultipleWithPercentageProfileKeyCalculator(profile); } if (profileKeyCalculator == null) { return; } profileKeyCalculator.Calculate(); }
protected void ToggleViewMode(object sender, EventArgs e) { switch (this.hfViewMode.Value) { default: case "0": Util.SwapGrid(this.views, 0, this.CurrentGrid, this.gridViewUsers); ProfileUtil.ToggleUserBrowseMode(0); break; case "1": Util.SwapGrid(this.views, 0, this.CurrentGrid, this.gridViewUsers); ProfileUtil.ToggleUserBrowseMode(1); break; case "2": Util.SwapGrid(this.views, 1, this.CurrentGrid, this.gridView2); ProfileUtil.ToggleUserBrowseMode(2); break; } }
/// <summary> /// Load test suite. /// </summary> /// <param name="filename">Filename of the profile</param> public void LoadTestSuite(string filename) { ProfileUtil profile = ProfileUtil.LoadProfile(filename); TestSuiteInfo tsinfo = null; foreach (var g in testSuites) { foreach (var info in g) { if (profile.VerifyVersion(info.TestSuiteName, info.TestSuiteVersion)) { tsinfo = info; goto FindTestSuite; } } } FindTestSuite: profile.Dispose(); util.LoadTestSuiteConfig(tsinfo); util.LoadTestSuiteAssembly(); util.LoadProfileSettings(filename); }
static void Main(string[] args) { Console.WriteLine("##########################################################"); Console.WriteLine("# MENU #"); Console.WriteLine("# CLOSE FIREFOX BEFORE BACKING UP!! #"); Console.WriteLine("# #"); Console.WriteLine("# 1. BACKUP #"); Console.WriteLine("# 2. RESTORE #"); Console.WriteLine("##########################################################"); Console.WriteLine("Choose an option:"); var key = Console.ReadKey(); if (key.KeyChar == '1') { Stopwatch sw = Stopwatch.StartNew(); string path = ProfileUtil.Backup(); sw.Stop(); Console.WriteLine(); Console.WriteLine($"Backup created under {path} (Took: {(sw.ElapsedMilliseconds / 1000.0).ToString()}s)"); } else { Console.WriteLine(); Console.WriteLine("Enter the archive path:"); string path = Console.ReadLine(); Stopwatch sw = Stopwatch.StartNew(); ProfileUtil.Restore(path); sw.Stop(); Console.WriteLine($"Restore finsihed (Took: {(sw.ElapsedMilliseconds / 1000.0).ToString()}s)"); } Console.ReadKey(); }