當前位置: 首頁>>代碼示例>>C#>>正文


C# Cordova.PluginResult類代碼示例

本文整理匯總了C#中WPCordovaClassLib.Cordova.PluginResult的典型用法代碼示例。如果您正苦於以下問題:C# PluginResult類的具體用法?C# PluginResult怎麽用?C# PluginResult使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


PluginResult類屬於WPCordovaClassLib.Cordova命名空間,在下文中一共展示了PluginResult類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: close

 public void close(string options = "")
 {
     if (browser != null)
     {
         Deployment.Current.Dispatcher.BeginInvoke(() =>
         {
             PhoneApplicationFrame frame = Application.Current.RootVisual as PhoneApplicationFrame;
             if (frame != null)
             {
                 PhoneApplicationPage page = frame.Content as PhoneApplicationPage;
                 if (page != null)
                 {
                     Grid grid = page.FindName("LayoutRoot") as Grid;
                     if (grid != null)
                     {
                         grid.Children.Remove(browser);
                     }
                     page.ApplicationBar = null;
                 }
             }
             browser = null;
             string message = "{\"type\":\"exit\"}";
             PluginResult result = new PluginResult(PluginResult.Status.OK, message);
             result.KeepCallback = false;
             this.DispatchCommandResult(result);
         });
     }
 }
開發者ID:sabarimanoj,項目名稱:browser,代碼行數:28,代碼來源:InAppBrowser.cs

示例2: readSecret

    public async void readSecret(string ignored)
    {
        var token = await new Repository().ReadToken();

        PluginResult result = new PluginResult(PluginResult.Status.OK, token);
        DispatchCommandResult(result);
    }
開發者ID:tgptom,項目名稱:aerogear-cordova-otp,代碼行數:7,代碼來源:OtpPlugin.cs

示例3: greet

 public void greet(string args)
 {
     string name = JsonHelper.Deserialize<string[]>(args)[0];
     string message = "Hello " + name;
     PluginResult result = new PluginResult(PluginResult.Status.OK, message);
     DispatchCommandResult(result);
 }
開發者ID:madhavanindira,項目名稱:SasiHello,代碼行數:7,代碼來源:Hello.cs

示例4: HandleNotification

    void HandleNotification(Event pushEvent)
    {
        PluginResult result = new PluginResult(PluginResult.Status.OK, pushEvent);
        result.KeepCallback = true;
        DispatchCommandResult(result);

    }
開發者ID:rsmeral,項目名稱:aerogear-cordova-push,代碼行數:7,代碼來源:PushPlugin.cs

示例5: init

        public void init(string args)
        {
            var pr = new PluginResult(PluginResult.Status.OK);
            pr.KeepCallback = true;

            try
            {
                if (string.IsNullOrEmpty(args))
                {
                    DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, "You must supply Facebook Application Key"));
                    return;
                }

                var _args = WPCordovaClassLib.Cordova.JSON.JsonHelper.Deserialize<string[]>(args);
                FacebookSessionClient = new FacebookSessionClient(_args[0]);

                DateTime access_expires;

                Settings.TryGetValue<string>("fb_access_token", out AccessToken);
                Settings.TryGetValue<DateTime>("fb_access_expires", out  access_expires);

                if (AccessToken != null)
                    this.DispatchCommandResult(new PluginResult(PluginResult.Status.OK));
                else
                    DispatchCommandResult(new PluginResult(PluginResult.Status.NO_RESULT));
            }
            catch (Exception ex)
            {
                RemoveLocalData();
                DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, ex.Message));
            }
        }
開發者ID:purplecabbage,項目名稱:Cordova-FB-Plugin,代碼行數:32,代碼來源:Connect.cs

示例6: registerWPEventDispatcher

 public void registerWPEventDispatcher(string parameters)
 {
     this.eventDispatcherCallbackId = this.CurrentCommandCallbackId;
     PluginResult result = new PluginResult(PluginResult.Status.OK);
     result.KeepCallback = true;
     DispatchCommandResult(result, this.eventDispatcherCallbackId);
 }
開發者ID:Hassanruediger,項目名稱:appSample,代碼行數:7,代碼來源:SocketPlugin.cs

示例7: getMeanings

        void getMeanings(object sender, DefineCompletedEventArgs e)
        {
            //System.Diagnostics.Debug.WriteLine(e.Result.ToString());

            try
            {
                List<Definition> defList = e.Result.Definitions.ToList();
                List<string> definitions = new List<string>();
                
                //string jsonArray = JsonConvert.SerializeObject(defList, Formatting.Indented);
                Dictionary<string, List<Definition>> obj = new Dictionary<string, List<Definition>>();
                obj.Add("Definitions", defList);
                Dictionary<string, Dictionary<string, List<Definition>>> jsonDic = new Dictionary<string, Dictionary<string, List<Definition>>>();
                jsonDic.Add("DATA", obj);
                string jsonObj = JsonConvert.SerializeObject(jsonDic, Formatting.Indented);
                System.Diagnostics.Debug.WriteLine(jsonObj);
                PluginResult result = new PluginResult(PluginResult.Status.OK,jsonObj);
                result.KeepCallback=false;
                DispatchCommandResult(result);
            }
            catch (Exception ex)
            {
                DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, "Service Error: Did not get proper response from the server, Please check network connectivity"));
                System.Diagnostics.Debug.WriteLine(ex.ToString());
            }
        }
開發者ID:Malkiat-Singh,項目名稱:DictionaryApp,代碼行數:26,代碼來源:DictionaryPlugin.cs

示例8: OnSuccess

 /// <summary>
 /// 安裝成功回調
 /// </summary>
 /// <param name="type">類型標識:安裝/卸載</param>
 /// <param name="appId">應用id</param>
 public override void OnSuccess(AMS_OPERATION_TYPE type, String appId)
 {
     string res = String.Format("\"appid\":\"{0}\",\"type\":\"{1}\"", appId, ((int)type).ToString());
     res = "{" + res + "}";
     xFaceLib.Log.XLog.WriteInfo("--------------AMS OnSuccess result: " + res);
     PluginResult result = new PluginResult(PluginResult.Status.OK, res);
     DispatchPluginResult(this, result);
 }
開發者ID:polyvi,項目名稱:xface-wp8,代碼行數:13,代碼來源:XAppInstallListener.cs

示例9: getInstallationObjectId

        public void getInstallationObjectId(string args)
        {

            String objectId = ParseInstallation.CurrentInstallation.ObjectId.ToString();
            var result = new PluginResult(PluginResult.Status.OK, objectId);
            DispatchCommandResult(result);

        }
開發者ID:Rareloop,項目名稱:phonegap-parse-plugin,代碼行數:8,代碼來源:ParsePlugin.cs

示例10: OnError

 /// <summary>
 /// 安裝錯誤回調
 /// </summary>
 /// <param name="type">類型標識:安裝/卸載</param>
 /// <param name="appId">應用id</param>
 /// /// <param name="errorState">錯誤碼</param>
 public override void OnError(AMS_OPERATION_TYPE type, String appId, AMS_ERROR errorState)
 {
     string res = String.Format("\"errorcode\":\"{0}\",\"appid\":\"{1}\",\"type\":\"{2}\"",
         ((int)errorState).ToString(), appId, ((int)type).ToString());
     res = "{" + res + "}";
     xFaceLib.Log.XLog.WriteInfo("-------------------AMS OnError result: " + res);
     PluginResult result = new PluginResult(PluginResult.Status.ERROR, res);
     DispatchPluginResult(this, result);
 }
開發者ID:polyvi,項目名稱:xface-wp8,代碼行數:15,代碼來源:XAppInstallListener.cs

示例11: generateOTP

    public void generateOTP(string unparsed)
    {
        var secret = JsonHelper.Deserialize<string[]>(unparsed)[0];

        Totp generator = new Totp(secret);

        PluginResult result = new PluginResult(PluginResult.Status.OK, generator.now());
        DispatchCommandResult(result);
    }
開發者ID:tgptom,項目名稱:aerogear-cordova-otp,代碼行數:9,代碼來源:OtpPlugin.cs

示例12: authenticate

        /// <summary>
        /// Native implementation for "authenticate" action
        /// </summary>
        public void authenticate(object jsVersion)
        {
            PhoneHybridMainPage.GetInstance().Authenticate(this);

            // Done
            PluginResult noop = new PluginResult(PluginResult.Status.NO_RESULT);
            noop.KeepCallback = true;
            DispatchCommandResult(noop);
        }
開發者ID:wmathurin,項目名稱:SalesforceMobileSDK-Win8,代碼行數:12,代碼來源:SalesforceOAuthPlugin.cs

示例13: getSubscriptions

        public void getSubscriptions(string args)
        {


            var installation = ParseInstallation.CurrentInstallation;
            IEnumerable<string> subscribedChannels = installation.Channels;
            var result = new PluginResult(PluginResult.Status.OK, subscribedChannels);
            DispatchCommandResult(result);

        }
開發者ID:Rareloop,項目名稱:phonegap-parse-plugin,代碼行數:10,代碼來源:ParsePlugin.cs

示例14: OnProgressUpdated

        /// <summary>
        /// 更新安裝進度
        /// </summary>
        /// <param name="type">類型標識:安裝/卸載</param>
        /// <param name="progressState">進度狀態</param>
        public override void OnProgressUpdated(AMS_OPERATION_TYPE type, InstallStatus progressState)
        {
            string res = String.Format("\"progress\":\"{0}\",\"type\":\"{1}\"", ((int)progressState).ToString(), ((int)type).ToString());
            res = "{" + res + "}";
            xFaceLib.Log.XLog.WriteInfo("-------------------AMS OnProgressUpdated result: " + res);

            //TODO: ams install progress
            PluginResult result = new PluginResult(PluginResult.Status.OK, res);
            result.KeepCallback = true;
            DispatchPluginResult(this, result);
        }
開發者ID:polyvi,項目名稱:xface-wp8,代碼行數:16,代碼來源:XAppInstallListener.cs

示例15: requestAccess

    public async void requestAccess(string unparsed)
    {
        var accountId = JsonHelper.Deserialize<string[]>(unparsed)[0];
        var module = AccountManager.GetAccountByName(accountId);

        AccountManager.SaveSate();
        IsolatedStorageSettings.ApplicationSettings["module"] = accountId;

        await module.RequestAccessAndContinue();

        PluginResult result = new PluginResult(PluginResult.Status.OK, module.GetAccessToken());
        DispatchCommandResult(result);
    }
開發者ID:corinnekrych,項目名稱:aerogear-cordova-oauth2,代碼行數:13,代碼來源:OAuth2Plugin.cs


注:本文中的WPCordovaClassLib.Cordova.PluginResult類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。