Ejemplo n.º 1
0
        static void ProcessListOfFiles(string listOfFilesFile, ArgsParser.ArgsParser argsParser)
        {
            StreamReader sr;

            try {
                sr = new StreamReader(listOfFilesFile);
            }
            catch (Exception e) {
                System.Diagnostics.Debug.WriteLine(e.Message);
                return;
            }
            string fileName;
            string dir     = Path.GetDirectoryName(listOfFilesFile);
            var    gviewer = new GViewer();
            Form   form    = FormStuff.CreateOrAttachForm(gviewer, null);
            int    nOfBugs = 0;

            while ((fileName = sr.ReadLine()) != null)
            {
                if (String.IsNullOrEmpty(fileName))
                {
                    continue;
                }
                fileName = Path.Combine(dir, fileName.ToLower());
                ProcessFile(fileName, argsParser, gviewer, ref nOfBugs);

                if (argsParser.OptionIsUsed(QuietOption) == false)
                {
                    form.ShowDialog();
                }
            }
        }
Ejemplo n.º 2
0
        static Form CreateForm(Graph graph, GViewer gviewer)
        {
            Form form = FormStuff.CreateOrAttachForm(gviewer, null);

            form.SuspendLayout();
            SetEdgeSeparationBar(form);

            gviewer.GraphChanged += GviewerGraphChanged;

            if (graph != null)
            {
                gviewer.Graph = graph;
            }
            return(form);
        }
        public ActionResult Index(FormStuff model)
        {
            foreach (var item in model.Options)
            {
                if (item.Id == "abc" && item.Checked)
                {
                    //abc was checked, do something...
                }
                else if (item.Id == "bcd")
                {
                    var myBool = item.Checked;
                    //do something with the value of myBool, which is true if bcd was checked...
                }
                //... and so on.
            }

            return(View(model));
        }
        public ActionResult Index()
        {
            var model = new FormStuff();

            //Dynamically add the "checkboxlist" items before returning the view
            model.Options = new List <FormOption> {
                new FormOption {
                    Id = "abc", Label = "A.B.C."
                },
                new FormOption {
                    Id = "bcd", Label = "BCD", Checked = true
                },                                                            //this one will appear checked
                new FormOption {
                    Id = "cde", Label = "C D E"
                },
                new FormOption {
                    Id = "def", Label = "Def."
                }
            };

            return(View(model));
        }