コード例 #1
0
        /// <summary>
        /// Check test cases.
        /// </summary>
        /// <param name="fullfilepath"></param>
        /// <returns></returns>
        public string GetPhotoSetName(string fullfilepath)
        {
            var config = new AppConfig();

               string initPath = config.FolderToScan.ToLower();

               string fullfilepathlower = fullfilepath.ToLower();

               var dirname = Path.GetDirectoryName(fullfilepathlower);

               int indexofInitPath = dirname.IndexOf(initPath);

               int endOfindexofInitPath = indexofInitPath + initPath.Length;

               int lengthofAllFolders = dirname.Length - endOfindexofInitPath;

               string folderafterinitpath = dirname.Substring(endOfindexofInitPath, lengthofAllFolders);

               string allfolderstrwithoutslash = folderafterinitpath.Trim(new[] { '\\' });

               if (string.IsNullOrEmpty(allfolderstrwithoutslash))
               {
               return "General";
               }

               return allfolderstrwithoutslash.Replace('\\', '_');
        }
コード例 #2
0
 /// <summary>
 /// saves authtoken in config and calls Connect()
 /// </summary>
 public void SetUserVerified()
 {
     var config = new AppConfig();
     string authToken = _flickrObj.AuthGetToken(_frob).Token;
     _log.InfoFormat("code : {0}", authToken);
     config.UpdateVerificationCode(authToken);
     Connect(); //verify if the user actually connected.
 }
コード例 #3
0
        private static Flickr CreateFlickr()
        {
            Flickr.CacheDisabled = true;
            var config = new AppConfig();

            var newflickr = new Flickr(
                apiKey: config.Apikey,
                sharedSecret: config.Apisecret,
                token: config.OAuthAccessToken); //token can be null.

            return newflickr;
        }
コード例 #4
0
 public FlickrUploadMan(Flickr flickr)
 {
     _config = new AppConfig();
     this._flickr = flickr;
 }