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

C# Cordova.PluginResult类代码示例

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

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



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


示例16: GetDescription

        public void GetDescription(string options)
        {
            PluginResult result;

            try
            {
                result = new PluginResult(PluginResult.Status.OK, "Cordova plugin by FrostAura to allow for adding events to Windows Phone native calendar.");
            }
            catch (Exception ex)
            {
                result = new PluginResult(PluginResult.Status.ERROR, ex.Message);
            }

            DispatchCommandResult(result);
        }
开发者ID:faGH,项目名称:fa-plugin-calendar,代码行数:15,代码来源:faCalendarPlugin.cs


示例17: ToUpper

        public void ToUpper(string options)
        {
            PluginResult result;

            try
            {
                string[] args = JsonHelper.Deserialize<string[]>(options);
                string[] calendarValues = args[0].Split('|');

                SaveAppointmentTask saveAppointmentTask = new SaveAppointmentTask();

                string title = calendarValues[0];
                string location = calendarValues[1];
                string notes = calendarValues[2];

                int appointmentYear = int.Parse(calendarValues[3]);
                int appointmentMonth = int.Parse(calendarValues[4]);
                int appointmentDay = int.Parse(calendarValues[5]);
                int fromHour = int.Parse(calendarValues[6]);
                int fromMinute = int.Parse(calendarValues[7]);
                int durationMinutes = int.Parse(calendarValues[8]);

                var startDateTime = new DateTime(appointmentYear, appointmentMonth, appointmentDay, fromHour, fromMinute,
                    0);
                var endDateTime = startDateTime.AddMinutes(durationMinutes);

                saveAppointmentTask.StartTime = startDateTime;
                saveAppointmentTask.EndTime = endDateTime;
                saveAppointmentTask.Subject = title;
                saveAppointmentTask.Location = location;
                saveAppointmentTask.Details = notes;
                saveAppointmentTask.IsAllDayEvent = false;
                saveAppointmentTask.Reminder = Reminder.OneHour;
                saveAppointmentTask.AppointmentStatus = AppointmentStatus.Busy;

                saveAppointmentTask.Show();

                result = new PluginResult(PluginResult.Status.OK, "Calendar event added successfully.");
            }
            catch (Exception ex)
            {
                result = new PluginResult(PluginResult.Status.ERROR, ex.Message);
            }

            DispatchCommandResult(result);
        }
开发者ID:faGH,项目名称:fa-plugin-toupper,代码行数:46,代码来源:ToUpperPlugin.cs


示例18: isSupported

        public async void isSupported(string options)
        {
            PluginResult result = new PluginResult(PluginResult.Status.OK);
            result.KeepCallback = true;

            try
            {
                bool available = await StepCounter.IsSupportedAsync();
                result.Message = JsonHelper.Serialize(available);
                DispatchCommandResult(result);
            }
            catch (Exception ex)
            {
                result.Message = JsonHelper.Serialize(new { error = "isSupported", message = ex.Message });
                DispatchCommandResult(result);
            }
        }
开发者ID:Grezzy,项目名称:pedometer,代码行数:17,代码来源:Pedometer.cs


示例19: _setUp

        private void _setUp(string applicationId, string clientKey)
        {
            this.applicationId = applicationId;
            this.clientKey = clientKey;

            ParseClient.Initialize(appId, clientKey);
            await ParseInstallation.CurrentInstallation.SaveAsync();
            //String installationId = ParseInstallation.CurrentInstallation.InstallationId.ToString();
            //String objectId = ParseInstallation.CurrentInstallation.ObjectId.ToString();
            //var installation = ParseInstallation.CurrentInstallation;
            //IEnumerable<string> subscribedChannels = installation.Channels;

            PluginResult pr = new PluginResult(PluginResult.Status.OK, "onRegisterAsPushNotificationClientSucceeded");
            pr.KeepCallback = true;
            DispatchCommandResult(pr);
            //PluginResult pr = new PluginResult(PluginResult.Status.ERROR);
            //pr.KeepCallback = true;
            //DispatchCommandResult(pr);
        }
开发者ID:OrazioLentini,项目名称:cordova-plugin-pushnotification-parse,代码行数:19,代码来源:ParsePlugin.cs


示例20: register

    public void register(string unparsedOptions)
    {
        var options = JsonHelper.Deserialize<string[]>(unparsedOptions)[0];
        var config = JsonHelper.Deserialize<PushConfig>(options);

        Registration registration = new Registration();
        registration.PushReceivedEvent += HandleNotification;
        registration.Register(new AeroGear.Push.PushConfig() { UnifiedPushUri = config.UnifiedPushUri, VariantId = config.VariantId, VariantSecret = config.VariantSecret });
        InvokeCustomScript(new ScriptCallback("eval", new string[] { "cordova.require('org.jboss.aerogear.cordova.push.AeroGear.UnifiedPush').successCallback()" }), false);

        PluginResult result = new PluginResult(PluginResult.Status.NO_RESULT);
        result.KeepCallback = true;
        DispatchCommandResult(result);

        if (P.message != null)
        {
            HandleNotification(new Event() { Alert = P.message });
        }
    }
开发者ID:rsmeral,项目名称:aerogear-cordova-push,代码行数:19,代码来源:PushPlugin.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# UI.NotificationBox类代码示例发布时间:2022-05-26
下一篇:
C# ManagementServices.CallButlerAuthInfo类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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