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


C# Visitor类代码示例

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


Visitor类属于命名空间,在下文中一共展示了Visitor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Accept

 public void Accept(Visitor visitor)
 {
     foreach (Employee e in employees)
     {
         e.Accept(visitor);
     }
 }
开发者ID:jiabailie,项目名称:self-projects,代码行数:7,代码来源:VisitorApp.cs

示例2: AcceptVisitor

 public void AcceptVisitor(Visitor visitor)
 {
     for(int y = 0; y < SectionHeight; ++y) {
         for(int x = 0; x < SectionWidth; ++x)
             sections[x, y].AcceptVisitor(visitor);
     }
 }
开发者ID:jaggedsoft,项目名称:aesirtk,代码行数:7,代码来源:MapDocument.cs

示例3: button1_Click

        // Добавление гостя в спискок
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                Visitor visitor = new Visitor();

                visitor.Surname = textBox2.Text;
                visitor.Name = textBox3.Text;
                visitor.Patronymic = textBox6.Text;
                visitor.Country = textBox4.Text;
                visitor.City = textBox5.Text;
                visitor.Num = num;
                visitor.Birthday = dateTimePicker2.Value;

                if (visitor.Surname == "" || visitor.Name == "" || visitor.Country == "" || visitor.City == "")
                    throw new ArgumentException("Все поля (кроме отчества) должны быть заполнены.");

                visitors.Add(visitor);

                string s = visitor.Surname + " " + visitor.Name;
                textBox1.AppendText(s + "\n");
                comboBox1.Items.Add(s);

                textBox2.Clear();
                textBox3.Clear();
                textBox6.Clear();
            }
            catch (ArgumentException exc)
            {
                MessageBox.Show(exc.Message, "Регистрация гостя", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
开发者ID:sasha-bogma,项目名称:ilab,代码行数:33,代码来源:RegistrationForm.cs

示例4: FindVisitorCo

    IEnumerator FindVisitorCo()
    {
        if (King.visitor == null)
            yield return null;

        visitor = King.visitor;
    }
开发者ID:hassank,项目名称:WendyWebVR,代码行数:7,代码来源:PotionBook.cs

示例5: Should_map_Visitor

        public void Should_map_Visitor()
        {
            new DatabaseTester().Clean();
            var visitor = new Visitor
            {
                Browser = "1",
                IpAddress = "2",
                LoginName = "3",
                PathAndQuerystring = "4",
                VisitDate =
                    new DateTime(2000, 1, 1),
                FirstName = "Jones"
            };

            var repository = new VisitorRepository();
            repository.Save(visitor);

            Visitor loadedVisitor;
            using (ISession session = DataContext.GetSession())
            {
                loadedVisitor = session.Load<Visitor>(visitor.Id);
            }

            loadedVisitor.ShouldNotBeNull();
            loadedVisitor.Browser.ShouldEqual("1");
            loadedVisitor.IpAddress.ShouldEqual("2");
            loadedVisitor.LoginName.ShouldEqual("3");
            loadedVisitor.PathAndQuerystring.ShouldEqual("4");
            loadedVisitor.VisitDate.ShouldEqual(new DateTime(2000, 1, 1));
            loadedVisitor.FirstName.ShouldEqual("Jones");
        }
开发者ID:jbasilio,项目名称:IterationZero,代码行数:31,代码来源:VisitorMappingTester.cs

示例6: Action

 /// <summary>
 /// 对象结构执行访问,对池中所有的元素访问
 /// </summary>
 /// <param name="visitor"></param>
 public void Action(Visitor visitor)
 {
     foreach (Element e in elements)
     {
         e.Accept(visitor);
     }
 }
开发者ID:chengn,项目名称:DPRun,代码行数:11,代码来源:ObjectStructure.cs

示例7: Import

 public Formatting.ParagraphModel Import(IExchangableText text, ParagraphStyle paragraphStyle)
 {
     var visitor = new Visitor();
     visitor.BeginParagraph(_latinWordMetric, paragraphStyle);
     text.Accept(visitor);
     return visitor.EndParagraph();
 }
开发者ID:karak,项目名称:Geovanni,代码行数:7,代码来源:ExchangableTextImporter.cs

示例8: IsInCohort

 public override bool IsInCohort(Visitor visitor)
 {
     if (visitor.FirstVisit >= this.StartDate && visitor.FirstVisit <= this.EndDate)
     {
         return true;
     }
     return false;
 }
开发者ID:codeyu,项目名称:mtelligent,代码行数:8,代码来源:FirstVisitCohort.cs

示例9: Convert

 public static QueryComplete Convert(
     Expression<Func<BsonDocument, bool>> expression
     )
 {
     var visitor = new Visitor();
     visitor.Visit(expression);
     return (QueryComplete) visitor.ResultStack.Pop();
 }
开发者ID:rmueller,项目名称:LinqToMongo,代码行数:8,代码来源:ExpressionToQueryConverter.cs

示例10: IsInCohort

 public override bool IsInCohort(Visitor visitor)
 {
     if (visitor.LandingUrls.Where(a => a.IndexOf(this.LandingUrl) > -1).FirstOrDefault() != null)
     {
         return true;
     }
     return false;
 }
开发者ID:codeyu,项目名称:mtelligent,代码行数:8,代码来源:LandingUrlCohort.cs

示例11: accept

        public bool accept(Visitor visitor)
        {
            if (visitor.visitEnter(this))
            {

            }
            return visitor.visitLeave(this);
        }    
开发者ID:galderli,项目名称:dp2compiler,代码行数:8,代码来源:FunctionCall.cs

示例12: IsInCohort

 public override bool IsInCohort(Visitor visitor)
 {
     if (visitor.Roles.IndexOf(this.Role) > -1)
     {
         return true;
     }
     return false;
 }
开发者ID:codeyu,项目名称:mtelligent,代码行数:8,代码来源:RoleCohort.cs

示例13: TransferStateTo

 public override void TransferStateTo(Visitor targetVisitor){
   base.TransferStateTo(targetVisitor);
   Scoper target = targetVisitor as Scoper;
   if (target == null) return;
   target.ScopeFor = this.ScopeFor;
   target.currentScope = this.currentScope;
   target.currentModule = this.currentModule;
 }
开发者ID:tapicer,项目名称:resource-contracts-.net,代码行数:8,代码来源:Scoper.cs

示例14: accept

 public bool accept(Visitor visitor)
 {
     if (visitor.visitEnter(this))
     {
         expression.accept(visitor);
     }
     return visitor.visitLeave(this);
 }
开发者ID:galderli,项目名称:dp2compiler,代码行数:8,代码来源:ExpressionStatement.cs

示例15: IsInCohort

 public override bool IsInCohort(Visitor visitor)
 {
     if (visitor.IsAuthenticated)
     {
         return false;
     }
     return true;
 }
开发者ID:codeyu,项目名称:mtelligent,代码行数:8,代码来源:NonAuthenticatedUsersCohort.cs


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