Пример #1
0
        private void DeleteLogFileButton_Click(object sender, EventArgs args)
        {
            FragmentTransaction ft = FragmentManager.BeginTransaction();

            CSIMessageDialog DeleteLogFileDialog = (CSIMessageDialog)FragmentManager.FindFragmentByTag("DeleteLogFileDialog");

            if (DeleteLogFileDialog != null)
            {
                ft.Show(DeleteLogFileDialog);
            }
            else
            {
                DeleteLogFileDialog            = new CSIMessageDialog(GetString(Resource.String.app_name), GetString(Resource.String.DeleteLogFile), DialogTypes.OKCancel);
                DeleteLogFileDialog.OkHandler += (o, e) =>
                {
                    CSIErrorLog.DeleteErrorLogFile();
                    LogEdit.Text = CSIErrorLog.ReadLog();
                };
                DeleteLogFileDialog.Show(ft, "DeleteLogFileDialog");
            }
        }
Пример #2
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            try
            {
                base.OnCreateView(inflater, container, savedInstanceState);

                var view = inflater.Inflate(Resource.Layout.CSILog, container, false);

                LogEdit             = view.FindViewById <EditText>(Resource.Id.LogEdit);
                DeleteLogFileButton = view.FindViewById <Button>(Resource.Id.DeleteLogFileButton);
                PrintLogFileButton  = view.FindViewById <Button>(Resource.Id.PrintLogFileButton);

                LogEdit.Text = CSIErrorLog.ReadLog();

                DeleteLogFileButton.Click += DeleteLogFileButton_Click;
                PrintLogFileButton.Click  += PrintLogFileButton_Click;;

                return(view);
            }catch (Exception Ex)
            {
                WriteErrorLog(Ex);
                return(null);
            }
        }