本文整理汇总了C#中Counter.DoIt方法的典型用法代码示例。如果您正苦于以下问题:C# Counter.DoIt方法的具体用法?C# Counter.DoIt怎么用?C# Counter.DoIt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Counter
的用法示例。
在下文中一共展示了Counter.DoIt方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main()
{
Counter c = new Counter();
c.DoIt(5, 7);
// obs += traduzido para a chamada a add_obs
c.obs += value => Console.WriteLine("ConsoleHandler = " + value);
c.obs += value => MessageBox.Show("Item = " + value);
c.obs += new A(2).FeedbackBeep;
c.DoIt(5, 7);
}
示例2: Main
static void Main()
{
Counter c = new Counter();
c.AddObserver(value => Console.WriteLine("ConsoleHandler = " + value));
c.AddObserver(value => MessageBox.Show("Item = " + value) );
c.DoIt(5, 7);
}
示例3: Main
static void Main()
{
Counter c = new Counter();
c.AddObserver(Program.FeedbackToConsole);
c.AddObserver(Program.FeedbackToMsgBox);
c.AddObserver(Program.FeedbackBeep);
c.DoIt(5, 7);
}
示例4: Main
static void Main()
{
Counter c = new Counter();
c.AddObserver(new FeedbackToConsole());
c.AddObserver(new FeedbackToMbox());
c.AddObserver(new FeedbackBeep());
c.DoIt(5, 7);
}
示例5: Main
static void Main()
{
Counter c = new Counter(2);
c.CounterEvent += (value => Console.WriteLine("ConsoleHandler = " + value));
c.CounterEvent += (value => MessageBox.Show("Item = " + value));
// c.AddObserver(new Observer(new A(2).FeedbackBeep));
c.DoIt(5, 7);
}
示例6: Main
static void Main()
{
Counter c = new Counter();
c.AddObserver(value => Console.WriteLine("ConsoleHandler = " + value));
c.AddObserver(Program.SuperPrint);
c.AddObserver(new Program().OtherAlert);
c.AddObserver(value => MessageBox.Show("Item = " + value) );
c.DoIt(5, 7);
}
示例7: Main
static void Main()
{
Counter c = new Counter();
c.DoIt(5, 7);
Observer h1 = Program.Foo;
Observer h2 = value => MessageBox.Show("Item = " + value);
Observer h3 = new A(2).FeedbackBeep;
c.obs += h1; c.obs += h2; c.obs += h3;
GC.Collect();
h1.GetHashCode();
c.DoIt(5, 7);
}
示例8: Main
static void Main(string[] args)
{
Counter c = new Counter();
// c.obs += value => Console.WriteLine("ConsoleHandler = " + value);
// c.obs += value => MessageBox.Show("Item = " + value);
if(args.Length != 0)
c.AddObserversFrom(args[0]);
c.DoIt(5, 7);
}
示例9: Main
static void Main()
{
Counter c = new Counter(5);
c.AddObserversFromAssembly("MyHandlers.dll");
c.DoIt(1,3);
}
示例10: Main
static void Main()
{
Counter c = new Counter();
c.AddFeedbackHandler(FH1.ConsoleHandler);
c.AddFeedbackHandler(new FH2().MboxHandler);
c.AddFeedbackHandler(FH2.BeepHandler);
// c.AddFeedbackHandler(FH1.HelloWorld); // Erro de compilação.
c.DoIt(5, 7);
}