protected Type? GetCurrentActivityViewModelType() { Type? currentActivityType = CurrentActivity?.GetType(); var activityViewModelType = ViewModelTypeFinder.FindTypeOrNull(currentActivityType); return activityViewModelType; }
public static void DisConnect() { #if UNITY_EDITOR #else CurrentActivity.Call("sendHandle", 1); #endif }
/// <inheritdoc /> public override void SetParentAndStart(TraceContextBase parentTraceContext) { if (CurrentActivity == null) { CurrentActivity = new Activity(this.OperationName); } if (parentTraceContext is W3CTraceContext) { var context = (W3CTraceContext)parentTraceContext; CurrentActivity.SetTraceparent(context.TraceParent); CurrentActivity.SetTracestate(context.TraceState); OrchestrationTraceContexts = context.OrchestrationTraceContexts.Clone(); } else // In case of null object { CurrentActivity.GenerateW3CContext(); } CurrentActivity.Start(); StartTime = CurrentActivity.StartTimeUtc; TraceParent = CurrentActivity.GetTraceparent(); TraceState = CurrentActivity.GetTracestate(); ParentSpanId = CurrentActivity.GetParentSpanId(); CorrelationTraceContext.Current = this; }
public static void StopSearch() { #if UNITY_EDITOR #else CurrentActivity.Call("sendHandle", 3); #endif }
/// <summary> /// Starts tags detection /// </summary> public void StartListening() { if (_nfcAdapter == null) { return; } var intent = new Intent(CurrentActivity, CurrentActivity.GetType()).AddFlags(ActivityFlags.SingleTop); var pendingIntent = PendingIntent.GetActivity(CurrentActivity, 0, intent, 0); var ndefFilter = new IntentFilter(NfcAdapter.ActionNdefDiscovered); ndefFilter.AddDataType("*/*"); var tagFilter = new IntentFilter(NfcAdapter.ActionTagDiscovered); tagFilter.AddCategory(Intent.CategoryDefault); var filters = new IntentFilter[] { ndefFilter, tagFilter }; _nfcAdapter.EnableForegroundDispatch(CurrentActivity, pendingIntent, filters, null); _isListening = true; OnTagListeningStatusChanged?.Invoke(_isListening); }
public async Task <IHttpActionResult> PutCurrentActivity(int id, CurrentActivity currentActivity) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != currentActivity.CurrentActivityId) { return(BadRequest()); } db.Entry(currentActivity).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CurrentActivityExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public ActivityExecutionStatusEvent ExecuteNewEventForActivity(ActivityExecutionStatus newExecutionStatus, User currentUser, string comments, DateTime?contextDate, string contextCode) { //if (CurrentActivity.CurrentStatus.Description == newExecutionStatus.Description) { return null; }; var activityExecutionStatusEvent = CurrentActivity.ExecuteEvent(newExecutionStatus, currentUser, comments, contextDate, contextCode); switch (newExecutionStatus.Description) { case "CONFIRMED": CheckIfAbleToChangeFromConfirmationActivity(); MoveToNextActivity(WorkFlow, currentUser); break; case "CAUSALITYCONFIRMED": MoveToNextActivity(WorkFlow, currentUser); AddCausalityConfirmedDomainEvent(); break; case "E2BGENERATED": AddE2BGeneratedDomainEvent(); break; case "E2BSUBMITTED": AddE2BSubmittedDomainEvent(); break; default: break; } return(activityExecutionStatusEvent); }
public bool SwitchActivity(ActivityType activity_type, ActivitySwitchMethod method, KaikeiSystemBody.models.Context context, object option = null) { var next_activity = GetActivity(activity_type); var form_x = CurrentActivity.Form.Left; var form_y = CurrentActivity.Form.Top; var form_w = CurrentActivity.Form.Width; var form_h = CurrentActivity.Form.Height; switch (method) { case ActivitySwitchMethod.Change: CurrentActivity.HideForm(); activityStack.Pop(); activityStack.Push(next_activity); CurrentActivity.ShowForm(form_x, form_y, context, option); break; case ActivitySwitchMethod.Push: CurrentActivity.HideForm(); activityStack.Push(next_activity); CurrentActivity.ShowForm(form_x, form_y, context, option); break; case ActivitySwitchMethod.PushModal: activityStack.Push(next_activity); CurrentActivity.ShowFormModal(form_x + form_w / 2, form_y + form_h / 2, context, option); break; } return(true); }
/// <inheritdoc /> public override void SetParentAndStart(TraceContextBase parentTraceContext) { if (CurrentActivity == null) { CurrentActivity = new Activity(this.OperationName); CurrentActivity.SetIdFormat(ActivityIdFormat.W3C); } if (parentTraceContext is W3CTraceContext) { var context = (W3CTraceContext)parentTraceContext; CurrentActivity.SetParentId(context.TraceParent); CurrentActivity.TraceStateString = context.TraceState; OrchestrationTraceContexts = context.OrchestrationTraceContexts.Clone(); } CurrentActivity.Start(); StartTime = CurrentActivity.StartTimeUtc; TraceParent = CurrentActivity.Id; TraceState = CurrentActivity.TraceStateString; ParentSpanId = CurrentActivity.ParentSpanId.ToHexString(); CorrelationTraceContext.Current = this; }
public void CancelActivity() { if (CurrentActivity != null) { CurrentActivity.Cancel(this); } }
public override Task <bool> Show(MvxViewModelRequest request) { //detect if we want a Forms View if (request.ViewModelType.FullName.Contains("XFViewModel")) { //get the Forms page from the request var contentPage = MvxPresenterHelpers.CreatePage(request); //set DataContext of page to LoadViewModel var viewModel = MvxPresenterHelpers.LoadViewModel(request); //set the binding context of the content page contentPage.BindingContext = viewModel; //set the current page of the activity MvxFormsApplicationActivity.CurrentPage = contentPage; //Start the Xamarin.Forms Activity CurrentActivity.StartActivity(typeof(MvxFormsApplicationActivity)); return(Task.FromResult(true)); } else { return(base.Show(request)); } }
public static string GetAotuPackage() { #if UNITY_ANDROID && !UNITY_EDITOR return(CurrentActivity.Call <string>("GetAotuPackage")); #endif return(""); }
public void Dispose() { // If CurrentActivity isn't null, run OnActorDisposeOuter in case some cleanups are needed. // This should be done before the FrameEndTask to avoid dependency issues. CurrentActivity?.OnActorDisposeOuter(this); // Allow traits/activities to prevent a race condition when they depend on disposing the actor (e.g. Transforms) WillDispose = true; World.AddFrameEndTask(w => { if (Disposed) { return; } if (IsInWorld) { World.Remove(this); } foreach (var t in TraitsImplementing <INotifyActorDisposing>()) { t.Disposing(this); } World.TraitDict.RemoveActor(this); Disposed = true; luaInterface?.Value.OnActorDestroyed(); }); }
public static void setmGetKeyFlage(bool flage) { #if UNITY_EDITOR #else CurrentActivity.Call("setmGetKeyFlage", flage); #endif }
public void Update(DestinyProfileTransitoryComponent?other) { if (other is null) { return; } if (!PartyMembers.DeepEqualsList(other.PartyMembers)) { PartyMembers = other.PartyMembers; OnPropertyChanged(nameof(PartyMembers)); } if (!CurrentActivity.DeepEquals(other.CurrentActivity)) { CurrentActivity.Update(other.CurrentActivity); OnPropertyChanged(nameof(CurrentActivity)); } if (!Joinability.DeepEquals(other.Joinability)) { Joinability.Update(other.Joinability); OnPropertyChanged(nameof(Joinability)); } if (!Tracking.DeepEqualsList(other.Tracking)) { Tracking = other.Tracking; OnPropertyChanged(nameof(Tracking)); } if (LastOrbitedDestinationHash != other.LastOrbitedDestinationHash) { LastOrbitedDestinationHash = other.LastOrbitedDestinationHash; OnPropertyChanged(nameof(LastOrbitedDestinationHash)); } }
private void MoveToNextActivity(WorkFlow workFlow, User currentUser) { if (workFlow.Activities.Count() == 0) { throw new DomainException($"Workflow {workFlow.Description} does not have any activities configured"); } switch (CurrentActivity.QualifiedName) { case "Confirm Report Data": CurrentActivity.SetToOld(); var meddraActivity = workFlow.Activities.Single(a => a.QualifiedName == "Set MedDRA and Causality"); var meddraActivityInstance = new ActivityInstance(meddraActivity, currentUser); _activities.Add(meddraActivityInstance); break; case "Set MedDRA and Causality": CurrentActivity.SetToOld(); var e2bActivity = workFlow.Activities.Single(a => a.QualifiedName == "Extract E2B"); var e2bActivityInstance = new ActivityInstance(e2bActivity, currentUser); _activities.Add(e2bActivityInstance); break; default: break; } }
public bool Equals(DestinyProfileTransitoryComponent input) { if (input == null) { return(false); } return (( PartyMembers == input.PartyMembers || (PartyMembers != null && PartyMembers.SequenceEqual(input.PartyMembers)) ) && ( CurrentActivity == input.CurrentActivity || (CurrentActivity != null && CurrentActivity.Equals(input.CurrentActivity)) ) && ( Joinability == input.Joinability || (Joinability != null && Joinability.Equals(input.Joinability)) ) && ( Tracking == input.Tracking || (Tracking != null && Tracking.SequenceEqual(input.Tracking)) ) && ( LastOrbitedDestinationHash == input.LastOrbitedDestinationHash || (LastOrbitedDestinationHash.Equals(input.LastOrbitedDestinationHash)) )); }
public void GoBack() { if (CurrentActivity != null) { CurrentActivity.Finish(); } }
/// <summary> /// If possible, discards the current page and displays the previous page /// on the navigation stack. /// </summary> public static void GoBack() { if (CurrentActivity != null) { CurrentActivity.OnBackPressed(); } }
public void TestCompleteActivityWithNullParameter() { string UserName = "******"; User User = new User(UserName); CurrentActivity Activity = null; Assert.AreEqual(0, User.CompleteActivity(Activity, ActivityGrade.Good, "I just broke the system, haha").Count); }
/// <summary> /// 获得用户正在处理的任务 /// </summary> /// <param name="processor"></param> /// <returns></returns> public Task GetUserProcessingTask(string processor) { if (CurrentActivity == null) { return(null); } return(CurrentActivity.GetUserProcessingTask(processor)); }
public static void AddListener(string setCallBackFunctionName, AndroidJavaProxy callBack) { if (Application.platform == RuntimePlatform.Android) { CurrentActivity.Call(setCallBackFunctionName, callBack); androidListernerList.Add(callBack); } }
private void ShowAtView(View decorView) { Window?.ShowAtLocation(decorView?.RootView, GravityFlags.Center, 0, 0); _previousActivity = CurrentActivity?.ToString(); decorView.ViewDetachedFromWindow -= DecorViewDetahcedFromWindowHandler; decorView.ViewDetachedFromWindow += DecorViewDetahcedFromWindowHandler; }
public void TestCurrentActivityConstructor() { Activity testActivity = new Activity("John Doe", "Complete me", 3, 4, null); CurrentActivity currActivity = new CurrentActivity(testActivity); Assert.AreEqual(testActivity, currActivity.Activity); Assert.AreEqual(testActivity.Time, currActivity.TimeLeft); }
public static int GetKeyEvent() { #if UNITY_EDITOR return(-1); #else return(CurrentActivity.Call <int>("GetKeyEvent")); #endif }
/// <summary> /// 用户是否有任务处理 /// </summary> /// <param name="processor"></param> /// <returns></returns> public bool CanUserProcess(string processor) { if (CurrentActivity == null) { return(false); } return(CurrentActivity.CanUserProcess(processor)); }
public void ToProject(Project project) { var intent = new Intent(CurrentActivity, typeof(BuildsActivity)); intent.PutExtra("ProjectId", project.Id); CurrentActivity.StartActivity(intent); }
public async Task ShowPopupAsync(string message) { await Task.Run(() => { var view = CurrentActivity.FindViewById(Android.Resource.Id.Content); Snackbar.Make(view, message, Snackbar.LengthShort) .Show(); }); }
public bool DeepEquals(DestinyProfileTransitoryComponent?other) { return(other is not null && PartyMembers.DeepEqualsList(other.PartyMembers) && (CurrentActivity is not null ? CurrentActivity.DeepEquals(other.CurrentActivity) : other.CurrentActivity is null) && (Joinability is not null ? Joinability.DeepEquals(other.Joinability) : other.Joinability is null) && Tracking.DeepEqualsList(other.Tracking) && LastOrbitedDestinationHash == other.LastOrbitedDestinationHash); }
static MainCommon() { #if UNITY_ANDROID && !UNITY_EDITOR mMainCommon = new AndroidJavaObject("skyworth.com.commonlib.MainCommon"); CurrentActivity.Call("SetNewIntentInferface", new NewIntentInferface()); #endif APPLIST.Add("com.htc.viveport.store"); APPLIST.Add("com.ssnwt.svrwelcom"); }