Beispiel #1
0
        public AppCenterContentPage()
        {
            InitializeComponent();

            LogFunctions = new Dictionary <LogLevel, Action <string, string> >();
            LogFunctions.Add(LogLevel.Verbose, AppCenterLog.Verbose);
            LogFunctions.Add(LogLevel.Debug, AppCenterLog.Debug);
            LogFunctions.Add(LogLevel.Info, AppCenterLog.Info);
            LogFunctions.Add(LogLevel.Warn, AppCenterLog.Warn);
            LogFunctions.Add(LogLevel.Error, AppCenterLog.Error);

            LogLevelNames = new Dictionary <LogLevel, string>();
            LogLevelNames.Add(LogLevel.Verbose, Constants.Verbose);
            LogLevelNames.Add(LogLevel.Debug, Constants.Debug);
            LogLevelNames.Add(LogLevel.Info, Constants.Info);
            LogLevelNames.Add(LogLevel.Warn, Constants.Warning);
            LogLevelNames.Add(LogLevel.Error, Constants.Error);

            LogWriteLevel = LogLevel.Verbose;
            UpdateLogWriteLevelLabel();


            if (Xamarin.Forms.Device.RuntimePlatform == Xamarin.Forms.Device.iOS)
            {
                Icon = "bolt.png";
            }

            // Setup start type dropdown choices
            foreach (var startType in StartTypeUtils.GetStartTypeChoiceStrings())
            {
                this.StartTypePicker.Items.Add(startType);
            }
            this.StartTypePicker.SelectedIndex = (int)(StartTypeUtils.GetPersistedStartType());
        }
Beispiel #2
0
        public AppCenterContentPage()
        {
            InitializeComponent();
            if (Xamarin.Forms.Device.RuntimePlatform == Xamarin.Forms.Device.iOS)
            {
                Icon = "bolt.png";
            }

            // Setup start type dropdown choices.
            foreach (var startType in StartTypeUtils.GetStartTypeChoiceStrings())
            {
                this.StartTypePicker.Items.Add(startType);
            }
            this.StartTypePicker.SelectedIndex = (int)(StartTypeUtils.GetPersistedStartType());
        }
Beispiel #3
0
        private string GetTokensString()
        {
            var persistedStartType = StartTypeUtils.GetPersistedStartType();

            switch (persistedStartType)
            {
            case StartType.OneCollector:
                return(GetOneCollectorTokenString());

            case StartType.Both:
                return($"{GetAppCenterTokenString()};{GetOneCollectorTokenString()}");

            default:
                return(GetAppCenterTokenString());
            }
        }
Beispiel #4
0
 async void ChangeStartType(object sender, PropertyChangedEventArgs e)
 {
     // IOS sends an event every time user rests their selection on an item without hitting "done", and the only event they send when hitting "done" is that the control is no longer focused.
     // So we'll process the change at that time. This works for android as well.
     if (e.PropertyName == "IsFocused" && !this.StartTypePicker.IsFocused)
     {
         var newSelectionCandidate = this.StartTypePicker.SelectedIndex;
         var persistedStartType    = StartTypeUtils.GetPersistedStartType();
         if (newSelectionCandidate != (int)persistedStartType)
         {
             StartTypeUtils.SetPersistedStartType((StartType)newSelectionCandidate);
             await Application.Current.SavePropertiesAsync();
             await DisplayAlert("Start Type Changed", "Start type has changed, which alters the app secret. Please close and re-run the app for the new app secret to take effect.", "OK");
         }
     }
 }