예제 #1
0
        void Harvest()
        {
            try
            {
                lblStatus.Text = "Harvesting sources, " + engine_index + " out of " + Lists.Engines.Count + " done.";
                while (engine_index < Lists.Engines.Count + 1)
                {
                    if (stop)
                    {
                        break;
                    }

                    Engine engine = Lists.Engines.ElementAt(engine_index);
                    engine_index++;
                    lblStatus.Text = "Harvesting sources, " + engine_index + " out of " + Lists.Engines.Count + " done.";
                    Lists.Sources.AddRange(Harvester.Harvest(engine, "", 0));
                    lblTotalSources.Text = string.Format("Total sources: {0}", Lists.Sources.Count);
                }

                GC.Collect();
                GC.WaitForPendingFinalizers();
            }
            catch
            {
            }
            finally
            {
                lblStatus.Text = "Harvesting done.";
                Halt();
            }
        }
예제 #2
0
파일: Class1.cs 프로젝트: Core-Techs/WiX
        public void Test1()
        {
            var h = new Harvester(@"D:\code\TrueCards\src\TrueCards\bin\Release", @"d:\users\roverby\mywixfile.wxs", "ProgramFilesDirectory", "ProductComponents")
            {
                ExcludeFiles = new[] { "*.pdb", "*.xml", "*.vshost.exe*" }
            }

            .ModifyComponentsWhere(c => c.File.Info.Extension.Equals(".exe", StringComparison.OrdinalIgnoreCase),
                                   (c, xe) => xe.Elements(Constants.WixNs + "File").Single().Add(new XAttribute("Checksum", "yes")));

            var xml = h.Harvest();

            Console.Write(xml.ToString());
        }
예제 #3
0
 private void TestHarvester_Load(object sender, EventArgs e)
 {
     if (engine.Page_end > 0)
     {
         for (int i = engine.Page_start; i < engine.Page_end + 1; i += engine.Page_increment)
         {
             try
             {
                 var test = Harvester.Harvest(engine, "", i);
                 foreach (Source x in test)
                 {
                     textBox1.Text += x.url + Environment.NewLine;
                 }
             }
             catch
             {
                 MessageBox.Show("An unknown error occured while harvesting sources.");
             }
         }
     }
     else
     {
         try
         {
             var test = Harvester.Harvest(engine, "", 0);
             foreach (Source x in test)
             {
                 textBox1.Text += x.url + Environment.NewLine;
             }
         }
         catch
         {
             MessageBox.Show("An unknown error occured while harvesting sources.");
         }
     }
 }