protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.Main); currency = FindViewById<TextView>(Resource.Id.currency); currencyLayout = FindViewById<LinearLayout>(Resource.Id.currencyLayout); Button getMoneyButton = FindViewById<Button>(Resource.Id.getMoney); Button refreshMoney = FindViewById<Button>(Resource.Id.refreshMoney); var incomeLayout = FindViewById<LinearLayout>(Resource.Id.incomeLayout); getMoneyButton.Click += OnGetMoney; refreshMoney.Click += OnRefreshMoney; currency.Text = "Монет в казне: 0"; timer = new Timer { Interval = 1000 }; timer.Elapsed += OnTimerTick; timer.Start(); logic = LastNonConfigurationInstance as EconomyLogic; if (logic == null) { logic = new EconomyLogic(); } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.Main); currency = FindViewById <TextView>(Resource.Id.currency); cityState = FindViewById <TextView>(Resource.Id.cityState); var alchemy = FindViewById <TextView>(Resource.Id.alchemy); var alchemyLevel = FindViewById <TextView>(Resource.Id.alchemyLevel); var jewelry = FindViewById <TextView>(Resource.Id.jewelry); var jewelryLevel = FindViewById <TextView>(Resource.Id.jewelryLevel); var smith = FindViewById <TextView>(Resource.Id.smith); var smithLevel = FindViewById <TextView>(Resource.Id.smithLevel); var palace = FindViewById <TextView>(Resource.Id.palace); var palaceLevel = FindViewById <TextView>(Resource.Id.palaceLevel); var library = FindViewById <TextView>(Resource.Id.library); var libraryLevel = FindViewById <TextView>(Resource.Id.libraryLevel); alchemyImage = FindViewById <ImageView>(Resource.Id.alchemyImage); jewelryImage = FindViewById <ImageView>(Resource.Id.jewelryImage); smithImage = FindViewById <FrameLayout>(Resource.Id.smithImage); palaceImage = FindViewById <FrameLayout>(Resource.Id.palaceImage); libraryImage = FindViewById <ImageView>(Resource.Id.libraryImage); SetImages(); currency.TextSize = 30f; cityState.TextSize = 30f; alchemy.TextSize = 18f; alchemyLevel.TextSize = 18f; jewelry.TextSize = 18f; jewelryLevel.TextSize = 18f; smith.TextSize = 18f; smithLevel.TextSize = 18f; palace.TextSize = 18f; palaceLevel.TextSize = 18f; library.TextSize = 18f; libraryLevel.TextSize = 18f; currencyLayout = FindViewById <LinearLayout>(Resource.Id.currencyLayout); Button getMoneyButton = FindViewById <Button>(Resource.Id.getMoney); Button refreshMoney = FindViewById <Button>(Resource.Id.refreshMoney); var cityLayout = FindViewById <LinearLayout>(Resource.Id.cityLayout); getMoneyButton.Click += OnGetMoney; refreshMoney.Click += OnRefreshMoney; currency.Text = "Монет в казне: 0"; timer = new Timer { Interval = 1000 }; timer.Elapsed += OnTimerTick; timer.Start(); logic = LastNonConfigurationInstance as EconomyLogic; if (logic == null) { logic = new EconomyLogic(); } }