예제 #1
0
        public override bool Edit(IPolicyEditArgs policyEditArgs)
        {
            PageViewTelemetry pvt    = new PageViewTelemetry("BranchPolicyEdit");
            Stopwatch         pvtrak = new Stopwatch();

            pvtrak.Start();
            bool result = false;

            try
            {
                IBranchPatternsRepository repo = new BranchPatternsRepository(branchPatterns);
                var wpfwindow = new BranchLockPolicyEditorWindow(policyEditArgs, repo);
                ElementHost.EnableModelessKeyboardInterop(wpfwindow);
                wpfwindow.ShowDialog();
                branchPatterns = repo.FindAll().ToList();
                TellMe.Instance.TrackMetric("BranchPolicyCount", branchPatterns.Count);
                result = true;
            }
            catch (Exception ex)
            {
                TellMe.Instance.TrackException(ex);
                MessageBox.Show(string.Format("There was an error loading the Edit Vew for BranchPatternPolicy:/n/n {0}", ex.Message));
                result = false;
            }
            pvt.Duration = pvtrak.Elapsed;
            TellMe.Instance.TrackPageView(pvt);
            return(result);
        }
예제 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            List <BranchPattern>      branchPatterns = new List <BranchPattern>();
            IBranchPatternsRepository repo           = new BranchPatternsRepository(branchPatterns);
            var wpfwindow = new BranchLockPolicyEditorWindow(null, repo);

            ElementHost.EnableModelessKeyboardInterop(wpfwindow);
            wpfwindow.ShowDialog();
            branchPatterns = repo.FindAll().ToList();
            this.Close();
        }