コード例 #1
0
ファイル: Program.cs プロジェクト: XyrohTest/XyrohLib
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");

            AppDomain.CurrentDomain.UnhandledException += UnhandledExceptionHandler;

            //XyrohLib.Test();

            XyrohLib.setFileLog("test.log");
            //XyrohLib.setFileLog("test.log", 5000);
            //XyrohLib.setCrashreporter("https://*****:*****@sentry.io/292140");
            //XyrohLib.Test();
            //XyrohLib.Log("test log 10 ");

            //XyrohLib.setAnalytics("13e9d1b9-7bae-4e4d-b20c-b8e5e7779d58", "917eea77-d8c0-4fc2-a2dd-940da5e8dd87");

            for (int i = 0; i < 100; i++)
            {
                XyrohLib.LogEvent("Test Analytics Event" + i);
            }

            Console.WriteLine("File Path: " + XyrohLib.GetLogPath());

            //throw new Exception("KaBlam2");


            //logger.Log("test from console");
        }
コード例 #2
0
        private async void OnSendTicketButtonClicked(object sender, EventArgs e)
        {
            try
            {
                if (string.IsNullOrEmpty(this.TicketEmail.Text) || string.IsNullOrEmpty(this.TicketSubject.Text) || string.IsNullOrEmpty(this.TicketDescription.Text))
                {
                    await this.DisplayAlert("Oops", "Please ensure all fields are completed", "OK");
                }
                else
                {
                    XyrohLib.LogEvent("Support Page : Send Ticket");

                    this.SendButton.IsEnabled = false;

                    // get log and db
                    var attachments = new List <string>();
                    attachments.Add(XyrohLib.GetLogPath());

                    // screencap?
                    if (File.Exists(this.captureImagePath))
                    {
                        XyrohLib.Log("Attaching: " + this.captureImagePath);
                        attachments.Add(this.captureImagePath);
                    }

                    var ticketId = await XyrohLib.CreateTicketWithAttachment(this.TicketEmail.Text, this.TicketSubject.Text, this.TicketDescription.Text, new string[] { "urlshortener", "worst", "mobile", "xyrohlib" }, attachments);

                    if (ticketId > 0)
                    {
                        await this.DisplayAlert("Ticket Created", "Ticket Ref: " + ticketId.ToString() + " Successfully Created", "OK");

                        await this.Navigation.PopAsync();
                    }
                    else
                    {
                        throw new Exception("Couldn't create Ticket - Please try again");
                    }
                }
            }
            catch (Exception ex)
            {
                XyrohLib.LogCrash(ex);

                await this.DisplayAlert("Error", "Error: " + ex.Message, "OK");

                this.SendButton.IsEnabled = true;
            }
        }