当前位置: 首页>>代码示例>>C#>>正文


C# Mark类代码示例

本文整理汇总了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);
     }
 }
开发者ID:davidbedok,项目名称:oeprog2,代码行数:7,代码来源:SubjectTrunk.cs

示例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();
 }
开发者ID:IngisKahn,项目名称:Nyaml,代码行数:35,代码来源:MarkTest.cs

示例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;
 }
开发者ID:roji,项目名称:YamlDotNet,代码行数:15,代码来源:DocumentStart.cs

示例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);
        }
开发者ID:cwetanow,项目名称:Telerik,代码行数:7,代码来源:MarkConstructorTests.cs

示例5: ValidateMark

 public static void ValidateMark(Mark mark)
 {
     if (!(mark.MarkValue >= 2.00M && mark.MarkValue <= 6.00M))
     {
         throw new MarkException();
     }
 }
开发者ID:TishoAngelov,项目名称:TelerikAcademy,代码行数:7,代码来源:Validation.cs

示例6: BasePlayer

 protected BasePlayer(string name, Mark mark)
 {
     EnsuresNameIsValid(name);
     EnsuresMarkIsValid(mark);
     _name = name;
     _mark = mark;
 }
开发者ID:alexmiranda,项目名称:tictactoe,代码行数:7,代码来源:BasePlayer.cs

示例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);
        }
开发者ID:cwetanow,项目名称:Telerik,代码行数:7,代码来源:MarkConstructorTests.cs

示例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();
            }
        }
开发者ID:TishoAngelov,项目名称:TelerikAcademy,代码行数:30,代码来源:AddMark.xaml.cs

示例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);
 }
开发者ID:alexmiranda,项目名称:tictactoe,代码行数:7,代码来源:Grid3X3.cs

示例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;
        }
开发者ID:Kratos-TA,项目名称:pSher,代码行数:30,代码来源:MarksService.cs

示例11: IsRange

 private static bool IsRange(int index, Mark mark)
 {
     if (mark.HeadCharIndex >= index && mark.TailCharIndex <= index)
     {
         return true;
     }
     return false;
 }
开发者ID:kienaiProject,项目名称:ArtOfWords,代码行数:8,代码来源:StoryFrameMarkManagementStrategy.cs

示例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;
 }
开发者ID:rogernorling,项目名称:YamlDotNet,代码行数:19,代码来源:Scalar.cs

示例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();
        }
开发者ID:ChrisPaine,项目名称:C-sharp,代码行数:8,代码来源:Form1.cs

示例14: addMarkToStudent

 public void addMarkToStudent(string neptunCode, Mark mark)
 {
     Student student = this.findStudent(neptunCode);
     if (student != null)
     {
         student.addMark(mark);
     }
 }
开发者ID:davidbedok,项目名称:oeprog2,代码行数:8,代码来源:Teacher.cs

示例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;
 }
开发者ID:Mechtatel-student,项目名称:tasks_cs1,代码行数:9,代码来源:Student.cs


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