• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Callback类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Callback的典型用法代码示例。如果您正苦于以下问题:C# Callback类的具体用法?C# Callback怎么用?C# Callback使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Callback类属于命名空间,在下文中一共展示了Callback类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Show

    public static void Show(string message, Callback OnFinish = null)
    {
        instance.text.text = message;
        instance.anim.SetBool("display", true);

        instance.onFinish = OnFinish;
    }
开发者ID:khinbaptista,项目名称:IHC_AR,代码行数:7,代码来源:InformationBox.cs


示例2: ReferenceFrameSelector

 public ReferenceFrameSelector(
     ManagerInterface manager,
     IntPtr plugin,
     Callback on_change,
     string name) : base(manager) {
   plugin_ = plugin;
   on_change_ = on_change;
   name_ = name;
   frame_type = FrameType.BODY_CENTRED_NON_ROTATING;
   expanded_ = new Dictionary<CelestialBody, bool>();
   foreach (CelestialBody celestial in FlightGlobals.Bodies) {
     if (!celestial.is_leaf() && !celestial.is_root()) {
       expanded_.Add(celestial, false);
     }
   }
   selected_celestial_ =
       FlightGlobals.currentMainBody ?? Planetarium.fetch.Sun;
   for (CelestialBody celestial = selected_celestial_;
        celestial.orbit != null;
        celestial = celestial.orbit.referenceBody) {
     if (!celestial.is_leaf()) {
       expanded_[celestial] = true;
     }
   }
   on_change_(FrameParameters());
   window_rectangle_.x = UnityEngine.Screen.width / 2;
   window_rectangle_.y = UnityEngine.Screen.height / 3;
 }
开发者ID:ThomasKerman,项目名称:Principia,代码行数:28,代码来源:reference_frame_selector.cs


示例3: DelayedCall

 public DelayedCall(Callback cb, int milliseconds)
     : this()
 {
     PrepareDCObject(this, milliseconds, false);
     callback = cb;
     if (milliseconds > 0) Start();
 }
开发者ID:5196HRDT,项目名称:SISCSHARP,代码行数:7,代码来源:DelayedCall.cs


示例4: AddOnCancelListener

		/**
		 * Add a callback when this window is canceled.
		 */
		public void AddOnCancelListener(Callback listener)
		{
			if(OnCancel != null)
				OnCancel += listener;
			else
				OnCancel = listener;
		}
开发者ID:procore3d,项目名称:giles,代码行数:10,代码来源:pb_FileDialog.cs


示例5: LoginServerCall

 public LoginServerCall(string id, string deviceType, string version, Callback callback)
 {
     this.id = id;
     this.deviceType = deviceType;
     this.version = version;
     this.callback = callback;
 }
开发者ID:maumaugithub,项目名称:round-sapphire-sky,代码行数:7,代码来源:LoginServerCall.cs


示例6: getShareCatalogResults

 public string getShareCatalogResults(string requestParam)
 {
     string RetVal = string.Empty;
     Callback objCallback = new Callback(new System.Web.UI.Page());
     RetVal = objCallback.ShareSearchResult(requestParam);
     return RetVal;
 }
开发者ID:SDRC-India,项目名称:sdrcdevinfo,代码行数:7,代码来源:QdsResults.cs


示例7: Main

  static void Main() 
  {
    Console.WriteLine("Adding and calling a normal C++ callback");
    Console.WriteLine("----------------------------------------");

    Caller caller = new Caller();
    using (Callback callback = new Callback())
    {
      caller.setCallback(callback);
      caller.call();
      caller.resetCallback();
    }

    Console.WriteLine();
    Console.WriteLine("Adding and calling a C# callback");
    Console.WriteLine("------------------------------------");

    using (Callback callback = new CSharpCallback())
    {
      caller.setCallback(callback);
      caller.call();
      caller.resetCallback();
    }

    Console.WriteLine();
    Console.WriteLine("C# exit");
  }
开发者ID:kesmit13,项目名称:swig,代码行数:27,代码来源:runme.cs


示例8: OnEnable

	public void OnEnable() {
		m_RemoteStorageAppSyncedClient = Callback<RemoteStorageAppSyncedClient_t>.Create(OnRemoteStorageAppSyncedClient);
		m_RemoteStorageAppSyncedServer = Callback<RemoteStorageAppSyncedServer_t>.Create(OnRemoteStorageAppSyncedServer);
		m_RemoteStorageAppSyncProgress = Callback<RemoteStorageAppSyncProgress_t>.Create(OnRemoteStorageAppSyncProgress);
		m_RemoteStorageAppSyncStatusCheck = Callback<RemoteStorageAppSyncStatusCheck_t>.Create(OnRemoteStorageAppSyncStatusCheck);
		m_RemoteStorageConflictResolution = Callback<RemoteStorageConflictResolution_t>.Create(OnRemoteStorageConflictResolution);
		m_RemoteStoragePublishedFileSubscribed = Callback<RemoteStoragePublishedFileSubscribed_t>.Create(OnRemoteStoragePublishedFileSubscribed);
		m_RemoteStoragePublishedFileUnsubscribed = Callback<RemoteStoragePublishedFileUnsubscribed_t>.Create(OnRemoteStoragePublishedFileUnsubscribed);
		m_RemoteStoragePublishedFileDeleted = Callback<RemoteStoragePublishedFileDeleted_t>.Create(OnRemoteStoragePublishedFileDeleted);
		m_RemoteStoragePublishFileProgress = Callback<RemoteStoragePublishFileProgress_t>.Create(OnRemoteStoragePublishFileProgress);
		m_RemoteStoragePublishedFileUpdated = Callback<RemoteStoragePublishedFileUpdated_t>.Create(OnRemoteStoragePublishedFileUpdated);

		RemoteStorageFileShareResult = CallResult<RemoteStorageFileShareResult_t>.Create(OnRemoteStorageFileShareResult);
		RemoteStoragePublishFileResult = CallResult<RemoteStoragePublishFileResult_t>.Create(OnRemoteStoragePublishFileResult);
		RemoteStorageDeletePublishedFileResult = CallResult<RemoteStorageDeletePublishedFileResult_t>.Create(OnRemoteStorageDeletePublishedFileResult);
		RemoteStorageEnumerateUserPublishedFilesResult = CallResult<RemoteStorageEnumerateUserPublishedFilesResult_t>.Create(OnRemoteStorageEnumerateUserPublishedFilesResult);
		RemoteStorageSubscribePublishedFileResult = CallResult<RemoteStorageSubscribePublishedFileResult_t>.Create(OnRemoteStorageSubscribePublishedFileResult);
		RemoteStorageEnumerateUserSubscribedFilesResult = CallResult<RemoteStorageEnumerateUserSubscribedFilesResult_t>.Create(OnRemoteStorageEnumerateUserSubscribedFilesResult);
		RemoteStorageUnsubscribePublishedFileResult = CallResult<RemoteStorageUnsubscribePublishedFileResult_t>.Create(OnRemoteStorageUnsubscribePublishedFileResult);
		RemoteStorageUpdatePublishedFileResult = CallResult<RemoteStorageUpdatePublishedFileResult_t>.Create(OnRemoteStorageUpdatePublishedFileResult);
		RemoteStorageDownloadUGCResult = CallResult<RemoteStorageDownloadUGCResult_t>.Create(OnRemoteStorageDownloadUGCResult);
		RemoteStorageGetPublishedFileDetailsResult = CallResult<RemoteStorageGetPublishedFileDetailsResult_t>.Create(OnRemoteStorageGetPublishedFileDetailsResult);
		RemoteStorageEnumerateWorkshopFilesResult = CallResult<RemoteStorageEnumerateWorkshopFilesResult_t>.Create(OnRemoteStorageEnumerateWorkshopFilesResult);
		RemoteStorageGetPublishedItemVoteDetailsResult = CallResult<RemoteStorageGetPublishedItemVoteDetailsResult_t>.Create(OnRemoteStorageGetPublishedItemVoteDetailsResult);
		RemoteStorageUpdateUserPublishedItemVoteResult = CallResult<RemoteStorageUpdateUserPublishedItemVoteResult_t>.Create(OnRemoteStorageUpdateUserPublishedItemVoteResult);
		RemoteStorageUserVoteDetails = CallResult<RemoteStorageUserVoteDetails_t>.Create(OnRemoteStorageUserVoteDetails);
		RemoteStorageEnumerateUserSharedWorkshopFilesResult = CallResult<RemoteStorageEnumerateUserSharedWorkshopFilesResult_t>.Create(OnRemoteStorageEnumerateUserSharedWorkshopFilesResult);
		RemoteStorageSetUserPublishedFileActionResult = CallResult<RemoteStorageSetUserPublishedFileActionResult_t>.Create(OnRemoteStorageSetUserPublishedFileActionResult);
		RemoteStorageEnumeratePublishedFilesByUserActionResult = CallResult<RemoteStorageEnumeratePublishedFilesByUserActionResult_t>.Create(OnRemoteStorageEnumeratePublishedFilesByUserActionResult);
	}
开发者ID:yoraiz0r,项目名称:Steamworks.NET-Test,代码行数:30,代码来源:SteamRemoteStorageTest.cs


示例9: OptimizeAdaptationDataBase

 public string OptimizeAdaptationDataBase()
 {
     string RetVal = string.Empty;
     Callback objCallback = new Callback();
     RetVal = objCallback.GenerateCacheResults("1" + Constants.Delimiters.ParamDelimiter + "General");
     return RetVal;
 }
开发者ID:SDRC-India,项目名称:sdrcdevinfo,代码行数:7,代码来源:OptimizeDataBase.cs


示例10: OnEnable

	public void OnEnable() {
		m_HTML_NeedsPaint = Callback<HTML_NeedsPaint_t>.Create(OnHTML_NeedsPaint);
		m_HTML_StartRequest = Callback<HTML_StartRequest_t>.Create(OnHTML_StartRequest);
		m_HTML_CloseBrowser = Callback<HTML_CloseBrowser_t>.Create(OnHTML_CloseBrowser);
		m_HTML_URLChanged = Callback<HTML_URLChanged_t>.Create(OnHTML_URLChanged);
		m_HTML_FinishedRequest = Callback<HTML_FinishedRequest_t>.Create(OnHTML_FinishedRequest);
		m_HTML_OpenLinkInNewTab = Callback<HTML_OpenLinkInNewTab_t>.Create(OnHTML_OpenLinkInNewTab);
		m_HTML_ChangedTitle = Callback<HTML_ChangedTitle_t>.Create(OnHTML_ChangedTitle);
		m_HTML_SearchResults = Callback<HTML_SearchResults_t>.Create(OnHTML_SearchResults);
		m_HTML_CanGoBackAndForward = Callback<HTML_CanGoBackAndForward_t>.Create(OnHTML_CanGoBackAndForward);
		m_HTML_HorizontalScroll = Callback<HTML_HorizontalScroll_t>.Create(OnHTML_HorizontalScroll);
		m_HTML_VerticalScroll = Callback<HTML_VerticalScroll_t>.Create(OnHTML_VerticalScroll);
		m_HTML_LinkAtPosition = Callback<HTML_LinkAtPosition_t>.Create(OnHTML_LinkAtPosition);
		m_HTML_JSAlert = Callback<HTML_JSAlert_t>.Create(OnHTML_JSAlert);
		m_HTML_JSConfirm = Callback<HTML_JSConfirm_t>.Create(OnHTML_JSConfirm);
		m_HTML_FileOpenDialog = Callback<HTML_FileOpenDialog_t>.Create(OnHTML_FileOpenDialog);
		m_HTML_NewWindow = Callback<HTML_NewWindow_t>.Create(OnHTML_NewWindow);
		m_HTML_SetCursor = Callback<HTML_SetCursor_t>.Create(OnHTML_SetCursor);
		m_HTML_StatusText = Callback<HTML_StatusText_t>.Create(OnHTML_StatusText);
		m_HTML_ShowToolTip = Callback<HTML_ShowToolTip_t>.Create(OnHTML_ShowToolTip);
		m_HTML_UpdateToolTip = Callback<HTML_UpdateToolTip_t>.Create(OnHTML_UpdateToolTip);
		m_HTML_HideToolTip = Callback<HTML_HideToolTip_t>.Create(OnHTML_HideToolTip);

		m_HTML_BrowserReadyResult = CallResult<HTML_BrowserReady_t>.Create(OnHTML_BrowserReady);

		m_Init = SteamHTMLSurface.Init();
		print("SteamHTMLSurface.Init() : " + m_Init);

		m_Texture = null;
	}
开发者ID:yoraiz0r,项目名称:Steamworks.NET-Test,代码行数:30,代码来源:SteamHTMLSurfaceTest.cs


示例11: ForAll

 protected override void ForAll(bool include_internals, Callback callback)
 {
     foreach(Widget w in children)
     {
         if(w.Visible) callback (w);
     }
 }
开发者ID:MASGAU,项目名称:gtk-sharp-ribbon,代码行数:7,代码来源:FlowLayoutContainer.cs


示例12: Subsribe

 /// <summary>
 /// Adds a String and OnEvent to the Susbribers Dictionary
 /// </summary>
 /// <param name="sPub"> As stated before. The awaited message from publisher</param>
 /// <param name="onEvent">OnEvent functions to be called when message is later resieved</param>
 public void Subsribe(string sPub, Callback onEvent)
 {
     if (Subscribers != null && Subscribers.ContainsKey(sPub.ToLower()))
         Subscribers[sPub.ToLower()] += onEvent;
     else
         Subscribers.Add(sPub.ToLower(), onEvent);
 }
开发者ID:QuintonBaudoin,项目名称:CombatRPG,代码行数:12,代码来源:EventSystem.cs


示例13: Initialize

 public override void Initialize()
 {
     this._reader.Start();
     CoreSocialModule.OnTick += new Action(this._writer.SendAll);
     Terraria.Social.Steam.NetSocialModule netSocialModule = this;
     this._lobbyChatMessage = Callback<LobbyChatMsg_t>.Create(new Callback<LobbyChatMsg_t>.DispatchDelegate(netSocialModule.OnLobbyChatMessage));
 }
开发者ID:Celant,项目名称:TerrariaAPI-Server,代码行数:7,代码来源:NetSocialModule.cs


示例14: QueueCallback

 /// <summary>
 /// Utility method for adding callback tasks to a queue
 /// that will eventually be handle in the Unity game loop 
 /// method 'Update()'.
 /// </summary>
 public void QueueCallback(Callback newTask)
 {
     lock (_CallbackQueue)
     {
         _CallbackQueue.Enqueue(newTask);
     }
 }
开发者ID:arnebp,项目名称:tet-unity-aircraft,代码行数:12,代码来源:AeroplaneAiControl.cs


示例15: hideMenu

    /// <summary>
    /// Hide menu
    /// </summary>
    public virtual void hideMenu(float transitionTimer, MenuTransition path = MenuTransition.BACKWARD, Callback callback = null)
    {
        // Stop any transition that's currently in effect
        TransitionHandler.removeTransition(alphaTransition);
        TransitionHandler.removeTransition(positionTransition);

        if(transitionTimer == 0.0f) {

            // Make UI object invisible
            imgAlpha.alpha = 0.0f;

            // Turn off the UI game object
            gameObject.SetActive(false);

            if(callback != null) {
                callback();
            }
        }
        else {

            // Animate the position transition
            positionTransition = TransitionHandler.addTransition(() => Vector2.zero, x => menuTransform.anchoredPosition = x, new Vector2(0, -30), transitionTimer).toggleTimeScale(false);

            // Fade out the menu then disable the object after it's finished fading out
            alphaTransition = TransitionHandler.addTransition(()=>getAlpha.alpha, x => getAlpha.alpha = x, 0.0f, transitionTimer).toggleTimeScale(false).finishLerp(() => {
                gameObject.SetActive(false);
                if (callback != null) {
                    callback();
                }
            });
        }
    }
开发者ID:rhhzero,项目名称:Infinity-Rush,代码行数:35,代码来源:MenuUI.cs


示例16: removeSub

 /// <summary>
 /// Remove this pair of message, function from the Dictionary
 /// </summary>
 /// <param name ="message">
 /// the message to remove to
 /// </param>
 /// <param name ="function">
 /// the function to remove to
 /// </param>
 public static void removeSub(string message, Callback function)
 {
     if (events.ContainsKey(message))
     {
         events[message] = (Callback)events[message] - function;
     }
 }
开发者ID:coringuyen,项目名称:ObserverPattern,代码行数:16,代码来源:EventSystem.cs


示例17: StartWizard

        public void StartWizard(Experiment experimentToBeBenchmarked)
        {
            if (experimentToBeBenchmarked == null)
                throw new InvalidOperationException("Benchmark cannot be run with null experiment.");

            //if webservice is set access webservice, and load benchmarks from there... on OnRetrieveListOfBenchmarksCallCompleted will load load also local benchmarks
            //and discover those that are online contests
            if (m_settings.WebserviceAddress != null)
            {
                m_webService = new WebserviceAccessor(m_settings.WebserviceAddress, true);

                if (m_webService != null)
                {
                    var listOfContestsCallback = new Callback<ListOfContestsResponse>();
                    listOfContestsCallback.CallCompleted += OnRetrieveListOfBenchmarksCallCompleted;
                    m_webService.RetrieveListOfContests(listOfContestsCallback);
                }
                else
                {
                    //load only local benchmarks
                    Benchmarks = BenchmarkLoader.LoadBenchmarksInfo(BenchmarksDirectory);
                }
            }
            else
            {
                //load only local benchmarks
                Benchmarks = BenchmarkLoader.LoadBenchmarksInfo(BenchmarksDirectory);
            }
            ExperimentToBeBenchmarked = experimentToBeBenchmarked;
        }
开发者ID:jira-sarec,项目名称:ICSE-2012-TraceLab,代码行数:30,代码来源:BenchmarkWizard.cs


示例18: answer

 /// <summary>
 /// Process the answer received from the engine
 /// </summary>
 /// <param name="answer">The String containing the answer</param>
 /// <param name="type">The type of the answer (unused)</param>
 /// <param name="callback">The delegate to call</param>
 /// <param name="data">CogaenEdit data that is linked to this answer (e.g. a gameobject)</param>
 public void answer(String answer, byte type, uint id, Callback callback, object data)
 {
     m_queueMutex.WaitOne();
     m_messageQueue.Enqueue(new CMessage(answer, type, id, callback, data));
     m_queueSema.Release(1);
     m_queueMutex.ReleaseMutex();
 }
开发者ID:DelBero,项目名称:XnaScrapEdit,代码行数:14,代码来源:MessageHandler.cs


示例19: EnqueueFrame

        public void EnqueueFrame(ATCommandFrame frame, Callback callback)
        {
            int frameID = UnusedFrameId;
            if (frameID == NOTFOUND)
            {
                waitingForSendingQueue.Enqueue(frame, callback);
                return;
            }

            if (callback != null)
            {
                frame.FrameID = (byte)frameID;
                waitingForResponseQueue.Enqueue(frame, callback);

                if (waitingForResponseQueue.Count > MaxWaitingForResponseNumber)
                {
                    Callback kickOutcallback = waitingForResponseQueue.CallbackForFrameAtIndex(0);
                    if (kickOutcallback != null)
                    {
                        kickOutcallback(null);
                    }
                    waitingForResponseQueue.RemoveAt(0);
                }
            }
            else
            {
                frame.FrameID = 0;
            }

            SendFrame(frame);
        }
开发者ID:kmarcell,项目名称:Netduino3Application,代码行数:31,代码来源:FrameQueueService.cs


示例20: Command

 public Command(string name, string shortDesctiption, string description, Callback callback)
 {
     Name = name;
     ShortDescription = shortDesctiption;
     Description = description;
     Handler = callback;
 }
开发者ID:sopnic,项目名称:larytet-master,代码行数:7,代码来源:CommadLineInterface.cs



注:本文中的Callback类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# CallbackArguments类代码示例发布时间:2022-05-24
下一篇:
C# CallType类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap