Пример #1
0
        private void SettingsLogButton_Click(object sender, EventArgs e)
        {
            bool LOG_SETTINGS_FORM_VISIBLE = SettingsLogViewForm == null;

            Preferences.Set(Constants.LOG_SETTINGS_FORM_VISIBLE, LOG_SETTINGS_FORM_VISIBLE);
            //
            if (LOG_SETTINGS_FORM_VISIBLE)
            {
                SettingsLogViewForm = LayoutInflater.Inflate(Resource.Layout.FormSettingsLogView, SettingsLogViewArea, false) as LinearLayoutCompat;
                //
                checkBoxTracView                = SettingsLogViewForm.FindViewById <AppCompatCheckBox>(Resource.Id.checkBoxTracView);
                checkBoxTracView.Checked        = Preferences.Get(Resources.GetResourceEntryName(checkBoxTracView.Id), true);
                checkBoxTracView.CheckedChange += CheckBoxTracView_CheckedChange;

                checkBoxInfoView                = SettingsLogViewForm.FindViewById <AppCompatCheckBox>(Resource.Id.checkBoxInfoView);
                checkBoxInfoView.Checked        = Preferences.Get(Resources.GetResourceEntryName(checkBoxInfoView.Id), true);
                checkBoxInfoView.CheckedChange += CheckBoxTracView_CheckedChange;

                checkBoxWarnView                = SettingsLogViewForm.FindViewById <AppCompatCheckBox>(Resource.Id.checkBoxWarnView);
                checkBoxWarnView.Checked        = Preferences.Get(Resources.GetResourceEntryName(checkBoxWarnView.Id), true);
                checkBoxWarnView.CheckedChange += CheckBoxTracView_CheckedChange;

                checkBoxErrView                = SettingsLogViewForm.FindViewById <AppCompatCheckBox>(Resource.Id.checkBoxErrView);
                checkBoxErrView.Checked        = Preferences.Get(Resources.GetResourceEntryName(checkBoxErrView.Id), true);
                checkBoxErrView.CheckedChange += CheckBoxTracView_CheckedChange;
                //
                SettingsLogViewArea.AddView(SettingsLogViewForm);
            }
            else
            {
                checkBoxTracView.CheckedChange -= CheckBoxTracView_CheckedChange;
                checkBoxInfoView.CheckedChange -= CheckBoxTracView_CheckedChange;
                checkBoxWarnView.CheckedChange -= CheckBoxTracView_CheckedChange;
                checkBoxErrView.CheckedChange  -= CheckBoxTracView_CheckedChange;
                //
                checkBoxTracView = null;
                checkBoxInfoView = null;
                checkBoxWarnView = null;
                checkBoxErrView  = null;
                //
                SettingsLogViewArea.RemoveAllViews();
                SettingsLogViewForm = null;
            }
        }
Пример #2
0
        protected void TypesCommand_ItemSelected(object sender, AdapterView.ItemSelectedEventArgs e)
        {
            //command_executer_id = -1;
            //command_executer_parameter = null;
            int Position = TypesCommand.SelectedItemPosition;

            selected_type_command_name = Resources.GetStringArray(Resource.Array.commands_types_array)[Position];

            string command_type_array_item_port       = GetString(Resource.String.command_type_array_item_port);
            string command_type_array_item_controller = GetString(Resource.String.command_type_array_item_controller);
            string command_type_array_item_transfer   = GetString(Resource.String.command_type_array_item_transit);

            //if (AbstractSettingsManage.Command != null)
            //{
            //    switch (AbstractSettingsManage.Command.TypeCommand)
            //    {
            //        case TypesCommands.Port:
            //            command_type_array_item_port = GetString(Resource.String.command_type_array_item_port);
            //            if (selected_type_command_name != command_type_array_item_port)
            //            {
            //                return;
            //            }
            //            break;
            //        case TypesCommands.Controller:
            //            if (selected_type_command_name != command_type_array_item_controller)
            //            {
            //                return;
            //            }
            //            break;
            //        case TypesCommands.Exit:
            //            if (selected_type_command_name != command_type_array_item_transfer)
            //            {
            //                return;
            //            }
            //            break;
            //    }
            //}

            Log.Debug(TAG, $"TypesCommand_ItemSelected({selected_type_command_name}) - Position:{Position}");
            CommandConfigForm.RemoveAllViews();

            if (selected_type_command_name == command_type_array_item_port)
            {
                SelectedTypeCommand         = TypesCommands.Port;
                about_selected_command.Text = GetString(Resource.String.about_selected_command_port_title);

                CommandConfigFormBody = LayoutInflater.Inflate(Resource.Layout.FormPortCommand, CommandConfigForm, false) as LinearLayoutCompat;

                AppCompatSpinner Controllers = CommandConfigFormBody.FindViewById <AppCompatSpinner>(Resource.Id.spinnerControllerPortCommand);
                AppCompatSpinner Ports       = CommandConfigFormBody.FindViewById <AppCompatSpinner>(Resource.Id.spinnerPortCommand);
                AppCompatSpinner States      = CommandConfigFormBody.FindViewById <AppCompatSpinner>(Resource.Id.spinnerStateCommand);

                SettingsManageKit = new SettingsManagePort(this, Controllers, Ports, States);
            }
            else if (selected_type_command_name == command_type_array_item_controller)
            {
                SelectedTypeCommand         = TypesCommands.Controller;
                about_selected_command.Text = GetString(Resource.String.about_selected_command_controller_title);

                CommandConfigFormBody = LayoutInflater.Inflate(Resource.Layout.FormControllerCommand, CommandConfigForm, false) as LinearLayoutCompat;

                AppCompatSpinner Controllers = CommandConfigFormBody.FindViewById <AppCompatSpinner>(Resource.Id.spinnerControllerCommand);
                EditText         CommandText = CommandConfigFormBody.FindViewById <EditText>(Resource.Id.editTextParametrControllerCommand);

                SettingsManageKit = new SettingsManageController(this, Controllers, CommandText);
            }
            else if (selected_type_command_name == command_type_array_item_transfer)
            {
                SelectedTypeCommand         = TypesCommands.Exit;
                about_selected_command.Text = GetString(Resource.String.about_selected_command_transit_title);

                CommandConfigFormBody = LayoutInflater.Inflate(Resource.Layout.FormTransferCommand, CommandConfigForm, false) as LinearLayoutCompat;

                AppCompatSpinner Scriptes = CommandConfigFormBody.FindViewById <AppCompatSpinner>(Resource.Id.spinnerCommandScript);
                AppCompatSpinner Steps    = CommandConfigFormBody.FindViewById <AppCompatSpinner>(Resource.Id.spinnerCommandStepScript);

                SettingsManageKit = new SettingsManageTransfer(this, Scriptes, Steps);
            }
            else
            {
            }

            CommandConfigForm.AddView(CommandConfigFormBody);
        }