示例#1
0
        public void Parse(bool required, string[] args)
        {
            for (int i = 0; i < args.Length; i++)
            {
                if (args[i].StartsWith("-"))
                {
                    ParseOption(args, ref i);
                }
                else
                {
                    string fileName = args[i];

                    if (i == 0 && fileName == Assembly.GetEntryAssembly().Location)
                    {
                        continue;
                    }
                    else if (Path.GetExtension(fileName).ToLower() == ".cset")
                    {
                        using (FileStream fs = File.Open(fileName, FileMode.Open))
                        {
                            XmlSerializer xs = new XmlSerializer(typeof(ComparisonSet));
                            _set = (ComparisonSet)xs.Deserialize(fs);
                            _set.FileName = fileName;
                        }
                    }
                    else
                    {
                        _set.Items.Add(fileName);
                    }
                }
            }

            Validate(required);
        }
        public void Parse(bool required, string[] args)
        {
            for (int i = 0; i < args.Length; i++)
            {
                if (args[i].StartsWith("-"))
                {
                    ParseOption(args, ref i);
                }
                else
                {
                    string fileName = args[i];

                    if (i == 0 && fileName == Assembly.GetEntryAssembly().Location)
                    {
                        continue;
                    }
                    else if (Path.GetExtension(fileName).ToLower() == ".cset")
                    {
                        using (FileStream fs = File.Open(fileName, FileMode.Open))
                        {
                            XmlSerializer xs = new XmlSerializer(typeof(ComparisonSet));
                            _set          = (ComparisonSet)xs.Deserialize(fs);
                            _set.FileName = fileName;
                        }
                    }
                    else
                    {
                        _set.Items.Add(fileName);
                    }
                }
            }

            Validate(required);
        }
示例#3
0
 public AssemblyComparison CompareAssemblies(ComparisonSet set)
 {
     if (set.Mode == ComparisonMode.CompareFiles)
     {
         return CompareAssemblyFiles(set.Config, set.Filter, set.Items.ToArray());
     }
     else
     {
         return CompareAssemblyDirectories(set.RecurseSubdirectories, set.Config, set.Filter, set.Items.ToArray());
     }
 }
示例#4
0
        internal void SaveSet(ComparisonSet set)
        {
            set.Mode = (ComparisonMode)cbMode.SelectedIndex;

            if (cbMode.SelectedIndex == 0)
            {
                set.Items = gridFiles.Items;
                set.RecurseSubdirectories = false;
            }
            else
            {
                set.Items = gridFolders.Items;
                set.RecurseSubdirectories = cbRecurse.Checked;
            }
        }
示例#5
0
        internal void LoadSet(ComparisonSet set)
        {
            cbMode.SelectedIndex = (int)set.Mode;
            cbRecurse.Checked = set.RecurseSubdirectories;

            if (cbMode.SelectedIndex == 0)
            {
                gridFiles.Items = set.Items;
            }
            else
            {
                gridFolders.Items = set.Items;
                gridFolders.BringToFront();
            }
        }
示例#6
0
        public MainFrm()
        {
            InitializeComponent();

            if (LicenseManager.UsageMode == LicenseUsageMode.Runtime)
            {
                this.Icon = Resources.App;

                //ProfessionalColorTable colorTable = new ProfessionalColorTable();
                //colorTable.UseSystemColors = true;
                //statusStrip1.Renderer = new ToolStripProfessionalRenderer(colorTable);
                //toolStrip1.Renderer = new ToolStripProfessionalRenderer(colorTable);

                Trace.Listeners.Add(_eltl);

                ProgramArguments args = new ProgramArguments();

                try
                {
                    args.Parse(false, Environment.GetCommandLineArgs());

                    if (args.Help)
                    {
                        ShowHelp();
                    }

                    if (args.ComparisonSet.Items.Count > 0)
                    {
                        _set = args.ComparisonSet;

                        this.Show();

                        UpdateCheckStates();
                        UpdateTitleBar();

                        Compare();
                    }
                }
                catch (ArgumentParserException ex)
                {
                    MessageBox.Show(this, ex.Message, "Error Parsing Arguments", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                }

                Application.Idle += new EventHandler(Application_Idle);
            }
        }
示例#7
0
        public ProjectSetup(ComparisonSet set)
            : this()
        {
            this.Icon = Resources.App;
            tsbFiles.Checked = true;
            _set = set;

            compareFiles.LoadSet(set);
            referencePaths.LoadOptions(set.Config);
            compareOptions.LoadOptions(set.Config);
            viewFilter.LoadFilter(set.Filter);

            ProfessionalColorTable colorTable = new ProfessionalColorTable();
            colorTable.UseSystemColors = true;
            toolStrip1.Renderer = new ToolStripProfessionalRenderer(colorTable);

            compareFiles.BackColor =
            compareOptions.BackColor =
            referencePaths.BackColor =
            viewFilter.BackColor = ((ToolStripProfessionalRenderer)toolStrip1.Renderer).ColorTable.ToolStripPanelGradientEnd;
        }
示例#8
0
        private void tsbNew_Click(object sender, EventArgs e)
        {
            if (!CheckSaveChanges())
            {
                return;
            }

            _set = new ComparisonSet();

            if (EditProject())
            {
                UpdateCheckStates();
                UpdateTitleBar();

                Compare();
            }
        }
示例#9
0
        private void DoLoadSet(string fileName)
        {
            _set = LoadSet(fileName);
            _dirty = false;

            UserPrefs.LastSelectedComparisonSet = fileName;

            UpdateCheckStates();
            UpdateTitleBar();

            Compare();
        }