private static IEnumerable <IImporter> PathToIImporter(string input) { // Remove preceding and seceding quotes from path. input = input.TrimStart('"').TrimEnd('"'); if (string.IsNullOrWhiteSpace(input)) { throw new ArgumentException("Input path cannot be null or whitespace.", nameof(input)); } // Correct paths if (!Path.IsPathRooted(input)) { input = Path.GetFullPath(input); } if (Directory.Exists(input) && input.Contains(Path.DirectorySeparatorChar + "statink")) { foreach (var file in Directory.EnumerateFiles(input)) { if (StatInkReader.AcceptsInput(file)) { yield return(new StatInkReader(file)); } } } else if (!File.Exists(input)) { Console.WriteLine($"Input does not exist on disk. Remote is not currently supported ({input})."); } else if (TwitterReader.AcceptsInput(input)) { yield return(new TwitterReader(input)); } else if (SendouReader.AcceptsInput(input)) { yield return(new SendouReader(input)); } else if (TSVReader.AcceptsInput(input)) { yield return(new TSVReader(input)); } else if (LUTIJsonReader.AcceptsInput(input)) { yield return(new LUTIJsonReader(input)); } else if (BattlefyJsonReader.AcceptsInput(input)) { yield return(new BattlefyJsonReader(input)); } else { throw new NotImplementedException("File extension not recognised or supported."); } }
public ActionResult Index() { TwitterReader objTwitter = new TwitterReader { OAuthConsumerKey = "kiVWzXFJJj4ZdblXDMwFxuWxI", OAuthConsumerSecret = "7QZL2HLcSH2nJYD6D7iLGcxlPmeP0wAYYAJdopUr2Lx3SzAUZx" }; return(View(objTwitter.GetLatestTweets())); }
public ActionResult GetView(int tileId) { var tile = db.Tile.Find(tileId); // which tile is it? if (tile.TileType == 1) { // this is a noticeboard tile. var noticeBoard = tile as Noticeboard; // get Noticeboard Items ViewModel. var noticeboardItem = NoticeboardReader.GetNoticeboardItem(noticeBoard, db); if (noticeboardItem == null) { return(PartialView("_ErrorPartialView", "Cannot find noticeboard item, check your configuration")); } // pass ViewModel to the view. return(PartialView("_NoticeBoardTilePartialView", noticeboardItem)); } if (tile.TileType == 2) { // this is a calendar tile. var calender = tile as Calender; // get Calendar Items ViewModel. var calendarItems = CalendarReader.GetCalendarItems(calender, db); // pass ViewModel to the view. return(PartialView("_CalendarTilePartialView", calendarItems)); } if (tile.TileType == 3) { // this is a newsfeed tile. var newstile = tile as Newsfeed; // get Newsfeed Items ViewModel. var newsItems = RssReader.Read(newstile.RssUrl); // pass ViewModel to the view. return(PartialView("_NewsFeedTilePartialView", newsItems)); } if (tile.TileType == 4) { // this is the a Twitter tile. var twitterTile = tile as Twitter; // get Twitter Items ViewModel. var tweets = TwitterReader.GetTweets(twitterTile.SearchCriteria); // pass ViewModel to the view. return(PartialView("_TwitterTilePartialView", tweets)); } return(PartialView("_TilePartialView")); }
// Use this for initialization void Start() { canvas = GameObject.Find("Canvas"); reader = FindObjectOfType <TwitterReader>(); }