//------------------------------------------------------------------------- public static Push Instant() { if (mPush == null) { mPush = new Push(); } return(mPush); }
public ActionResult TestPushJobToNadia() { Push p = new Push(); Device d = db.devices.First(x => x.id.Equals("86e0e4a5")); string nToken = d.token; p.PushToAndroid(nToken, "job"); return(RedirectToAction("About", "Home")); }
protected override async void ViewIsAppearing(object sender, EventArgs e) { base.ViewIsAppearing(sender, e); NotificationsEnabled = await Push.IsEnabledAsync(); BaseUrl = Helpers.Constants.BaseUrl; ApiManagementKey = Helpers.Constants.ApiManagementKey; }
private async Task SubscribeToPush(bool silent = false) { Uri uri = (await Push.Open()).ChannelUri; if (Endpoint != null) { await WithClient(Endpoint, client => TryEnablePush(client, uri, silent)); } }
private void EvaluateActivationArgs() { // Initially started? if (!Data_Manager2.Classes.Settings.getSettingBoolean(SettingsConsts.INITIALLY_STARTED)) { PerformInitialStartSetup(); ROOT_FRAME.Navigate(typeof(AddAccountPage), typeof(ChatPage)); } else if (ACTIVATION_ARGS is ProtocolActivatedEventArgs protocolActivationArgs) { Logger.Info("App activated by protocol activation with: " + protocolActivationArgs.Uri.ToString()); // If we're currently not on a page, navigate to the main page: ROOT_FRAME.Navigate(typeof(ChatPage), UriUtils.parse(protocolActivationArgs.Uri)); } else if (ACTIVATION_ARGS is ToastNotificationActivatedEventArgs toastActivationArgs) { Logger.Info("App activated by toast with: " + toastActivationArgs.Argument); // If empty args, no specific action (just launch the app): if (string.IsNullOrEmpty(toastActivationArgs.Argument)) { Logger.Warn("Toast activation with no argument!"); if (ROOT_FRAME.Content is null) { ROOT_FRAME.Navigate(typeof(ChatPage)); } else { ROOT_FRAME.Navigate(typeof(ChatPage)); } } else { ROOT_FRAME.Navigate(typeof(ChatPage), ToastActivationArgumentParser.parseArguments(toastActivationArgs.Argument)); } if (ROOT_FRAME.BackStack.Count == 0) { ROOT_FRAME.BackStack.Add(new PageStackEntry(typeof(ChatPage), null, null)); } } else if (ACTIVATION_ARGS is LaunchActivatedEventArgs launchActivationArgs) { Push.CheckLaunchedFromNotification(launchActivationArgs); // If launched with arguments (not a normal primary tile/applist launch) if (launchActivationArgs.Arguments.Length > 0) { Logger.Debug(launchActivationArgs.Arguments); // TODO: Handle arguments for cases = launching from secondary Tile, so we navigate to the correct page //throw new NotImplementedException(); } // If we're currently not on a page, navigate to the main page ROOT_FRAME.Navigate(typeof(ChatPage)); } }
public Soccer(Room room) { this.room = room; this.ball = null; this.rebugMove = null; this.pushMove = null; this.cloudMove = null; this.goals = new List <RoomItem>(); }
private static Push CreatePushRequest(string commitId) { var push = new Push( new Repository(Guid.NewGuid()), new Commit[] { new Commit(commitId, new UserDate(DateTime.Now)) } ); return(push); }
public async Task <ActionResult> DeleteConfirmed(long id) { Push push = await db.PushSet.FindAsync(id); db.PushSet.Remove(push); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
// Use this for initialization void OnTriggerExit(Collider Other) { // Get attached pushScript pushScript = GetComponent <Push>(); // Destroy pushScript Destroy(pushScript); // Close off the shaft closeCollider.enabled = true; }
public async Task PushAsync(Push push, CancellationToken cancellationToken = default(CancellationToken)) { await _options.Url .AppendPathSegment(_options.PushPath) .WithHeader("Content-Type", "application/json; charset=utf-8") .WithHeader("Client-Token", _options.Token) .WithHeader("Application-Name", _options.ApplicationName) .PostJsonAsync(push); }
public ActionResult TestPushProjectToViktor() { Push p = new Push(); Device d = db.devices.First(x => x.id.Equals("HT451WM08832")); string vToken = d.token; p.PushToAndroid(vToken, "project"); return(RedirectToAction("About", "Home")); }
public ActionResult TestPushJobToKjetil() { Push p = new Push(); Device d = db.devices.First(x => x.id.Equals("ENU7N15B04007825")); string nToken = d.token; p.PushToAndroid(nToken, "job"); return(RedirectToAction("About", "Home")); }
public bool Optimize(ref List <Instruction> src) { int pushidx; if (CurrentIndex == -1) { return(false); } Pop OldPop = (Pop)src[CurrentIndex]; pushidx = -1; Push OldPush = OptimizeUtils.GetLastPush(src, CurrentIndex - 1, ref pushidx); if (OldPush == null) { return(false); } // check for same operands if (OptimizeUtils.SameOperands(OldPop, OldPush)) { src[CurrentIndex].Emit = false; src[pushidx].Emit = false; SamePushPop++; Optimizer.OptimizationsSize += 6; Optimizer.Optimizations++; return(true); } if (OldPop.DestinationIsIndirect && OldPush.DestinationIsIndirect) { return(false); } // Transfer to mov dst,src if (OptimizeUtils.CanTransfer(OldPush, OldPop)) { src[CurrentIndex].Emit = false; src[pushidx].Emit = false; InstructionWithDestinationAndSourceAndSize mv = new Mov(); OptimizeUtils.CopyDestination((InstructionWithDestinationAndSize)OldPush, ref mv, true); OptimizeUtils.CopyDestination((InstructionWithDestinationAndSize)OldPop, ref mv, false); src[CurrentIndex] = mv; src[pushidx] = null; PushPopCount++; Optimizer.OptimizationsSize += 3; Optimizer.Optimizations++; } return(true); }
/// <summary> /// 通过条件查询 /// </summary> /// <param name="WhereString">查询条件</param> /// <returns>Push实体类对象</returns> public List <Push> SelectByWhere(string WhereString) { SqlParameter[] param = new SqlParameter[] { new SqlParameter("@where", WhereString) }; List <Push> list = new List <Push>(); Push model = null; using (SqlDataReader dr = DBHelper.RunProcedure("Push_SelectByWhere", param)) { while (dr.Read()) { model = new Push(); model.PushId = Convert.ToInt32(dr["PushId"]); if (DBNull.Value != dr["PushName"]) { model.PushName = dr["PushName"].ToString(); } if (DBNull.Value != dr["Content"]) { model.Content = dr["Content"].ToString(); } if (DBNull.Value != dr["UserId"]) { model.UserId = Convert.ToInt32(dr["UserId"]); } if (DBNull.Value != dr["CreateDate"]) { model.CreateDate = Convert.ToDateTime(dr["CreateDate"]); } if (DBNull.Value != dr["Remark"]) { model.Remark = dr["Remark"].ToString(); } if (DBNull.Value != dr["Status"]) { model.Status = Convert.ToBoolean(dr["Status"]); } if (DBNull.Value != dr["ObjType"]) { model.ObjType = Convert.ToInt32(dr["ObjType"]); } if (DBNull.Value != dr["ObjId"]) { model.ObjId = Convert.ToInt32(dr["ObjId"]); } if (DBNull.Value != dr["IsDelete"]) { model.IsDelete = Convert.ToBoolean(dr["IsDelete"]); } list.Add(model); } } return(list); }
/// <summary> /// Initializes the singleton application object. This is the first line of authored code /// executed, and as such is the logical equivalent of main() or WinMain(). /// </summary> public App() { CoreApplication.EnablePrelaunch(true); InitializeComponent(); Suspending += OnSuspending; AppCenter.LogLevel = LogLevel.Verbose; AppCenter.Start("e8354a9a-001a-4728-be65-a6477e57f2e7", typeof(Analytics), typeof(Crashes), typeof(Push)); Push.SetEnabledAsync(true); Push.PushNotificationReceived += PushNotificationReceivedHandler; }
public bool AddPushRefSpec(RefSpec s) { if (Push.Contains(s)) { return(false); } Push.Add(s); return(true); }
// TODO: Decouple entity, attack and health private void TryAttack(Entity target) { Push push = target.GetComponent <Push>(); if (push != null) { } target.GetComponent <Health>().IncomingAttack(self); }
private String GetBranch(Push push) { var tokens = push.Ref.Split('/'); if (tokens.Length == 3) { return(push.Ref.Split('/')[2]); } return(string.Empty); }
// Initializes the Push // // channel - The Channel // event - The event, for example `"phx_join"` // payload - The payload, for example `{user_id: 123}` // timeout - The push timeout in milliseconds // public static Push GetInstance(Channel _channel, string _event, PayloadReq _payload, int _timeout) { Push push = _channel.gameObject.AddComponent <Push>(); push.channel = _channel; push.eventName = _event; push.payloadReq = _payload; push.Timeout = _timeout; return(push); }
protected override void OnCreate(Bundle bundle) { TabLayoutResource = Resource.Layout.Tabbar; ToolbarResource = Resource.Layout.Toolbar; base.OnCreate(bundle); global::Xamarin.Forms.Forms.Init(this, bundle); Push.SetSenderId("474483213605"); LoadApplication(new App()); }
public ActionResult Edit([Bind(Include = "Id,Target,TagContent,Tag,RecordTime,RecordPerson,PersonName,TagTitle")] Push push) { if (ModelState.IsValid) { sdb.Entry(push).State = EntityState.Modified; sdb.SaveChanges(); return(RedirectToAction("Index")); } return(View(push)); }
static void Main(string[] args) { Push pb = new Push("Configuration/Configuration.xml"); Note note = new Note("Title", "Body", pb.GetDefaultDevice()); pb.SetPush(note); HttpResponseMessage resp = pb.Send(); Console.ReadKey(); }
public void PushTargets(Push push) { foreach (var target in targetingContext.targetContexts) { if (!target.transform.entity.IsDead()) { target.transform.entity.TryBePushed(push, direction); } } }
private RongCloud(String appKey, String appSecret) { user = new User(appKey, appSecret); message = new Message(appKey, appSecret); wordfilter = new Wordfilter(appKey, appSecret); group = new Group(appKey, appSecret); chatroom = new Chatroom(appKey, appSecret); push = new Push(appKey, appSecret); sms = new SMS(appKey, appSecret); }
private RongCloud(string appKey, string appSecret) { User = new User(appKey, appSecret); Message = new Message(appKey, appSecret); WordFilter = new Wordfilter(appKey, appSecret); Group = new Group(appKey, appSecret); Chatroom = new Chatroom(appKey, appSecret); Push = new Push(appKey, appSecret); SMS = new SMS(appKey, appSecret); }
public static SocketMessage GetMessageFor(Push push) { return(new SocketMessage { Title = "Git - [PUSH] Repository : " + push.Repository.FullName, DataType = push.GetType(), Data = push, IsImportant = false, }); }
public bool Send(Push item) { if (item == null) { throw new ArgumentNullException("item"); } List <Commit> commits = item.Commits; if (commits == null || commits.Count == 0) { Log(LogSeverity.Info, "Push has no commits. Not sending mails."); return(false); } SmtpServerConfig smtpConfig = Config.Instance.SmtpServer; MailMessage message = null; try { foreach (Commit c in commits) { if (!c.FetchDiff(item)) { return(false); } } var template = GetMailTemplate <Push> (item.CHAuthID); message = template.ComposeMail(item); if (message == null) { Log(LogSeverity.Error, "No mail message composed."); return(false); } var smtp = new SmtpClient(); smtp.Host = smtpConfig.Host; smtp.Port = smtpConfig.Port; smtp.EnableSsl = smtpConfig.EnableSSL; smtp.Credentials = smtpConfig.Credentials; smtp.Send(message); } catch (SmtpException ex) { Log(ex, "While sending mail. SMTP failure code: {4}.\n{0}", ex.StatusCode); return(false); } catch (Exception ex) { Log(ex, "While sending mail.\n{0}"); return(false); } finally { if (message != null) { message.Dispose(); } } return(true); }
private bool IsFilteringByAge(Push push) { var age = push.Parameters.Get <AgeParameter>(); if (age == null) { return(false); } return(age.Value > SystemData.Age.Value); }
Author GetCommitterAddress(Push push) { List <Commit> commits = push.Commits; if (commits == null || commits.Count == 0) { return(null); } return(commits[0].Author); }
public PushViewModel(Push push) { Index = push.index; Tag = push.tag; Userid = push.userid; Content = push.content; IPDatetime = push.ipdatetime; IP = push.ip; Date = push.date; Time = push.time; }
public Push Map(PushForm form) { var device = new Push(); device.Token = form.Token; device.Platform = form.Platform; device.UdId =form.UdId; device.OsVersion = form.OsVersion; device.CreatedDate = DateTime.Now; device.ModifiedDate = DateTime.Now; device.AppVersion = "1.0"; return device; }
public void Push_EncodesADataInstructionWithGivenOperand() { // Arrange var encoder = new Mock<IEncoder>(); var stack = new Mock<IStack>(); var context = new ExecutionContext { Encoder = encoder.Object, Stack = stack.Object }; var instruction = new Instruction { Operand = 12345 }; var pusher = new Push(); // Act pusher.Execute(context, instruction); // Assert encoder.Verify(e => e.Encode(It.Is<Instruction>(i => i.Operand == instruction.Operand && i.Type == InstructionType.Data))); }
public void Push_PushesValueOntoStack() { // Arrange var encoder = new Mock<IEncoder>(); var stack = new Mock<IStack>(); var context = new ExecutionContext { Encoder = encoder.Object, Stack = stack.Object }; var instruction = new Instruction { Operand = 12345 }; var pusher = new Push(); // Act pusher.Execute(context, instruction); // Assert stack.Verify(s => s.Push(It.IsAny<UInt64>()), Times.Once); }
public void InsertDevice(Push device) { using (var cnn = OpenConnection()) { var query = "select * from Push where UdId=@UdId"; var resultat = cnn.Query<Push>(query, new { UdId = device.UdId}); if (resultat.Count() == 0) { var id = cnn.Insert(device); } else { var tab = cnn.Get<Push>(device.UdId); device.Id = tab.Id; cnn.Update(device); } } }
public void Then_a_specific_value_is_retrieved_by_a_number_of_pops(int[] valuesToPush, int numberOfPops, int expectedValueRetrievedByPop) { Theater theater = new Theater(); var promiseOfTheActualValue = new TaskCompletionSource<int>(); Address customer = null; Address stack = null; Given(() => { SetThe<IActorNamingService>().To(new InMemoryActorNamingService()); stack = theater.CreateActor(new StackNodeBehavior<int>(default(int), null)); foreach (var i in valuesToPush) { var push = new Push<int>(i); theater.Dispatch(push, stack); } customer = theater.CreateActor(new AssertionBehavior<int>(promiseOfTheActualValue, numberOfPops)); }); When(() => { for (var i = 0; i < numberOfPops; i++) { var pop = new Pop(customer); theater.Dispatch(pop, stack); } }); Then(async () => { var actualValue = await promiseOfTheActualValue.Task; actualValue.Should().Be(expectedValueRetrievedByPop); }); }
public PowerUp getPowerUp(PowerUpList chosenPowerUpID) { PowerUp chosenPowerUp = null; switch (chosenPowerUpID) { case PowerUpList.SlowDown: chosenPowerUp = new SlowDown(10); break; case PowerUpList.SpeedUp: chosenPowerUp = new SpeedUp(10); break; case PowerUpList.Warp: chosenPowerUp = new Warp(10); break; case PowerUpList.IceyPlayer: chosenPowerUp = new IceyPlayer(10); break; case PowerUpList.ObjectSpawnPowerUp: chosenPowerUp = new ObjectSpawnPowerUp(10); break; case PowerUpList.Pull: chosenPowerUp = new Pull(10); break; case PowerUpList.Push: chosenPowerUp = new Push(10); break; case PowerUpList.Bigger: chosenPowerUp = new Bigger(10); break; case PowerUpList.Smaller: chosenPowerUp = new Smaller(10); break; case PowerUpList.OrbitingShield: chosenPowerUp = new OrbitingShield(10); break; } return chosenPowerUp; }
/// <summary> /// Moves the <see cref="Actor"/> instance /// to the <see cref="E:Destination"/>. /// </summary> public override void Execute() { Push push = new Push(Destination); level.Actor.DoMove(push); }
public static void SendPush(Push push) { }
public void Add(Push pushed) { who += pushed; }
private void PushApplication(object sender, EventArgs e) { Project project = vsMonitorSelection.GetActiveProject(); if (project != null) { var cloudGuid = GetCurrentCloudGuid(project); var projectDirectories = GetProjectDirectories(project); Messenger.Default.Register<NotificationMessageAction<Guid>>(this, message => { if (message.Notification.Equals(Messages.SetPushAppData)) message.Execute(cloudGuid); }); Messenger.Default.Register<NotificationMessageAction<string>>(this, message => { if (message.Notification.Equals(Messages.SetPushAppDirectory)) message.Execute(projectDirectories.DeployFromPath); }); var window = new Push(); var helper = new WindowInteropHelper(window); helper.Owner = (IntPtr)(dte.MainWindow.HWnd); var result = window.ShowDialog(); if (result.GetValueOrDefault()) { PushViewModel modelData = null; Messenger.Default.Send(new NotificationMessageAction<PushViewModel>(Messages.GetPushAppData, model => modelData = model)); SetCurrentCloudGuid(project, modelData.SelectedCloud.ID); PerformAction("Push Application", project, modelData.SelectedCloud, projectDirectories, (c, d) => c.Push(modelData.Name, modelData.Url, Convert.ToUInt16(modelData.Instances), d, Convert.ToUInt32(modelData.SelectedMemory), modelData.ApplicationServices.Select(provisionedService => provisionedService.Name).ToArray())); } } }
private void addLabel(Push push, String info) { switch (push) { case Push.One: label1.Text = info; break; case Push.Two: label2.Text = info; break; case Push.Three: label3.Text = info; break; } }
public void Pop Push Initial Capacity 1()
private async void RegisterForNotifications() { var push = new Push { Platform = "wp", Identifier = App.CurrentChannel.ChannelUri.ToString() }; try { await App.MobileService.GetTable<Push>().InsertAsync(push); } catch (Exception ex) { LogDebug("RegisterForNotifications failed"); } }