本文整理汇总了C#中Period类的典型用法代码示例。如果您正苦于以下问题:C# Period类的具体用法?C# Period怎么用?C# Period使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Period类属于命名空间,在下文中一共展示了Period类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Painting
public Painting(string name, string description,
string author, Period period)
: base(name, description)
{
this.author = author;
this.period = period;
}
开发者ID:Nadar13,项目名称:PredavanjaNET,代码行数:7,代码来源:Painting.cs
示例2: SingleMonth_PeriodOfTwoFullMonths
public void SingleMonth_PeriodOfTwoFullMonths()
{
var period = new Period(new DateTime(2010, 1, 1), new DateTime(2010, 1, 31));
var expected = new[] {"01/01/2010 - 01/31/2010"};
AssertPeriodBasedOnToStrings(period, expected);
}
开发者ID:martijnhazebroek,项目名称:DryPants,代码行数:7,代码来源:PeriodExtensionsTests.cs
示例3: EngineType
public EngineType(
string model,
Manufacturer manufacturer,
TypeOfEngine engine,
NoiseLevel noise,
double consumptation,
long price,
int maxspeed,
int ceiling,
double runway,
double range,
Period<int> produced)
{
Model = model;
Manufacturer = manufacturer;
Engine = engine;
ConsumptationModifier = consumptation;
Price = price;
MaxSpeed = maxspeed;
Ceiling = ceiling;
RunwayModifier = runway;
RangeModifier = range;
Produced = produced;
Types = new List<AirlinerType>();
Noise = noise;
}
开发者ID:TheAirlineProject,项目名称:tap-desktop,代码行数:26,代码来源:EngineType.cs
示例4: Clocks
public Clocks(string name, string description, int price, string manufacturer, Period period, Material material)
: base(name, description, price)
{
this.manufacturer = manufacturer;
this.material = material;
this.period = period;
}
开发者ID:bttalic,项目名称:BitcampStudentTest,代码行数:7,代码来源:Clocks.cs
示例5: CreateMenu
void CreateMenu()
{
additem = new MenuItem (Catalog.GetString ("Add period"));
additem.Activated += (sender, e) => {
string periodname = App.Current.Dialogs.QueryMessage (Catalog.GetString ("Period name"), null,
(project.Periods.Count + 1).ToString (),
null).Result;
if (periodname != null) {
project.Dashboard.GamePeriods.Add (periodname);
Period p = new Period { Name = periodname };
p.Nodes.Add (new TimeNode {
Name = periodname,
Start = new Time { TotalSeconds = time.TotalSeconds - 10 },
Stop = new Time { TotalSeconds = time.TotalSeconds + 10 }
});
project.Periods.Add (p);
if (timertimeline != null) {
timertimeline.AddTimer (p);
}
}
};
Add (additem);
delitem = new MenuItem (Catalog.GetString ("Delete period"));
delitem.Activated += (sender, e) => {
project.Periods.Remove (timer as Period);
if (timertimeline != null) {
timertimeline.RemoveTimer (timer);
selectionCanvas.ClearSelection ();
}
};
Add (delitem);
ShowAll ();
}
开发者ID:LongoMatch,项目名称:longomatch,代码行数:33,代码来源:PeriodsMenu.cs
示例6: Subscription
/// <summary>
/// Initializes a new instance of the <see cref="Subscription"/> class.
/// If the activated date is before the start date, a pro-rated amount is calculated.
/// If the activated date is after the start date, they are swapped and a pro-rated amount is calculated.
/// </summary>
/// <param name="name">The name.</param>
/// <param name="start">The starting date.</param>
/// <param name="end">The ending date.</param>
/// <param name="activated">The activated date.</param>
/// <param name="billingPeriod">The billing period.</param>
/// <param name="billingAmount">The billing amount.</param>
/// <param name="trialPeriod">The trial period.</param>
public Subscription(string name, DateTime start, DateTime end, DateTime activated, Period billingPeriod,
Money billingAmount, Period trialPeriod)
: this(name, start, end, billingPeriod, billingAmount)
{
ApplyTrialPeriod(trialPeriod, 1);
ApplyProratedAmount(start, billingAmount, activated);
}
开发者ID:RyanFarley,项目名称:dotnetmerchant,代码行数:19,代码来源:Subscription.cs
示例7: SingleDay_PeriodOfSingleDay
public void SingleDay_PeriodOfSingleDay()
{
var period = new Period(new DateTime(2010, 1, 1), new DateTime(2010, 1, 1));
var expected = new[] { "01/01/2010 - 01/01/2010" };
AssertPeriodBasedOnToStrings(period, expected);
}
开发者ID:martijnhazebroek,项目名称:DryPants,代码行数:7,代码来源:PeriodExtensionsTests.cs
示例8: CorrelationAnalyzer
public CorrelationAnalyzer(DatedDataCollectionGen<double> series1_, DatedDataCollectionGen<double> series2_, Period p_, int numOfPeriods_)
{
m_series1 = series1_;
m_series2 = series2_;
m_period = p_;
m_numPeriod = numOfPeriods_;
// find common dates
List<DateTime> commonDates = new List<DateTime>();
List<DateTime> stratDates = new List<DateTime>(m_series1.Dates);
foreach (DateTime date in m_series2.Dates)
if (stratDates.Contains(date))
commonDates.Add(date);
QuickSort.Sort<DateTime>(commonDates);
List<double> first = new List<double>();
List<double> second = new List<double>();
// get the values for each of the common dates
foreach (DateTime date in commonDates)
{
first.Add(m_series1.ValueOnDate(date));
second.Add(m_series2.ValueOnDate(date));
}
m_series1 = new DatedDataCollectionGen<double>(commonDates.ToArray(), first.ToArray());
m_series2 = new DatedDataCollectionGen<double>(commonDates.ToArray(), second.ToArray());
recalc();
}
开发者ID:heimanhon,项目名称:researchwork,代码行数:33,代码来源:CorrelationAnalyzer.cs
示例9: getPeriod
// получаем период в формате - название месяца + год
public Period getPeriod(int month_id, int year)
{
SqlConnection conn = new SqlConnection(this.ConnectionString);
string sql = "SELECT * FROM rolf_timeboard_periods WHERE (month_id = @month_id) AND (year = @year)";
SqlCommand cmd = new SqlCommand(sql, conn);
cmd.Parameters.Add(new SqlParameter("@month_id", SqlDbType.Int, 4));
cmd.Parameters["@month_id"].Value = month_id;
cmd.Parameters.Add(new SqlParameter("@year", SqlDbType.VarChar, 8));
cmd.Parameters["@year"].Value = year;
Period period = null;
try
{
conn.Open();
SqlDataReader reader = cmd.ExecuteReader();
reader.Read();
period = new Period((int)reader["id"], (int)reader["month_id"], (string)reader["month"], (int)reader["year"], (int)reader["is_closed"]);
reader.Close();
}
catch (Exception e)
{
throw new Exception(e.Message);
}
finally
{
conn.Close();
}
return period;
}
开发者ID:ROLF-IT-Department,项目名称:timeboard,代码行数:32,代码来源:PeriodDB.cs
示例10: TeacherBusyTimeConflictHelper
/// <summary>
/// 建構式
/// </summary>
/// <param name="Rows"></param>
/// <param name="Messages"></param>
public TeacherBusyTimeConflictHelper(List<IRowStream> Rows,RowMessages Messages)
{
this.mTeacherPeriods = new Dictionary<string, List<Period>>();
this.mMessages = Messages;
foreach(IRowStream Row in Rows)
{
string TeacherFullName = Row.GetValue(constTeacehrName) + Row.GetValue(constTeacherNickName);
if (!mTeacherPeriods.ContainsKey(TeacherFullName))
mTeacherPeriods.Add(TeacherFullName, new List<Period>());
DateTime Date = K12.Data.DateTimeHelper.ParseDirect(Row.GetValue(constDate));
string StartTime = Row.GetValue(constStartTime);
string EndTime = Row.GetValue(constEndTime);
Tuple<DateTime, int> StorageTime = Utility.GetStorageTime(StartTime, EndTime);
DateTime BeginDatetime = StorageTime.Item1;
int Duration = StorageTime.Item2;
Period Period = new Period();
Period.Date= Date;
Period.Hour = BeginDatetime.Hour;
Period.Minute = BeginDatetime.Minute;
Period.Duration = Duration;
Period.Position = Row.Position;
mTeacherPeriods[TeacherFullName].Add(Period);
}
}
开发者ID:KunHsiang,项目名称:ischedulePlus,代码行数:36,代码来源:TeacherBusyTimeConflictHelper.cs
示例11: AirlinerTypeConfiguration
public AirlinerTypeConfiguration(string name, AirlinerType type, Period<DateTime> period, Boolean standard)
: base(ConfigurationType.AirlinerType, name, standard)
{
Airliner = type;
Period = period;
Classes = new List<AirlinerClassConfiguration>();
}
开发者ID:TheAirlineProject,项目名称:tap-desktop,代码行数:7,代码来源:AirlinerTypeConfiguration.cs
示例12: BrushlessMotor
/// <summary>
/// Use higher period, means faster response, not supported by all ESC
/// </summary>
/// <param name="pin">PWM pin</param>
/// <param name="period">Period</param>
public BrushlessMotor(PWM.Pin pin, Period period)
{
_precalc = (Max - Min) / _scale;
Period = (uint)period;
this._pwmPin = new PWM(pin);
this._pwmPin.SetPulse(Period, Min);
}
开发者ID:ianlee74,项目名称:Omnicopter,代码行数:12,代码来源:BrushlessMotor.cs
示例13: GetBurnDownData
/// <summary>
/// OBSOLETE
/// </summary>
/// <param name="ms"></param>
/// <param name="startDate"></param>
public static void GetBurnDownData(this RMilestoneStatus ms, DateTime startDate)
{
var rep = new ReleaseRepository();
var result = rep.GetArtefactsProgress(ms.Release.Id);
// determine amount days till milestone
var period = new Period { StartDate = startDate, EndDate = ms.Date };
var workingDays = period.AmountWorkingDays;
// get progress data for milestone
var count = 0;
var totalProgress = result.Where(x => ms.Id == x.MilestoneId).Select(x => new { HoursRemaining = x.HoursRemaining, StatusDate = x.StatusDate, DayNumber = count++ }).ToList().OrderBy(x => x.StatusDate);
// determine slope of known status data
var amountDays = totalProgress.Count();
var avgDays = totalProgress.Select(x => x.DayNumber).Average();
var avgHours = totalProgress.Select(x => x.HoursRemaining).Average();
var deviations = totalProgress.Select(x => new { xDeviation = x.DayNumber - avgDays, yDeviation = x.HoursRemaining - avgHours, xDevTimesyDev = (x.DayNumber - avgDays) * (x.HoursRemaining - avgHours), xDevSquare = (x.DayNumber - avgDays) * (x.DayNumber - avgDays) }).ToList();
// divide SUM( (x - avgX) * (y - avgY) ) by SUM( (x - avgX) * (x - avgX) )
var slope = deviations.Select(x => x.xDevTimesyDev).Sum() / deviations.Select(x => x.xDevSquare).Sum();
// determine intercept: avgY = (slope * avgX) + intercept -> intercept = -((slope * avgX) - avgY)
var intercept = -((slope * avgDays) - avgHours);
// formula best fitted line: amtHours = slope * amtDays + intercept
}
开发者ID:mnatte,项目名称:Planner,代码行数:31,代码来源:RMilestoneStatus.cs
示例14: getGeeAccumStyle
private GUIStyle getGeeAccumStyle(KeepFitCrewMember crew, Period period, GeeLoadingAccumulator accum)
{
GameConfig gameConfig = scenarioModule.GetGameConfig();
GUIStyle style = new GUIStyle(GUI.skin.label);
style.normal.textColor = Color.green;
style.wordWrap = false;
GeeToleranceConfig tolerance = gameConfig.GetGeeTolerance(period);
if (tolerance == null)
{
return style;
}
float geeWarn = GeeLoadingCalculator.GetFitnessModifiedGeeTolerance(tolerance.warn, crew, gameConfig);
float geeFatal = GeeLoadingCalculator.GetFitnessModifiedGeeTolerance(tolerance.fatal, crew, gameConfig);
float gee = accum.GetLastGeeMeanPerSecond();
if (gee > geeFatal)
{
style.normal.textColor = Color.red;
}
else
{
if (gee > geeWarn)
{
style.normal.textColor = Color.yellow;
}
}
return style;
}
开发者ID:Kerbas-ad-astra,项目名称:Timmers_KSP,代码行数:32,代码来源:RosterWindow.cs
示例15: GetCookBills
public List<WayBill> GetCookBills(string userName, string item,
DateTime periodStart = new DateTime(), DateTime periodEnd = new DateTime())
{
List<WayBill> userBills=new List<WayBill>();
List<WayBill> userBillsByPeriod = new List<WayBill>();
period = new Period { Start = periodStart, End = periodEnd };
userBills = GetUserBills(userName).ToList();
userBills = new List<WayBill>(userBills.OrderByDescending(bill => bill.Id));
if (item == "1")
{
if ((period.Start == Convert.ToDateTime("01.01.0001 0:00:00")) ||
(period.End == Convert.ToDateTime("01.01.0001 0:00:00")))
return userBills;
if (period.Start == period.End)
{
userBillsByPeriod.AddRange(userBills.Where(bill => ((DateTime)(bill.Date)).Day == period.End.Day));
return userBillsByPeriod;
} //LINQ it's POWER!!!
userBillsByPeriod.AddRange(userBills.Where(bill => (bill.Date >= period.Start) && (bill.Date <= period.End)));
return userBillsByPeriod;
}
//TODO: Различные запросы
return userBills;
}
开发者ID:boublikSystem,项目名称:BoublikSystem,代码行数:27,代码来源:Statistic.cs
示例16: AirlinerPassengerType
public AirlinerPassengerType(Manufacturer manufacturer, string name,string family, int seating, int cockpitcrew, int cabincrew, double speed, long range, double wingspan, double length, double consumption, long price, int maxAirlinerClasses, long minRunwaylength, long fuelcapacity, BodyType body, TypeRange rangeType, EngineType engine, Period<DateTime> produced, int prodRate, Boolean standardType = true)
: base(manufacturer,TypeOfAirliner.Passenger,name,family,cockpitcrew,speed,range,wingspan,length,consumption,price,minRunwaylength,fuelcapacity,body,rangeType,engine,produced, prodRate,standardType)
{
this.MaxSeatingCapacity = seating;
this.CabinCrew = cabincrew;
this.MaxAirlinerClasses = maxAirlinerClasses;
}
开发者ID:pedromorgan,项目名称:theairlineproject-cs,代码行数:7,代码来源:AirlinerType.cs
示例17: begin
public void begin(Troop host,Troop challenger)
{
var p=new Period();
p.type="begin";
queuePeriod.Add(p);
play();
}
开发者ID:QuenZhan,项目名称:EWP,代码行数:7,代码来源:Performance.cs
示例18: GetChart
/// <summary>
/// Reads the chart with price box. over the chart
/// Data for this chart are added inside tag chartDiv
/// PriceBox contains open, close, min, max records
/// Things shown inside the priceBox are shown by javascripts on the client side.
/// !! There is css class called barchartStyle is inside, you can set how will price box looks like
/// </summary>
/// <param name="contractCode">The contract code.</param>
/// <param name="periodSize">BarChartProxy.Constants.PeriodSize.Monthly next parameters are dayly, weekly</param>
/// <param name="frameSize">Size of the frame.</param>
/// <param name="movingAverages">add indicators higher than 1</param>
/// <returns></returns>
public string GetChart(string contractCode, Period periodSize, FrameSize frameSize, List<int> movingAverages)
{
//http://www.barchart.com/chart.php?sym=KCZ10&indicators=
//http://www.barchart.com/chart.php?sym={0}&style=technical{1}&d=M&sd=&ed=&size=M&log=0&t=BAR&v=2&g=1&evnt=1&late=1&o1=&o2=&o3=&sh=100{2}&txtDate=#jump
var address = GetChartPath(contractCode, periodSize, frameSize, movingAverages);
return GetChart(contractCode, address, frameSize,periodSize, movingAverages);
}
开发者ID:kuritka,项目名称:MarketLoader,代码行数:19,代码来源:BarChartProxy.cs
示例19: HistoricalPriceRequest
public HistoricalPriceRequest(string ticker, DateTime start_date, DateTime end_date, Period period)
{
Ticker = ticker;
StartDate = start_date;
EndDate = end_date;
Period = period;
}
开发者ID:haithemaraissia,项目名称:yahoo_stock_quotes,代码行数:7,代码来源:HistoricalPriceRequest.cs
示例20: AirportProfile
public AirportProfile(
string name,
string code,
string icaocode,
AirportType type,
Period<DateTime> period,
Town town,
TimeSpan offsetGMT,
TimeSpan offsetDST,
Coordinates coordinates,
GeneralHelpers.Size cargo,
double cargovolume,
Weather.Season season)
{
PaxValues = new List<PaxValue>();
Expansions = new List<AirportExpansion>();
Name = name;
Period = period;
IATACode = code;
ICAOCode = icaocode;
Type = type;
Town = town;
Coordinates = coordinates;
CargoVolume = cargovolume;
MajorDestionations = new Dictionary<string, int>();
Cargo = cargo;
Logo = "";
OffsetDST = offsetDST;
OffsetGMT = offsetGMT;
Season = season;
ID =
$"{char.ConvertToUtf32(IATACode, 0):00}-{char.ConvertToUtf32(IATACode, 1):00}-{char.ConvertToUtf32(IATACode, 2):00}-{name.Length:00}-{char.ConvertToUtf32(Name, Name.Length/2):00}-{(int) Cargo:00}";
}
开发者ID:TheAirlineProject,项目名称:tap-desktop,代码行数:34,代码来源:AirportProfile.cs
注:本文中的Period类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论