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

C# Mark类代码示例

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

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



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


示例16: SetMark

 public void SetMark(Subject subject, Mark mark)
 {
     foreach (var pair in _subjectsMarks)
     {
         if (pair.Key == subject)
         {
             _subjectsMarks[pair.Key] = mark;
         }
     }
 }
开发者ID:Mechtatel-student,项目名称:tasks_cs1,代码行数:10,代码来源:Student.cs


示例17: markQuestionTypeCount

        /// <summary>
        /// mark question based on the number of responses
        /// </summary>
        /// <param name="markingSchema"></param>
        /// <param name="response"></param>
        /// <returns>
        /// calculated score
        /// </returns>
        public static int markQuestionTypeCount(Mark markingSchema, string response)
        {
            var score = 0;
            var responses = response.Split('|');

            // compare response
            if (Convert.ToInt32(markingSchema.answer) == responses.Length)
                score = Convert.ToInt32(markingSchema.mark);

            return score;
        }
开发者ID:jezswift,项目名称:LCP-Marker,代码行数:19,代码来源:Scorer.cs


示例18: Create

        public Mark Create(CreateMarkCommand command)
        {
            var service = new Mark(command.Term, command.Job, command.Description);
            service.Validate();
            _repository.Create(service);

            if (Commit())
                return service;

            return null;
        }
开发者ID:luancarloswd,项目名称:CoachingPlan,代码行数:11,代码来源:MarkApplicationService.cs


示例19: AnchorAlias

        /// <summary>
        /// Initializes a new instance of the <see cref="AnchorAlias"/> class.
        /// </summary>
        /// <param name="value">The value of the alias.</param>
        /// <param name="start">The start position of the event.</param>
        /// <param name="end">The end position of the event.</param>
        public AnchorAlias(string value, Mark start, Mark end)
            : base(start, end)
        {
            if(string.IsNullOrEmpty(value)) {
                throw new YamlException(start, end, "Anchor value must not be empty.");
            }

            if(!NodeEvent.anchorValidator.IsMatch(value)) {
                throw new YamlException(start, end, "Anchor value must contain alphanumerical characters only.");
            }
            
            this.value = value;
        }
开发者ID:pablinos,项目名称:YamlDotNet,代码行数:19,代码来源:AnchorAlias.cs


示例20: GetNode

		/// <summary>
		/// Gets the node with the specified anchor.
		/// </summary>
		/// <param name="anchor">The anchor.</param>
		/// <param name="throwException">if set to <c>true</c>, the method should throw an exception if there is no node with that anchor.</param>
		/// <param name="start">The start position.</param>
		/// <param name="end">The end position.</param>
		/// <returns></returns>
		public YamlNode GetNode(string anchor, bool throwException, Mark start, Mark end)
		{
			YamlNode target;
			if (anchors.TryGetValue(anchor, out target))
			{
				return target;
			}
			else if (throwException)
			{
				throw new AnchorNotFoundException(start, end, string.Format(CultureInfo.InvariantCulture, "The anchor '{0}' does not exists", anchor));
			}
			else
			{
				return null;
			}
		}
开发者ID:ChelseaLing,项目名称:AssetGraph,代码行数:24,代码来源:DocumentLoadingState.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# MarkdownDeep.Markdown类代码示例发布时间:2022-05-24
下一篇:
C# Mappings类代码示例发布时间: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