• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# ProgressEventArgs类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ProgressEventArgs的典型用法代码示例。如果您正苦于以下问题:C# ProgressEventArgs类的具体用法?C# ProgressEventArgs怎么用?C# ProgressEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ProgressEventArgs类属于命名空间,在下文中一共展示了ProgressEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ProjectBuilder

 protected ProjectBuilder(Project project, ProgressEventHandler total_handler, ProgressEventHandler task_handler)
 {
     this.project = project;
     this.total_handler = total_handler;
     this.task_handler = task_handler;
     total = new ProgressEventArgs ();
 }
开发者ID:GNOME,项目名称:mistelix,代码行数:7,代码来源:ProjectBuilder.cs


示例2: OnProgressUpdate

 public void OnProgressUpdate(object sender, ProgressEventArgs args)
 {
     this.filteredReplays = args.Filtered;
       this.totalReplays = args.Total - args.Filtered;
       this.progressBar1.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action<double>(this.UpdateProgressBar), args.Progress);
       this.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(this.Refresh));
 }
开发者ID:jokaa,项目名称:StarcraftRandom,代码行数:7,代码来源:MatchupsStatistics.xaml.cs


示例3: ProgressHadler

        public void ProgressHadler(object sender, ProgressEventArgs e)
        {
            if (!Visible)
                Show();

            if (e.Step == 0)
            {
                progressBar.Maximum = e.Steps;
                begin = DateTime.Now;
            }
            progressBar.Value = e.Step;

            stepLabel.Text = e.Step.ToString() + "/" + e.Steps.ToString();
            actionNameLabel.Text = e.Process + " (" + e.ProcessedItem + ")";
            Text = "Loading... (" + DateTime.Now.Subtract(begin).ToString() + ")";

            if (DateTime.Now.Subtract(lastRefresh).Milliseconds > 200)
            {
                lastRefresh = DateTime.Now;
                Refresh();
            }

            if (e.Step == (e.Steps - 1))
                Hide();
        }
开发者ID:Expro,项目名称:Filechronization,代码行数:25,代码来源:ProgressForm.cs


示例4: processor_ProgressUpdate

 void processor_ProgressUpdate(object sender, ProgressEventArgs<CopyFileWorkItem> e)
 {
     if (CopyFileProgressUpdate != null)
     {
         CopyFileProgressUpdate(this, e);
     }
 }
开发者ID:marswon,项目名称:open-productivity,代码行数:7,代码来源:MultiThreadCopyCommand.cs


示例5: OnProgress

	void OnProgress(object sender, ProgressEventArgs e) {
		if (e.before < this.progress && e.after >= this.progress) {
			Debug.LogFormat("{0} progress went from {1} to {2} which crosses threshold {3}, adding {4} to cash",
			                thing.name, e.before, e.after, this.progress, this.cash);
			MoniesController.Instance.cash += this.cash;
			thing.ProgressChanged -= OnProgress;
		}	
	}
开发者ID:clicksoft-game,项目名称:ClickSoft,代码行数:8,代码来源:Paycheck.cs


示例6: OnProgressEvent

        protected virtual void OnProgressEvent(ProgressEventArgs e)
        {
            Throw.If(e).IsNull();

            EventHandler<ProgressEventArgs> evt = ProgressEvent;
            if (evt != null)
            {
                evt(this, e);
            }
        }
开发者ID:sneal,项目名称:SqlServerExporter,代码行数:10,代码来源:ScriptEngine.cs


示例7: AssertEventArgsCorrect

 private void AssertEventArgsCorrect(ProgressEventArgs actual, EventType et, 
   LocalNamespace ns, LocalTopic topic, Status oldStatus, Status newStatus, 
   string message)
 {
   Assert.AreEqual(et, actual.EventType, 
     "Checking that event types are equivalent for " + message); 
   Assert.AreEqual(ns.Name, actual.Namespace.Name, 
     "Checking that namespaces are equivalent for " + message); 
   Assert.AreEqual(topic.Name, actual.Topic.Name, 
     "Checking that topics are equivalent for " + message); 
   Assert.AreEqual(oldStatus, actual.OldStatus, 
     "Checking that old statuses are equivalent for " + message); 
   Assert.AreEqual(newStatus, actual.NewStatus, 
     "Checking that new statuses are equivalent for " + message); 
 }
开发者ID:nuxleus,项目名称:flexwiki,代码行数:15,代码来源:ProgressCallbackTests.cs


示例8: ProgressHandler

        public void ProgressHandler(object sender, ProgressEventArgs e)
        {
            progress.Invoke(new MethodInvoker(delegate()
                                                        {
                                                  	if (!activity.Text.Equals(e.Process))
                                                  		activityProgress.PerformStep();
                                                  	activity.Text = e.Process;
                                                  	activityCountLabel.Text = activityProgress.Value.ToString() + "/3";

                                                  	progressText.Text = e.ProcessedItem;
                                                  	progressCountLabel.Text = e.Step.ToString() + "/" + e.Steps;

                                                            if (e.Step == 0)
                                                                progress.Maximum = e.Steps;

                                                            progress.Value = e.Step;
                                              }));
        }
开发者ID:Expro,项目名称:Filechronization,代码行数:18,代码来源:SplashScreen.cs


示例9: ShowProgress

        private void ShowProgress(ProgressEventArgs e)
        {
            if ("nextStep".Equals(e.Message))
            {
                label9.Text = "Ready measuring with signal";
                button3.Enabled = true;
                progressBar.Value = 0;
                return;
            }

            if (objProcess.getIsStopped())
            {
                label9.Text = "Result of measurement can be found in c:\\temp\\measurement.txt";
                stopProcess();
                progressBar.Value = 0;
                return;
            }
            progressBar.Value = (progressBar.Value + 1) % 100;

            if ( e.Message.Length > 0 ) label9.Text = e.Message;
        }
开发者ID:pa3gsb,项目名称:RadioBerry,代码行数:21,代码来源:Form1.cs


示例10: AddFile

 private bool AddFile(string filePath)
 {
     var success = false;
     try
     {
         var tagFile = new TagFile(filePath);
         Files.Add(tagFile);
         FileIndex++;
         success = true;
     }
     catch (TagLib.CorruptFileException)
     {
         FileCount--;
     }
     catch (TagLib.UnsupportedFormatException)
     {
         FileCount--;
     }
     var e = new ProgressEventArgs(index: FileIndex, count: FileCount, path: filePath, success: success);
     Progress.Report(e);
     return e.Continue;
 }
开发者ID:dogbiscuituk,项目名称:TagScanner32767,代码行数:22,代码来源:TagFileReader.cs


示例11: ImportPricesFromEDDBStrings

        /// <summary>
        /// Imports the prices from a list of csv-strings in EDDB format
        /// </summary>
        /// <param name="CSV_Strings">data to import</param>
        /// <param name="importBehaviour">filter, which prices to import</param>
        /// <param name="dataSource">if data has no information about the datasource, this setting will count</param>
        public void ImportPricesFromEDDBStrings(String[] CSV_Strings, enImportBehaviour importBehaviour, enDataSource dataSource, PriceImportParameters importParams)
        {
            List<EDStation> StationData;
            Boolean updateTables = false;
            ProgressEventArgs eva=new ProgressEventArgs();
            Int32 initialSize=0;

            try
            {
                StationData = fromCSV_EDDB(CSV_Strings);

                if(importParams != null)
                {
                    DataTable data = Program.Data.GetNeighbourSystems(importParams.SystemID, importParams.Radius);

                    String info = "filter data to the bubble (radius " + importParams.Radius+ " ly) : " + data.Rows.Count +" systems...";
                    eva = new ProgressEventArgs() { Info=info, NewLine=true};      

                    if(!sendProgressEvent(eva))
                    {
                       if(data.Rows.Count > 0)
                       {
                           updateTables = true;

                            initialSize = StationData.Count();

                            for (int i = StationData.Count()-1 ; i >= 0 ; i--)
                           {
                               if(data.Rows.Find(StationData[i].SystemId) == null)    
                               {
                                   // system is not in the bubble
                                   StationData.Remove(StationData[i]);
                               }
                               else
                               { 
                                      // system is in the bubble - set as visited
                                   Program.Data.checkPotentiallyNewSystemOrStation(StationData[i].SystemName, StationData[i].Name, null, true);
                               }

                               eva = new ProgressEventArgs() { Info=info, CurrentValue=initialSize-i, TotalValue=initialSize };
                               sendProgressEvent(eva);
                               if(eva.Cancelled)
                                   break;

                           }

                       }
                       else
                           StationData.Clear();
                    }

                    eva = new ProgressEventArgs() { Info=info, CurrentValue=initialSize, TotalValue=initialSize, ForceRefresh=true };
                    sendProgressEvent(eva);
                }

                if((!eva.Cancelled) && (updateTables))
                { 
                    eva = new ProgressEventArgs() { Info = "refreshing basetables in memory...", NewLine=true };
                    sendProgressEvent(eva);

                    if(!eva.Cancelled)
                    {
                        Program.Data.updateVisitedFlagsFromBase();
                        eva = new ProgressEventArgs() { Info = "refreshing basetables in memory...", CurrentValue=25, TotalValue=100, ForceRefresh=true };
                        sendProgressEvent(eva);
                    }
                    if(!eva.Cancelled)
                    {
                        Program.Data.PrepareBaseTables(Program.Data.BaseData.tbsystems.TableName);
                        eva = new ProgressEventArgs() { Info = "refreshing basetables in memory...", CurrentValue=50, TotalValue=100, ForceRefresh=true };
                        sendProgressEvent(eva);
                    }
                    if(!eva.Cancelled)
                    {
                        Program.Data.PrepareBaseTables(Program.Data.BaseData.tbstations.TableName);
                        eva = new ProgressEventArgs() { Info = "refreshing basetables in memory...", CurrentValue=75, TotalValue=100, ForceRefresh=true };
                        sendProgressEvent(eva);
                    }
                    if(!eva.Cancelled)
                    {
                        Program.Data.PrepareBaseTables(Program.Data.BaseData.visystemsandstations.TableName);
                        eva = new ProgressEventArgs() { Info = "refreshing basetables in memory...", CurrentValue=100, TotalValue=100, ForceRefresh=true };
                        sendProgressEvent(eva);
                    }
                }

                // now import the prices
                if(!eva.Cancelled)
                { 
                   ImportPrices(StationData, importBehaviour, dataSource);
                }



//.........这里部分代码省略.........
开发者ID:Duke-Jones,项目名称:ED-IBE,代码行数:101,代码来源:EliteDBIO.cs


示例12: ImportPricesFromCSVStrings

        /// <summary>
        /// Imports the prices from a list of csv-strings
        /// </summary>
        /// <param name="CSV_Strings">data to import</param>
        /// <param name="importBehaviour">filter, which prices to import</param>
        /// <param name="dataSource">if data has no information about the datasource, this setting will count</param>
        /// <returns>a list of converted station data (including correct station ids) </returns>
        public List<EDStation> ImportPricesFromCSVStrings(String[] CSV_Strings, enImportBehaviour importBehaviour, enDataSource dataSource)
        {
            Boolean MissingSystem   = false;
            Boolean MissingStation  = false;
            String currentLanguage;
            DataTable newData;
            List<EDStation> StationData;
            List<EDSystem> SystemData = null;
            List<CsvRow> csvRowList = new List<CsvRow>();
            ProgressEventArgs eva;

            Int32 counter = 0;
            Dictionary<String, String> foundNames = new Dictionary<string,string>();            // quick cache for finding commodity names

            try
            {
                // *****************************************************************
                // START :section for automatically add unknown commodities

                currentLanguage     = Program.DBCon.getIniValue(IBESettingsView.DB_GROUPNAME, "Language", Program.BASE_LANGUAGE, false);
                newData             = new DataTable();
                newData.TableName   = "Names";
                newData.Columns.Add(Program.BASE_LANGUAGE, typeof(String));
                if(currentLanguage != Program.BASE_LANGUAGE)
                    newData.Columns.Add(currentLanguage, typeof(String));

                eva = new ProgressEventArgs() { Info="analysing data...", AddSeparator = true};
                sendProgressEvent(eva);

                for (int i = 0; i < CSV_Strings.Length; i++)
                {
                    String currentName;
                    List<dsEliteDB.tbcommoditylocalizationRow> currentCommodity;
                    if (CSV_Strings[i].Trim().Length > 0)
                    {
                        currentName = new CsvRow(CSV_Strings[i]).CommodityName;
                        if (!String.IsNullOrEmpty(currentName))
                        {
                            // check if we need to remap this name
                            Datasets.dsEliteDB.tbdnmap_commodityRow mappedName = (Datasets.dsEliteDB.tbdnmap_commodityRow)BaseData.tbdnmap_commodity.Rows.Find(new object[] {currentName, ""});
                            if (mappedName != null)
                            {
                                CSV_Strings[i] = CSV_Strings[i].Replace(mappedName.CompanionName, mappedName.GameName);
                                currentName = mappedName.GameName;
                            }

                            if (!foundNames.ContainsKey(currentName))
                            {
                                currentCommodity = Program.Data.BaseData.tbcommoditylocalization.Where(x => x.locname.Equals(currentName, StringComparison.InvariantCultureIgnoreCase)).ToList();
                                if (currentCommodity.Count == 0)
                                {
                                    if (currentLanguage == Program.BASE_LANGUAGE)
                                        newData.Rows.Add(currentName);
                                    else
                                        newData.Rows.Add(currentName, currentName);
                                }
                                foundNames.Add(currentName, "");
                            }
                        }
                    }
                    counter++;

                    eva = new ProgressEventArgs() { Info="analysing data...", CurrentValue=counter, TotalValue=CSV_Strings.GetUpperBound(0) + 1 };
                    sendProgressEvent(eva);
                    if(eva.Cancelled)
                        break;
                }

                eva = new ProgressEventArgs() { Info="analysing data...", CurrentValue=counter, TotalValue=counter, ForceRefresh=true };
                sendProgressEvent(eva);

                if (!eva.Cancelled)
                    if(newData.Rows.Count > 0)
                    {
                        // add found unknown commodities
                        var ds = new DataSet();
                        ds.Tables.Add(newData);
                        ImportCommodityLocalizations(ds);

                        // refresh translation columns
                        Program.Data.updateTranslation();

                        // refresh working tables 
                        Program.Data.PrepareBaseTables(Program.Data.BaseData.tbcommoditylocalization.TableName);
                        Program.Data.PrepareBaseTables(Program.Data.BaseData.tbcommodity.TableName);
                    }
                    
                // END : section for automatically add unknown commodities
                // *****************************************************************

                // convert csv-strings to EDStation-objects
                StationData = fromCSV(CSV_Strings, ref SystemData, ref csvRowList);

//.........这里部分代码省略.........
开发者ID:Duke-Jones,项目名称:ED-IBE,代码行数:101,代码来源:EliteDBIO.cs


示例13: OnProgress

 public static void OnProgress(int progress)
 {
     try
     {
         var handler = OnProgressHandler;
         if (handler == null) return;
         var args = new ProgressEventArgs(progress);
         handler(null, args);
     }
     catch (Exception)
     {
         //ignored
     }
 }
开发者ID:jjbaird87,项目名称:TMP_TAExporter,代码行数:14,代码来源:PeoplePayroll.cs


示例14: ProgressChangePercent

 private void ProgressChangePercent(object sender, ProgressEventArgs e)
 {
     Assert.AreEqual(actualPerc, e.Percent);
     actualPerc += actualAdd;
 }
开发者ID:TheJeremyGray,项目名称:FileWatcherService,代码行数:5,代码来源:Progress.cs


示例15: RunInternal

		void RunInternal()
		{
			for (int i = 0; i < files.Count; i++)
			{
				string f = files[i];
				multihasnext = false;
				multiindex = 0;
				do
				{
					LoadOne(f);
				} while (multihasnext);
				if (OnProgress != null)
				{
					var e = new ProgressEventArgs(i + 1, files.Count);
					OnProgress(this, e);
					if (e.ShouldCancel)
						return;
				}
			}
		}
开发者ID:ddugovic,项目名称:RASuite,代码行数:20,代码来源:BatchRunner.cs


示例16: ProgressionCallBack

        private void ProgressionCallBack(object sender, ProgressEventArgs e)
        {
            this.textProgressInformation.Text += "\nPreparing page " + e.ProgressInfo.CurrentPageNumber.ToString();

            this.progressScrollViewer.ScrollToBottom();
        }
开发者ID:erwin-hamid,项目名称:LogPro,代码行数:6,代码来源:QueriesView.xaml.cs


示例17: ExportMarketDataToCSV

        /// <summary>
        /// exports the market data to a file
        /// </summary>
        /// <param name="fileName"></param>
        public void ExportMarketDataToCSV(string fileName, Boolean inCurrentLanguage, Boolean extendedFormat)
        {
            String sqlString;
            DataTable data;
            Int32 Counter;
            StringBuilder sBuilder = new StringBuilder();
            Char filterCharacter=(char)(48);
            Int32 totalDataCount = 0;
            ProgressEventArgs eva;

            try
            {

                if(System.IO.File.Exists(fileName))
                    System.IO.File.Delete(fileName);

                var writer = new StreamWriter(File.OpenWrite(fileName));

                if(extendedFormat)
                    writer.WriteLine("System;Station;Commodity;Sell;Buy;Demand;;Supply;;Date;SourceFileName;Source");
                else
                    writer.WriteLine("System;Station;Commodity;Sell;Buy;Demand;;Supply;;Date;");

                data        = new DataTable();
                Counter     = 0;
                    
                totalDataCount = Program.DBCon.Execute<Int32>("select count(*) from tbCommodityData;");

                for (int i = 0; i < 36; i++)
                {
                    if(i < 10)
                        filterCharacter = (char)(48 + i);
                    else
                        filterCharacter = (char)(65 + i - 10);

                    if (inCurrentLanguage)
                    {
                        // export names in user language
                        sqlString = String.Format("select Sy.systemname, St.stationname, C.loccommodity as commodity, D.sell, D.buy, D.demand, D.demandlevel, D.supply, D.supplylevel, D.timestamp, S.source" +
                                                  " from tbSystems Sy, tbStations St, tbCommodityData D, tbCommodity C, tbSource S" +
                                                  " where Sy.id           = St.system_id" + 
                                                  " and   St.id           = D.station_id" +
                                                  " and   D.commodity_id  = C.id" +
                                                  " and   D.sources_id    = S.id" +
                                                  " and   Sy.systemname like '{0}%'" +
                                                  " order by Sy.systemname, St.stationname, C.loccommodity",
                                                  filterCharacter); 
                    }
                    else
                    {
                        // export names in default language (english)
                        sqlString = String.Format("select Sy.systemname, St.stationname, C.commodity, D.sell, D.buy, D.demand, D.demandlevel, D.supply, D.supplylevel, D.timestamp, S.source" +
                                                  " from tbSystems Sy, tbStations St, tbCommodityData D, tbCommodity C, tbSource S" +
                                                  " where Sy.id           = St.system_id" + 
                                                  " and   St.id           = D.station_id" +
                                                  " and   D.commodity_id  = C.id" +
                                                  " and   D.sources_id    = S.id" +
                                                  " and   Sy.systemname like '{0}%'" +
                                                  " order by Sy.systemname, St.stationname, C.commodity",
                                                  filterCharacter); 
                    }

                    eva = new ProgressEventArgs() { Info=String.Format("collecting data '{0}'...", filterCharacter), CurrentValue=Counter, TotalValue=totalDataCount, NewLine=true};
                    sendProgressEvent(eva);

                    Program.DBCon.Execute(sqlString, data);

                    foreach (DataRow row in data.Rows)
                    {
                        String Demand = "";
                        String Supply = "";

                        if (inCurrentLanguage)
                        {
                            Demand =  ((String)BaseTableIDToName("economylevel", SQL.DBConvert.To<int?>(row["demandlevel"]), "loclevel")).NToString("");
                            Supply =  ((String)BaseTableIDToName("economylevel", SQL.DBConvert.To<int?>(row["supplylevel"]), "loclevel")).NToString("");
                        }
                        else
                        {
                            Demand =  ((String)BaseTableIDToName("economylevel", SQL.DBConvert.To<int?>(row["demandlevel"]), "level")).NToString("");
                            Supply =  ((String)BaseTableIDToName("economylevel", SQL.DBConvert.To<int?>(row["supplylevel"]), "level")).NToString("");
                        }

                        sBuilder.Append(row["systemname"] + ";" + 
                                        row["stationname"] + ";" + 
                                        row["commodity"] + ";" + 
                                        row["sell"] + ";" + 
                                        row["buy"] + ";" + 
                                        row["demand"] + ";" + 
                                        Demand + ";" + 
                                        row["supply"] + ";" + 
                                        Supply + ";" + 
                                        row["timestamp"]);

                        if(extendedFormat)
                        {
//.........这里部分代码省略.........
开发者ID:Duke-Jones,项目名称:ED-IBE,代码行数:101,代码来源:EliteDBIO.cs


示例18: fromCSV

        /// <summary>
        /// creates a list of "EDStations" with price listings from csv-array
        /// </summary>
        /// <param name="CSV_Strings">String to be converted</param>
        /// <param name="foundSystems"></param>
        /// <param name="csvRowList">for optional processing outside: a list of the data converted to CsvRow-objects</param>
        /// <returns></returns>
        public List<EDStation> fromCSV(String[] CSV_Strings, ref List<EDSystem> foundSystems, ref List<CsvRow> csvRowList)
        {
            List<EDStation> foundValues                     = new List<EDStation>();
            Dictionary<String, Int32> foundIndex            = new Dictionary<String, Int32>();
            Dictionary<String, Int32> foundSystemIndex      = new Dictionary<String, Int32>();
            String LastID                                   = "";
            EDSystem LastSystem                             = null;
            String currentID                                = "";
            EDStation currentStation                        = null;
            Int32 Index                                     = 0;
            Dictionary<String, Int32> commodityIDCache      = new Dictionary<string,Int32>();            // quick cache for finding commodity names
            Int32 currentItem                               = 0;
            ProgressEventArgs eva;

            try
            {
                eva = new ProgressEventArgs() { Info="converting data...", CurrentValue=currentItem, TotalValue=CSV_Strings.GetUpperBound(0)+1, AddSeparator = true };
                sendProgressEvent(eva);

                if(foundSystems != null)
                    foundSystems.Clear();
                else
                    foundSystems = new List<EDSystem>();


                foreach (String CSV_String in CSV_Strings)
	            {

                    if(!String.IsNullOrEmpty(CSV_String.Trim()))
                    {
		                CsvRow currentRow           = new CsvRow(CSV_String);

                        if(csvRowList != null)
                            csvRowList.Add(currentRow);

                        currentID = currentRow.StationID;

                        if(!LastID.Equals(currentID, StringComparison.InvariantCultureIgnoreCase))
                        {
                            if(currentStation != null)
                                currentStation.ListingExtendMode = false;

                            if(foundIndex.TryGetValue(currentID, out Index))
                                currentStation = foundValues[Index];
                            else
                            {
                                currentStation  = new EDStation(currentRow);

                                foundValues.Add(currentStation);
                                foundIndex.Add(currentID, foundValues.Count-1);
                            }
                            LastID = currentRow.StationID;

                            currentStation.ListingExtendMode = true;


                            if((LastSystem == null) || (!LastSystem.Name.Equals(currentRow.SystemName, StringComparison.InvariantCultureIgnoreCase)))
                            {
                                if(foundSystemIndex.TryGetValue(currentRow.SystemName, out Index))
                                    LastSystem = foundSystems[Index];
                                else
                                {
                                    LastSystem  = new EDSystem();
                                    LastSystem.Name = currentRow.SystemName;

                                    if(LastSystem.Id == 0)
                                        LastSystem.Id = currentStation.SystemId;


                                    foundSystems.Add(LastSystem);
                                    foundSystemIndex.Add(currentRow.SystemName, foundSystems.Count-1);
                                }
                            }
                        }

                        currentStation.addListing(currentRow, ref commodityIDCache);
                    }

                    eva = new ProgressEventArgs() { Info="converting data...", CurrentValue=currentItem, TotalValue=CSV_Strings.GetUpperBound(0)+1};
                    sendProgressEvent(eva);

                    if(eva.Cancelled)
                        break;

                    currentItem++;

	            }

                if(currentStation != null)
                    currentStation.ListingExtendMode = false;

                eva = new ProgressEventArgs() { Info="converting data...", CurrentValue=currentItem, TotalValue=CSV_Strings.GetUpperBound(0)+1, ForceRefresh=true};
                sendProgressEvent(eva);
//.........这里部分代码省略.........
开发者ID:Duke-Jones,项目名称:ED-IBE,代码行数:101,代码来源:EliteDBIO.cs


示例19: fromCSV_EDDB

        /// <summary>
        /// creates a list of "EDStations" with price listings from csv-array in EDDB format
        /// </summary>
        /// <param name="CSV_Strings">String to be converted</param>
        /// <param name="foundSystems"></param>
        /// <param name="csvRowList">for optional processing outside: a list of the data converted to CsvRow-objects</param>
        /// <returns></returns>
        public List<EDStation> fromCSV_EDDB(String[] CSV_Strings)
        {
            List<EDStation> foundValues                     = new List<EDStation>();
            Dictionary<Int32, Int32> foundIndex             = new Dictionary<Int32, Int32>();
            Dictionary<String, Int32> foundSystemIndex      = new Dictionary<String, Int32>();
            Int32 LastID                                    = 0;
            EDSystem LastSystem                             = null;
            Int32 currentID                                 = 0;
            EDStation currentStation                        = null;
            Int32 Index                                     = 0;
            Dictionary<String, Int32> commodityIDCache      = new Dictionary<string,Int32>();            // quick cache for finding commodity names
            Int32 currentItem                               = 0;
            ProgressEventArgs eva;

            try
            {
                eva = new ProgressEventArgs() { Info="converting data...", CurrentValue=currentItem, TotalValue=CSV_Strings.GetUpperBound(0), NewLine= true};
                sendProgressEvent(eva);

                foreach (String CSV_String in CSV_Strings)
	            {

                    if(!String.IsNullOrEmpty(CSV_String.Trim()))
                    {
		                Listing currentRow           = new Listing(CSV_String);

                        currentID = currentRow.StationId;

                        if(LastID != currentID)
                        {
                            if(currentStation != null)
                                currentStation.ListingExtendMode = false;

                            if(foundIndex.TryGetValue(currentID, out Index))
                                currentStation = foundValues[Index];
                            else
                            {
                                currentStation  = new EDStation(currentRow);

                                foundValues.Add(currentStation);
                                foundIndex.Add(currentID, foundValues.Count-1);
                            }
                            LastID = currentRow.StationId;

                            currentStation.ListingExtendMode = true;

                        }

                        currentStation.addListing(currentRow);
                    }
                
                    eva = new ProgressEventArgs() { Info="converting data...", CurrentValue=currentItem, TotalValue=CSV_Strings.GetUpperBound(0)};
                    sendProgressEvent(eva);

                    if(eva.Cancelled)
                        break;

                    currentItem++;
	            }

                if(currentStation != null)
                    currentStation.ListingExtendMode = false;

                eva = new ProgressEventArgs() { Info="converting data...", CurrentValue=currentItem, TotalValue=CSV_Strings.GetUpperBound(0), ForceRefresh=true};
                sendProgressEvent(eva);

                return foundValues;

            }
            catch (Exception ex)
            {
                throw new Exception("Error while getting station values from CSV-String", ex);
            }
        }
开发者ID:Duke-Jones,项目名称:ED-IBE,代码行数:81,代码来源:EliteDBIO.cs


示例20: OnProgress

        /// <summary>
        /// Raises the Progress Event
        /// </summary>
        /// <param name="e">The Event Args</param>
        protected void OnProgress(ProgressEventArgs e)
        {
            if (Progress == null)
                return;

            Progress(this, e);
        }
开发者ID:bosspacific,项目名称:FileHelpers-fork,代码行数:11,代码来源:EngineBase.cs



注:本文中的ProgressEventArgs类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ProgressHandler类代码示例发布时间:2022-05-24
下一篇:
C# ProgressCallback类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap