internal void LoadConfiguration() { model = new MobilesModel(); platform = new MobilePlatform(); Mobile defaultMobile = new Mobile("Nokia 3311") { Display = new Display(300, 300) }; defaultMobile.MobileApps.Add(new MessageApp()); defaultMobile.MobileApps.Add(new ContactApp()); defaultMobile.MobileApps.Add(new SettingApp()); defaultMobile.MobileApps.Add(new CallApp()); defaultMobile.MobileApps.Add(new LoggerApp()); defaultMobile.MobileApps.Add(new BrowserApp()); Mobile secondMobile = new Mobile("Nokia 110") { Display = new Display(300, 300), BackgroundColor = Brushes.CadetBlue }; secondMobile.MobileApps.Add(new MessageApp()); secondMobile.MobileApps.Add(new ContactApp()); secondMobile.MobileApps.Add(new SettingApp()); secondMobile.MobileApps.Add(new CallApp()); secondMobile.MobileApps.Add(new LoggerApp()); model.Mobiles.Add(defaultMobile); model.Mobiles.Add(secondMobile); MobileList.ItemsSource = model.Mobiles.Items; }
public async Task Register(MobilePlatform platform, string handle, string registrationId, IEnumerable <string> tags) { var hub = _factory.NotificationHubClient; RegistrationDescription registration = null; switch (platform) { case MobilePlatform.Windows: registration = new WindowsRegistrationDescription(handle); break; case MobilePlatform.Apple: registration = new AppleRegistrationDescription(handle); break; case MobilePlatform.Android: registration = new FcmRegistrationDescription(handle); break; } registration.RegistrationId = registrationId; registration.Tags = new HashSet <string>(tags ?? Enumerable.Empty <string>()); try { await hub.CreateOrUpdateRegistrationAsync(registration); } catch (MessagingException exception) { _logger.LogError(exception, "Unhandled exception was thrown during registration in Azure Notification Hub"); throw; } }
public string SaveToken(string refreshedToken) { MobilePlatform platform = MobilePlatform.gcm; if (Device.RuntimePlatform == Device.Android) { platform = MobilePlatform.gcm; } if (Device.RuntimePlatform == Device.iOS) { platform = MobilePlatform.apns; } var deviceUpdate = new DeviceRegistration() { Handle = refreshedToken, Platform = platform, Tags = new string[1] { refreshedToken }, DeviceId = CrossDeviceInfo.Current.Id }; Device.BeginInvokeOnMainThread(async() => { await plantService.EnablePushNotifications(refreshedToken, deviceUpdate); }); return("refreshedToken"); }
public MobilePlatform FindMobilePlatformByName(string mobilePlatformName) { MobilePlatform f1 = _context.MobilePlatforms.Where(x => x.MobilePlatformName.ToUpper().StartsWith(mobilePlatformName.ToUpper())).FirstOrDefault(); MobilePlatform f2 = (from cf in _context.MobilePlatforms where cf.MobilePlatformName.ToUpper().StartsWith(mobilePlatformName.ToUpper()) select cf).FirstOrDefault(); return(f2); }
private bool TryExtractPlatform(out MobilePlatform platform) { var regex = new Regex("(?<windows>windows)|(?<apple>ipad|iphone|mac os)|(?<android>android)", RegexOptions.IgnoreCase); var match = regex.Match(Request.Headers["User-Agent"].ToString()).Groups.Values .Where(m => m.Success && m.Name.Length > 1) .Select(m => m.Name) .FirstOrDefault(); return(Enum.TryParse(match, out platform)); }
public void Init(MobilePlatform platform) { _bt = GetComponent <BehaviorTree>(); SharedGameObject gameObject = (SharedGameObject)_bt.GetVariable("gameObject"); gameObject.Value = platform.gameObject; _bt.enabled = true; }
private RegistrationDescription BuildPlatformSpecific(MobilePlatform platform, string handle) { switch (platform) { case MobilePlatform.Apns: return(new AppleRegistrationDescription(handle)); case MobilePlatform.Fcm: return(new FcmRegistrationDescription(handle)); default: return(null); } }
void Start() { ID = (uint)defaultID; gearType = "MobilePlatformGear"; platform = gameObject.transform.parent.gameObject.GetComponent<MobilePlatform>(); avatars = new List<Transform>(); //triggleEnable = true; //stateOne = false; isFirstIn = true; AddListeners(); }
void Start() { ID = (uint)defaultID; gearType = "MobilePlatformGear"; platform = gameObject.transform.parent.gameObject.GetComponent <MobilePlatform>(); avatars = new List <Transform>(); //triggleEnable = true; //stateOne = false; isFirstIn = true; AddListeners(); }
private void AllButtonEvent() { transform.FindOnButton("CopyButton", CopyInputFieldText); transform.FindOnButton("PasteButton", PasteInputFieldText); transform.FindOnButton("btnIsOpenGPS", () => { m_txtAll.text = $"是否打开了定位:{MobilePlatform.IsOpenGPS()}"; }); transform.FindOnButton("btnOpenGPS", OpenGPS); transform.FindOnButton("btnOpenImage", GetPhotosImage); transform.FindOnButton("btnOpenUri", OpenUri); transform.FindOnButton("btnOpenCamera", OpenCamera); transform.FindOnButton("btnSetWeChat", () => { MobilePlatform.SetIWXAPI(); }); transform.FindOnButton("btnShowHand", () => { if (!string.IsNullOrEmpty(WeChat.UnionID.headimgurl)) { StartCoroutine(MobilePlatform.SelectPhotos(WeChat.UnionID.headimgurl, null)); } }); transform.FindOnButton("btnLoginWeChat", () => { MobilePlatform.SendReqWXLogin(); }); //transform.FindOnButton("btnLoginWeChat", () => //{ // MobilePlatform.SendReqWXPay(null); //}); transform.FindOnButton("btnShareText", () => { MobilePlatform.SendReqWXShare(new WXShare() { type = (int)WXShareType.ShareText, scene = (int)WXShareScene.分享给好友, title = "测试", description = "发达史蒂芬阿萨德股份阿萨德gas的gbdds", }); }); }
public void AddMobilePlatform(MobilePlatform mp) { _context.MobilePlatforms.Add(mp); }
/// <summary> /// 将拷贝的内容粘贴到Text /// </summary> private void PasteInputFieldText() { m_txtAll.text = MobilePlatform.GetCopyText(); }
/// <summary> /// 拷贝输入框里的内容 /// </summary> private void CopyInputFieldText() { MobilePlatform.SaveCopyText(m_Content.text); }
private void OpenCamera() { MobilePlatform.GetTakePhotos(TempImg, "打开摄像头拍照并返回"); }
private void OpenUri() { MobilePlatform.OpenHttpUri(m_Content.text); }
private void GetPhotosImage() { MobilePlatform.GetPhotosOne(TempImg, "是否选取相册中的一张图片"); }
private void OpenGPS() { MobilePlatform.GotoSettingGPS(null); }