/// <summary>
        /// Initializes the Splunk MINT plugin with additions for Xamarin.
        /// </summary>
        /// <param name="apiKey">Your Splunk MINT API key.</param>
        public void InitAndStartXamarinSession(string apiKey)
        {
            XamarinHelper.XamarinVersion("4.0.1");
            XamarinHelper.XamarinArchitecture("armv7s");

            TaskScheduler.UnobservedTaskException       += UnobservedTaskExceptionsHandler;
            AsyncSynchronizationContext.ExceptionCaught += SyncContextExceptionHandler;
            AsyncSynchronizationContext.Register();

            if (Debugger.IsAttached)
            {
                DisableCrashReporter();
            }

            IntPtr sigbus  = Marshal.AllocHGlobal(512);
            IntPtr sigsegv = Marshal.AllocHGlobal(512);

            // Store Mono SIGSEGV and SIGBUS handlers
            sigaction(Signal.SIGBUS, IntPtr.Zero, sigbus);
            sigaction(Signal.SIGSEGV, IntPtr.Zero, sigsegv);

            InitAndStartSession(apiKey);

            // Restore Mono SIGSEGV and SIGBUS handlers
            sigaction(Signal.SIGBUS, sigbus, IntPtr.Zero);
            sigaction(Signal.SIGSEGV, sigsegv, IntPtr.Zero);

            Marshal.FreeHGlobal(sigbus);
            Marshal.FreeHGlobal(sigsegv);
        }
Пример #2
0
        private void Stop()
        {
            // Stop command
            if (XamarinHelper.CanExecuteCommand(StopCommand))
            {
                StopCommand.Execute(null);
            }

            submitButton.Text = StartText;

            IsStarted = false;
        }
Пример #3
0
        private void Start()
        {
            // Start command
            if (_time.Minute == 0 && _time.Hour == 0)
            {
                _time = _time.AddMinutes(Step);
            }

            if (XamarinHelper.CanExecuteCommand(StartCommand, _time))
            {
                StartCommand.Execute(_time);
            }

            submitButton.Text = StopText;

            IsStarted = true;
        }
Пример #4
0
        protected override void OnPropertyChanged(string propertyName = null)
        {
            base.OnPropertyChanged(propertyName);

            // MaxBoost
            if (propertyName == MaxBoostProperty.PropertyName)
            {
                slider.Maximum = MaxBoost;
            }
            // MinBoost

            if (propertyName == MinBoostProperty.PropertyName)
            {
                slider.Minimum = MinBoost;
            }

            // Primary color
            if (propertyName == PrimaryColorProperty.PropertyName)
            {
                _barPaint = new SKPaint
                {
                    Style       = SKPaintStyle.Fill,
                    Color       = SKColor.Parse(XamarinHelper.GetHexString(PrimaryColor)),
                    IsAntialias = true,
                };

                indicatorValueContainer.BackgroundColor = PrimaryColor;

                UpdateBoostRelaxColors();
            }

            // Value
            if (propertyName == CurrentValueProperty.PropertyName)
            {
                slider.Value = CurrentValue;

                UpdateCurrentIndicator();
                UpdateBoostRelaxColors();
            }

            // Scale
            if (propertyName == ScaleProperty.PropertyName)
            {
                //
            }

            // Scale lines
            if (propertyName == ScaleLinesProperty.PropertyName)
            {
                // Render scale lines
                if (ScaleLines > 0)
                {
                    for (int i = 0; i < ScaleLines; i++)
                    {
                        scale.Children.Add(new BoxView
                        {
                            HeightRequest     = 2,
                            HorizontalOptions = LayoutOptions.FillAndExpand,
                            BackgroundColor   = Color.FromHex(_lightColor)
                        });
                    }
                }
            }

            // Is enabled
            if (propertyName == IsEnabledProperty.PropertyName)
            {
                if (!IsEnabled)
                {
                    UpdateTextValuesColor();
                }
            }
        }