コード例 #1
0
        public static SerialGenerator RunFragment(CSIBaseDialogFragment BaseDialogFragment)
        {
            try
            {
                FragmentTransaction ft = BaseDialogFragment.FragmentManager.BeginTransaction();

                SerialGenerator SerialGeneratorDialog = (SerialGenerator)BaseDialogFragment.FragmentManager.FindFragmentByTag("SerialGenerator");
                if (SerialGeneratorDialog != null)
                {
                    ft.Show(SerialGeneratorDialog);
                    //ft.AddToBackStack(null);
                }
                else
                {
                    // Create and show the dialog.
                    SerialGeneratorDialog = new SerialGenerator(BaseDialogFragment.GetBaseActivity())
                    {
                        ParentFragment = BaseDialogFragment
                    };
                    //Add fragment
                    SerialGeneratorDialog.Show(ft, "SerialGenerator");
                }
                return(SerialGeneratorDialog);
            }
            catch (Exception Ex)
            {
                CSIErrorLog.WriteErrorLog(Ex);
                return(null);
            }
        }
コード例 #2
0
        public static void RunFragment(CSIBaseActivity activity)
        {
            try
            {
                FragmentTransaction ft = activity.FragmentManager.BeginTransaction();

                DCJobRunFragment JobDialog = (DCJobRunFragment)activity.FragmentManager.FindFragmentByTag("JobReceipt");
                if (JobDialog != null)
                {
                    ft.Show(JobDialog);
                    //ft.AddToBackStack(null);
                }
                else
                {
                    // Create and show the dialog.
                    JobDialog = new DCJobRunFragment(activity);
                    //Add fragment
                    JobDialog.Show(ft, "JobReceipt");
                }
            }
            catch (Exception Ex)
            {
                CSIErrorLog.WriteErrorLog(Ex);
            }
        }
コード例 #3
0
        public static void RunFragment(CSIBaseActivity activity)
        {
            try
            {
                FragmentTransaction ft = activity.FragmentManager.BeginTransaction();

                ItemListFragment ItemListFragmentDialog = (ItemListFragment)activity.FragmentManager.FindFragmentByTag("Items");
                if (ItemListFragmentDialog != null)
                {
                    ft.Show(ItemListFragmentDialog);
                    //ft.AddToBackStack(null);
                }
                else
                {
                    // Create and show the dialog.
                    ItemListFragmentDialog = new ItemListFragment(activity);
                    //Add fragment
                    ItemListFragmentDialog.Show(ft, "Items");
                }
            }
            catch (Exception Ex)
            {
                CSIErrorLog.WriteErrorLog(Ex);
            }
        }
コード例 #4
0
 // Launches the startup task
 protected override void OnResume()
 {
     try
     {
         base.OnResume();
         Task startupWork = new Task(() => { SimulateStartup(); });
         startupWork.Start();
     }catch (Exception Ex)
     {
         CSIErrorLog.WriteErrorLog(Ex);
     }
 }
コード例 #5
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");
            }
        }
コード例 #6
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);
            }
        }
コード例 #7
0
 private void PrintLogFileButton_Click(object sender, EventArgs e)
 {
     CSIErrorLog.PrintLog(this.BaseActivity);
 }