private void SetControlReference()
 {
     edUserName = FindViewById<EditText>(Resource.Id.EdName);
     edOldPassword = FindViewById<EditText>(Resource.Id.EdOldPassword);
     edNewPassword = FindViewById<EditText>(Resource.Id.EdNewPassword);
     edConfirmPassword = FindViewById<EditText>(Resource.Id.EdConfirmPassword);
     btnOk = FindViewById<Button>(Resource.Id.BtnOk);
     btnCancel = FindViewById<Button>(Resource.Id.BtnCancel);
 }
        protected override void OnStart()
        {
            Console.WriteLine("OnStart");
            base.OnStart();
            _listview =  this.FindViewById<ListView>(Resource.Id.DlgListviewMainListview);
            _btnOk = this.FindViewById<Button>(Resource.Id.BtnDlgListViewOK);
            _btnOk.Click+= (sender, e) => { this.Dismiss();};
            this.FillListView();

        }
示例#3
0
文件: Menu.cs 项目: FoKycHuK/CVARC
    // Use this for initialization
    void Start()
    {
        if (!serverIsRunned)
        {
            Server();
            serverIsRunned = true;
        }
        LoadingData data = new LoadingData();

        data.AssemblyName = AssemblyName;
        data.Level        = Level;

        Element.InitUi();
        var c = new Canvas(new Vector2(100, 100));
        var w = new Window(Sprite, "CVARC Pudge Wars", new Rect(0, 0, kMenuWidth, kMenuHeight));
        var buttonOpenTutorial = new Button(
            () => Dispatcher.GameManager.RequestTutorial(data), SpriteButton, new Rect(50, 50, kButtonWidth, kButtonHeight), "Tutorial");

        w.AddElement(buttonOpenTutorial);
        c.AddElement(w.Head);
    }
示例#4
0
		public override Android.Views.View OnCreateView(Android.Views.LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
		{
			// Android 3.x+ still wants to show title: disable
			// Dialog.Window.RequestFeature(WindowFeatures.NoTitle);

			Dialog.SetTitle ("Apollo Mobile");

			// Create our view
			var view = inflater.Inflate(Resource.Layout.ActivityDialogConfirm, container, true);

			TxtMain = view.FindViewById<TextView> (Resource.Id.txtMain);
			TxtMain.Text = MainText;

			// Handle dismiss button click
			BtnNo = view.FindViewById<Button>(Resource.Id.BtnNo);
			BtnNo.Click += BtnNo_Click;

			BtnYes = view.FindViewById<Button> (Resource.Id.BtnYes);
			BtnYes.Click += BtnYes_Click;


			return view;
		}
		public override Android.Views.View OnCreateView(Android.Views.LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
		{
			// Android 3.x+ still wants to show title: disable
			// Dialog.Window.RequestFeature(WindowFeatures.NoTitle);

			Dialog.SetTitle ("Apollo Mobile");

			// Create our view
			var view = inflater.Inflate(Resource.Layout.ActivityDialogAuthentication, container, true);

			EdName = view.FindViewById<EditText> (Resource.Id.EdName);
			EdPassword = view.FindViewById<EditText> (Resource.Id.EdPassword);
			EdMandant = view.FindViewById<EditText> (Resource.Id.EdMandant);
			TxtResult = view.FindViewById<TextView> (Resource.Id.txtResult);
			 
			// Handle dismiss button click
			BtnCancel = view.FindViewById<Button>(Resource.Id.BtnCancel);
			BtnCancel.Click += BtnCancel_Click;

			BtnOk = view.FindViewById<Button> (Resource.Id.BtnOk);
			BtnOk.Click += BtnOk_Click;

			return view;
		}
        protected override void OnCreate (Bundle bundle)
        {
            base.OnCreate (bundle);

            // Create your application here
            // Set the layout
            SetContentView(Resource.Layout.ActivitySettings);
            _OfflineSwitch = FindViewById<Switch> (Resource.Id.switch1);
            _btnUploadData = FindViewById<Button>(Resource.Id.BtnUploadData);
            _btnClear = FindViewById<Button>(Resource.Id.BtnClear);
            _btnUrlSave = FindViewById<Button>(Resource.Id.BtnUrlSave);
            _btnChangePassword = FindViewById<Button>(Resource.Id.BtnChangePassword);
            _btnLog = FindViewById<Button>(Resource.Id.BtnLog);
            _edUrl = FindViewById<EditText>(Resource.Id.edUrl);
            _tvAndroidID = FindViewById<TextView>(Resource.Id.tvAndroidID);

            // Spinner for the main color of the app
            // Set the main colors
            _colors = new List<int>();
            _colors.Add(Android.Resource.Color.HoloOrangeDark);
            _colors.Add(Android.Resource.Color.HoloBlueDark);
            _colors.Add(Android.Resource.Color.DarkerGray);
            _colors.Add(Android.Resource.Color.HoloGreenDark);
            _colors.Add(Android.Resource.Color.HoloRedDark);

            // Initialze the color spinner
            _spinnerMainColor = FindViewById<Spinner>(Resource.Id.spinnerMainColor);
            MainColorViewAdapter _adapter = new MainColorViewAdapter (this,_colors);
            _spinnerMainColor.SetBackgroundColor( Resources.GetColor(DataAccessLayer.Utilities.MainColor));
            _spinnerMainColor.SetBackgroundResource(DataAccessLayer.Utilities.MainColor);
            _spinnerMainColor.Adapter = _adapter;

            // Initialize the LoginSaveOption Spinner
            _spinnerLoginSaveOption = FindViewById<Spinner>(Resource.Id.spinnerLoginSaveOption);
            LoginSaveOptionViewAdapter _LSO_adapter = new LoginSaveOptionViewAdapter(this);



            _spinnerLoginSaveOption.Adapter = _LSO_adapter;

            // Set the right selected item for the spinnerMainColor
            switch (DataAccessLayer.Utilities.MainColor)
            {
                case Android.Resource.Color.HoloOrangeDark:
                    _spinnerMainColor.SetSelection(0);
                    break;
                case Android.Resource.Color.HoloBlueDark:
                    _spinnerMainColor.SetSelection(1);
                    break;
                case Android.Resource.Color.DarkerGray:
                    _spinnerMainColor.SetSelection(2);
                    break;
                case Android.Resource.Color.HoloGreenDark:
                    _spinnerMainColor.SetSelection(3);
                    break;
                case Android.Resource.Color.HoloRedDark:
                    _spinnerMainColor.SetSelection(4);
                    break;
                default:
                    _spinnerMainColor.SetSelection(0);
                    break;
            }

            // Set the right selected item for the spinnerLoginSaveOption
            _spinnerLoginSaveOption.SetSelection(Convert.ToInt32( BusinessLayer.User.GetLoginSaveOption()));

            // Set the status of the button 
            if (UI.MainActivity.User.NetworkStatus == DataAccessLayer.NetworkState.Disconnected) 
                _OfflineSwitch.Checked = false;
            else
                _OfflineSwitch.Checked = true;

            // Enable or disable the Button to sync offline data
            offlineTasks =  BusinessLayer.Task.HasNewOfflineTasks();
            if (offlineTasks != 0 &&MainActivity.User.NetworkStatus  != DataAccessLayer.NetworkState.Disconnected)
                _btnUploadData.Enabled = true;
            else
                _btnUploadData.Enabled = false;

            // If the app is offline, the switch control must be disabled
            if (UI.MainActivity._networkstate == DataAccessLayer.NetworkState.Disconnected)
                _OfflineSwitch.Enabled = false;
            else
                _OfflineSwitch.Enabled = true;

            // Set the current URL
            _edUrl.Text = DataAccessLayer.Utilities.ServerIP;

            // set the android ID
            _tvAndroidID.Text = Android.Provider.Settings.Secure.GetString(this.ContentResolver,
                Android.Provider.Settings.Secure.AndroidId); 
            
            // Set the event handler of the controls 
            SetControlEvents(true);

        }
示例#7
0
        protected override void OnCreate (Bundle bundle)
        {
            base.OnCreate (bundle);



            
            // Set the main flag of the activity
            isRunning = true;

            // First initialize and then set the ServerIP
            DataAccessLayer.SQLiteUtilities.Initialize ();
            DataAccessLayer.Utilities.ServerIP = BusinessLayer.User.GetURL();
            DataAccessLayer.Utilities.MainColor = BusinessLayer.User.GetColor();

            //DataAccessLayer.Utilities.ServerIP = "92.79.164.242";

            // Set the layout
            SetContentView(Resource.Layout.ActivityAuthentication);


            networkStatus = GetNetworkStatus ();

            // The SQLite Utility will be initialized
            // -> Open Connection -> Create Database -> Create Security and Object tables
            //DataAccessLayer.SQLiteUtilities.Initialize ();

            EdName = FindViewById<EditText> (Resource.Id.EdName);
            EdPassword = FindViewById<EditText> (Resource.Id.EdPassword);
            EdMandant = FindViewById<EditText> (Resource.Id.EdMandant);
            EdUrl = FindViewById<EditText>(Resource.Id.EdLoginUrl);
            TxtResult = FindViewById<TextView> (Resource.Id.txtResult);
            LyDummy = FindViewById<LinearLayout> (Resource.Id.LayoutDummy);
            CbOffline = FindViewById<CheckBox>(Resource.Id.cbOffline);

            // RELEASE CHANGE: delete these three lines
            // Get the LoginSaveOption to determine which of the controls should be filled
            string loginSaveOption = BusinessLayer.User.GetLoginSaveOption();
            if (loginSaveOption == "0")
            {
                // Don't show anything
                EdName.Text = "";
                EdPassword.Text = "";
                EdMandant.Text = "";
            }
            else if(loginSaveOption == "1")
            {
                // Just show the Name and Mandant
                // Get the last logged-in User
                BusinessLayer.User user = BusinessLayer.User.GetLastOnlineLoggedUser();
                EdName.Text = user.Name;
                EdMandant.Text = user.Mandant;
            }
            else
            {
                // Show Name, Mandant and passord
                BusinessLayer.User user = BusinessLayer.User.GetLastOnlineLoggedUser();
                EdName.Text = user.Name;
                EdMandant.Text = user.Mandant;
                EdPassword.Text = user.Password;

            }


            //            EdName.Text = "MB7";
            //            EdPassword.Text = "100";
            //            EdMandant.Text = "100";
            EdUrl.Text = DataAccessLayer.Utilities.ServerIP;
            EdUrl.Visibility = ViewStates.Gone;

            // Show the CheckboxOffline if you have network connectability
            // And check it
            if (networkStatus == DataAccessLayer.NetworkState.Disconnected)
            {
                CbOffline.Visibility = ViewStates.Visible;
                CbOffline.Checked = true;
            }
            else
                CbOffline.Visibility = ViewStates.Gone;

            // Handle dismiss button click
            BtnCancel = FindViewById<Button>(Resource.Id.BtnCancel);
            BtnCancel.Click += BtnCancel_Click;

            BtnOk = FindViewById<Button> (Resource.Id.BtnOk);
            BtnOk.Click += BtnOk_Click;

            BtnSetting = FindViewById<Button>(Resource.Id.BtnSetting);
            BtnSetting.Click += BtnSetting_Click;
            //Process.KillProcess (Process.MyPid ());



        }
示例#8
0
		protected override void OnCreate(Bundle savedInstanceState)
		{
			// Set the main flag for the activity, so that the blank Launcher knows this activity is running
			isRunning = true;

            progress_handler = new ProgressHandler (this);

			// Create the broadcast receiver and bind the event handler
			// so that the app gets updates of the network connectivity status
			_networkmonitor = new NetworkStatusMonitor (this);
			if (_broadcastReceiver == null)
			{
				// Set the ActivityController to 0 -> That has the effect that the sound won't be raised
				// This is just the first time when the activity starts, after that this counter increments
				// And doesn't prevent the sound
				NetworkStatusMonitor.ActivityController = 0;
				_broadcastReceiver = new NetworkStatusBroadcastReceiver ();
				_broadcastReceiver.ConnectionStatusChanged += _networkmonitor.OnNetworkStatusChanged;

				// Register the broadcast receiver
				Application.Context.RegisterReceiver (_broadcastReceiver, 
					new IntentFilter (ConnectivityManager.ConnectivityAction));

			}

			// Keep the ActivityController to 0 because we want to call the UpdateNetworkStatus on our own
			// And the sound shouldn't be raised
			UI.MainActivity._networkstate = _networkmonitor.GetNetworkStatus();


			base.OnCreate(savedInstanceState);

			// The SQLite Utility will be initialized
			// -> Open Connection -> Create Database -> Create Security and Object tables
			//DataAccessLayer.SQLiteUtilities.Initialize ();

			// Set the classname which is by default Kunden
			_className = "Kunden";

			// Set the layout
			SetContentView(Resource.Layout.ActivityMain);

            // First run the UtilityClasses
            BusinessLayer.UtilityClasses.FillUtilityClasses(BaseContext.Resources.Configuration.Locale.Language.ToUpper(), _user);

			// Run our lovely fragment which is by default the FrgGeneral
            fragment = new PersonGeneralFragment(Resource.Layout.FrgPersonGeneral,this,null);
			FragmentManager
				.BeginTransaction()
				.Replace(Resource.Id.frameContent, fragment)
				.Commit();

			// Initialize the controls
			_list = FindViewById<ListView>(Resource.Id.left_pane);
			_btnSearch = FindViewById<ImageButton> (Resource.Id.btnSearch);
			_btnNew = FindViewById<ImageButton> (Resource.Id.btnNew);
			_btnEdit = FindViewById<ImageButton> (Resource.Id.btnEdit);
			_btnSave = FindViewById<ImageButton> (Resource.Id.btnSave);
			_btnDelete = FindViewById<ImageButton> (Resource.Id.btnDelete);
			_leftLayout = FindViewById<LinearLayout> (Resource.Id.leftLayout);
			_btnOffline = FindViewById<ImageButton> (Resource.Id.btnOffline);
			_btnUebersicht = FindViewById<Button> (Resource.Id.btnUebersicht);
			_btnCharts = FindViewById<Button> (Resource.Id.btnCharts);
            _btnTasks = FindViewById<Button> (Resource.Id.btnTasks);
            _btnAngebot = FindViewById<Button> (Resource.Id.btnAngebot);
            _btnAuftrag = FindViewById<Button> (Resource.Id.btnAuftrag);
            _tvTelefon = FindViewById<TextView>(Resource.Id.tvTelefon);
            _ImageViewRecord = FindViewById<ImageView>(Resource.Id.ImageViewRecord);


			_btnAnsprechpartner = FindViewById<Button> (Resource.Id.btnAnsprechpartner);
			_btnMap = FindViewById<Button> (Resource.Id.btnMap);
			_edSearch = FindViewById<EditText> (Resource.Id.edSearch);

			// Set the Buttons
			// Disable the New - Edit - Save - Delete Button
			_btnNew.Enabled 		= false;
			_btnEdit.Enabled 		= false;
			_btnSave.Enabled 		= false;
			_btnDelete.Enabled 		= false;

			_btnOffline.Enabled = false;


			// Set the eventhandlers of the controls:
			// Buttons + listview
			_list.ItemClick += (sender, args) =>
			{
				ListItemClickAsync (args);
			};

            // Eventhandler for the Search button on the keyboard
            _edSearch.EditorAction += (object sender, TextView.EditorActionEventArgs e) => 
                {
                    if (e.ActionId == Android.Views.InputMethods.ImeAction.Search)
                    {
                        BtnSearchAsync();
                    }

                };

			_btnSearch.Click += (sender, e) => 
			{
				BtnSearchAsync ();
			};

			_btnNew.Click += (sender, e) => 
			{
				BtnNewClick ();
			};

			_btnEdit.Click += (sender, e) => 
			{
				BtnEditClick ();
			};

			// BtnSave Event must be handled here 
			_btnSave.Click += (sender, e) => 
			{
				BtnSaveClickAsync ();
			};

			_btnDelete.Click += (sender, e) => 
			{
				BtnDeleteClick ();
			};

			_btnUebersicht.Click += (sender, e) => 
			{
				BtnUebersichtClick ();
			};

			_btnMap.Click += (sender, e) => 
			{
				BtnMapClickAsync ();
			};

			
			_btnAnsprechpartner.Click += (sender, e) => 
			{
				BtnAnsprechpartnerClickAsync();
			};

			_btnTasks.Click += (sender, e) => {
				BtnTasksClickAsync ();
			};

            _btnAngebot.Click += (sender, e) => {

                BtnAngebotClickAsync();
            };

            _btnAuftrag.Click += (sender, e) => {

                BtnAuftragClickAsync();
            };

			_btnCharts.Click += (sender, e) => {
				BtnChartsClick();
			};

			_btnOffline.Click += (sender, e) => {

                BtnOfflineClickAsync();

			};

            // set the main tabbar according to the permissions
            this.setMainTabbar();

            // Hide the keyboard except the user clickes on it
            Console.WriteLine("Window.SetSoftInputMode (SoftInput.StateAlwaysHidden); Hide keyboard");
            Window.SetSoftInputMode (SoftInput.StateAlwaysHidden);

            // Set the MainColor 
            FindViewById<TableLayout>(Resource.Id.AM_ColoredTableLayout).SetBackgroundResource(DataAccessLayer.Utilities.MainColor);

		}