/// <summary> /// Constructor for an Action /// </summary> /// <param name="obj">The object for which we are saving state</param> /// <param name="state">The state to saved</param> /// <param name="undoCallback">The delegate to undo the action</param> /// <param name="redoCallback">The delegate to redo the action</param> public Action( object obj, object state, ActionCallback undoCallback, ActionCallback redoCallback ) { _object = obj; _state = state; _undoCallback = undoCallback; _redoCallback = redoCallback; }
public Action(ActionCallback callback) { if(callback == null) { throw new System.ArgumentException("Action callback must not be null"); } this.callback = callback; }
/// <summary> /// 绑定 Callback /// </summary> /// <param name="act"></param> /// <param name="callback"></param> /// <typeparam name="T"></typeparam> public void BindCallback <T>(ACTION_CALLBACK_TYPE act, ActionCallback <T> callback) { if (!m_callbackDic.ContainsKey(act)) { m_callbackDic.Add(act, null); } m_callbackDic[act] = (ActionCallback <T>)m_callbackDic[act] + callback; }
public void mergeAnimationsTo(Animatable[] animatables, Scene scene = null, ActionCallback <CachedEntity> targetConverter = null) { EventHorizonBlazorInterop.Func <CachedEntity>( new object[] { new string[] { this.___guid, "mergeAnimationsTo" }, scene, animatables, targetConverter } ); }
public void removeEventListener <K>(K type, ActionCallback <XMLHttpRequest, K> listener, System.Nullable <bool> options = null) { EventHorizonBlazorInterop.Func <CachedEntity>( new object[] { new string[] { this.___guid, "removeEventListener" }, type, listener, options } ); }
public void Register(GuiCommandIds commandId, ActionCallback callback) { if (!_callbacks.ContainsKey(commandId)) { _callbacks.Add(commandId, new List <ActionCallback>()); } _callbacks[commandId].Add(callback); }
public void moveTo(FixVector3 startPos, FixVector3 endPos, Fix64 time, ActionCallback cb = null) { if (moveToAction == null) { moveToAction = new MoveTo(); moveToAction.init(this, startPos, endPos, time, cb); actionManager.addAction(moveToAction); } }
public void open(ActionCallback successCallback, ActionCallback errorCallback) { EventHorizonBlazorInterop.Func <CachedEntity>( new object[] { new string[] { this.___guid, "open" }, successCallback, errorCallback } ); }
/// <summary> /// 异步调用扩展接口 /// </summary> /// <param name="funcName"></param> /// <param name="parameters"></param> /// <param name="callback"></param> public static void CallAsyncFunc(string funcName, string parameters, ActionCallback callback) { if (Application.platform == RuntimePlatform.Android) { LogFormat("GPlaySDK.CallAsyncFunc", "funcName:{0} parameters:{1}", funcName, parameters); int callbackid = ActionCallbackManager.Instance.AddCallback(callback); callAsyncFunc(funcName, parameters, callbackid); } }
public static async ValueTask EncodeScreenshotCanvasData(ActionCallback <string> successCallback = null, string mimeType = null, string fileName = null) { await EventHorizonBlazorInterop.Func <CachedEntity>( new object[] { new string[] { "BABYLON", "Tools", "EncodeScreenshotCanvasData" }, successCallback, mimeType, fileName } ); }
public static async ValueTask ToBlob(HTMLCanvasElement canvas, ActionCallback <Blob> successCallback, string mimeType = null) { await EventHorizonBlazorInterop.Func <CachedEntity>( new object[] { new string[] { "BABYLON", "Tools", "ToBlob" }, canvas, successCallback, mimeType } ); }
public static async ValueTask LoadScript(string scriptUrl, ActionCallback onSuccess, ActionCallback <string, object> onError = null, string scriptId = null) { await EventHorizonBlazorInterop.Func <CachedEntity>( new object[] { new string[] { "BABYLON", "Tools", "LoadScript" }, scriptUrl, onSuccess, onError, scriptId } ); }
public static async ValueTask SetImmediate(ActionCallback action) { await EventHorizonBlazorInterop.Func <CachedEntity>( new object[] { new string[] { "BABYLON", "Tools", "SetImmediate" }, action } ); }
public void forEach(ActionCallback <T> func) { EventHorizonBlazorInterop.Func <CachedEntity>( new object[] { new string[] { this.___guid, "forEach" }, func } ); }
public void load(Scene scene, ActionCallback onLoaded = null) { EventHorizonBlazorInterop.Func <CachedEntity>( new object[] { new string[] { this.___guid, "load" }, scene, onLoaded } ); }
public static async ValueTask AddNodeConstructor(string type, ActionCallback <string, Scene, CachedEntity> constructorFunc) { await EventHorizonBlazorInterop.Func <CachedEntity>( new object[] { new string[] { "BABYLON", "Node", "AddNodeConstructor" }, type, constructorFunc } ); }
public void loadFile(string url, ActionCallback <object> sceneLoaded, ActionCallback <object> progressCallBack = null, ActionCallback errorCallback = null, System.Nullable <bool> useArrayBuffer = null) { EventHorizonBlazorInterop.Func <CachedEntity>( new object[] { new string[] { this.___guid, "loadFile" }, url, sceneLoaded, progressCallBack, errorCallback, useArrayBuffer } ); }
public decimal setImmediate(ActionCallback <CachedEntity[]> handler) { return(EventHorizonBlazorInterop.Func <decimal>( new object[] { new string[] { this.___guid, "setImmediate" }, handler } )); }
public void updateURL(string url, string buffer = null, ActionCallback onLoad = null) { EventHorizonBlazorInterop.Func <CachedEntity>( new object[] { new string[] { this.___guid, "updateURL" }, url, buffer, onLoad } ); }
public static void AddIndividualParser(string name, ActionCallback <CachedEntity, Scene, string> parser) { EventHorizonBlazorInterop.Func <CachedEntity>( new object[] { new string[] { "BABYLON", "AbstractScene", "AddIndividualParser" }, name, parser } ); }
public void forceCompilation(AbstractMesh mesh, ActionCallback <Material> onCompiled = null, IMaterialCompilationOptions options = null, ActionCallback <string> onError = null) { EventHorizonBlazorInterop.Func <CachedEntity>( new object[] { new string[] { this.___guid, "forceCompilation" }, mesh, onCompiled, options, onError } ); }
public void createEffectForParticles(IParticleSystem particleSystem, ActionCallback <Effect> onCompiled = null, ActionCallback <Effect, string> onError = null) { EventHorizonBlazorInterop.Func <CachedEntity>( new object[] { new string[] { this.___guid, "createEffectForParticles" }, particleSystem, onCompiled, onError } ); }
public void stop(string animationName = null, ActionCallback <object> targetMask = null) { EventHorizonBlazorInterop.Func <CachedEntity>( new object[] { new string[] { this.___guid, "stop" }, animationName, targetMask } ); }
public bool hasSpecificTrigger(decimal trigger, ActionCallback <object> parameterPredicate = null) { return(EventHorizonBlazorInterop.Func <bool>( new object[] { new string[] { this.___guid, "hasSpecificTrigger" }, trigger, parameterPredicate } )); }
public async ValueTask forEach(ActionCallback <T> func) { await EventHorizonBlazorInterop.Func <CachedEntity>( new object[] { new string[] { this.___guid, "forEach" }, func } ); }
public bool load(Scene scene, object data, string rootUrl, ActionCallback <string, object> onError = null) { return(EventHorizonBlazorInterop.Func <bool>( new object[] { new string[] { this.___guid, "load" }, scene, data, rootUrl, onError } )); }
public async ValueTask forEach(decimal count, ActionCallback <decimal, decimal> callback) { await EventHorizonBlazorInterop.Func <CachedEntity>( new object[] { new string[] { this.___guid, "forEach" }, count, callback } ); }
public async ValueTask executeOnAllControls(ActionCallback <Control> func, Container container = null) { await EventHorizonBlazorInterop.Func <CachedEntity>( new object[] { new string[] { this.___guid, "executeOnAllControls" }, func, container } ); }
public async ValueTask executeWhenCompiled(ActionCallback <Effect> func) { await EventHorizonBlazorInterop.Func <CachedEntity>( new object[] { new string[] { this.___guid, "executeWhenCompiled" }, func } ); }
public static void WhenAllReady(BaseTexture[] textures, ActionCallback callback) { EventHorizonBlazorInterop.Func <CachedEntity>( new object[] { new string[] { "BABYLON", "BaseTexture", "WhenAllReady" }, textures, callback } ); }
public async ValueTask setRenderingOrder(decimal renderingGroupId, ActionCallback <SubMesh, SubMesh> opaqueSortCompareFn = null, ActionCallback <SubMesh, SubMesh> alphaTestSortCompareFn = null, ActionCallback <SubMesh, SubMesh> transparentSortCompareFn = null) { await EventHorizonBlazorInterop.Func <CachedEntity>( new object[] { new string[] { this.___guid, "setRenderingOrder" }, renderingGroupId, opaqueSortCompareFn, alphaTestSortCompareFn, transparentSortCompareFn } ); }
public async ValueTask forceCompilation(ActionCallback <IShadowGenerator> onCompiled = null, CachedEntity options = null) { await EventHorizonBlazorInterop.Func <CachedEntity>( new object[] { new string[] { this.___guid, "forceCompilation" }, onCompiled, options } ); }
public ActionNode AddNode(string text, ActionNode parent = null, string type = null, ActionCallback callback = null) { TreeNodeCollection nodes; if (parent == null) { nodes = this.Nodes; } else { nodes = parent.Nodes; } ActionNode node = CreateNode(); node.Text = text; node.TypeName = type; if (callback != null) { node.ActionCallback += callback; } nodes.Add(node); return node; }
public void Init(ActionCallback callback = null) { if (FB.IsInitialized) { if (callback != null) callback(); return; } Debug.Log("Initialize"); actionInitCallback = callback; FB.Init(InitCallBack); }
/// <summary> /// Runs the tests in an assembly syncronously reporting back the test results through the callback /// or through the return value /// </summary> /// <param name="callback">The callback that receives the test results</param> /// <param name="filter">A string containing the XML representation of the filter to use</param> /// <returns>The XML result of the test run</returns> public string RunTests(Action<string> callback, string filter) { Guard.ArgumentNotNull(filter, "filter"); var handler = new ActionCallback(callback); TNode result = Runner.Run(new TestProgressReporter(handler), TestFilter.FromXml(filter)).ToXml(true); // Insert elements as first child in reverse order if (Settings != null) // Some platforms don't have settings InsertSettingsElement(result, Settings); #if !PORTABLE && !SILVERLIGHT InsertEnvironmentElement(result); #endif // Ensure that the CallContext of the thread is not polluted // by our TestExecutionContext, which is not serializable. TestExecutionContext.ClearCurrentContext(); return result.OuterXml; }
/// <summary> /// Runs the tests in an assembly asyncronously reporting back the test results through the callback /// </summary> /// <param name="callback">The callback that receives the test results</param> /// <param name="filter">A string containing the XML representation of the filter to use</param> private void RunAsync(Action<string> callback, string filter) { Guard.ArgumentNotNull(filter, "filter"); var handler = new ActionCallback(callback); Runner.RunAsync(new TestProgressReporter(handler), TestFilter.FromXml(filter)); }
public Step( AstNode n, ActionCallback a, string d = null ) { this.node = n; this.action = a; this.description = d; }