当前位置: 首页>>代码示例>>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;未经允许,请勿转载。