本文整理汇总了C#中Mark类的典型用法代码示例。如果您正苦于以下问题:C# Mark类的具体用法?C# Mark怎么用?C# Mark使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Mark类属于命名空间,在下文中一共展示了Mark类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: addSubjectMarkToStudent
public void addSubjectMarkToStudent(string subject, string studentNeptunCode, Mark mark)
{
if (this.trunk.ContainsKey(subject))
{
this.trunk[subject].addMarkToStudent(studentNeptunCode, mark);
}
}
示例2: TestMarks
public void TestMarks( string fileName)
{
var stream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
var inputs = new StreamReader(stream).ReadToEnd().Split(new[] {"---\n"}, StringSplitOptions.None);
foreach (var input in inputs.Skip(1))
{
var index = 0;
var line = 0;
var column = 0;
while (index < input.Length && input[index] != '*')
if (input[index++] == '\n')
{
line++;
column = 0;
}
else
column++;
var mark = new Mark
{
Name = fileName,
Index = index,
Line = line,
Column = column,
Buffer = new StringBuilder(input),
Pointer = index
};
var snippet = mark.GetSnippet(2, 79);
var lineCount = snippet.Count(c => c == '\n');
Assert.AreEqual(lineCount, 1);
var lines = snippet.Split('\n');
Assert.Less(lines[0].Length, 82);
Assert.AreEqual(lines[0][lines[1].Length - 1], '*');
}
stream.Close();
}
示例3: DocumentStart
/// <summary>
/// Initializes a new instance of the <see cref="DocumentStart"/> class.
/// </summary>
/// <param name="version">The version.</param>
/// <param name="tags">The tags.</param>
/// <param name="isImplicit">Indicates whether the event is implicit.</param>
/// <param name="start">The start position of the event.</param>
/// <param name="end">The end position of the event.</param>
public DocumentStart(VersionDirective version, TagDirectiveCollection tags, bool isImplicit, Mark start, Mark end)
: base(start, end)
{
this.version = version;
this.tags = tags;
this.isImplicit = isImplicit;
}
示例4: TestConstructor_PassValidValues_ShouldSetValueAndSubjectCorrectly
public void TestConstructor_PassValidValues_ShouldSetValueAndSubjectCorrectly(float value, Subject subject)
{
var mark = new Mark(subject, value);
Assert.AreEqual(mark.Subject, subject);
Assert.AreEqual(mark.Value, value);
}
示例5: ValidateMark
public static void ValidateMark(Mark mark)
{
if (!(mark.MarkValue >= 2.00M && mark.MarkValue <= 6.00M))
{
throw new MarkException();
}
}
示例6: BasePlayer
protected BasePlayer(string name, Mark mark)
{
EnsuresNameIsValid(name);
EnsuresMarkIsValid(mark);
_name = name;
_mark = mark;
}
示例7: TestConstructor_PassValidValues_ShouldInitialiseCorrectly
public void TestConstructor_PassValidValues_ShouldInitialiseCorrectly(float value, Subject subject)
{
var mark = new Mark(subject, value);
Assert.IsNotNull(mark);
Assert.IsInstanceOf<Mark>(mark);
}
示例8: btnSave_Click_1
private void btnSave_Click_1(object sender, RoutedEventArgs e)
{
SubjectName subject = GetSubjectName();
TypeOfMarks markType = GetMarkType();
Mark newMark = new Mark(decimal.Parse(txtMarkValue.Text), markType, student, new Subject(subject));
// Validate the mark. If the mark is incorrect, throw exception.
try
{
Validation.ValidateMark(newMark);
ESchoolDiaryData.Marks.Add(newMark);
studentWindow.lblSubjectContent.Content += lblSubject.Content.ToString();
studentWindow.lblMarksTypeContent.Content += lblMarkType.Content.ToString();
studentWindow.lblMarksValueContent.Content += string.Format("{0:0.00}", decimal.Parse(txtMarkValue.Text));
MessageBox.Show("Mark added.");
this.Close();
}
catch (MarkException markEx)
{
MessageBox.Show(markEx.Message);
}
finally
{
txtMarkValue.Clear();
}
}
示例9: Fill
public virtual IGrid Fill(IPosition position, Mark mark)
{
var grid = new Mark[3, 3];
Array.Copy(_grid, grid, _grid.Length);
grid[position.Row, position.Col] = mark;
return new Grid3X3(grid);
}
示例10: Add
public async Task<int> Add(string authorId, int imageId, int value)
{
var assessingUser = this.users
.All()
.FirstOrDefault(u => u.Id == authorId);
var imageToAttachMarkTo = this.images
.All()
.FirstOrDefault(i => i.Id == imageId);
if (imageToAttachMarkTo == null || assessingUser == null)
{
return GlobalConstants.InvalidDbObjectReturnValue;
}
var markToAdd = new Mark()
{
GivenBy = assessingUser,
IsDeleted = false,
Value = value
};
imageToAttachMarkTo.Rating.Marks.Add(markToAdd);
this.images.Update(imageToAttachMarkTo);
await this.images.SaveChangesAsync();
return markToAdd.Id;
}
示例11: IsRange
private static bool IsRange(int index, Mark mark)
{
if (mark.HeadCharIndex >= index && mark.TailCharIndex <= index)
{
return true;
}
return false;
}
示例12: Scalar
/// <summary>
/// Initializes a new instance of the <see cref="Scalar"/> class.
/// </summary>
/// <param name="anchor">The anchor.</param>
/// <param name="tag">The tag.</param>
/// <param name="value">The value.</param>
/// <param name="style">The style.</param>
/// <param name="isPlainImplicit">.</param>
/// <param name="isQuotedImplicit">.</param>
/// <param name="start">The start position of the event.</param>
/// <param name="end">The end position of the event.</param>
public Scalar(string anchor, string tag, string value, ScalarStyle style, bool isPlainImplicit, bool isQuotedImplicit, Mark start, Mark end)
: base(anchor, tag, start, end)
{
this.value = value;
this.style = style;
this.isPlainImplicit = isPlainImplicit;
this.isQuotedImplicit = isQuotedImplicit;
}
示例13: button1_Click
private void button1_Click(object sender, EventArgs e)
{
Mark m = new Mark("Chris");//constructor runs here.
m.testThis();
Mark j = new Mark();
j.testThis();
}
示例14: addMarkToStudent
public void addMarkToStudent(string neptunCode, Mark mark)
{
Student student = this.findStudent(neptunCode);
if (student != null)
{
student.addMark(mark);
}
}
示例15: Student
public Student(string firstName, string secondName, Mark mark, Group group, Dictionary<Subject, Mark> subjectsMarks, DateTime birthDate)
{
_firstName = firstName;
_secondName = secondName;
_mark = mark;
CurrentGroup = group;
_subjectsMarks = subjectsMarks;
_birthDate = birthDate;
}