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

C# CallBack类代码示例

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

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



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

示例1: FadeIn

 //淡入
 public void FadeIn(float _fadeInTime, CallBack _fun = null)
 {
     if (!isFading)
     {
         StartCoroutine(FadeAction(true,_fadeInTime, _fun));
     }
 }
开发者ID:GaoKaiHaHa,项目名称:MyUnityFrameWork,代码行数:8,代码来源:CameraFade.cs


示例2: Main

        public static void Main()
        {
            CallBack callback = new CallBack(TimeNow);
            Timer time = new Timer(callback.Invoke, null, 0, 1000);

            Console.Read(); //press enter to exit
        }
开发者ID:Bvaptsarov,项目名称:Homework,代码行数:7,代码来源:TimerCallBack.cs


示例3: FadeOut

 //淡出
 public void FadeOut(float _fadeOutTime, CallBack _fun = null)
 {
     if (!isFading)
     {
         StartCoroutine(FadeAction(false,_fadeOutTime, _fun));
     }
 }
开发者ID:GaoKaiHaHa,项目名称:MyUnityFrameWork,代码行数:8,代码来源:CameraFade.cs


示例4: AddVkFriend

        public void AddVkFriend(string uid, CallBack onSuccess, CallBack onError)
        {
            if (!this.connected)
            {
                return;
            }

            var url = "https://api.vk.com/method/friends.add";
            var sendData = new Dictionary<string, string>
                               {
                                   { "access_token", this.access_token },
                                   { "uid", uid }
                               };
            this.GetQuery(
                url,
                sendData,
                res =>
                    {
                        var decodedResponse = Newtonsoft.Json.Linq.JObject.Parse(res.ToString());
                        var answer = decodedResponse["response"];
                        if (answer == null)
                        {
                            onError(new object());
                            return;
                        }

                        onSuccess(answer.ToString());
                    },
                res =>
                    {
                        onError(new object());
                    });
        }
开发者ID:appgranula,项目名称:vk_metro,代码行数:33,代码来源:VK_API.cs


示例5: FadeInToOut

 //从淡入到淡出
 public void FadeInToOut(float _fadeInTime, float afterInDelayTime, float _fadeOutTime, CallBack afterFadeInCallback=null, CallBack afterFadeOutCallback = null)
 {
     if (!isFading)
     {
         StartCoroutine(FadeInToOutAction(_fadeInTime, afterInDelayTime, _fadeOutTime, afterFadeInCallback, afterFadeOutCallback));
     }
 }
开发者ID:GaoKaiHaHa,项目名称:MyUnityFrameWork,代码行数:8,代码来源:CameraFade.cs


示例6: Handle

        public void Handle(List<UPnPArg> args, CallBack cb, XMLWriterPi writer)
        {
            Console.WriteLine("Browse Was called (BrowseStrat)");
            List<UPnPArg> retArgs = new List<UPnPArg>();

            string containerId = GetContainerID(args);

            if (containerId == "BadArgs")
            {
                cb(retArgs, containerId);
            }
            else
            {
                List<ITrack> containingList = _dbLookup.Browse(containerId);
                int NumberReturned = containingList.Count;

                string retVal = writer.ConvertITrackToXML(containingList);

                retArgs.Add(new UPnPArg("Result", retVal));
                retArgs.Add(new UPnPArg("NumberReturned", NumberReturned.ToString()));
                retArgs.Add(new UPnPArg("TotalMatches", NumberReturned.ToString()));

                cb(retArgs, "Browse");
            }
        }
开发者ID:GufCab,项目名称:Semester-Projekt---Pi-Program,代码行数:25,代码来源:DBHandle.cs


示例7: registerCallBack

 public void registerCallBack(CallBack callbackToRegister)
 {
     if(!m_Listeners.Contains(callbackToRegister))
     {
         m_Listeners.Add(callbackToRegister);
     }
 }
开发者ID:ZaikMD,项目名称:ImagineNation,代码行数:7,代码来源:AnimationCallBackManager.cs


示例8: addEventListner

 public void addEventListner(string eventType,CallBack function)
 {
     if(_listenList==null){
         _listenList		= new List<EventListenTerm>();
     }
     _listenList.Add(new EventListenTerm(eventType,function));
 }
开发者ID:hxflyer,项目名称:NanoGUI,代码行数:7,代码来源:EventDispatcher.cs


示例9: removeCallBack

 public void removeCallBack(CallBack callbackToRemove)
 {
     if (m_Listeners.Contains(callbackToRemove))
     {
         m_Listeners.Remove(callbackToRemove);
     }
 }
开发者ID:ZaikMD,项目名称:ImagineNation,代码行数:7,代码来源:AnimationCallBackManager.cs


示例10: string_callback

 public void string_callback(CallBack cb, [StringValue][WideChar(false)] string mesg) {
     if(cb == null) {
         Console.WriteLine("Received a nil callback.");
         return;
     }              
     cb.call_back(mesg);
 }
开发者ID:JnS-Software-LLC,项目名称:iiop-net,代码行数:7,代码来源:TestService.cs


示例11: LongForLoop

 //passing the delegate as a parameter
 // declaring the delegate
 public void LongForLoop(CallBack obj)
 {
     for (int i = 0; i < 10000; i++)
     {
         obj(i); //invokeing the delegate
     }
 }
开发者ID:higharc91,项目名称:LambdaAndDelegateExamples,代码行数:9,代码来源:DelegatesBetweenParties.cs


示例12: Request

    public static void Request(MethodType method, string uri, string body, CallBack<string> callBack)
    {
        try
        {
            Init("8aa5b8b5-f769-11e3-954e-06a6fa0000b9", "6ef2e5c0-3ef1-11e4-ae91-06a6fa0000b9");

            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(APIEndpoint + uri);

            request.Method = method.ToString();
            request.ContentType = "applications/json";

            if (PlayerPrefs.HasKey("access_token"))
            request.Headers["Authorization"] = "Bearer " + PlayerPrefs.GetString("access_token");

            if(request.Method == "POST" || request.Method == "PUT")
            {
                StreamWriter writer = new StreamWriter(request.GetRequestStream());
                writer.Write(body);
                writer.Close();
            }

            HttpWebResponse response = (HttpWebResponse)request.GetResponse();
            Stream dataStream = response.GetResponseStream();
            StreamReader reader = new StreamReader(dataStream);

            string responseFromServer = reader.ReadToEnd();

            callBack(responseFromServer);
        }
        catch(Exception e)
        {
            Debug.Log(e.Message);
        }
    }
开发者ID:ylyking,项目名称:AssetBundleCreator-1,代码行数:34,代码来源:BaasIOBinding.cs


示例13: FadeAction

    IEnumerator FadeAction(bool isFadeIn,float tempFadeTime,  CallBack _fun)
    {
        tempColor = GUI.color;
        GUI.depth = 100;
        fadeTime = tempFadeTime;

        if (isFadeIn) alpha = 0;
        else alpha = 1;

        if (crossfadeTexture == null)
        {
            crossfadeTexture = new Texture2D(1, 1, TextureFormat.RGB24, false);
            crossfadeTexture.SetPixel(0, 0, Color.black);
            crossfadeTexture.Apply();
        }

        isFading = true;
        float tempTime = fadeTime + Time.unscaledTime; ;

        while (true)
        {
                if (!isFadeIn)
                {
                    alpha = (tempTime - Time.unscaledTime) / fadeTime;

                    if (alpha < 0.05f)
                    {
                        alpha = 0;
                        break;
                    }
                }
                else
                {
                    alpha = Mathf.Clamp(1 - ((tempTime - Time.unscaledTime) / fadeTime), 0f, 1f);

                    if (alpha >= 0.98f)
                    {
                        alpha = 1;
                        break;
                    }
                }
            yield return new WaitForEndOfFrame();
        }
        yield return new WaitForEndOfFrame();
        isFading = false;
        Debug.Log("Camera fade alpha: " + alpha);
        try
        {
            if (_fun != null)
            {
                _fun();
            }
        }
        catch (Exception e)
        {
            Debug.LogError("Camera Fade Call back Exception :" + e);
        }
          //  yield return new WaitForEndOfFrame();
    }
开发者ID:GaoKaiHaHa,项目名称:MyUnityFrameWork,代码行数:59,代码来源:CameraFade.cs


示例14: onShowDCN

 public void onShowDCN(string mess, CallBack clickOK) {
     DoOnMainThread.ExecuteOnMainThread.Enqueue(() => {
         this.lb_mess.text = mess;
         btnOK.gameObject.SetActive(true);
         onClickOK = clickOK;
         onShow();
     });
 }
开发者ID:sonxoans2,项目名称:CoThu,代码行数:8,代码来源:PanelThongBao.cs


示例15: Main

        public static void Main(string[] args)
        {
            // Create an instance of the delegate
            CallBack myCallBack = new CallBack(Program.Report);

            // Call the function
            EnumWindows(myCallBack, 0);
        }
开发者ID:oblivious,项目名称:Oblivious,代码行数:8,代码来源:Program.cs


示例16: RequestInventory

 public void RequestInventory(string accountID, CallBack callBack)
 {
     string url = host + "getInventory";
     WWWForm form = new WWWForm();
     form.AddField("PlayerId", accountID.ToString());
     WWW www = new WWW(url, form);
     StartCoroutine(WaitForRequest(www, callBack));
 }
开发者ID:snowhoro,项目名称:Dakimaku,代码行数:8,代码来源:ServerRequests.cs


示例17: CKLBUICanvas

 public CKLBUICanvas(CKLBUITask parent, uint order, float x, float y, uint vertexMax, uint indexMax, CallBack onDrawCallBack)
     : base(s_classID)
 {
     NativeManagement.resetCppError();
     IntPtr ptr = CKLBUICanvas_create(parent != null ? parent.CppObject : IntPtr.Zero, order, x, y, vertexMax, indexMax);
     NativeManagement.intercepCppError();
     bind(ptr);
     m_callback = onDrawCallBack;
 }
开发者ID:ForceRain,项目名称:PlaygroundOSS,代码行数:9,代码来源:CKLBUICanvas.cs


示例18: CKLBStoreService

 public CKLBStoreService(CallBack callback)
     : base(s_classID)
 {
     NativeManagement.resetCppError();
     IntPtr ptr = CKLBStoreService_create();
     NativeManagement.intercepCppError();
     m_callback = callback;
     bind(ptr);
 }
开发者ID:keizi,项目名称:PlaygroundOSS,代码行数:9,代码来源:CKLBStoreService.cs


示例19: CKLBUITouchPad

 public CKLBUITouchPad(CKLBTask parent, CallBack callback, bool modal = false)
     : base(s_classID)
 {
     NativeManagement.resetCppError();
     IntPtr ptr = CKLBUITouchPad_create(parent != null ? parent.CppObject : IntPtr.Zero, modal);
     NativeManagement.intercepCppError();
     bind(ptr);
     m_callback = callback;
 }
开发者ID:keizi,项目名称:PlaygroundOSS,代码行数:9,代码来源:CKLBUITouchPad.cs


示例20: CKLBUIDebugItem

 //a string is given to the constructor which creates a font object
 public CKLBUIDebugItem(CKLBUITask parent, uint order, float x, float y, uint argb, String font_name, uint font_size, String text, uint cmdID, CallBack callback)
     : base(s_classID)
 {
     NativeManagement.resetCppError();
     IntPtr ptr = CKLBUIDebugItem_create(parent != null ? parent.CppObject : IntPtr.Zero, order, x, y, argb, __MarshallingUtils.NativeUtf8FromString(font_name), font_size, __MarshallingUtils.NativeUtf8FromString(text), cmdID);
     NativeManagement.intercepCppError();
     bind(ptr);
     m_callback = callback;
 }
开发者ID:ForceRain,项目名称:PlaygroundOSS,代码行数:10,代码来源:CKLBUIDebugItem.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# CallContext类代码示例发布时间:2022-05-24
下一篇:
C# Call类代码示例发布时间: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