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

C# ConnectionResult类代码示例

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

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



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

示例1: UploadVideoHash

        public static bool UploadVideoHash(IMLItem Item, string location, string imdbid, ConnectionResult connectionresult, bool FileServerIsOnline, bool IsUNC)
        {

            if (String.IsNullOrEmpty(imdbid))
            {
                Debugger.LogMessageToFile("[OSdb movie hash uploader] This video's IMDb ID is not available. Uploading of it's file hash cannot be performed.");
                return false;
            }

            if (!FileServerIsOnline && IsUNC)
            {
                Debugger.LogMessageToFile("[OSdb movie hash uploader] Your file server is offline. ");
                return false;
            }

            if (!File.Exists(location))
                return false;

            string moviehash = Helpers.GetTagValueFromItem(Item, "VideoHash");

            if (String.IsNullOrEmpty(moviehash))
                return false;

           
            #region get file info
            Debugger.LogMessageToFile("[OSdb movie hash uploader] Extracting file information for movie hash uploading...");
            FileInfo file = new FileInfo(location);
            long filesize = file.Length;
            string imdbidNumOnly = imdbid.Remove(0, 2);      
            #endregion

            return PerformUploading(Item, moviehash, connectionresult, filesize, imdbidNumOnly);
        
        }
开发者ID:stavrossk,项目名称:MeediFier_for_MeediOS,代码行数:34,代码来源:OSdbMovieHashUploader.cs


示例2: PerformUploading

        private static bool PerformUploading(IMLItem Item, string moviehash, ConnectionResult connectionresult, long filesize, string imdbidNumOnly)
        {
            try
            {
                MainImportingEngine.ThisProgress.Progress(MainImportingEngine.CurrentProgress, "Updating video definitions database...");
                InsertVideoHash(Item, connectionresult.OsDbLoginResult.token, moviehash, filesize,
                                             imdbidNumOnly);
                return true;
            }
            catch
            {
                MainImportingEngine.ThisProgress.Progress(MainImportingEngine.CurrentProgress,
                                               "Osdb database did not respond. Retrying...");
                Thread.Sleep(3000);
                try
                {
                    InsertVideoHash(Item, connectionresult.OsDbLoginResult.token, moviehash, filesize,
                                                 imdbidNumOnly);
                    return true;
                }
                catch
                {
                    Debugger.LogMessageToFile("Unable to communicate with OSdb. Video hash was not uploaded.");
                    MainImportingEngine.ThisProgress.Progress(MainImportingEngine.CurrentProgress,
                                                   "Unable to communicate with OSdb. Video hash was not uploaded.");
                    return false;
                }

            }


        }//endof method
开发者ID:stavrossk,项目名称:MeediFier_for_MeediOS,代码行数:32,代码来源:OSdbMovieHashUploader.cs


示例3: OSoperations

        internal static ConnectionResult ConnectToOsDb
            (ConnectionResult connectionResult)
        {

            if (!connectionResult.InternetConnectionAvailable
                &&
                Settings.ConnectionDiagnosticsEnabled)
            {
                connectionResult.OSDbIsOnline = false;
                return connectionResult;
            }



            if (!Settings.EnableVideoHasher &&
                !Settings.EnableSubtitleDownloader &&
                !Settings.WantOSdbDetails)
            {
                connectionResult.OSDbIsOnline = false;
                return connectionResult;
            }



            OSoperations osDbOperations = new OSoperations();

            connectionResult = 
                TryConnection(osDbOperations, connectionResult);


            return connectionResult;


        }
开发者ID:stavrossk,项目名称:MeediFier_for_MeediOS,代码行数:34,代码来源:OsDbConnector.cs


示例4: OsDbConnectionRetry

        internal static ConnectionResult OsDbConnectionRetry(OSoperations osDbOperations,
            ConnectionResult connectionResult)
        {
            MainImportingEngine.ThisProgress.Progress
                (MainImportingEngine.CurrentProgress,
                 "OSdb did not respond. Retrying... ");

            Thread.Sleep(2000);

            try
            {
                connectionResult.OsDbLoginResult =
                    osDbOperations.SiteLogin();

                MainImportingEngine.ThisProgress.Progress
                    (MainImportingEngine.CurrentProgress,
                     "login status: " +
                     connectionResult.OsDbLoginResult.Status);

                Thread.Sleep(3000);

                connectionResult.OsDbIsOnline = true;

            }
            catch (Exception)
            {
                connectionResult =
                    DisableOsDbConnection(connectionResult);
            }

            return connectionResult;
        }
开发者ID:stavrossk,项目名称:Automated-Video-Subtitle-Importer-for-MeediOS,代码行数:32,代码来源:OsDbConnector.cs


示例5: OnConnectionFailed

        public void OnConnectionFailed (ConnectionResult result)
        {
            Log.Debug (TAG, "onConnectionFailed:" + result);

            if (!mIsResolving && mShouldResolve)
            {
                if (result.HasResolution)
                {
                    try
                    {
                        result.StartResolutionForResult (Activity, RC_SIGN_IN);
                        mIsResolving = true;
                    }
                    catch (IntentSender.SendIntentException e)
                    {
                        Log.Error (TAG, "Could not resolve ConnectionResult.", e);
                        mIsResolving = false;
                        mGoogleApiClient.Connect ();
                    }
                }
                else {
                    ShowErrorDialog (result);
                }
            }
            else {
                UpdateUI (false);
            }
        }
开发者ID:yonifra,项目名称:Shortie,代码行数:28,代码来源:LoginFragment.cs


示例6: IdentifyMovieByVideoFingerprint

        internal static string IdentifyMovieByVideoFingerprint(IMLItem item, ConnectionResult connectionresult, bool FileServerIsOnline, bool IsUNC, string location, string parent )
        {

            #region function variables

            string moviehash = Helpers.GetTagValueFromItem(item,"VideoHash");
            string imdbid = Helpers.GetTagValueFromItem(item,"ImdbID");
            #endregion


            if (!String.IsNullOrEmpty(imdbid))
                return imdbid;

            #region Compute Hash
            if (String.IsNullOrEmpty(moviehash))
            {
                //if ( Importer.EnableHashing)
                //{
                if (!IsUNC || FileServerIsOnline)
                {
                    if (File.Exists(location))
                    {
                        Debugger.LogMessageToFile("Computing video fingerprint for " + item.Name + "...");
                        MainImportingEngine.ThisProgress.Progress(MainImportingEngine.CurrentProgress, "Computing video fingerprint for " + item.Name + "...");
                        Thread.Sleep(200);
                        moviehash = Hasher.ComputeHash(location, item);
                        item.Tags["VideoHash"] = moviehash;
                        item.SaveTags();
                    }
                    else
                    {
                        MainImportingEngine.ThisProgress.Progress(MainImportingEngine.CurrentProgress, "The video file in location field was not found. MediaFairy cannot identify this film.");
                        Thread.Sleep(Settings.SleepValue);
                    }
                }
                //}
            }
            else moviehash = Helpers.GetTagValueFromItem(item,"VideoHash");

            item.SaveTags();
            #endregion


            MovieDescriptorReader.ReadMovieDescriptor(item, moviehash, parent, item.Name );


            if (Settings.PrimaryVideoFingerprintMatchingSource == "OSDb")
            {
                OSDbVideoFingeprintIdentifier.IdentifyMovieByHashOSDb(item, connectionresult);
                imdbid = TMDbVideoFingerprintIdentifier.IdentifyMovieByHashTMDb(item, connectionresult);
            }
            else
            {
                TMDbVideoFingerprintIdentifier.IdentifyMovieByHashTMDb(item, connectionresult);
                imdbid = OSDbVideoFingeprintIdentifier.IdentifyMovieByHashOSDb(item, connectionresult);
            }

            return imdbid;
        }
开发者ID:stavrossk,项目名称:MeediFier_for_MeediOS,代码行数:59,代码来源:VideoFingerprintIdentifier.cs


示例7: ResolveConnectionFailed

        public static void ResolveConnectionFailed(ConnectionResult connectionResult)
        {
            if (connectionResult.HasResolution) {

            } else {

            }
        }
开发者ID:nagyist,项目名称:bikr,代码行数:8,代码来源:ServiceUtils.cs


示例8: OnConnectionFailed

        public void OnConnectionFailed(ConnectionResult result)
        {
            if (progressDialog.IsShowing) {
                ResolveLogin (result);
            }

            connectionResult = result;
            Toast.MakeText (this, "Connection Failed!", ToastLength.Long).Show ();
        }
开发者ID:Mpverdi,项目名称:GooglePlusSignIn,代码行数:9,代码来源:MainActivity.cs


示例9: DisconnectMessage

        public void DisconnectMessage(ConnectionResult result, string customReason)
        {
            var msg = new DisconnectMessage();
            msg.Reason = ConnectionResult.Success;
            msg.CustomReason = null;

            var mresult = msg.AssertLengthMatches();
            Assert.AreEqual (msg.Reason, mresult.Reason);
            Assert.AreEqual (msg.CustomReason, mresult.CustomReason);
        }
开发者ID:strager,项目名称:Tempest,代码行数:10,代码来源:InternalProtocolMessageTests.cs


示例10:

        public static string IdentifyFilmByFilmTitleMatchingEngines
            (IMLItem item, string imdbid, IMDbOperations imdbOp, 
             string year, ConnectionResult connectionresult)
        {


            #region Return Cases
            if (!Settings.FilmTitleMatchingEnginesAreEnabled)
            {
                Debugger.LogMessageToFile("[IMDb Film Title Matcher] IMDb Title matching is disabled. Returning...");
                return imdbid;
            }

            if (!String.IsNullOrEmpty(imdbid))
            {
                Debugger.LogMessageToFile("[IMDb Film Title Matcher] This item is already identified. Returning...");
                return imdbid;
            }
            #endregion

            if (Settings.PrimaryFilmTitleMatchingEngine == "TMDb")
            {


                imdbid = Code.Media_Identifiers.
                    Film_Identifiers.Title_Matching_Engines
                    .TMDb.TMDbTitleMatchingEngine.
                    IdentifyFilmByTMDbFilmTitleMatchingEngine(item);

                imdbid = IdentifyFilmByIMDbFilmTitleMatchingEngines
                    (item, imdbid, imdbOp, connectionresult);
            
            
            }
            else
            {


                imdbid = IdentifyFilmByIMDbFilmTitleMatchingEngines
                    (item, imdbid, imdbOp, connectionresult);


                imdbid = Code.Media_Identifiers.
                    Film_Identifiers.Title_Matching_Engines
                    .TMDb.TMDbTitleMatchingEngine.
                    IdentifyFilmByTMDbFilmTitleMatchingEngine(item);


            }



            return imdbid;
        }
开发者ID:stavrossk,项目名称:MeediFier_for_MeediOS,代码行数:54,代码来源:filmTitleMatchingEngine.cs


示例11: InternetConnectionTestWasSuccessful

        private static ConnectionResult InternetConnectionTestWasSuccessful()
        {
            ConnectionResult connectionresult = new ConnectionResult();

            Helpers.UpdateProgress("Performing Diagnostic Operations...",
                                   "Internet connection test was successful.", null);

            Thread.Sleep(3000);

            connectionresult.InternetConnectionAvailable = true;
            return connectionresult;
        }
开发者ID:stavrossk,项目名称:MeediFier_for_MeediOS,代码行数:12,代码来源:InternetConnectionDiagnostic.cs


示例12: IdentifyEpisode

        public static string IdentifyEpisode(IMLItem item, ConnectionResult connectionresult,
            bool fileServerIsOnline, bool isUNC, string location, string parent)
        {

            CalculateVideoHash(item, fileServerIsOnline, isUNC, location);

            //Helpers.ReadXmlForEpisode(Item, moviehash, parent );

            string videoHash = Helpers.GetTagValueFromItem(item, "Hash");
            string imdbID = Helpers.GetTagValueFromItem(item, "ImdbID");

            //imdbID = GetIMDbIdByVideoHash(item, connectionresult, imdbID, videoHash);

            return imdbID;

        }
开发者ID:stavrossk,项目名称:MeediFier_for_MeediOS,代码行数:16,代码来源:TvSeriesOperations.cs


示例13: ConnectToOsDb

        internal static ConnectionResult ConnectToOsDb(ConnectionResult connectionResult)
        {
            if (!connectionResult.InternetConnectionAvailable
                &&
                Settings.ConnectionDiagnosticsEnabled)
            {
                connectionResult.OsDbIsOnline = false;
                return connectionResult;
            }

            OSoperations osDbOperations = new OSoperations();

            connectionResult =
                TryConnection(osDbOperations, connectionResult);

            return connectionResult;
        }
开发者ID:stavrossk,项目名称:Automated-Video-Subtitle-Importer-for-MeediOS,代码行数:17,代码来源:OsDbConnector.cs


示例14: OsDbConnectionFirstTry

        internal static ConnectionResult OsDbConnectionFirstTry(OSoperations osDbOperations,
            ConnectionResult connectionResult)
        {
            connectionResult.OsDbLoginResult =
                osDbOperations.SiteLogin();

            MainImportingEngine.ThisProgress.Progress
                (MainImportingEngine.CurrentProgress,
                 "login status: " +
                 connectionResult.OsDbLoginResult.Status);

            Thread.Sleep(3000);

            connectionResult.OsDbIsOnline = true;

            return connectionResult;
        }
开发者ID:stavrossk,项目名称:Automated-Video-Subtitle-Importer-for-MeediOS,代码行数:17,代码来源:OsDbConnector.cs


示例15: CalculateMusicDnsIdentificationTime

        internal static int CalculateMusicDnsIdentificationTime(ConnectionResult connectionresult,
                            out int tracksToIdentify, ref int totalTracksToIdentifyCount)
        {

            int remainingTime = 0;
            tracksToIdentify = 0;

            if (!Settings.EnableMusicDnsAudioTrackIdentification)
                return remainingTime;

            if (
                !Settings.EstimateAudioIdentification ||
                (
                    !connectionresult.InternetConnectionAvailable && 
                    Settings.ConnectionDiagnosticsEnabled
                )
                )
                return remainingTime;


            Debugger.LogMessageToFile("Calculating audio identification time...");
            MainImportingEngine.ThisProgress.Progress(MainImportingEngine.CurrentProgress,
                                                      "Calculating audio identification time...");
            Thread.Sleep(500);


            CountItemsWhichNeedMusicDnsIdentification
                (ref totalTracksToIdentifyCount);


            remainingTime = totalTracksToIdentifyCount*10;
            tracksToIdentify = totalTracksToIdentifyCount;


            if (totalTracksToIdentifyCount > 12)
            {
                StatusForm.statusForm.TrayIcon.ShowBalloonTip(5000,
                    "Music Track Identification has started.",
                    "This operation will need approximately " +
                    remainingTime/60 + " minutes to complete. ",
                    ToolTipIcon.Info);
            }

            return remainingTime;
        
        }
开发者ID:stavrossk,项目名称:MeediFier_for_MeediOS,代码行数:46,代码来源:MusicDnsIdentificationTimeCalculator.cs


示例16: OnConnectionFailed

        public void OnConnectionFailed(ConnectionResult result)
        {
            if (resolvingError)
                return; // Already attempting to resolve an error.

            if (result.HasResolution)
                try {
                    resolvingError = true;
                    result.StartResolutionForResult(context, 1001);
                } catch (Exception e) {
                    Console.WriteLine("[SimpleLocation: Connection failed. Error: {0}]", e.Message);
                    googleApiClient.Connect(); // There was an error with the resolution intent. Try again.
                }
            else {
                GooglePlayServicesUtil.GetErrorDialog(result.ErrorCode, context, 9000)?.Show();
                resolvingError = true;
            }
        }
开发者ID:jv9,项目名称:SimpleLocation,代码行数:18,代码来源:SimpleLocationManager.Droid.cs


示例17:

        internal static string PerformMediaOrganizing
            (bool fileServerChecked,
            bool fileServerIsOnline,
            ConnectionResult connectionresult,
            int currentItem,
            string[] multipart, string location,
            IMLItem Item, bool IsMultipart)
        {

            if (!Settings.WantSortingTvShows)
                return location;
            
            string itemTitle
                = Helpers.GetTagValueFromItem
                (Item, "EpisodeName");



            #region update runtime paramaters

            itemUpdateParams updateParams;
            updateParams.FileInUse = Settings.FileInUse;
            updateParams.IsMultipart = IsMultipart;
            updateParams.CanWorkOnline = connectionresult.InternetConnectionAvailable;
            updateParams.CompletedItems = currentItem;
            updateParams.FileServerChecked = fileServerChecked;
            updateParams.FileServerIsOnline = fileServerIsOnline;
            updateParams.OSIsOnline = connectionresult.OSDbIsOnline;

            #endregion



            MediaOrganizers.OrganizeMediaFiles
                (Item, itemTitle, multipart, ref location,
                 Settings.SortingDestinationTvShows,
                 Settings.DirectoryTagMaskTvShows,
                 updateParams,
                 "TvShow");


            return location;
       
        }
开发者ID:stavrossk,项目名称:MeediFier_for_MeediOS,代码行数:44,代码来源:SingleTvEpisodeItemUpdaterHelpers.cs


示例18: DisableOsDbConnection

        internal static ConnectionResult DisableOsDbConnection(ConnectionResult connectionResult)
        {
            MainImportingEngine.ThisProgress.Progress
                (MainImportingEngine.CurrentProgress,
                 "Unable to connect to OSdb online database. ");

            //StatusForm.statusForm.TrayIcon.ShowBalloonTip
            //    (5000, "Unable to connect to OSDb",
            //     "MediaFairy was unable to connect to " +
            //     "OpenSubtitles.org databse." +
            //     "Video Fingerprint Identifying and Subtitle Downloading" +
            //     "will not be performed in this session using this source.",
            //     ToolTipIcon.Warning);

            Thread.Sleep(2000);

            connectionResult.OsDbIsOnline = true;

            return connectionResult;
        }
开发者ID:stavrossk,项目名称:Automated-Video-Subtitle-Importer-for-MeediOS,代码行数:20,代码来源:OsDbConnector.cs


示例19: OnConnectionFailed

 public void OnConnectionFailed(ConnectionResult p0)
 {
     if (p0.HasResolution)
     {
         try
         {
             Mvx.TaggedTrace("OnConnectionFailed()", "Launching Resolution for ConnectionResult with ErrorCode: {0}", p0.ErrorCode.ToString());
             var intent = new Intent();
             var receiver = new ConnectionFailedPendingIntentReceiver();
             receiver.ResultOk += ok => {
                 if (ok)
                     _locationClient.Connect();
             };
             p0.Resolution.Send(Context, 0, intent, receiver, null);
         }
         catch (PendingIntent.CanceledException ex)
         {
             Mvx.TaggedTrace("OnConnectionFailed()", "Resolution for ConnectionResult Cancelled! Exception: {0}", ex);
         }
     }
 }
开发者ID:Sway0308,项目名称:MvxGeoLocationSample,代码行数:21,代码来源:PlayServicesLocationWatcher.cs


示例20: TryConnection

        private static ConnectionResult TryConnection(OSoperations osDbOperations, ConnectionResult connectionResult)
        {
            Helpers.UpdateProgress("Performing Diagnostic Operations... ",
                                   "Connecting to OSDb...", null);

            try
            {
                connectionResult =
                    OsDbConnectionFirstTry
                        (osDbOperations, connectionResult);
            }
            catch (Exception)
            {
                connectionResult =
                    OsDbConnectionRetry
                        (osDbOperations, connectionResult);
            }

            return connectionResult;

        }
开发者ID:stavrossk,项目名称:MeediFier_for_MeediOS,代码行数:21,代码来源:OsDbConnector.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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