public void CamApproach(CallbackDelegate callback=null) { moving=true; mStartFrom=transform.localPosition; mMoveTo=mClosePosition; mCallback=callback; }
public void CamGetBack(CallbackDelegate callback=null) { moving=true; mStartFrom=transform.localPosition; mMoveTo=mNormalPosition; mCallback=callback; }
internal static int DRMCreateClientSession( CallbackDelegate pfnCallback, uint uCallbackVersion, string GroupIDProviderType, string GroupID, out SafeRightsManagementSessionHandle phSession) { SecurityHelper.DemandRightsManagementPermission(); int res = UnsafeNativeMethods.DRMCreateClientSession( pfnCallback, uCallbackVersion, GroupIDProviderType, GroupID, out phSession); // on some platforms in the failure cases the out parameter is being created with the value 0 // in order to simplify error handling and Disposing of those handles we will just close them as // soon as we detect such case if ((phSession != null) && phSession.IsInvalid) { phSession.Dispose(); phSession = null; } return res; }
public ChatCommand setCallback(string function) { callback = new CallbackDelegate((cmd, player) => { plugin.Invoke(function, new[] { (object)cmd, player }); }); return this; }
public bool WatchFolder(string folder, CallbackDelegate callbackOnChanged) { _callbackOnChanged = callbackOnChanged; // Create a new FileSystemWatcher and set its properties. FileSystemWatcher watcher = new FileSystemWatcher(); // Watch the folder try { watcher.Path = folder; /* Watch for changes in LastAccess and LastWrite times, and the renaming of files or directories. */ watcher.NotifyFilter = NotifyFilters.LastAccess | NotifyFilters.LastWrite | NotifyFilters.FileName | NotifyFilters.DirectoryName; // Only watch pdf files. watcher.Filter = "*.pdf"; // Add event handlers. watcher.Changed += new FileSystemEventHandler(OnChanged); watcher.Created += new FileSystemEventHandler(OnCreated); watcher.Renamed += new RenamedEventHandler(OnRenamed); // Begin watching. watcher.EnableRaisingEvents = true; } catch (Exception excp) { logger.Error("Failed to watch {0}, excp {1}", folder, excp.Message); return false; } return true; }
public LerpInfo(LerpDelegate lerpF, float min, float max, float time, CallbackDelegate cb=null) { this.lerpF=lerpF; this.lerpMin=min; this.lerpMax=max; this.lerpTime=time; this.lerp=0f; this.lerpCB=cb; }
public ConsoleCommand setCallback(string function) { callback = new CallbackDelegate(cmd => { try { plugin.Invoke(function, (object)cmd); } catch (Exception ex) { Logger.Log("there"); Logger.Log(ex.ToString()); } }); return this; }
//Start hook public KeyboardHook(bool Global) { this.Global = Global; TheHookCB = new CallbackDelegate(KeybHookProc); if (Global) { HookID = SetWindowsHookEx(HookType.WH_KEYBOARD_LL, TheHookCB, 0, //0 for local hook. eller hwnd til user32 for global 0); //0 for global hook. eller thread for hooken } else { HookID = SetWindowsHookEx(HookType.WH_KEYBOARD, TheHookCB, 0, //0 for local hook. or hwnd to user32 for global GetCurrentThreadId()); //0 for global hook. or thread for the hook } }
private void Update() { if(moving) { mMovingTime+=Time.deltaTime; float ratio=Mathf.Clamp(mMovingTime/approachTime, 0f, 1f); Vector3 point=Vector3.Lerp(mStartFrom, mMoveTo, ratio); point.y+=Mathf.Sin(ratio*Mathf.PI*yBias); transform.localPosition=point; if(mMovingTime>=approachTime) { if(null!=mCallback) { mCallback(); mCallback=null; } moving=false; mMovingTime=0f; approachTime=normalApproachTime; } } }
public static void InitLibrary() { new Eval(); new Moves(); new Zobrist(); new Pawn(); new Rook(); new Knight(); new Bishop(); new King(); new Queen(); TTable.Init(32); cb = Callback; var ptr = Marshal.GetFunctionPointerForDelegate(cb); Manager.SetCallback(ptr); SendMessage = DefaultHandler; }
public void ChoiceDoneEnd() { mBack.gameObject.SetActive(false); if(mCachedSceneUI!=null) { mCachedSceneUI.SetActive(false); } mCachedSceneUI=null; if(mActiveChoice!=null) { mActiveChoice.sound.gameObject.SetActive(false); mPlayer.DeltaStress(mActiveChoice.deltaStress); mPlayer.DeltaHealth(mActiveChoice.deltaHealth); mPlayer.DeltaMorality(mActiveChoice.deltaMorality); if(mActiveChoice.choiceText!="") { StartCoroutine(TimerChoice(mActiveChoice.choiceTextDelay, DefaultChoice)); } } mActiveChoice=null; if(null!=mCallback) { mCallback(); } mCallback=null; }
public override void CreateScene() { //create our hikarimanager _HikariManager = new HikariManager("..\\..\\Media\\gui"); viewport.BackgroundColour = new ColourValue(200, 200, 200); //creation of a flash control, first we create an overlay, then we load a flash control onto it _FpsControl = _HikariManager.CreateFlashOverlay("Fps", viewport, 130, 91, RelativePosition.TopLeft, 0, 0); _FpsControl.Load("fps.swf"); _FpsControl.SetTransparent(true); _ColorPickerControl = _HikariManager.CreateFlashOverlay("ColorPicker", viewport, 350, 400, RelativePosition.Center, 1, 0); _ColorPickerControl.Load("controls.swf"); _ColorPickerControl.SetTransparent(true, true); //define delegate of csharp functions that we can call from flash _AsyncExitCallback = this.OnExitClick; _AsyncOpacityCallback = this.OnOpacityChange; _AsyncColorCallback = this.OnColorChange; //bind it to our flash control _ColorPickerControl.Bind("opacityChange", _AsyncOpacityCallback); _ColorPickerControl.Bind("colorChange", _AsyncColorCallback); _ColorPickerControl.Bind("exitClick", _AsyncExitCallback); }
private void EventControl_Closed(object sender, EventArgs e) { CardInserted -= ((ICardEventCallback)sender).OnCardInserted; CardRemoved -= ((ICardEventCallback)sender).OnCardRemoved; }
public void SetOnPlaybackInterrupted(CallbackDelegate cb) { AddEventListener("OnPlaybackInterrupted", cb); }
internal void SetCallback(CallbackDelegate callback) { _callback=callback; }
public void SubscribeCardEvent(string reader) { ICardEventCallback callback = OperationContext.Current.GetCallbackChannel<ICardEventCallback>(); CardInserted += callback.OnCardInserted; CardRemoved += callback.OnCardRemoved; ICommunicationObject obj = (ICommunicationObject)callback; obj.Closed += EventControl_Closed; //obj.Closing += new EventHandler(EventService_Closing); }
public void GetSidTokenAsync(CallbackDelegate<string> callback) { if (callback != null) { ThreadPool.QueueUserWorkItem(o => { string sid = GetSidToken(); callback(sid); }); } }
/// <summary> /// Adds a callback function on the client (pre-postback, so beware) and then sets a server-side delegate /// </summary> /// <param name="key">A friendly key to internally associate with the callback (does not get passed to client)</param> /// <param name="callbackDelegate">The delegate method to call when this callback gets fired</param> /// <returns>The name of a generated client-side function that can be called from JavaScript with args and context parameters</returns> public string AddCallback(string key, CallbackDelegate callbackDelegate) { if (CallbackFunctions.ContainsKey(key)) { if (callbackDelegate != null && !CallbackDelegates[key].Contains(callbackDelegate)) CallbackDelegates[key].Add(callbackDelegate); return CallbackFunctions[key]; } string str = this.Page.ClientScript.GetCallbackEventReference( this, "args", this.ClientID + "_Callback", //"IAjax.DisplayResult", "context", "ReportGrid_Error", //"IAjax.DisplayError", false); StringBuilder builder2 = new StringBuilder(); // Generate a function name for this guy int index = CallbackDelegates.Count + 1; string funcName = "_fn" + index.ToString() + this.ClientID; builder2.Append("window." + funcName + " = function(args,context){" + (string.IsNullOrEmpty(ClientShowBusyDuringCallback) ? string.Empty : ((UseClientIDPrefix ? (this.ClientID + "_") : string.Empty) + ClientShowBusyDuringCallback + "(true);")) + "args='fn=_fn" + index.ToString() + "&' + (args == null ? '' : args);" + str + ";}\n"); JS.RegisterJSBlock(this, builder2.ToString(), this.ClientID + "_JS" + index.ToString()); CallbackDelegates.Add( key, callbackDelegate == null ? new List<CallbackDelegate>() : new List<CallbackDelegate>(new CallbackDelegate[] { callbackDelegate })); CallbackFunctions.Add(key, funcName); CallbackIndexes.Add("_fn" + index.ToString(), key); return funcName; }
public void SetOnUpdatePlayInfo(CallbackDelegate cb) { AddEventListener("OnUpdatePlayInfo", cb); }
private static extern string nativeRegisterEventListener(CallbackDelegate callback);
public void SetOnErrorOccurred(CallbackDelegate cb) { AddEventListener("OnErrorOccurred", cb); }
public void SetOnPlaybackComplete(CallbackDelegate cb) { AddEventListener("OnPlaybackComplete", cb); }
public void SetOnIdle(CallbackDelegate cb) { AddEventListener("OnIdle", cb); }
public void SetOnStarted(CallbackDelegate cb) { AddEventListener("OnStarted", cb); }
public void SetOnSeeking(CallbackDelegate cb) { AddEventListener("OnSeeking", cb); }
private CallbackDelegate OnSoundAttenuationChange(IDictionary <string, object> args, CallbackDelegate callback) { var attenuation = args.FirstOrDefault(arg => arg.Key == "soundAttenuation").Value?.ToString(); if (!string.IsNullOrEmpty(attenuation)) { TriggerServerEvent(ServerEvents.OnSetSoundAttenuation, attenuation); } return(callback); }
private CallbackDelegate OnHideNUI(IDictionary <string, object> args, CallbackDelegate callback) { API.SetNuiFocus(false, false); API.SendNuiMessage(JsonConvert.SerializeObject(new { type = "HypnonemaNUI.HideUI" })); return(callback); }
private static extern string nativeRegisterCallback(CallbackDelegate callback);
/// <summary> /// Gets an <see cref="IEnumerable{T}"/> with all the <see cref="AnalyticsAccountInfo"/> available to the user. /// </summary> /// <param name="callback">The <see cref="CallbackDelegate{T}"/> to invoke when the accounts have been received.</param> public void GetAccountsAsync(CallbackDelegate<IEnumerable<AnalyticsAccountInfo>> callback) { if (callback != null) { ThreadPool.QueueUserWorkItem( o => { IEnumerable<AnalyticsAccountInfo> result = GetAccounts(); callback(result); }); } }
protected override void NativeRegisterEventListener(CallbackDelegate callback) { AmazonMobileAdsIOS.nativeRegisterEventListener(callback); }
/// <summary> /// Creates an asynchronous request for a report from Google Analytics with the given dimensions and metrics. /// </summary> /// <param name="account">The <see cref="AnalyticsAccountInfo"/> to get the reports for.</param> /// <param name="dimensions">A list of <see cref="Dimension"/> for the report.</param> /// <param name="metrics">A list of <see cref="Metric"/> for the report.</param> /// <param name="from">The start <see cref="DateTime"/> of the report data.</param> /// <param name="to">The end <see cref="DateTime"/> of the report data.</param> /// <param name="callback">The <see cref="CallbackDelegate{T}"/> to invoke when the data has been received.</param> public void RequestReportAsync(AnalyticsAccountInfo account, IEnumerable<Dimension> dimensions, IEnumerable<Metric> metrics, DateTime from, DateTime to, CallbackDelegate<IEnumerable<GenericEntry>> callback) { if (callback != null) { ThreadPool.QueueUserWorkItem(o => { IEnumerable<GenericEntry> result = RequestReport( account, dimensions, metrics, from, to); callback(result); }); } }
public void GetAuthTokenAsync(CallbackDelegate<string> callback) { if (callback != null) { ThreadPool.QueueUserWorkItem(o => { string auth = GetAuthToken(); callback(auth); }); } }
static void GetResult(int[] arr, CallbackDelegate cbd) { cbd(arr); Console.WriteLine("\n-------------------"); }
public ConsoleFunction(string menu_entry_text, CallbackDelegate callback_delegate) { _menu_text = menu_entry_text; callback = callback_delegate; }
private CallbackDelegate OnPause(IDictionary <string, object> args, CallbackDelegate callback) { TriggerServerEvent(ServerEvents.OnPause); return(callback); }
public static extern void StartAPI(CallbackDelegate notifyInfo, CallbackDelegateTick notifyTick, CallbackDelegate notifyLog);
private CallbackDelegate OnResumeVideo(IDictionary <string, object> args, CallbackDelegate callback) { TriggerServerEvent(ServerEvents.OnResumeVideo); return(callback); }
public void UnsubscribeCardEvent() { ICardEventCallback callback = OperationContext.Current.GetCallbackChannel<ICardEventCallback>(); CardInserted -= callback.OnCardInserted; CardRemoved -= callback.OnCardRemoved; }
private CallbackDelegate OnSoundMinDistanceChange(IDictionary <string, object> args, CallbackDelegate callback) { var soundMinDistance = args.FirstOrDefault(arg => arg.Key == "minDistance").Value?.ToString(); if (!string.IsNullOrEmpty(soundMinDistance)) { TriggerServerEvent(ServerEvents.OnSetSoundMinDistance, soundMinDistance); } return(callback); }
public void Invoke(CallbackDelegate action) { using (ManualResetEvent ok = new ManualResetEvent(false)) { int msg = Interlocked.Increment(ref nextMessage) % 0x1000 + 0x9000; MessageHandlers[msg] = action + delegate { ok.Set(); }; PostMessage(msg, IntPtr.Zero, IntPtr.Zero); ok.WaitOne(); } }
public void SetOnThrowException(CallbackDelegate cb) { AddEventListener("OnThrowException", cb); }
/// <summary> /// Creates an asynchronous request for a report from Google Analytics with the given dimensions and metrics. /// </summary> /// <param name="account">The <see cref="AnalyticsAccountInfo"/> to get the reports for.</param> /// <param name="from">The start <see cref="DateTime"/> of the report data.</param> /// <param name="to">The end <see cref="DateTime"/> of the report data.</param> /// <param name="callback">The <see cref="CallbackDelegate{T}"/> to invoke when the data has been received.</param> public void GetUserCountByLocationAsync(AnalyticsAccountInfo account, DateTime from, DateTime to, CallbackDelegate<IEnumerable<CityReport>> callback) { if (callback != null) { ThreadPool.QueueUserWorkItem(o => { IEnumerable<CityReport> result = GetUserCountByLocation(account, from, to); callback(result); }); } }
protected static void OnPlayerDropped([FromSource] Player player, string playerName, CallbackDelegate kickReason) { Debug.WriteLine($"Disconnect: {player.Name} [{player.EndPoint}]. Reason: {kickReason}"); User.SaveAccount(player); }
public void ClearPlayers() { if (listBoxPlayers.InvokeRequired) { CallbackDelegate d = new CallbackDelegate(ClearPlayers); this.Invoke(d); } else { listBoxPlayers.Items.Clear(); } }
private CallbackDelegate ToggleBigMapOnDown(IDictionary <string, object> data, CallbackDelegate callback) { bool state = (bool)data["newstate"]; Config["BigMapOnDown"] = state ? "true" : "false"; callback("ok"); return(callback); }
public void SetCallback(CallbackDelegate x) { callback = x; }
protected static void OnPlayerConnecting([FromSource] Player player, string playerName, CallbackDelegate kickCallback, IDictionary <string, object> deferrals) { Debug.WriteLine($"Connect: {player.Name} [{player.EndPoint}]"); if (!User.DoesAccountExist(player)) { User.CreatePlayerAccount(player); } }