Pandorym 2014-05-12 06:38 采纳率: 0%
浏览 2775

“CS$<>9__CachedAnonymousMethodDelegate1” 在哪里定义?

这是我反编译一个软件时,在 消息窗口 部分看到的。

MessageWidget.cs
public void DisplayMessage(string text, bool blinking)

    {
        this.m_message = text;
        this.m_messageStartTime = TimeManager.Time;
        if (!blinking)
        {
        }
        this.m_duration = (CS$<>9__CachedAnonymousMethodDelegate1 != null) ? 
          6f : 
         (4f + MathUtils.Min((float) (1f * this.m_message.Count<char>(CS$<>9__CachedAnonymousMethodDelegate1)), (float) 4f));
        this.m_blinking = blinking;
    } 

我在MessageWidget.cs中并没有找到关于CS$<>9__CachedAnonymousMethodDelegate1的定义。

使用Reflector查看到的定义是:
[CompilerGenerated]
private static Func CS$<>9__CachedAnonymousMethodDelegate1;

以下是MessageWidget.Cs的内容:
public class MessageWidget : CanvasWidget
{
private bool m_blinking;
private float m_duration;
private LabelWidget m_labelWidget;
private string m_message;
private double m_messageStartTime;

    public MessageWidget()
    {
        XElement node = ContentManager.Load<XElement>(@"Widgets\MessageWidget");
        WidgetsManager.LoadWidgetContents(this, this, node);
        this.m_labelWidget = base.FindWidget<LabelWidget>("Label", true);
    }

    public void DisplayMessage(string text, bool blinking)
    {
        this.m_message = text;
        this.m_messageStartTime = TimeManager.Time;
        if (!blinking)
        {
        }
        this.m_duration = (CS$<>9__CachedAnonymousMethodDelegate1 != null) ? 6f : (4f + MathUtils.Min((float) (1f * this.m_message.Count<char>(CS$<>9__CachedAnonymousMethodDelegate1)), (float) 4f));
        this.m_blinking = blinking;
    }

    public override void Update()
    {
        double time = TimeManager.Time;
        if (!string.IsNullOrEmpty(this.m_message))
        {
            float num2;
            if (this.m_blinking)
            {
                num2 = MathUtils.Saturate((float) (1f * ((float) ((this.m_messageStartTime + this.m_duration) - time))));
                if ((time - this.m_messageStartTime) < 0.417)
                {
                    num2 *= MathUtils.Lerp((float) 0.25f, (float) 1f, (float) (0.5f * (1f - MathUtils.Cos((float) (37.69911f * ((float) (time - this.m_messageStartTime)))))));
                }
            }
            else
            {
                num2 = MathUtils.Saturate(MathUtils.Min((float) (3f * ((float) (time - this.m_messageStartTime))), (float) (1f * ((float) ((this.m_messageStartTime + this.m_duration) - time)))));
            }
            this.m_labelWidget.Color = new Color(num2, num2, num2, num2);
            this.m_labelWidget.IsVisible = true;
            this.m_labelWidget.Text = this.m_message;
            if ((time - this.m_messageStartTime) > this.m_duration)
            {
                this.m_message = null;
            }
        }
        else
        {
            this.m_labelWidget.IsVisible = false;
        }
    }
}

它或许与Linq有关。
请问“CS$<>9__CachedAnonymousMethodDelegate1”这个委托是在哪里定义的呢?

  • 写回答

1条回答 默认 最新

  • Pandorym 2014-05-12 10:53
    关注

    Thx,调成None够就能看到了,接下来的自己解决。~

    评论

报告相同问题?

悬赏问题

  • ¥15 全志H618ROM新增分区
  • ¥20 jupyter保存图像功能的实现
  • ¥15 在grasshopper里DrawViewportWires更改预览后,禁用电池仍然显示
  • ¥15 NAO机器人的录音程序保存问题
  • ¥15 C#读写EXCEL文件,不同编译
  • ¥15 MapReduce结果输出到HBase,一直连接不上MySQL
  • ¥15 扩散模型sd.webui使用时报错“Nonetype”
  • ¥15 stm32流水灯+呼吸灯+外部中断按键
  • ¥15 将二维数组,按照假设的规定,如0/1/0 == "4",把对应列位置写成一个字符并打印输出该字符
  • ¥15 NX MCD仿真与博途通讯不了啥情况