Example #1
0
        public bool AddGroup(string groupName, string preMessage, string postMessage, bool isMultiple, bool hasPrompt, bool isRequired)
        {
            var g = new InputGroup(groupName, isMultiple, hasPrompt, isMultiple);
            g.PreMessage = preMessage;
            g.PostMessage = postMessage;

            return this.AddGroup(g);
        }
Example #2
0
        public bool AddGroup(string groupName, string preMessage, string postMessage)
        {
            var g = new InputGroup(groupName);
            g.PreMessage = preMessage;
            g.PostMessage = postMessage;

            return this.AddGroup(g);
        }
        public InputDialogViewModelDesign() 
        {
            this.Message = "a test messagessage that is very long to see the over all effect of fjdsio joif  oijfd ssage that is very long to see the over all effect of fjdsio joif  oijfd";
            this.UnitWidth = 150;
            this.Window.UnitWidth = 200;
            


            var a = new InputGroup("ques1");
            a.PreMessage = "a test message that is very long to see the over all effect of fjdsio joif  oijfdaoi jo";
            a.PostMessage = "a simple one";
            
            a.AddSelection("opp 1 2321231 23 123 12ji2 jio2 j1oij 1 joi21j oij2 1o2j3 o1j2o ij12 o1j2 oijoij2 oij1o2ij o1j  j1oij 1 joi21j oij2 1o2j3 o1j2o ij12 o1j2 oijoij2 oij1o2ij o1 j1oij 1 joi21j oij2 1o2j3 o1j2o ij12 o1j2 oijoij2 oij1o2ij o1");
            a.AddSelection("jenga");
            a.HasPrompt = true;
            InputBase inpt;
            inpt = new SinglePrompt("p1");
            a.AddItem(inpt);
            inpt = new SinglePrompt("p2");
            a.AddItem(inpt);


            var b = new InputGroup("qus 2");
            b.IsMultiple = true;
            b.PreMessage = "FrequencyCode:";
            b.PostMessage = "Please make sure any selection is made before changing. fdsg sdfg sdf ..";
            b.AddSelection("jido");
            b.AddSelection("jido 2 e dsa"); 
            b.AddSelection("after meals and at bedtime");
            b.AddSelection("at bedtime");
            b.AddSelection("before bedtime/snack");
            b.AddSelection("before breakfast");
            b.AddSelection("before dinner");
            b.AddSelection("before lunch");
            b.AddSelection("before meals and at bedtime");
            b.AddSelection("BID 0900-1300");
            b.AddSelection("BID after meals");
            b.AddSelection("BID before meals");
            b.AddSelection("BID twice daily");
            b.AddSelection("BID with meals");
            b.AddSelection("Daily");
            b.AddSelection("Daily at 0700");
            b.AddSelection("every other day");
            b.AddSelection("five times daily");

            b.HasPrompt = true;            
            b.AddPrompt("dfs");

            b.Items.ElementAt(3).IsSelected = true;
            b.Items.ElementAt(5).IsSelected = true;

            


            Repository.Add(a);
            Repository.Add(b);
        }
Example #4
0
        static void Main(string[] args)
        {
            
            //var dlg = Dialog.CreateInputDialog();
            InputGroup g;
            
            

            //g = new InputGroup("g1");
            //g.IsMultiple = true;
            //g.IsRequired = true;
            //g.HasPrompt = true;

            //g.AddSelection("opt 1");
            //g.AddSelection("op2 2");

            //g.AddPrompt("jfdi");
            //dlg.Repository.Add(g);


            g = new InputGroup("g2");
            g.MaxWidth = 500;
            g.IsMultiple = true;
            g.PreMessage = "FrequencyCode: Please make sure any selection is made before changing.. Please make sure any selection is made before changing..c Please make sure any selection is made before changing..";
            g.PostMessage = "Please make sure any selection is made before changing...";
            g.AddSelection("jido");
            g.AddSelection("jido 2 e dsa");
            g.AddSelection("after meals and at bedtime after meals and at bedtime after meals and at bedtime after meals and at bedtime");
            g.AddSelection("at bedtime");
            g.AddSelection("before bedtime/snack");
            g.AddSelection("before breakfast");
            g.AddSelection("before dinner");
            g.AddSelection("before lunch");
            g.AddSelection("before meals and at bedtime"); g.AddSelection("jido");
            g.AddSelection("jido 2 e dsa");
            g.AddSelection("after meals and at bedtime after meals and at bedtime after meals and at bedtime after meals and at bedtime");
            g.AddSelection("at bedtime");
            g.AddSelection("before bedtime/snack");
            g.AddSelection("before breakfast");
            g.AddSelection("before dinner");
            g.AddSelection("before lunch");
            g.AddSelection("before meals and at bedtime"); g.AddSelection("jido");
            g.AddSelection("jido 2 e dsa");
            g.AddSelection("after meals and at bedtime after meals and at bedtime after meals and at bedtime after meals and at bedtime");
            g.AddSelection("at bedtime");
            g.AddSelection("before bedtime/snack");
            g.AddSelection("before breakfast");
            g.AddSelection("before dinner");
            g.AddSelection("before lunch");
            g.AddSelection("before meals and at bedtime");
            g.HasPrompt = true;
            g.AddPrompt("dfs");

            g.Items.ElementAt(3).IsSelected = true;


            var dlg = Dialog.CreateInputDialog();
            dlg.Message = "today is a good day!today is a good day! today is a good da today is a good da today is a good datoday is a good da today is a good datoday is a good da today is a good da";
            dlg.AddGroup(g);


            //dlg.AddGroup("group1", "thi s jionly seems to affect the actual viewing of the Excel files, so as far as I can tell you should still be able to update the script assignments with Pass/Fail/Issue info, just not directly edit the spreadsheets themselves.");
            //dlg.AddItem("group1", "option 1");
            //dlg.AddItem("group1", "option 2");
            //dlg.AddItem("group1", "option 3");
            //dlg.Repository.First().Items.Add(new SinglePrompt("a") { Group = "group1" });

            //var g2 = "group 2";
            //var g2a = dlg.AddGroup(g2, "pre-message","post-message");
            //g2a.SetCardinality(Cardinality.Multiple);
            //dlg.AddItem(g2, "option a");
            //dlg.AddItem(g2, "option b");

            //dlg.AddItem("abc", "bbbooo");
            //dlg.AddItem("abc", "bbbooo2");

            ////x.AddItem("a", "val_a");
            ////x.AddItem("a", "val_b");
            ////x.AddItem("b", "val_2a");
            ////x.AddItem("b", "val_2b");
            ////x.AddItem("c", "val_2b");
            ////x.AddItem("d", "val_2b");

            //var b = new InputGroup("qus 2");
            //b.SetCardinality(Cardinality.Multiple);
            //b.PreMessage = "FrequencyCode:";
            //b.PostMessage = "Please make sure any selection is made before changing...";
            //b.AddItem("jido");
            //b.AddItem("jido 2 e dsa");
            //b.AddItem("after meals and at bedtime");
            //b.AddItem("at bedtime");
            //b.AddItem("before bedtime/snack");
            //b.AddItem("before breakfast");
            //b.AddItem("before dinner");
            //b.AddItem("before lunch");
            //b.AddItem("before meals and at bedtime");
            //b.AddItem("BID 0900-1300");
            //b.AddItem("BID after meals");
            //b.AddItem("BID before meals");
            //b.AddItem("BID twice daily");
            //b.AddItem("BID with meals");
            //b.AddItem("Daily");
            //b.AddItem("Daily at 0700");
            //b.AddItem("every other day");
            //b.AddItem("five times daily");
            //b.AddItem("Once");
            //b.AddItem("Q 1 hour");
            //b.AddItem("Q 1 week");
            //b.AddItem("Q 12 hours");
            //b.AddItem("Q 2 days");
            //b.AddItem("Q 2 hours");
            //b.AddItem("Q 2 hours while awake");
            //b.AddItem("Q 2 weeks");
            //b.AddItem("Q 24 hours");
            //b.AddItem("Q 3 days");
            //b.AddItem("Q 3 hours");
            //b.AddItem("Q 3 Months");
            //b.AddItem("Q 3 weeks");
            //b.AddItem("Q 30 days");
            //b.AddItem("Q 30 minutes");
            //b.AddItem("Q 36 hours");
            //b.AddItem("Q 4 hours");
            //b.AddItem("Q 4 hours while awake");
            //b.AddItem("Q 4 weeks");
            //b.AddItem("Q 48 hours");
            //b.AddItem("Q 5 minutes");
            //b.AddItem("Q 6 hours");
            //b.AddItem("Q 6 Months");
            //b.AddItem("Q 72 hours");
            //b.AddItem("Q 8 hours");
            //b.AddItem("Q 96 hours");
            //b.AddItem("Q10M");
            //b.AddItem("QID four times daily");
            //b.AddItem("QID with meals and at bedtime");
            //b.AddItem("TID after meals");
            //b.AddItem("TID before meals");
            //b.AddItem("TID three times daily");
            //b.AddItem("TID with meals");
            //b.AddItem("with breakfast");
            //b.AddItem("with dinner");
            //b.AddItem("with lunch");

            ////dlg.AddGroup(b);


            dlg.ShowDialog();

            var gtest = "g1";

            Console.WriteLine("{0} response: {1}", gtest, dlg.GetResponse(gtest));

            var lst = dlg.GetResponseList("g2");

            Console.WriteLine(lst.ElementAt(0));



            //Console.WriteLine(dlg.GetResponse("qus 2"));


            //foreach (var y in (dlg.Repository.FirstOrDefault().Items.Where(x => x.IsChecked).Select(y => y.Name).ToArray()))
            //{
            //    Console.WriteLine(y);
            //}
            //Console.WriteLine(dlg.Repository.FirstOrDefault().Items.FirstOrDefault().IsChecked);
            ////Console.WriteLine(a.GetResponse("group2") as string);

            //var rtn = dlg.GetResponse("group1");
            //var rtnlist = dlg.GetResponseList("qus 2");

            //Console.WriteLine(rtnlist.Count);
            //foreach (var c in rtnlist)
            //{
            //    Console.WriteLine(c);
            //}

            ////Console.WriteLine(x.GetResponse("a"));

            Console.ReadLine();
        }
Example #5
0
 public bool AddGroup(InputGroup g) { return this.Repository.Add(g); }
Example #6
0
        private InputGroup GetGroup(string groupName, bool autoAdd = true)
        {
            var g = this.Repository.Where(x => x.Name == groupName).FirstOrDefault();

            if (g == null && autoAdd)
            {
                g = new InputGroup(groupName);
                this.AddGroup(g);
            }

            return g;
        }