void OnConnectionModeChanged(object sender, EventArgs e) { var picker = (Picker)sender; int selectedIndex = picker.SelectedIndex; if (selectedIndex != -1) { int comoswebsdk_mode = selectedIndex; ComosWebSDK.IComosWeb comosweb = Services.XServices.Instance.GetService <ComosWebSDK.IComosWeb>(); var db = Services.XServices.Instance.GetService <Services.IDatabase>(); switch (comoswebsdk_mode) { case 0: // Offline only if (comosweb is Services.ComosWebOffline) { return; // Nothing tod, is already in this mode. } Services.XServices.Instance.RemoveService <ComosWebSDK.IComosWeb>(); Services.XServices.Instance.AddService <ComosWebSDK.IComosWeb>( new Services.ComosWebOffline(db, comosweb.ComosWeb.URL)); break; case 1: // Online only if (comosweb is ComosWebSDK.ComosWeb) { return; // Nothing tod, is already in this mode. } Services.XServices.Instance.RemoveService <ComosWebSDK.IComosWeb>(); Services.XServices.Instance.AddService <ComosWebSDK.IComosWeb>( comosweb.ComosWeb); break; case 2: //Online first if (comosweb is Services.ComosWebOnlineFirst) { return; // Nothing tod, is already in this mode. } Services.XServices.Instance.RemoveService <ComosWebSDK.IComosWeb>(); Services.XServices.Instance.AddService <ComosWebSDK.IComosWeb>( new Services.ComosWebOnlineFirst(comosweb.ComosWeb)); break; case 3: // Offline first if (comosweb is Services.ComosWebOfflineFirst) { return; // Nothing tod, is already in this mode. } Services.XServices.Instance.RemoveService <ComosWebSDK.IComosWeb>(); Services.XServices.Instance.AddService <ComosWebSDK.IComosWeb>( new Services.ComosWebOfflineFirst(comosweb.ComosWeb)); break; default: break; } } }
public PageMenu(ComosWebSDK.IComosWeb web) { InitializeComponent(); this.BindingContext = this; this.web = web; //foreach(var item in Enum.GetNames(typeof(Theming.Themes))) // PickerThemes.Items.Add(item); this.VersionNumber.Text = "V" + Services.XServices.Instance.GetService <Services.IPlatformSystem>().AppVersionName; }
public PageSolutions(ComosWebSDK.IComosWeb web) { InitializeComponent(); this.ShowHamburger = false; this.ShowProjectInfo = true; this.web = web; new CheckAndDownloadAditionalContent(); this.TileWidth = (int)((App.WidthPixels / 2.0f) - 20.0f / App.PixelDensity); this.TileHeight = this.TileWidth; this.BindingContext = this; }