public static string GetBaseImagesPath() { //string appPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); AnimePluginSettings settings = new AnimePluginSettings(); string filePath = Path.Combine(settings.ThumbsFolder, "Anime3"); if (!Directory.Exists(filePath)) { Directory.CreateDirectory(filePath); } return(filePath); }
public MainWindow() { // get ID of windowplugin belonging to this setup // enter your own unique code GetID = Constants.PlugInInfo.ID; try { settings = new AnimePluginSettings(); imageHelper = new ImageDownloader(); imageHelper.Init(); listPoster = new AsyncImageResource(); listPoster.Property = "#Anime3.GroupSeriesPoster"; listPoster.Delay = artworkDelay; fanartTexture = new AsyncImageResource(); fanartTexture.Property = "#Anime3.Fanart.1"; fanartTexture.Delay = artworkDelay; GroupFilterQuickSorts = new Dictionary<int, QuickSort>(); //searching searchTimer = new System.Timers.Timer(); searchTimer.AutoReset = true; searchTimer.Interval = settings.FindTimeout_s * 1000; searchTimer.Elapsed += new System.Timers.ElapsedEventHandler(searchTimer_Elapsed); //set the search key sound to the same sound for the REMOTE_1 key Key key = new Key('1', (int)Keys.D1); MediaPortal.GUI.Library.Action action = new MediaPortal.GUI.Library.Action(); ActionTranslator.GetAction(GetID, key, ref action); searchSound = action.SoundFileName; // timer for automatic updates autoUpdateTimer = new System.Timers.Timer(); autoUpdateTimer.AutoReset = true; autoUpdateTimer.Interval = 5 * 60 * 1000; // 5 minutes * 60 seconds autoUpdateTimer.Elapsed += new System.Timers.ElapsedEventHandler(autoUpdateTimer_Elapsed); downloadImagesWorker.DoWork += new DoWorkEventHandler(downloadImagesWorker_DoWork); this.OnToggleWatched += new OnToggleWatchedHandler(MainWindow_OnToggleWatched); g_Player.PlayBackEnded += new g_Player.EndedHandler(g_Player_PlayBackEnded); } catch (Exception ex) { BaseConfig.MyAnimeLog.Write(ex.ToString()); throw; } }
/// <summary> /// If the plugin should have it's own button on the main menu of MediaPortal then it /// should return true to this method, otherwise if it should not be on home /// it should return false /// </summary> /// <param name="strButtonText">text the button should have</param> /// <param name="strButtonImage">image for the button, or empty for default</param> /// <param name="strButtonImageFocus">image for the button, or empty for default</param> /// <param name="strPictureImage">subpicture for the button or empty for none</param> /// <returns>true : plugin needs it's own button on home /// false : plugin does not need it's own button on home</returns> public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage) { AnimePluginSettings sett = new AnimePluginSettings(); strButtonText = sett.PluginName; strButtonImage = String.Empty; strButtonImageFocus = String.Empty; strPictureImage = "hover_my anime3.jpg"; return true; }
public static string GetBaseImagesPath() { //string appPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); AnimePluginSettings settings = new AnimePluginSettings(); string filePath = Path.Combine(settings.ThumbsFolder, "Anime3"); if (!Directory.Exists(filePath)) Directory.CreateDirectory(filePath); return filePath; }