예제 #1
0
        public SettingsManagePort(CommandAddActivity command_add_activity, AppCompatSpinner controllers, AppCompatSpinner ports, AppCompatSpinner states)
        {
            Log.Debug(TAG, "~ constructor");

            command_add_activity.HardwaresListSpinnerLoad(ref controllers);
            ParentActivity = command_add_activity;

            Controllers = controllers;
            Ports       = ports;
            States      = states;

            string[]     script_trigger_port_states_array = ParentActivity.Resources.GetStringArray(Resource.Array.script_trigger_port_states_array);
            ArrayAdapter adapterPortStatuses = new ArrayAdapter <string>(ParentActivity, Android.Resource.Layout.SimpleSpinnerItem, script_trigger_port_states_array);

            adapterPortStatuses.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
            States.Adapter = adapterPortStatuses;

            if (Command != null)
            {
                if (Command.ExecutionParametr == "true")
                {
                    States.SetSelection(Array.IndexOf(script_trigger_port_states_array, ParentActivity.GetString(Resource.String.abc_capital_on)));
                }
                else if (Command.ExecutionParametr == "false")
                {
                    States.SetSelection(Array.IndexOf(script_trigger_port_states_array, ParentActivity.GetString(Resource.String.abc_capital_off)));
                }
                else
                {
                    States.SetSelection(Array.IndexOf(script_trigger_port_states_array, ParentActivity.GetString(Resource.String.abc_capital_switch)));
                }
            }

            OnResume();
        }
        public SettingsManageController(CommandAddActivity command_add_activity, AppCompatSpinner controllers, EditText commandText)
        {
            Log.Debug(TAG, "~ constructor");

            command_add_activity.HardwaresListSpinnerLoad(ref controllers);
            ParentActivity = command_add_activity;

            Controllers = controllers;
            CommandText = commandText;

            if (Command != null)
            {
                CommandText.Text = Command.ExecutionParametr;
            }

            OnResume();
        }