本文整理汇总了C#中System.CodeDom.CodeGotoStatement类的典型用法代码示例。如果您正苦于以下问题:C# CodeGotoStatement类的具体用法?C# CodeGotoStatement怎么用?C# CodeGotoStatement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CodeGotoStatement类属于System.CodeDom命名空间,在下文中一共展示了CodeGotoStatement类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Constructor1
public void Constructor1 ()
{
string label1 = "mono1";
CodeGotoStatement cgs = new CodeGotoStatement (label1);
Assert.IsNotNull (cgs.Label, "#1");
Assert.AreSame (label1, cgs.Label, "#2");
#if NET_2_0
Assert.IsNotNull (cgs.StartDirectives, "#3");
Assert.AreEqual (0, cgs.StartDirectives.Count, "#4");
Assert.IsNotNull (cgs.EndDirectives, "#5");
Assert.AreEqual (0, cgs.EndDirectives.Count, "#6");
#endif
Assert.IsNotNull (cgs.UserData, "#7");
Assert.AreEqual (typeof(ListDictionary), cgs.UserData.GetType (), "#8");
Assert.AreEqual (0, cgs.UserData.Count, "#9");
Assert.IsNull (cgs.LinePragma, "#10");
string label2 = "mono2";
cgs.Label = label2;
Assert.AreSame (label2, cgs.Label, "#11");
}
示例2: Constructor0
public void Constructor0 ()
{
CodeGotoStatement cgs = new CodeGotoStatement ();
Assert.IsNull (cgs.Label, "#1");
Assert.IsNotNull (cgs.StartDirectives, "#2");
Assert.AreEqual (0, cgs.StartDirectives.Count, "#3");
Assert.IsNotNull (cgs.EndDirectives, "#4");
Assert.AreEqual (0, cgs.EndDirectives.Count, "#5");
Assert.IsNotNull (cgs.UserData, "#6");
Assert.AreEqual (typeof(ListDictionary), cgs.UserData.GetType (), "#7");
Assert.AreEqual (0, cgs.UserData.Count, "#8");
Assert.IsNull (cgs.LinePragma, "#9");
CodeLinePragma clp = new CodeLinePragma ("mono", 10);
cgs.LinePragma = clp;
Assert.IsNotNull (cgs.LinePragma, "#10");
Assert.AreSame (clp, cgs.LinePragma, "#11");
cgs.LinePragma = null;
Assert.IsNull (cgs.LinePragma, "#12");
string label = "mono";
cgs.Label = label;
Assert.AreSame (label, cgs.Label, "#13");
}
示例3: TypescriptGotoStatement
public TypescriptGotoStatement(
IStatementFactory statementFactory,
IExpressionFactory expressionFactory,
CodeGotoStatement statement,
CodeGeneratorOptions options)
{
_statementFactory = statementFactory;
_expressionFactory = expressionFactory;
_statement = statement;
_options = options;
}
示例4: EmitGotoStatement
private void EmitGotoStatement(CodeGotoStatement Goto)
{
Depth++;
Debug("Emitting goto: " + Goto.Label);
LabelMetadata Meta = LookupLabel(Goto.Label);
Generator.Emit(OpCodes.Br, Meta.Label);
Meta.From = Goto;
Depth--;
}
示例5: Write
private void Write(CodeGotoStatement e){
TextWriter w = this.writer;
w.Write("goto ");
w.Write(e.Label);
w.WriteLine(";");
}
示例6: GenerateGotoStatement
protected override void GenerateGotoStatement(CodeGotoStatement e)
{
Output.WriteLine("[CodeGotoStatement: {0}]", e.ToString());
}
示例7: GenerateGotoStatement
protected override void GenerateGotoStatement (CodeGotoStatement statement)
{
TextWriter output = Output;
output.Write ("goto ");
output.Write (statement.Label);
output.WriteLine ();
}
示例8: Visit
public void Visit (CodeGotoStatement o)
{
g.GenerateGotoStatement (o);
}
示例9: Label_Null
public void Label_Null ()
{
CodeGotoStatement cgs = new CodeGotoStatement ("mono");
cgs.Label = null;
}
示例10: GenerateGotoStatement
protected override void GenerateGotoStatement(CodeGotoStatement e) {
throw new Exception(JScriptException.Localize("No goto statements", CultureInfo.CurrentUICulture));
}
示例11: Generate
public void Generate(CodeGotoStatement statement)
{
throw new NotImplementedException();
}
示例12: Label_Empty
public void Label_Empty () {
CodeGotoStatement cgs = new CodeGotoStatement ("mono");
cgs.Label = string.Empty;
#if ONLY_1_1
Assert.IsNotNull (cgs.Label, "#1");
Assert.AreEqual (string.Empty, cgs.Label, "#2");
#endif
}
示例13: Label_Null
public void Label_Null ()
{
CodeGotoStatement cgs = new CodeGotoStatement ("mono");
cgs.Label = null;
#if ONLY_1_1
Assert.IsNull (cgs.Label, "#1");
#endif
}
示例14: Constructor1_EmptyLabel
public void Constructor1_EmptyLabel () {
CodeGotoStatement cgs = new CodeGotoStatement (string.Empty);
#if ONLY_1_1
Assert.IsNotNull (cgs.Label, "#1");
Assert.AreEqual (string.Empty, cgs.Label, "#2");
#endif
}
示例15: Constructor1_NullLabel
public void Constructor1_NullLabel ()
{
CodeGotoStatement cgs = new CodeGotoStatement ((string) null);
#if ONLY_1_1
Assert.IsNull (cgs.Label, "#1");
#endif
}