Exemplo n.º 1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);

            power = new Power (3);

            // Set our view from the "main" layout resource
            SetContentView (Resource.Layout.Main);

            // Get our button from the layout resource,
            // and attach an event to it
            Button button = FindViewById<Button> (Resource.Id.MyButton);

            button.Click += delegate
            {
                var number = power.Compute (count++);
                button.Text = string.Format ("{0} is the power", number);
            };
        }
Exemplo n.º 2
0
 static void Main(string[] args)
 {
     var power = new Power (5);
     var number = power.Compute (5);
     Console.WriteLine (number);
 }
Exemplo n.º 3
0
 // Shared initialization code
 void Initialize()
 {
     power = new Power (8);
 }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();

            // Perform any additional setup after loading the view, typically from a nib.
            power = new Power (4);
        }