private void ReceiveTimeline() { if (User == null || User.TwitterUser == null) { return; } IsStandby = false; Task.Factory.StartNew(() => { try { var acc = AccountStorage.GetRandom(a => a.Followings.Contains(this.User.TwitterUser.NumericId), true); var tweets = InjectionPoint.UnfoldTimeline(i => acc.GetUserTimeline(userId: this.User.TwitterUser.NumericId, count: 100, includeRts: true, page: i), 100, 5); if (tweets != null) { tweets.ForEach(t => TweetStorage.Register(t)); } } catch (Exception e) { ExceptionStorage.Register(e, ExceptionCategory.TwitterError, "ユーザータイムラインを受信できませんでした: @" + this.User.TwitterUser.ScreenName, ReceiveTimeline); } finally { IsStandby = true; } }); }
public void ReflectorReturnsCorrectCtorInjectionPointForParamsCtor() { Assert.True(true); InjectionPoint injectionPoint = reflector.DescribeInjections(typeof(OneParameterConstructorInjectee)).ctor; Assert.True(injectionPoint is ConstructorInjectionPoint, "reflector-returned injectionPoint is ctor injectionPoint"); }
public void ReflectorCorrectlySortsInjectionPointsForPreDestroyMethods() { InjectionPoint first = reflector.DescribeInjections(typeof(OrderedPreDestroyInjectee)).preDestroyMethods; Assert.AreEqual(1, (first as PreDestroyInjectionPoint).order, "First injection point has order '1'"); Assert.AreEqual(2, (first.next as PreDestroyInjectionPoint).order, "Second injection point has order '2'"); Assert.AreEqual(3, (first.next.next as PreDestroyInjectionPoint).order, "Third injection point has order '3'"); Assert.AreEqual(int.MaxValue, (first.next.next.next as PreDestroyInjectionPoint).order, "Fourth injection point has no order 'int.MaxValue'"); }
protected internal virtual string getVariableTypedName(InjectionPoint ip) { string variableName = ip.Annotated.getAnnotation(typeof(ProcessVariableTyped)).value(); if (variableName.Length == 0) { variableName = ip.Member.Name; } return(variableName); }
// Called for each camera/injection point pair on each frame. // Return true if the effect should be rendered for this camera. public override bool Setup(ref RenderingData renderingData, InjectionPoint injectionPoint) { base.Setup(ref renderingData, injectionPoint); var stack = VolumeManager.instance.stack; _volumeComponent = stack.GetComponent <ColorGrading>(); bool shouldRenderEffect = _volumeComponent.intensity.value > 0; return(shouldRenderEffect); }
/// <summary> /// @since 7.3 /// </summary> //JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Produces @ProcessVariableTyped protected org.camunda.bpm.engine.variable.value.TypedValue getProcessVariableTyped(javax.enterprise.inject.spi.InjectionPoint ip) protected internal virtual TypedValue getProcessVariableTyped(InjectionPoint ip) { string processVariableName = getVariableTypedName(ip); if (logger.isLoggable(Level.FINE)) { logger.fine("Getting typed process variable '" + processVariableName + "' from ProcessInstance[" + businessProcess.ProcessInstanceId + "]."); } return(businessProcess.getVariableTyped(processVariableName)); }
public override void Render(CommandBuffer cmd, RenderTargetIdentifier source, RenderTargetIdentifier destination, ref RenderingData renderingData, InjectionPoint injectionPoint) { const int downSample = 1; RenderTextureDescriptor descriptor = GetTempRTDescriptor(renderingData); int wh = descriptor.width / downSample; int hh = descriptor.height / downSample; // Assumes a radius of 1 is 1 at 1080p. Past a certain radius our gaussian kernel will look very bad so we'll // clamp it for very high resolutions (4K+). float blurRadius = _volumeComponent.blur.value * (wh / 1080f); blurRadius = Mathf.Min(blurRadius, 2f); float edgePreserve = _volumeComponent.edgePreserve.value * (wh / 1080f); edgePreserve = Mathf.Min(edgePreserve, 2f); var rangeStart = _volumeComponent.rangeStart.overrideState ? _volumeComponent.rangeStart.value : 0; var rangeEnd = _volumeComponent.rangeEnd.overrideState ? _volumeComponent.rangeEnd.value : -1; _effectMaterial.SetVector(PropertyIDs.CoCParams, new Vector2(rangeStart, rangeEnd)); _effectMaterial.SetFloat(PropertyIDs.Intensity, _volumeComponent.intensity.value); SetSourceSize(cmd, descriptor); var tempRtDescriptor = GetTempRTDescriptor(renderingData, wh, hh, _defaultHDRFormat); cmd.GetTemporaryRT(PropertyIDs.PingTexture, tempRtDescriptor, FilterMode.Bilinear); cmd.GetTemporaryRT(PropertyIDs.Blur1, tempRtDescriptor, FilterMode.Bilinear); cmd.GetTemporaryRT(PropertyIDs.Blur2, tempRtDescriptor, FilterMode.Bilinear); cmd.SetGlobalVector(PropertyIDs.DownSampleScaleFactor, new Vector4(1.0f / downSample, 1.0f / downSample, downSample, downSample)); cmd.SetGlobalFloat(PropertyIDs.BlurStrength, edgePreserve); cmd.SetGlobalTexture(PropertyIDs.Input, source); CoreUtils.DrawFullScreen(cmd, _effectMaterial, PropertyIDs.PingTexture, null, 1); cmd.SetGlobalTexture(PropertyIDs.Input, PropertyIDs.PingTexture); CoreUtils.DrawFullScreen(cmd, _effectMaterial, PropertyIDs.Blur1, null, 2); cmd.SetGlobalFloat(PropertyIDs.BlurStrength, blurRadius); cmd.SetGlobalTexture(PropertyIDs.Input, PropertyIDs.Blur1); CoreUtils.DrawFullScreen(cmd, _effectMaterial, PropertyIDs.PingTexture, null, 1); cmd.SetGlobalTexture(PropertyIDs.Input, PropertyIDs.PingTexture); CoreUtils.DrawFullScreen(cmd, _effectMaterial, PropertyIDs.Blur2, null, 2); cmd.SetGlobalTexture(PropertyIDs.Input, source); CoreUtils.DrawFullScreen(cmd, _effectMaterial, destination, null, 0); cmd.ReleaseTemporaryRT(PropertyIDs.PingTexture); cmd.ReleaseTemporaryRT(PropertyIDs.Blur1); cmd.ReleaseTemporaryRT(PropertyIDs.Blur2); }
/// <summary> /// Construct the custom post-processing render pass /// </summary> /// <param name="injectionPoint">The post processing injection point</param> /// <param name="renderers">The list of classes for the renderers to be executed by this render pass</param> public CompoundPass(InjectionPoint injectionPoint, List <CompoundRenderer> renderers) { _injectionPoint = injectionPoint; m_ProfilingSamplers = new List <ProfilingSampler>(renderers.Count); m_PostProcessRenderers = renderers; foreach (var renderer in renderers) { // Get renderer name and add it to the names list var attribute = CompoundRendererFeatureAttribute.GetAttribute(renderer.GetType()); m_ProfilingSamplers.Add(new ProfilingSampler(attribute?.Name)); } // Pre-allocate a list for active renderers this.m_ActivePostProcessRenderers = new List <int>(renderers.Count); // Set render pass event and name based on the injection point. switch (injectionPoint) { case InjectionPoint.AfterOpaqueAndSky: renderPassEvent = RenderPassEvent.AfterRenderingSkybox; m_PassName = "[Dustyroom] PostProcess after Opaque & Sky"; break; case InjectionPoint.BeforePostProcess: renderPassEvent = RenderPassEvent.BeforeRenderingPostProcessing; m_PassName = "[Dustyroom] PostProcess before PostProcess"; break; case InjectionPoint.AfterPostProcess: #if UNITY_2021_2_OR_NEWER renderPassEvent = RenderPassEvent.AfterRenderingPostProcessing; #else // NOTE: This was initially "AfterRenderingPostProcessing" but it made the builtin post-processing // to blit directly to the camera target. renderPassEvent = RenderPassEvent.AfterRendering; #endif m_PassName = "[Dustyroom] PostProcess after PostProcess"; break; } // Initialize the IDs and allocation state of the intermediate render targets m_Intermediate = new RenderTargetHandle[2]; m_Intermediate[0].Init("_IntermediateRT0"); m_Intermediate[1].Init("_IntermediateRT1"); m_IntermediateAllocated = new bool[2]; m_IntermediateAllocated[0] = false; m_IntermediateAllocated[1] = false; }
// This code is mostly copied from Unity's HDRP repository /// <summary> /// Intialize a reoderable list /// </summary> void InitList(ref ReorderableList reorderableList, List <string> elements, string headerName, InjectionPoint injectionPoint, QuibliPostProcess feature) { reorderableList = new ReorderableList(elements, typeof(string), true, true, true, true); reorderableList.drawHeaderCallback = (rect) => EditorGUI.LabelField(rect, headerName, EditorStyles.boldLabel); reorderableList.drawElementCallback = (rect, index, isActive, isFocused) => { rect.height = EditorGUIUtility.singleLineHeight; var elemType = Type.GetType(elements[index]); EditorGUI.LabelField(rect, GetName(elemType), EditorStyles.boldLabel); }; reorderableList.onAddCallback = (list) => { var menu = new GenericMenu(); foreach (var type in _availableRenderers[injectionPoint]) { if (!elements.Contains(type.AssemblyQualifiedName)) { menu.AddItem(new GUIContent(GetName(type)), false, () => { Undo.RegisterCompleteObjectUndo(feature, $"Added {type} Custom Post Process"); elements.Add(type.AssemblyQualifiedName); forceRecreate(feature); // This is done since OnValidate doesn't get called. }); } } if (menu.GetItemCount() == 0) { menu.AddDisabledItem(new GUIContent("No Custom Post Process Available")); } menu.ShowAsContext(); EditorUtility.SetDirty(feature); }; reorderableList.onRemoveCallback = (list) => { Undo.RegisterCompleteObjectUndo(feature, $"Removed {list.list[list.index]} Custom Post Process"); elements.RemoveAt(list.index); EditorUtility.SetDirty(feature); forceRecreate(feature); // This is done since OnValidate doesn't get called. }; reorderableList.elementHeightCallback = _ => EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing; reorderableList.onReorderCallback = (list) => { EditorUtility.SetDirty(feature); forceRecreate(feature); // This is done since OnValidate doesn't get called. }; }
public override void Render(CommandBuffer cmd, RenderTargetIdentifier source, RenderTargetIdentifier destination, ref RenderingData renderingData, InjectionPoint injectionPoint) { RenderTextureDescriptor descriptor = GetTempRTDescriptor(renderingData); _effectMaterial.SetFloat(PropertyIDs.Intensity, _volumeComponent.intensity.value); _effectMaterial.SetVector(PropertyIDs.ShadowBezierPoints, new Vector4(_volumeComponent.blueShadows.value, _volumeComponent.greenShadows.value)); _effectMaterial.SetVector(PropertyIDs.HighlightBezierPoints, new Vector4(_volumeComponent.redHighlights.value, 0, 0, 0)); _effectMaterial.SetFloat(PropertyIDs.Contrast, _volumeComponent.contrast.value); _effectMaterial.SetFloat(PropertyIDs.Vibrance, _volumeComponent.vibrance.value * 0.5f); _effectMaterial.SetFloat(PropertyIDs.Saturation, _volumeComponent.saturation.value * 0.5f); SetSourceSize(cmd, descriptor); cmd.SetGlobalTexture(PropertyIDs.Input, source); CoreUtils.DrawFullScreen(cmd, _effectMaterial, destination); }
public virtual ProcessEngine processEngine(InjectionPoint ip) { ProcessEngineName annotation = ip.Annotated.getAnnotation(typeof(ProcessEngineName)); string processEngineName = annotation.value(); if (string.ReferenceEquals(processEngineName, null) || processEngineName.Length == 0) { throw new ProcessEngineException("Cannot determine which process engine to inject: @ProcessEngineName must specify the name of a process engine."); } try { ProcessEngineService processEngineService = BpmPlatform.ProcessEngineService; return(processEngineService.getProcessEngine(processEngineName)); } catch (Exception e) { throw new ProcessEngineException("Cannot find process engine named '" + processEngineName + "' specified using @ProcessEngineName: " + e.Message, e); } }
private void ApplyInjectionPoints( object target, Type targetType, TypeDescription description) { InjectionPoint injectionPoint = description.injectionPoints; if (_preConstruct != null) { _preConstruct(target, targetType); } while (injectionPoint != null) { injectionPoint.ApplyInjection(target, targetType, this); injectionPoint = injectionPoint.next; } if (description.preDestroyMethods != null) { _managedObjects[target] = target; } if (_postConstruct != null) { _postConstruct(target, targetType); } }
public virtual FormService formService(InjectionPoint ip) { return(processEngine(ip).FormService); }
public virtual TaskService taskService(InjectionPoint ip) { return(processEngine(ip).TaskService); }
public virtual RepositoryService repositoryService(InjectionPoint ip) { return(processEngine(ip).RepositoryService); }
private StatementSyntax GetTopLevelParent(InjectionPoint injection) => injection.ToPoint.F(GetTopLevelParent);
public virtual RuntimeService runtimeService(InjectionPoint ip) { return(processEngine(ip).RuntimeService); }
public void ReflectorCreatesInjectionPointsForPreDestroyMethods() { InjectionPoint first = reflector.DescribeInjections(typeof(OrderedPreDestroyInjectee)).preDestroyMethods; Assert.True(first != null && first.next != null && first.next.next != null && first.next.next.next != null, "Four injection points have been added"); }
public virtual DecisionService decisionService(InjectionPoint ip) { return(processEngine(ip).DecisionService); }
public virtual FilterService filterService(InjectionPoint ip) { return(processEngine(ip).FilterService); }
public virtual ExternalTaskService externalTaskService(InjectionPoint ip) { return(processEngine(ip).ExternalTaskService); }
public virtual ManagementService managementService(InjectionPoint ip) { return(processEngine(ip).ManagementService); }
public virtual AuthorizationService authorizationService(InjectionPoint ip) { return(processEngine(ip).AuthorizationService); }
public virtual IdentityService identityService(InjectionPoint ip) { return(processEngine(ip).IdentityService); }
// TODO: KG - Add peverify call after modification // TODO: KG - Make InjectionPoints extensible private static Tuple <int, int> InjectInstructionBlock(MethodDef method, List <Instruction> instructions, InjectionPoint injectionPoint) { Tuple <int, int> range = null; if (injectionPoint == InjectionPoint.Prefix) { range = InjectPrefixBlock(method, instructions); } if (injectionPoint == InjectionPoint.Postfix) { range = InjectPostfixBlock(method, instructions); } method.Body.Instructions.UpdateInstructionOffsets(); return(range); }
/// <summary> /// Called every frame for each camera when the post process needs to be rendered. /// </summary> /// <param name="cmd">Command Buffer used to issue your commands</param> /// <param name="source">Source Render Target, it contains the camera color buffer in it's current state</param> /// <param name="destination">Destination Render Target</param> /// <param name="renderingData">Current Rendering Data</param> /// <param name="injectionPoint">The injection point from which the renderer is being called</param> public abstract void Render(CommandBuffer cmd, RenderTargetIdentifier source, RenderTargetIdentifier destination, ref RenderingData renderingData, InjectionPoint injectionPoint);
public virtual HistoryService historyService(InjectionPoint ip) { return(processEngine(ip).HistoryService); }
public virtual CaseService caseService(InjectionPoint ip) { return(processEngine(ip).CaseService); }
protected PatchBase(InjectionPoint injectionPoint) { _patchName = GetType().Name; _injectionPoint = injectionPoint; }
/// <summary> /// Setup function, called every frame once for each camera before render is called. /// </summary> /// <param name="renderingData">Current Rendering Data</param> /// <param name="injectionPoint">The injection point from which the renderer is being called</param> /// <returns> /// True if render should be called for this camera. False Otherwise. /// </returns> public virtual bool Setup(ref RenderingData renderingData, InjectionPoint injectionPoint) { return(true); }