当前位置: 首页>>代码示例>>C#>>正文


C# Callback类代码示例

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


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


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