예제 #1
0
        public Configuration(string currentConfig, bool setcurrentconfig, bool createTemp, LoadParameterInfo loadParams)
        {
            #region init variables
              CustomViews = new MFview();
              CurrentView = string.Empty;
              DbSelection = new string[] { string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty };
              ListSeparator = new string[] { string.Empty, string.Empty, string.Empty, string.Empty, string.Empty };
              RoleSeparator = new string[] { string.Empty, string.Empty, string.Empty, string.Empty, string.Empty };
              StrGlobalFilterString = string.Empty;
              WStrSortSensCount = string.Empty;
              WStrSortSens = string.Empty;
              TitleDelim = string.Empty;
              StrPlayedRow = null;
              StrSuppressPlayed = string.Empty;
              MovieList = new List<string[]>();
              TrailerList = new List<string[]>();
              MyFilmsPlaybackActive = false;
              StrArtist = false;
              BoolMenuShowAll = false;
              IsDbReloadRequired = false;
              BoolSortCountinViews = false;
              BoolDontSplitValuesInViews = false;
              BoolSkipViewState = false;
              MenuSelectedId = -1;
              BoolEnableOnlineServices = false;
              #endregion

              #region Load Config Parameters in MyFilms.xml file (section currentConfig)

              //LogMyFilms.Debug("MFC: Configuration loading started for '" + CurrentConfig + "'");
              //if (setcurrentconfig)
              //{
              //  XmlConfig xmlConfigSave = new XmlConfig();
              //  xmlConfigSave.WriteXmlConfig("MyFilms", "MyFilms", "Current_Config", CurrentConfig);
              //  // the xmlwriter caused late update on the file when leaving MP, thus overwriting MyFilms.xml and moving changes to MyFilms.bak !!! -> We write directly only!
              //  //using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MyFilms.xml")))
              //  //{
              //  //  xmlwriter.SetValue("MyFilms", "Current_Config", CurrentConfig);
              //  //  xmlwriter.Dispose();
              //  //}
              //  //using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MyFilms.xml")))
              //}
              using (var xmlConfig = new XmlSettings(Config.GetFile(Config.Dir.Config, "MyFilms.xml"), true)) // true = cached !
              {
            if (setcurrentconfig)
            {
              xmlConfig.WriteXmlConfig("MyFilms", "MyFilms", "Current_Config", currentConfig);
              // XmlSettings.SaveCache(); // ToDo: Debug, if it is required here !
            }
            #region read xml data
            AlwaysShowConfigMenu = xmlConfig.ReadXmlConfig("MyFilms", "MyFilms", "Menu_Config", false);
            StrStorage = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AntStorage", string.Empty);
            StrDirStor = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "PathStorage", string.Empty);
            StrStorageTrailer = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AntStorageTrailer", string.Empty);
            StrDirStorTrailer = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "PathStorageTrailer", string.Empty);
            StrDirStorActorThumbs = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "PathStorageActorThumbs", string.Empty);
            SearchFile = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "SearchFileName", "False");
            SearchFileTrailer = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "SearchFileNameTrailer", false);
            ItemSearchFile = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "ItemSearchFileName", string.Empty);
            ItemSearchGrabber = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "ItemSearchGrabberName", string.Empty);
            ItemSearchGrabberScriptsFilter = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "ItemSearchGrabberScriptsFilter", string.Empty);
            GrabberOverrideLanguage = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "GrabberOverrideLanguage", string.Empty);
            GrabberOverridePersonLimit = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "GrabberOverridePersonLimit", string.Empty);
            GrabberOverrideTitleLimit = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "GrabberOverrideTitleLimit", string.Empty);
            GrabberOverrideGetRoles = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "GrabberOverrideGetRoles", string.Empty);
            PictureHandling = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "PictureHandling", string.Empty);
            ItemSearchFileTrailer = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "ItemSearchFileNameTrailer", string.Empty);
            SearchSubDirs = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "SearchSubDirs", false);
            SearchOnlyExactMatches = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "SearchOnlyExactMatches", false);
            AutoRegisterTrailer = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "TrailerAutoregister", false);
            CacheOnlineTrailer = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "CacheOnlineTrailer", false);

            CheckWatched = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "CheckWatched", false);
            CheckWatchedPlayerStopped = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "CheckWatchedPlayerStopped", false);
            StrIdentItem = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AntIdentItem", string.Empty);
            StrTitle1 = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AntTitle1", string.Empty);
            StrTitle2 = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AntTitle2", string.Empty);
            StrSTitle = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AntSTitle", string.Empty);
            if (StrSTitle == string.Empty) StrSTitle = StrTitle1;

            StrViewDfltItem = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "ViewDfltItem", string.Empty);
            if (loadParams != null && !string.IsNullOrEmpty(loadParams.View)) StrViewDfltItem = loadParams.View;

            StrViewDfltText = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "ViewDfltText", string.Empty);
            if (loadParams != null && !string.IsNullOrEmpty(loadParams.ViewValue)) StrViewDfltText = loadParams.ViewValue;

            CustomViews.View.Clear();
            int iCustomViews = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AntViewTotalCount", -1);

            #region New Customviews not yet present - add them ...
            if (iCustomViews == -1)
            {
              MFview.ViewRow newRow = CustomViews.View.NewViewRow();

              //Films (mastertitle)
              newRow.DBfield = StrTitle1;
              newRow.Label = GUILocalizeStrings.Get(342); // videos
              newRow.Value = "*";
              newRow.ImagePath = MyFilmsSettings.GetPath(MyFilmsSettings.Path.DefaultImages) + @"\Films.jpg";
              CustomViews.View.Rows.Add(newRow);
              //year
              newRow = CustomViews.View.NewViewRow();
              newRow.DBfield = "Year";
              newRow.SortDirectionView = " DESC";
              newRow.Label = BaseMesFilms.TranslateColumn(newRow.DBfield);
              newRow.ImagePath = MyFilmsSettings.GetPath(MyFilmsSettings.Path.DefaultImages) + @"\Year.jpg";
              CustomViews.View.Rows.Add(newRow);
              //Category
              newRow = CustomViews.View.NewViewRow();
              newRow.DBfield = "Category";
              newRow.Label = BaseMesFilms.TranslateColumn(newRow.DBfield);
              newRow.ImagePath = MyFilmsSettings.GetPath(MyFilmsSettings.Path.DefaultImages) + @"\Category.jpg";
              CustomViews.View.Rows.Add(newRow);
              //Country
              newRow = CustomViews.View.NewViewRow();
              newRow.DBfield = "Country";
              newRow.Label = BaseMesFilms.TranslateColumn(newRow.DBfield);
              newRow.ImagePath = MyFilmsSettings.GetPath(MyFilmsSettings.Path.DefaultImages) + @"\Country.jpg";
              CustomViews.View.Rows.Add(newRow);
              //RecentlyAdded
              newRow = CustomViews.View.NewViewRow();
              newRow.DBfield = "RecentlyAdded";
              newRow.Label = BaseMesFilms.TranslateColumn(newRow.DBfield);
              newRow.ImagePath = MyFilmsSettings.GetPath(MyFilmsSettings.Path.DefaultImages) + @"\RecentlyAdded.jpg";
              CustomViews.View.Rows.Add(newRow);
              //Indexed title view
              newRow = CustomViews.View.NewViewRow();
              newRow.DBfield = StrTitle1;
              newRow.Label = BaseMesFilms.TranslateColumn(newRow.DBfield);
              newRow.Index = 1;
              newRow.Value = "*";
              newRow.ImagePath = MyFilmsSettings.GetPath(MyFilmsSettings.Path.DefaultImages) + @"\TitlesIndex.jpg";
              CustomViews.View.Rows.Add(newRow);
              //Box Sets view (mastertitle)
              newRow = CustomViews.View.NewViewRow();
              newRow.DBfield = StrTitle1;
              newRow.Label = "Box Sets";
              newRow.Value = "*";
              newRow.Filter = @"(" + StrTitle1 + @" like '*\*') ";
              newRow.ImagePath = MyFilmsSettings.GetPath(MyFilmsSettings.Path.DefaultImages) + @"\Films.jpg";
              CustomViews.View.Rows.Add(newRow);
              //Actors
              newRow = CustomViews.View.NewViewRow();
              newRow.DBfield = "Actors";
              newRow.Index = 1;
              newRow.Label = BaseMesFilms.TranslateColumn(newRow.DBfield);
              newRow.ImagePath = MyFilmsSettings.GetPath(MyFilmsSettings.Path.DefaultImages) + @"\PersonsIndex.jpg";
              CustomViews.View.Rows.Add(newRow);
              //Producer
              newRow = CustomViews.View.NewViewRow();
              newRow.DBfield = "Producer";
              newRow.Label = BaseMesFilms.TranslateColumn(newRow.DBfield);
              newRow.ImagePath = MyFilmsSettings.GetPath(MyFilmsSettings.Path.DefaultImages) + @"\Persons.jpg";
              CustomViews.View.Rows.Add(newRow);
              iCustomViews = 5; // to load "old Custom Views"
            }
            #endregion

            #region load customviews from config
            int index = 1;
            for (int i = 1; i < iCustomViews + 1; i++)
            {
              if (string.IsNullOrEmpty(xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AntViewText" + index, string.Empty)))
            break;
              MFview.ViewRow view = CustomViews.View.NewViewRow();
              view.Label = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, string.Format("AntViewText{0}", index), string.Empty);
              // view.Label2 = XmlConfig.ReadXmlConfig("MyFilms", CurrentConfig, string.Format("AntViewLabel2{0}", index), string.Empty); // cached counts, if available
              view.ViewEnabled = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, string.Format("AntViewEnabled{0}", index), true);
              view.ImagePath = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, string.Format("AntViewImagePath{0}", index), string.Empty);
              view.DBfield = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, string.Format("AntViewItem{0}", index), string.Empty);
              view.Value = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, string.Format("AntViewValue{0}", index), string.Empty);
              view.Filter = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, string.Format("AntViewFilter{0}", index), string.Empty);
              view.Index = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, string.Format("AntViewIndex{0}", index), 0);
              view.SortFieldViewType = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, string.Format("AntViewSortFieldViewType{0}", index), "Name");
              view.SortDirectionView = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, string.Format("AntViewSortDirectionView{0}", index), " ASC");
              view.SortDirectionView = view.SortDirectionView.Contains("ASC") ? " ASC" : " DESC";
              view.LayoutView = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, string.Format("AntViewLayoutView{0}", index), "0");
              // LogMyFilms.Debug("Adding view - #: '" + index + "', DBitem: '" + view.DBfield + "', View Label: '" + view.Label + "'");
              if (view.DBfield.Length > 0)
            CustomViews.View.AddViewRow(view);
              index++;
            }
            #endregion

            StrFileXml = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AntCatalog", string.Empty);
            StrFileXmlTemp = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AntCatalogTemp", string.Empty);
            StrFileType = (CatalogType)int.Parse(xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "CatalogType", "0"));
            StrPathImg = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AntPicture", string.Empty);
            StrArtistDflt = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "ArtistDflt", false);
            StrPathFanart = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "FanartPicture", string.Empty);
            StrPathViews = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "ViewsPicture", string.Empty);
            StrPathArtist = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "ArtistPicturePath", string.Empty);

            #region user defined display items
            Stritem1 = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AntItem1", string.Empty);
            Stritem2 = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AntItem2", string.Empty);
            Stritem3 = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AntItem3", string.Empty);
            Stritem4 = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AntItem4", string.Empty);
            Stritem5 = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AntItem5", string.Empty);
            Strlabel1 = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AntLabel1", string.Empty);
            Strlabel2 = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AntLabel2", string.Empty);
            Strlabel3 = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AntLabel3", string.Empty);
            Strlabel4 = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AntLabel4", string.Empty);
            Strlabel5 = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AntLabel5", string.Empty);

            StritemDetails1 = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AntItemDetails1", "Category");
            StritemDetails2 = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AntItemDetails2", "Country");
            StritemDetails3 = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AntItemDetails3", "Director");
            StritemDetails4 = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AntItemDetails4", "Producer");
            StritemDetails5 = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AntItemDetails5", "Languages");
            StritemDetails6 = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AntItemDetails6", "Date");
            StrlabelDetails1 = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AntLabelDetails1", BaseMesFilms.TranslateColumn(StritemDetails1));
            StrlabelDetails2 = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AntLabelDetails2", BaseMesFilms.TranslateColumn(StritemDetails2));
            StrlabelDetails3 = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AntLabelDetails3", BaseMesFilms.TranslateColumn(StritemDetails3));
            StrlabelDetails4 = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AntLabelDetails4", BaseMesFilms.TranslateColumn(StritemDetails4));
            StrlabelDetails5 = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AntLabelDetails5", BaseMesFilms.TranslateColumn(StritemDetails5));
            StrlabelDetails6 = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AntLabelDetails6", BaseMesFilms.TranslateColumn(StritemDetails6));
            #endregion

            StrIdentLabel = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AntIdentLabel", string.Empty);
            StrLogos = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "Logos", false);
            StrSuppressAutomatic = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "Suppress", false);
            StrSuppressManual = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "SuppressManual", false);
            StrSuppressPlayStopUpdateUserField = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "SuppressPlayed", false);
            StrSuppressAutomaticActionType = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "SuppressType", string.Empty);
            StrWatchedField = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "WatchedField", "Checked"); // Defaults to "Checked", if no value set, as it's most used in ANT like that
            StrSuppressField = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "SuppressField", string.Empty);
            StrSuppressValue = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "SuppressValue", string.Empty);

            EnhancedWatchedStatusHandling = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "EnhancedWatchedStatusHandling", false) || StrFileType == CatalogType.AntMovieCatalog4Xtended;  // always force MUS/EWS on AMC4 Catalog types
            StrUserProfileName = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "UserProfileName", MyFilms.DefaultUsername); // MyFilms.DefaultUsername

            StrECoptionStoreTaglineInDescription = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "ECoptionStoreTaglineInDescription", false);
            #region Common EC options
            bool addTagline = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "ECoptionAddTagline", false);
            bool addTags = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "ECoptionAddTags", false);
            bool addCertification = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "ECoptionAddCertification", false);
            bool addWriter = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "ECoptionAddWriter", false);
            string destinationTagline = "";
            string destinationTags = "";
            string destinationCertification = "";
            string destinationWriter = "";

            if (IsExternalCatalog(StrFileType))
            {
              destinationTagline = addTagline ? xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "ECoptionAddDestinationTagline", "") : "";
              destinationTags = addTags ? xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "ECoptionAddDestinationTags", "") : "";
              destinationCertification = addCertification ? xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "ECoptionAddDestinationCertification", "") : "";
              destinationWriter = addWriter ? xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "ECoptionAddDestinationWriter", "") : "";
            }
            // LogMyFilms.Debug("MFC: switch (StrFileType) '" + StrFileType.ToString() + "'");
            #endregion

            ReadOnly = IsExternalCatalog(StrFileType);

            #region Catalog Specific Settings ...
            switch (StrFileType)
            {
              case CatalogType.AntMovieCatalog3:
              case CatalogType.AntMovieCatalog4Xtended:
            break;
              case CatalogType.DVDProfiler:
            if (createTemp)
            {
              string WStrPath = System.IO.Path.GetDirectoryName(StrFileXml);
              string destFile = WStrPath + "\\" + StrFileXml.Substring(StrFileXml.LastIndexOf(@"\") + 1, StrFileXml.Length - StrFileXml.LastIndexOf(@"\") - 5) + "_tmp.xml";
              if ((System.IO.File.Exists(destFile) && (System.IO.File.GetLastWriteTime(destFile) > System.IO.File.GetLastWriteTime(StrFileXml))))
              {
                StrFileXml = destFile;
                break;
              }
              bool OnlyFile = false;
              OnlyFile = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "OnlyFile", false);
              string TagField = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "DVDPTagField", string.Empty);
              DvdProfiler cv = new DvdProfiler(TagField);
              StrFileXml = cv.ConvertProfiler(StrFileXml, StrPathImg, destinationTagline, destinationTags, destinationCertification, destinationWriter, TagField, OnlyFile);
            }
            else
              StrFileXml = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AntCatalogTemp", string.Empty);
            break;
              case CatalogType.MovieCollector:
            if (createTemp)
            {
              string WStrPath = System.IO.Path.GetDirectoryName(StrFileXml);
              string destFile = WStrPath + "\\" + StrFileXml.Substring(StrFileXml.LastIndexOf(@"\") + 1, StrFileXml.Length - StrFileXml.LastIndexOf(@"\") - 5) + "_tmp.xml";
              if ((System.IO.File.Exists(destFile) && (System.IO.File.GetLastWriteTime(destFile) > System.IO.File.GetLastWriteTime(StrFileXml))))
              {
                StrFileXml = destFile;
                break;
              }
              bool OnlyFile = false;
              OnlyFile = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "OnlyFile", false);
              MovieCollector mc = new MovieCollector();
              StrFileXml = mc.ConvertMovieCollector(StrFileXml, StrPathImg, destinationTagline, destinationTags, destinationCertification, destinationWriter, OnlyFile, TitleDelim);
            }
            else
              StrFileXml = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AntCatalogTemp", string.Empty);
            break;
              case CatalogType.MyMovies:
            if (createTemp)
            {
              string WStrPath = System.IO.Path.GetDirectoryName(StrFileXml);
              string destFile = WStrPath + "\\" + StrFileXml.Substring(StrFileXml.LastIndexOf(@"\") + 1, StrFileXml.Length - StrFileXml.LastIndexOf(@"\") - 5) + "_tmp.xml";
              if ((System.IO.File.Exists(destFile) && (System.IO.File.GetLastWriteTime(destFile) > System.IO.File.GetLastWriteTime(StrFileXml))))
              {
                StrFileXml = destFile;
                break;
              }
              bool OnlyFile = false;
              OnlyFile = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "OnlyFile", false);
              MyMovies mm = new MyMovies();
              StrFileXml = mm.ConvertMyMovies(StrFileXml, StrPathImg, destinationTagline, destinationTags, destinationCertification, destinationWriter, OnlyFile);
            }
            else
              StrFileXml = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AntCatalogTemp", string.Empty);
            break;
              case CatalogType.EaxMovieCatalog2:
            if (createTemp)
            {
              string WStrPath = System.IO.Path.GetDirectoryName(StrFileXml);
              string destFile = WStrPath + "\\" + StrFileXml.Substring(StrFileXml.LastIndexOf(@"\") + 1, StrFileXml.Length - StrFileXml.LastIndexOf(@"\") - 5) + "_tmp.xml";
              if ((System.IO.File.Exists(destFile) && (System.IO.File.GetLastWriteTime(destFile) > System.IO.File.GetLastWriteTime(StrFileXml))))
              {
                StrFileXml = destFile;
                break;
              }
              bool OnlyFile = false;
              OnlyFile = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "OnlyFile", false);
              EaxMovieCatalog emc = new EaxMovieCatalog();
              StrFileXml = emc.ConvertEaxMovieCatalog(StrFileXml, StrPathImg, destinationTagline, destinationTags, destinationCertification, destinationWriter, OnlyFile, TitleDelim);
            }
            else
              StrFileXml = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AntCatalogTemp", string.Empty);
            break;
              case CatalogType.EaxMovieCatalog3:
            if (createTemp)
            {
              string WStrPath = System.IO.Path.GetDirectoryName(StrFileXml);
              string destFile = WStrPath + "\\" + StrFileXml.Substring(StrFileXml.LastIndexOf(@"\") + 1, StrFileXml.Length - StrFileXml.LastIndexOf(@"\") - 5) + "_tmp.xml";
              if ((System.IO.File.Exists(destFile) && (System.IO.File.GetLastWriteTime(destFile) > System.IO.File.GetLastWriteTime(StrFileXml))))
              {
                StrFileXml = destFile;
                break;
              }
              bool OnlyFile = false;
              OnlyFile = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "OnlyFile", false);
              EaxMovieCatalog3 emc3 = new EaxMovieCatalog3();
              StrFileXml = emc3.ConvertEaxMovieCatalog3(StrFileXml, StrPathImg, destinationTagline, destinationTags, destinationCertification, destinationWriter, OnlyFile, TitleDelim);
            }
            else
              StrFileXml = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AntCatalogTemp", string.Empty);
            break;
              case CatalogType.PersonalVideoDatabase:
            if (createTemp)
            {
              string WStrPath = System.IO.Path.GetDirectoryName(StrFileXml);
              string destFile = WStrPath + "\\" + StrFileXml.Substring(StrFileXml.LastIndexOf(@"\") + 1, StrFileXml.Length - StrFileXml.LastIndexOf(@"\") - 5) + "_tmp.xml";
              if ((System.IO.File.Exists(destFile) && (System.IO.File.GetLastWriteTime(destFile) > System.IO.File.GetLastWriteTime(StrFileXml))))
              {
                StrFileXml = destFile;
                break;
              }
              bool OnlyFile = false;
              OnlyFile = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "OnlyFile", false);
              PersonalVideoDatabase pvd = new PersonalVideoDatabase();
              StrFileXml = pvd.ConvertPersonalVideoDatabase(StrFileXml, StrPathImg, destinationTagline, destinationTags, destinationCertification, destinationWriter, OnlyFile, TitleDelim, StrECoptionStoreTaglineInDescription);
            }
            else
              StrFileXml = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AntCatalogTemp", string.Empty);
            break;
              case CatalogType.eXtremeMovieManager:
            if (createTemp)
            {
              string WStrPath = System.IO.Path.GetDirectoryName(StrFileXml);
              string destFile = WStrPath + "\\" + StrFileXml.Substring(StrFileXml.LastIndexOf(@"\") + 1, StrFileXml.Length - StrFileXml.LastIndexOf(@"\") - 5) + "_tmp.xml";
              if ((System.IO.File.Exists(destFile) && (System.IO.File.GetLastWriteTime(destFile) > System.IO.File.GetLastWriteTime(StrFileXml))))
              {
                StrFileXml = destFile;
                break;
              }
              bool OnlyFile = false;
              OnlyFile = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "OnlyFile", false);
              XMM xmm = new XMM();
              StrFileXml = xmm.ConvertXMM(StrFileXml, StrPathImg, destinationTagline, destinationTags, destinationCertification, destinationWriter, OnlyFile);
            }
            else
              StrFileXml = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AntCatalogTemp", string.Empty);
            break;
              case CatalogType.XBMC: // XBMC fulldb export (all movies in one DB)
            if (createTemp)
            {
              string WStrPath = System.IO.Path.GetDirectoryName(StrFileXml);
              string destFile = WStrPath + "\\" + StrFileXml.Substring(StrFileXml.LastIndexOf(@"\") + 1, StrFileXml.Length - StrFileXml.LastIndexOf(@"\") - 5) + "_tmp.xml";
              if ((System.IO.File.Exists(destFile) && (System.IO.File.GetLastWriteTime(destFile) > System.IO.File.GetLastWriteTime(StrFileXml))))
              {
                StrFileXml = destFile;
                break;
              }
              bool OnlyFile = false;
              OnlyFile = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "OnlyFile", false);
              XbmcNfo nfo = new XbmcNfo();
              StrFileXml = nfo.ConvertXbmcNfo(StrFileXml, StrPathImg, destinationTagline, destinationTags, destinationCertification, destinationWriter, StrStorage, OnlyFile, TitleDelim);
            }
            else
              StrFileXml = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AntCatalogTemp", string.Empty);
            break;
              case CatalogType.MovingPicturesXML:
            if (createTemp)
            {
              string WStrPath = System.IO.Path.GetDirectoryName(StrFileXml);
              string destFile = WStrPath + "\\" + StrFileXml.Substring(StrFileXml.LastIndexOf(@"\") + 1, StrFileXml.Length - StrFileXml.LastIndexOf(@"\") - 5) + "_tmp.xml";
              if ((System.IO.File.Exists(destFile) && (System.IO.File.GetLastWriteTime(destFile) > System.IO.File.GetLastWriteTime(StrFileXml))))
              {
                StrFileXml = destFile;
                break;
              }
              bool OnlyFile = false;
              OnlyFile = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "OnlyFile", false);
              MovingPicturesXML mopi = new MovingPicturesXML();
              StrFileXml = mopi.ConvertMovingPicturesXML(StrFileXml, StrPathImg, destinationTagline, destinationTags, destinationCertification, destinationWriter, OnlyFile);
            }
            else
              StrFileXml = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AntCatalogTemp", string.Empty);
            break;
              case CatalogType.XBMCnfoReader:
            break;
              //case CatalogType.MediaBrowser3:
              //  if (createTemp)
              //  {
              //    string WStrPath = System.IO.Path.GetDirectoryName(StrFileXml);
              //    string destFile = WStrPath + "\\" + StrFileXml.Substring(StrFileXml.LastIndexOf(@"\") + 1, StrFileXml.Length - StrFileXml.LastIndexOf(@"\") - 5) + "_tmp.xml";
              //    if ((System.IO.File.Exists(destFile) && (System.IO.File.GetLastWriteTime(destFile) > System.IO.File.GetLastWriteTime(StrFileXml))))
              //    {
              //      StrFileXml = destFile;
              //      break;
              //    }
              //    bool OnlyFile = false;
              //    OnlyFile = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "OnlyFile", false);
              //    var mb3 = new Mediabrowser();
              //    StrFileXml = mb3.ConvertMediabrowser(StrFileXml, StrPathImg, destinationTagline, destinationTags, destinationCertification, destinationWriter);
              //  }
              //  else
              //    StrFileXml = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AntCatalogTemp", string.Empty);
              //  break;

            }
            #endregion

            StrSelect = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "StrSelect", string.Empty);
            StrPersons = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "StrPersons", string.Empty);
            StrTitleSelect = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "StrTitleSelect", string.Empty);
            StrFilmSelect = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "StrFilmSelect", string.Empty);
            StrDfltSelect = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "StrDfltSelect", string.Empty);
            StrViewSelect = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "StrViewSelect", string.Empty);

            #region experimental Viewmanager settings
            //StartView.InitDefaults();
            //CurrentView.InitDefaults();

            ////ViewManager.CurrentSettings.FilmsSortItem = XmlConfig.ReadXmlConfig("MyFilms", CurrentConfig, "StrSort", string.Empty);
            //CurrentView.FilmsSortItem = XmlConfig.ReadXmlConfig("MyFilms", CurrentConfig, "StrSort", string.Empty);
            //CurrentView.FilmsSortDirection = XmlConfig.ReadXmlConfig("MyFilms", CurrentConfig, "StrSortSens", string.Empty);

            //CurrentView.HierarchySortItem = XmlConfig.ReadXmlConfig("MyFilms", CurrentConfig, "StrSortInHierarchies", string.Empty);
            //CurrentView.HierarchySortDirection = XmlConfig.ReadXmlConfig("MyFilms", CurrentConfig, "StrSortSensInHierarchies", string.Empty);

            //StartView.FilmsSortItem = XmlConfig.ReadXmlConfig("MyFilms", CurrentConfig, "AntDfltStrSort", string.Empty);
            //StartView.FilmsSortDirection = XmlConfig.ReadXmlConfig("MyFilms", CurrentConfig, "AntDfltStrSortSens", string.Empty);

            //StartView.HierarchySortItem = XmlConfig.ReadXmlConfig("MyFilms", CurrentConfig, "AntDfltStrSortInHierarchies", string.Empty); // InHierarchies
            //StartView.HierarchySortItemFriendlyName = XmlConfig.ReadXmlConfig("MyFilms", CurrentConfig, "AntDfltStrSortSensInHierarchies", string.Empty);

            //string startview = XmlConfig.ReadXmlConfig("MyFilms", CurrentConfig, "CurrentView", string.Empty);
            //if (!string.IsNullOrEmpty(startview)) StartView.LoadFromString(startview);
            #endregion

            ViewContext = (MyFilms.ViewContext)Enum.Parse(typeof(MyFilms.ViewContext), xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "ViewContext", Enum.GetName(typeof(MyFilms.ViewContext), MyFilms.ViewContext.None)));
            StrTxtView = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "View", string.Empty);
            StrTxtSelect = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "Selection", string.Empty);
            try { StrIndex = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "IndexItem", -1); }
            catch { StrIndex = -1; }
            StrTIndex = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "TitleItem", string.Empty);
            Boolselect = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "Boolselect", false);
            Boolreturn = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "Boolreturn", false);
            Boolindexed = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "Boolindexed", false);
            Boolindexedreturn = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "Boolindexedreturn", false);
            IndexedChars = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "IndexedChars", 0);
            BoolReverseNames = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "ReversePersonNames", false);
            BoolVirtualPathBrowsing = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "VirtualPathBrowsing", false);
            BoolAskForPlaybackQuality = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AskForPlaybackQuality", false);
            WStrSort = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "WStrSort", string.Empty);
            Wselectedlabel = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "WSelectedLabel", string.Empty);
            Wstar = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "Wstar", string.Empty);
            LastID = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "LastID", -1);
            TitleDelim = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "TitleDelim", ".");
            DefaultCover = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "DefaultCover", string.Empty);
            DefaultCoverArtist = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "DefaultCoverArtist", string.Empty);
            DefaultCoverViews = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "DefaultCoverViews", string.Empty);
            DefaultFanartImage = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "DefaultFanartImage", string.Empty);
            StrAntFilterMinRating = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AntFilterMinRating", "5");
            StrGrabber_cnf = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "Grabber_cnf", string.Empty);
            StrPicturePrefix = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "PicturePrefix", string.Empty);
            StrGrabber_Always = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "Grabber_Always", false);
            StrGrabber_ChooseScript = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "Grabber_ChooseScript", false);
            StrAMCUpd = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AMCUpd", false);
            AMCUscanOnStartup = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AMCUscanOnStartup", false);
            AMCUwatchScanFolders = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AMCUwatchScanFolders", false);
            AMCUscanStartDelay = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AMCUscanStartDelay", 60);

            StrAMCUpd_cnf = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AMCUpd_cnf", string.Empty);
            StrFanart = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "Fanart", false);
            StrFanartDefaultViews = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "FanartDefaultViews", false);
            StrFanartDefaultViewsUseRandom = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "FanartDefaultViewsUseRandom", false);
            StrFanartDflt = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "FanartDflt", false);
            StrFanartDfltImage = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "FanartDfltImage", false);
            StrFanartDfltImageAll = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "FanartDfltImageAll", false);
            UseThumbsForViews = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "Views", false);
            UseThumbsForPersons = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "Persons", false);
            PersonsEnableDownloads = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "PersonsEnableDownloads", false);
            StrViewsDflt = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "ViewsDflt", false);
            StrViewsDfltAll = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "ViewsDfltAll", false);
            StrViewsShowIndexedImgInIndViews = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "ViewsShowIndexedImages", false);

            #region WOL settings
            StrCheckWOLenable = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "WOL-Enable", false);
            StrWOLtimeout = Convert.ToInt16(xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "WOL-Timeout", "15"));
            StrCheckWOLuserdialog = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "WOL-Userdialog", false);
            StrNasName1 = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "NAS-Name-1", string.Empty);
            StrNasMAC1 = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "NAS-MAC-1", string.Empty);
            StrNasName2 = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "NAS-Name-2", string.Empty);
            StrNasMAC2 = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "NAS-MAC-2", string.Empty);
            StrNasName3 = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "NAS-Name-3", string.Empty);
            StrNasMAC3 = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "NAS-MAC-3", string.Empty);
            #endregion

            #region external player
            ExternalPlayerPath = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "ExternalPlayerPath", string.Empty);
            ExternalPlayerStartParams = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "ExternalPlayerStartParams", string.Empty);
            ExternalPlayerExtensions = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "ExternalPlayerExtensions", string.Empty);
            #endregion

            #region read states vars for each possible view - do we also need states for "userdefined views"? (disabled)
            //DataBase.AntMovieCatalog ds = new DataBase.AntMovieCatalog();
            //MyFilms.ViewStateCache.Clear();
            //foreach (DataColumn dc in ds.Movie.Columns)
            //{
            //  ViewState tView = new ViewState();
            //  string viewstateName = "ViewState-" + dc.ColumnName;
            //  string viewstate = XmlConfig.ReadXmlConfig("MyFilms", CurrentConfig, viewstateName, string.Empty);
            //  if (!string.IsNullOrEmpty(viewstate))
            //  {
            //    tView.LoadFromString(viewstate);
            //    MyFilms.ViewStateCache.Add(dc.ColumnName, tView);
            //  }
            //  //else
            //  //{
            //  //  tView.ViewDBItem = dc.ColumnName;
            //  //  CustomView.Add(tView);
            //  //}
            //}
            #endregion

            #region search history
            StrSearchHistory = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "SearchHistory", string.Empty);
            MyFilms.SearchHistory.Clear();
            foreach (string s in this.StrSearchHistory.Split('|').Where(s => !string.IsNullOrEmpty(s.Trim())))
            {
              MyFilms.SearchHistory.Add(s);
            }
            #endregion

            #region list and role separators
            int j = 0;
            for (int i = 1; i <= 5; i++)
            {
              if (xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "ListSeparator" + i, string.Empty).Length > 0)
              {
            this.ListSeparator[j] = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "ListSeparator" + i, string.Empty).Replace("#LF#", "\n"); // support for new line separation
            j++;
              }
            }
            j = 0;
            for (int i = 1; i <= 5; i++)
            {
              if (xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "RoleSeparator" + i, string.Empty).Length > 0)
              {
            RoleSeparator[j] = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "RoleSeparator" + i, string.Empty);
            j++;
              }
            }
            #endregion

            CmdPar = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "CmdPar", string.Empty);
            if (CmdPar == "(none)") CmdPar = "";
            OnlyTitleList = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "OnlyTitleList", false);
            GlobalAvailableOnly = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "GlobalAvailableOnly", false);
            GlobalUnwatchedOnly = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "GlobalUnwatchedOnly", false);
            GlobalUnwatchedOnlyValue = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "GlobalUnwatchedOnlyValue", "false");
            ScanMediaOnStart = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "CheckMediaOnStart", false);
            BoolShowEmptyValuesInViews = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "ShowEmpty", false);
            AllowTraktSync = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AllowTraktSync", false);
            AllowRecentlyAddedApi = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AllowRecentAddedAPI", false);

            #region layout settings
            StrLayOut = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "LayOut", 0);
            StrLayOutInHierarchies = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "LayOutInHierarchies", StrLayOut);
            WStrLayOut = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "WLayOut", StrLayOut);
            int iDfltLayOut = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AntDfltLayOut", 0);
            int iDfltLayOutInHierarchies = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AntDfltLayOutInHierarchies", 0);

            if (loadParams != null && !string.IsNullOrEmpty(loadParams.Layout))
            {
              #region override layout with start params, if available
              int iLayout = 0;
              if (int.TryParse(loadParams.Layout, out iLayout))
            if (iLayout >= 0 && iLayout <= 4)
            {
              StrLayOut = iLayout;
              WStrLayOut = iLayout;
              StrLayOutInHierarchies = iLayout;
            }
              #endregion
            }
            #endregion

            #region Sort Settings
            StrSorta = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "StrSort", string.Empty);
            StrSortSens = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "StrSortSens", string.Empty);
            StrSortaInHierarchies = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "StrSortInHierarchies", string.Empty);
            StrSortSensInHierarchies = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "StrSortSensInHierarchies", string.Empty);
            string wDfltSort = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AntDfltStrSort", string.Empty);
            string wDfltSortSens = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AntDfltStrSortSens", string.Empty);

            string wDfltSortInHierarchies = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AntDfltStrSortInHierarchies", string.Empty); // InHierarchies
            string wDfltSortSensInHierarchies = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AntDfltStrSortSensInHierarchies", string.Empty);
            #endregion

            AlwaysDefaultView = xmlConfig.ReadXmlConfig("MyFilms", currentConfig, "AlwaysDefaultView", false);

            if (AlwaysDefaultView || MyFilms.InitialStart || (loadParams != null && (!string.IsNullOrEmpty(loadParams.View) || !string.IsNullOrEmpty(loadParams.MovieID))))
            {
              #region overrides for "AlwaysDefaultView"
              ViewContext = MyFilms.ViewContext.StartView;
              StrIndex = -1;
              LastID = -1;
              Wstar = "";
              Boolreturn = false;
              Boolselect = true;
              Boolindexed = false;
              Boolindexedreturn = false;

              Wselectedlabel = StrViewDfltText;
              if (loadParams == null || string.IsNullOrEmpty(loadParams.Layout))
              {
            StrLayOut = iDfltLayOut;
            StrLayOutInHierarchies = iDfltLayOutInHierarchies;
            WStrLayOut = iDfltLayOut; // also preset views layout to default - although it most probably will be overridden by views setting
              }
              if (Helper.FieldIsSet(wDfltSort))
              {
            StrSorta = wDfltSort;
            StrSortSens = wDfltSortSens;
              }
              if (Helper.FieldIsSet(wDfltSortInHierarchies)) // hierarchies sort settings
              {
            StrSortaInHierarchies = wDfltSortInHierarchies;
            StrSortSensInHierarchies = wDfltSortSensInHierarchies;
              }
              #endregion
            }
            xmlConfig.Dispose();
            #endregion
              }
              #endregion

              #region check and correct settings
              // if (string.IsNullOrEmpty(StrSelect)) StrSelect = StrTitle1 + " not like ''";

              if (string.IsNullOrEmpty(StrSorta)) StrSorta = StrSTitle;
              if (string.IsNullOrEmpty(StrSortaInHierarchies)) StrSortaInHierarchies = StrSTitle;

              // ToDo: Remove Migration Code
              if (StrSorta == "DateAdded") StrSorta = "Date";
              if (StrSortaInHierarchies == "DateAdded") StrSortaInHierarchies = "Date";

              if (string.IsNullOrEmpty(StrSortSens) || StrSortSens == "ASC") StrSortSens = " ASC";
              if (StrSortSens == "DESC") StrSortSens = " DESC";

              if (string.IsNullOrEmpty(StrSortSensInHierarchies) || StrSortSensInHierarchies == "ASC") StrSortSensInHierarchies = " ASC";
              if (StrSortSensInHierarchies == "DESC") StrSortSensInHierarchies = " DESC";

              if (string.IsNullOrEmpty(WStrSortSens) || WStrSortSens == "ASC") WStrSortSens = " ASC";
              if (WStrSortSens == "DESC") WStrSortSens = " DESC";

              if (string.IsNullOrEmpty(WStrSortSensCount) || WStrSortSensCount == "DESC") WStrSortSensCount = " DESC";
              if (WStrSortSensCount == "ASC") WStrSortSensCount = " ASC";

              if (StrFanart)
            if (!(StrPathFanart.Length > 0 && System.IO.Directory.Exists(StrPathFanart)))
            {
              LogMyFilms.Info("MyFilms : Fanart Path '" + StrPathFanart + "', doesn't exist. Fanart disabled ! ");
              StrFanart = false;
            }
              if (StrArtist)
            if (!(StrPathArtist.Length > 0 && System.IO.Directory.Exists(StrPathArtist)))
            {
              LogMyFilms.Info("MyFilms : Artist Path '" + StrPathArtist + "', doesn't exist. Artist Pictures disabled ! ");
              StrArtist = false;
            }
              #endregion
              // LogMyFilms.Debug("MFC: Configuration loading ended for '" + CurrentConfig + "'");
        }