Cosmos/source/Cosmos.Build.Windows/UI/IBuildProgressUC.cs
2009-05-16 10:26:46 +00:00

51 lines
1.2 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Cosmos.Compiler.Builder
{
public interface IBuildProgressUC
{
void NewError (string error);
void BuildProgressChanged(BuildProgress progress);
}
//DO not pump to UI unless there is more than 1% change!
//not a great design.
public class BuildProgress
{
public int? MaxMethods =0;
public int? MethodsProcessed =0;
public int? MaxFields =0;
public int? FieldsProcessed =0;
public string Step = "Init";
public int MethodProgressPercent
{
get
{
if (MaxMethods == null || MethodsProcessed == null || MaxMethods.Value < 1)
return 0;
return MethodsProcessed.Value * 100 / MaxMethods.Value;
}
}
public int FieldProgressPercent
{
get
{
if (MaxFields == null || FieldsProcessed == null || MaxFields.Value < 1)
return 0;
return FieldsProcessed.Value * 100 / MaxFields.Value;
}
}
}
}