本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
}
示例4: FindVisitorCo
IEnumerator FindVisitorCo()
{
if (King.visitor == null)
yield return null;
visitor = King.visitor;
}
示例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");
}
示例6: Action
/// <summary>
/// 对象结构执行访问,对池中所有的元素访问
/// </summary>
/// <param name="visitor"></param>
public void Action(Visitor visitor)
{
foreach (Element e in elements)
{
e.Accept(visitor);
}
}
示例7: Import
public Formatting.ParagraphModel Import(IExchangableText text, ParagraphStyle paragraphStyle)
{
var visitor = new Visitor();
visitor.BeginParagraph(_latinWordMetric, paragraphStyle);
text.Accept(visitor);
return visitor.EndParagraph();
}
示例8: IsInCohort
public override bool IsInCohort(Visitor visitor)
{
if (visitor.FirstVisit >= this.StartDate && visitor.FirstVisit <= this.EndDate)
{
return true;
}
return false;
}
示例9: Convert
public static QueryComplete Convert(
Expression<Func<BsonDocument, bool>> expression
)
{
var visitor = new Visitor();
visitor.Visit(expression);
return (QueryComplete) visitor.ResultStack.Pop();
}
示例10: IsInCohort
public override bool IsInCohort(Visitor visitor)
{
if (visitor.LandingUrls.Where(a => a.IndexOf(this.LandingUrl) > -1).FirstOrDefault() != null)
{
return true;
}
return false;
}
示例11: accept
public bool accept(Visitor visitor)
{
if (visitor.visitEnter(this))
{
}
return visitor.visitLeave(this);
}
示例12: IsInCohort
public override bool IsInCohort(Visitor visitor)
{
if (visitor.Roles.IndexOf(this.Role) > -1)
{
return true;
}
return false;
}
示例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;
}
示例14: accept
public bool accept(Visitor visitor)
{
if (visitor.visitEnter(this))
{
expression.accept(visitor);
}
return visitor.visitLeave(this);
}
示例15: IsInCohort
public override bool IsInCohort(Visitor visitor)
{
if (visitor.IsAuthenticated)
{
return false;
}
return true;
}