示例#1
0
        public void CanCreateCategoryAndCounter()
        {
            using (CounterRepository cr = CounterRepositoryConfigurator.New(cfg => { cfg.Register <MagnumTestCounters>(); }))
            {
                PerformanceCategoryExists("MagnumTestCounters");
                PerformanceCounterExists("MagnumTestCounters", "ConsumerThreadCount");

                var counters = cr.GetCounter <MagnumTestCounters>("_default");
            }
        }
示例#2
0
        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>();
            }
        }
示例#3
0
        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();
     }
 }
示例#5
0
        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"]);
 }
示例#7
0
 public CounterController(CounterRepository repo)
 {
     _repo = repo;
 }
示例#8
0
 public ThreadSafeCounterRepository(CounterRepository repository)
 {
     _repository = repository;
 }
示例#9
0
 public CounterController(CounterCommand incrementCommand, CounterRepository counterReposotory)
 {
     _incrementCommand  = incrementCommand;
     _counterReposotory = counterReposotory;
 }