public void CanCreateCategoryAndCounter() { using (CounterRepository cr = CounterRepositoryConfigurator.New(cfg => { cfg.Register <MagnumTestCounters>(); })) { PerformanceCategoryExists("MagnumTestCounters"); PerformanceCounterExists("MagnumTestCounters", "ConsumerThreadCount"); var counters = cr.GetCounter <MagnumTestCounters>("_default"); } }
public void DeleteCategoryViaType() { using (CounterRepository cr = CounterRepositoryConfigurator.New(cfg => { cfg.Register<MagnumTestCounters>(); })) { var counters = cr.GetCounter<MagnumTestCounters>("_default"); } using (var cr = new CounterRepository()) { cr.RemoveCategory<MagnumTestCounters>(); } }
public void DeleteCategoryViaType() { using (CounterRepository cr = CounterRepositoryConfigurator.New(cfg => { cfg.Register <MagnumTestCounters>(); })) { var counters = cr.GetCounter <MagnumTestCounters>("_default"); } using (var cr = new CounterRepository()) { cr.RemoveCategory <MagnumTestCounters>(); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { CounterRepository cr = new CounterRepository(); string studentid; studentid = Session["studentid"].ToString(); Label2.Text = studentid; Session["data"] = cr.GetLinkUrl(Label2.Text); GridView1.DataSource = Session["data"]; GridView1.DataBind(); } }
protected void Button2_Click(object sender, EventArgs e) { string username = tbxUsername.Text.Trim(); CounterRepository ar = new CounterRepository(); Counter currentUser = ar.FindBystdid(username); if (currentUser == null) { HadafTools.ShowMessage(lblmessage, "توسط این کاربر ثبت نامی انجام نشده است", Color.Red); return; } else { string stdid = tbxUsername.Text; Session["studentid"] = stdid; Redirector.Goto(Redirector.PageName.StdUnit); } }
public CounterFacade() { _counterRepository = new CounterRepository(WebConfigurationManager.AppSettings["ConnectionString"]); }
public CounterController(CounterRepository repo) { _repo = repo; }
public ThreadSafeCounterRepository(CounterRepository repository) { _repository = repository; }
public CounterController(CounterCommand incrementCommand, CounterRepository counterReposotory) { _incrementCommand = incrementCommand; _counterReposotory = counterReposotory; }