Beispiel #1
0
        public void AddNewSegment()
        {
            SegmentData _cutsegment = new SegmentData();

            _segmentslist.Add((object)_cutsegment);
            _listchanged = true;
        }
Beispiel #2
0
        /// <summary>
        /// Construct a DownloadsPage object. This is carried out by the Application
        /// because the downloads page is global and not owned by any single
        /// Experience.
        /// NOTE: This is public to enable debug markup access.
        /// </summary>
        public DownloadsPage CreateDownloadsPage()
        {
            DownloadsPage page = new DownloadsPage();

            page.Description = Z.Resources.Downloads;

            //
            // Create one filter for each experience and one global "All"
            // filter that indicates all experiences.
            //

            ArrayListDataSet filters = new ArrayListDataSet(page);

            filters.Add(new DownloadFilter(page, "All", ActiveDownloads));
            foreach (ApplicationExperience experience in experiences)
            {
                filters.Add(CreateDownloadPageFilter(page, experience));
            }
            Choice filtersChoice = new Choice(page, null, filters);

            // Default to having "All" as the current filter
            filtersChoice.ChosenIndex = 0;

            page.Filters = filtersChoice;

            return(page);
        }
Beispiel #3
0
        public AboutSettings()
        {
            System.Resources.ResourceManager RM = new System.Resources.ResourceManager("Library.Resources", System.Reflection.Assembly.GetExecutingAssembly());
            string creditsString = (string)RM.GetObject("Credits");

            byte[]       byteArray = Encoding.ASCII.GetBytes(creditsString);
            MemoryStream stream    = new MemoryStream(byteArray);
            //XmlTextReader reader = new XmlTextReader(stream);
            XmlDocument xDoc = new XmlDocument();

            xDoc.Load(stream);
            XPathNavigator    nav = xDoc.CreateNavigator();
            XPathNodeIterator it  = nav.Select("Credits/Developers/Person");

            this.CreditsText = "DEVELOPMENT TEAM:";
            while (it.MoveNext())
            {
                this.CreditsText += "\n" + it.Current.Value;
            }
            this.CreditsText += "\n\n";
            it = nav.Select("Credits/Contributors/Person");

            this.CreditsText += "COMPANIES AND INDIVIDUALS:";
            while (it.MoveNext())
            {
                this.CreditsText += "\n" + it.Current.Value;
            }
            this.CreditsText += "\n\n";
            it = nav.Select("Credits/Special/Person");

            this.CreditsText += "SPECIAL THANKS:";
            while (it.MoveNext())
            {
                this.CreditsText += "\n" + it.Current.Value;
            }

            string version = Assembly.GetExecutingAssembly().GetName().Version.ToString();

            this.AboutText  = "Open Media Library (replace with image)\n\nVersion: " + version + " (Revision: " + OMLApplication.Current.RevisionNumber + ")";
            this.AboutText += "\nCopyright © 2008, GNU General Public License v3";

            this.radioCommands = new Choice(this);
            ArrayListDataSet radioSet = new ArrayListDataSet();

            Command aboutCmd = new Command(this);

            aboutCmd.Description = "About";
            radioSet.Add(aboutCmd);

            Command creditsCmd = new Command(this);

            creditsCmd.Description = "Credits";
            radioSet.Add(creditsCmd);

            //this.CreditsText = "this is a credit";

            this.radioCommands.Options        = radioSet;
            this.radioCommands.ChosenChanged += new EventHandler(radioCommands_ChosenChanged);
        }
        public AboutSettings()
        {
            System.Resources.ResourceManager RM = new System.Resources.ResourceManager("Library.Resources",System.Reflection.Assembly.GetExecutingAssembly());
            string creditsString = (string)RM.GetObject("Credits");
            byte[] byteArray = Encoding.ASCII.GetBytes(creditsString);
            MemoryStream stream = new MemoryStream(byteArray);
            //XmlTextReader reader = new XmlTextReader(stream);
            XmlDocument xDoc = new XmlDocument();
            xDoc.Load(stream);
            XPathNavigator nav = xDoc.CreateNavigator();
            XPathNodeIterator it = nav.Select("Credits/Developers/Person");

            this.CreditsText = "DEVELOPMENT TEAM:";
            while (it.MoveNext())
            {
                this.CreditsText += "\n" + it.Current.Value;
            }
            this.CreditsText += "\n\n";
            it = nav.Select("Credits/Contributors/Person");

            this.CreditsText += "COMPANIES AND INDIVIDUALS:";
            while (it.MoveNext())
            {
                this.CreditsText += "\n" + it.Current.Value;
            }
            this.CreditsText += "\n\n";
            it = nav.Select("Credits/Special/Person");

            this.CreditsText += "SPECIAL THANKS:";
            while (it.MoveNext())
            {
                this.CreditsText += "\n" + it.Current.Value;
            }

            string version=Assembly.GetExecutingAssembly().GetName().Version.ToString();

            this.AboutText = "Open Media Library (replace with image)\n\nVersion: " + version + " (Revision: " + OMLApplication.Current.RevisionNumber+")";
            this.AboutText += "\nCopyright © 2008, GNU General Public License v3";

            this.radioCommands = new Choice(this);
            ArrayListDataSet radioSet = new ArrayListDataSet();

            Command aboutCmd=new Command(this);
            aboutCmd.Description="About";
            radioSet.Add(aboutCmd);

            Command creditsCmd = new Command(this);
            creditsCmd.Description = "Credits";
            radioSet.Add(creditsCmd);

            //this.CreditsText = "this is a credit";

            this.radioCommands.Options = radioSet;
            this.radioCommands.ChosenChanged += new EventHandler(radioCommands_ChosenChanged);
        }
Beispiel #5
0
        /// <summary>
        /// Creat the filters on the gallery.
        /// </summary>
        private void CreateShowGalleryFilters(GalleryPage page)
        {
            //
            // Put together a list of filters on the content.
            //

            ArrayListDataSet list = new ArrayListDataSet(page);

            // Create the unfiltered "All" filter
            ModelItem filterAll = new Filter(page, Z.Resources.TV_Filter_All, -1);

            list.Add(filterAll);

            // Get the rest of the filters out of the genre list.
            DataTable tbl_TV_Genre = dataSet.Tables["tbl_TV_Genre"];

            foreach (DataRow genreData in tbl_TV_Genre.Rows)
            {
                string genreName = (string)genreData["TV_Genre"];
                int    genreId   = (int)genreData["TV_Genre_ID"];

                ModelItem filter = new Filter(page, genreName, genreId);
                list.Add(filter);
            }

            // FUTURE: There's information in the data table for us to implement
            // a "featured" filter.  Its implementation would go here.

            Choice filters = new Choice(page, null, list);

            filters.Chosen = filterAll;

            //
            // Hook up the "filter changed" event so that we can apply the
            // active filter to our gallery.
            //
            // As soon as this Filters list is set, we will get an OnActiveFilterChanged
            // event which will cause us to populate the gallery.
            //

            page.ActiveFilterChanged += delegate(object sender, EventArgs e)
            {
                GalleryPage galleryPage  = (GalleryPage)sender;
                Filter      activeFilter = (Filter)galleryPage.Filters.Chosen;
                FilterContent(galleryPage, activeFilter.FilterId);
            };
            page.Filters = filters;
        }
Beispiel #6
0
        private void ParseYahooWeatherDoc(XmlDocument xDoc)
        {
            //Setting up NSManager
            XmlNamespaceManager man = new XmlNamespaceManager(xDoc.NameTable);

            man.AddNamespace("yweather", "http://xml.weather.yahoo.com/ns/rss/1.0");

            this.Unit            = xDoc.SelectSingleNode("rss/channel/yweather:units", man).Attributes["temperature"].Value.ToString();
            this.CodeDescription = xDoc.SelectSingleNode("rss/channel/item/yweather:condition", man).Attributes["text"].Value.ToString();
            this.Location        = xDoc.SelectSingleNode("rss/channel/yweather:location", man).Attributes["city"].Value.ToString();
            this.Temp            = xDoc.SelectSingleNode("rss/channel/item/yweather:condition", man).Attributes["temp"].Value.ToString();
            this.Code            = xDoc.SelectSingleNode("rss/channel/item/yweather:condition", man).Attributes["code"].Value.ToString();
            this.ImageUrl        = string.Format("resx://MediaBrowser/MediaBrowser.Resources/_{0}", this.Code);
            //this.ImageUrl = string.Format("http://l.yimg.com/a/i/us/we/52/{0}.gif", this.Code);
            this.LongTemp = string.Format("{0}°{1} {2}", Temp, Unit, CodeDescription);

            var tempForecast = xDoc.SelectNodes("rss/channel/item/yweather:forecast", man);

            //<yweather:forecast day="Fri" date="24 Apr 2009" low="50" high="63" text="Partly Cloudy" code="30" />
            foreach (XmlNode temp in tempForecast)
            {
                ForecastItem fi = new ForecastItem();
                fi.Day             = temp.Attributes["day"].Value.ToString();
                fi.Date            = temp.Attributes["date"].Value.ToString();
                fi.Low             = temp.Attributes["low"].Value.ToString();
                fi.High            = temp.Attributes["high"].Value.ToString();
                fi.Code            = temp.Attributes["code"].Value.ToString();
                fi.CodeDescription = temp.Attributes["text"].Value.ToString();
                fi.ImageUrl        = string.Format("resx://MediaBrowser/MediaBrowser.Resources/_{0}", fi.Code);
                _forecast.Add(fi);
            }
        }
        //I don't think this is used any more, but I need to check
        public VideoItems(string query, int maxItems = 24, int startItem = 0, bool search = false)
        {
            m_Choice = new Choice();
            List     = new ArrayListDataSet();
            string data;

            //if (search)
            //{
            //    data = AmazonVideoRequest.searchPrime(query, maxItems, startItem);
            //}
            //else
            //{
            //    data = AmazonVideoRequest.getVideoItemsWithQuery(query, maxItems, startItem);
            //}
            data = AmazonVideoRequest.ExecuteQuery(query);
            JsonTextReader reader = new JsonTextReader(new StringReader(data));

            JObject titles = JObject.Parse(data);

            foreach (JObject node in titles["message"]["body"]["titles"])
            {
                List.Add(new VideoItem(node));
            }
            m_Choice.Options = List;
        }
Beispiel #8
0
        private void updateDiscArray()
        {
            ArrayListDataSet discArray = new ArrayListDataSet();

            if (OMLApplication.Current.MediaChangers.HasMediaChangers)
            {
                foreach (DiscDataEx disc in OMLApplication.Current.MediaChangers.KnownDiscs)
                {
                    DiscCommand discItem = new DiscCommand(this);
                    discItem.Description = disc.VolumeLabel;
                    discItem.Disc        = disc;
                    if (!string.IsNullOrEmpty(disc.Title))
                    {
                        discItem.Description = disc.Title;
                    }

                    discItem.Invoked += delegate(object discSender, EventArgs discArgs)
                    {
                        if (discSender is DiscCommand)
                        {
                            ((DiscCommand)discSender).Disc.Eject();
                        }
                    };
                    discArray.Add(discItem);
                }
            }
            this.DiscArray = discArray;
        }
Beispiel #9
0
        public void GetNetworkListDone(bool success)
        {
            if (this.WirelessUnblockPage())
            {
                return;
            }
            WlanProfileList  networkList      = this.wirelessGetNetworkListHelper.NetworkList;
            ArrayListDataSet arrayListDataSet = new ArrayListDataSet();

            if (success && networkList != null)
            {
                foreach (WlanProfile profile in networkList)
                {
                    arrayListDataSet.Add(new WlanCommand(profile));
                }
            }
            if (!success)
            {
                if (string.IsNullOrEmpty(this.wirelessDeviceErrorDescription))
                {
                    this.wirelessDeviceErrorDescription = this.wirelessGetNetworkListHelper.Error;
                }
                if (this.wirelessDeviceErrorCode == HRESULT._S_OK)
                {
                    this.wirelessDeviceErrorCode = this.wirelessGetNetworkListHelper.Hr;
                }
            }
            this.WirelessNetworksList = arrayListDataSet;
        }
        private void ParseYahooWeatherDoc(XmlDocument xDoc)
        {
            //Setting up NSManager
            XmlNamespaceManager man = new XmlNamespaceManager(xDoc.NameTable);

            man.AddNamespace("yweather", "http://xml.weather.yahoo.com/ns/rss/1.0");

            Unit         = xDoc.SelectSingleNode("query/results/channel/yweather:units", man).Attributes["temperature"].Value.ToString();
            SpeedUnit    = xDoc.SelectSingleNode("query/results/channel/yweather:units", man).Attributes["speed"].Value.ToString();
            PressureUnit = xDoc.SelectSingleNode("query/results/channel/yweather:units", man).Attributes["pressure"].Value.ToString();
            DistanceUnit = xDoc.SelectSingleNode("query/results/channel/yweather:units", man).Attributes["distance"].Value.ToString();

            CodeDescription  = xDoc.SelectSingleNode("query/results/channel/item/yweather:condition", man).Attributes["text"].Value.ToString();
            Location         = xDoc.SelectSingleNode("query/results/channel/yweather:location", man).Attributes["city"].Value.ToString();
            Humidity         = xDoc.SelectSingleNode("query/results/channel/yweather:atmosphere", man).Attributes["humidity"].Value.ToString();
            VisibileDistance = xDoc.SelectSingleNode("query/results/channel/yweather:atmosphere", man).Attributes["visibility"].Value.ToString();
            Chill            = xDoc.SelectSingleNode("query/results/channel/yweather:wind", man).Attributes["chill"].Value.ToString();
            Direction        = xDoc.SelectSingleNode("query/results/channel/yweather:wind", man).Attributes["direction"].Value.ToString();
            Speed            = xDoc.SelectSingleNode("query/results/channel/yweather:wind", man).Attributes["speed"].Value.ToString();
            Pressure         = xDoc.SelectSingleNode("query/results/channel/yweather:atmosphere", man).Attributes["pressure"].Value.ToString();
            Sunrise          = xDoc.SelectSingleNode("query/results/channel/yweather:astronomy", man).Attributes["sunrise"].Value.ToString();
            Sunset           = xDoc.SelectSingleNode("query/results/channel/yweather:astronomy", man).Attributes["sunset"].Value.ToString();
            Temp             = xDoc.SelectSingleNode("query/results/channel/item/yweather:condition", man).Attributes["temp"].Value.ToString();
            Code             = xDoc.SelectSingleNode("query/results/channel/item/yweather:condition", man).Attributes["code"].Value.ToString();
            ImageUrl         = string.Format("resx://MediaBrowser/MediaBrowser.Resources/_{0}", this.Code);
            //this.ImageUrl = string.Format("http://l.yimg.com/a/i/us/we/52/{0}.gif", this.Code);
            LongTemp       = string.Format("{0}°{1} {2}", Temp, Unit, CodeDescription);
            LongPressure   = string.Format("{0} {1}", Pressure, PressureUnit);
            LongWindSpeed  = string.Format("{0} {1} {2}", Speed, SpeedUnit, Direction);
            LongVisibility = string.Format("{0} {1}", VisibileDistance, DistanceUnit);

            var tempForecast = xDoc.SelectNodes("query/results/channel/item/yweather:forecast", man);

            //<yweather:forecast day="Fri" date="24 Apr 2009" low="50" high="63" text="Partly Cloudy" code="30" />
            foreach (XmlNode temp in tempForecast)
            {
                var fi = new ForecastItem();
                fi.Day             = temp.Attributes["day"].Value.ToString();
                fi.Date            = temp.Attributes["date"].Value.ToString();
                fi.Low             = temp.Attributes["low"].Value.ToString();
                fi.High            = temp.Attributes["high"].Value.ToString();
                fi.Code            = temp.Attributes["code"].Value.ToString();
                fi.CodeDescription = temp.Attributes["text"].Value.ToString();
                fi.ImageUrl        = string.Format("resx://MediaBrowser/MediaBrowser.Resources/_{0}", fi.Code);
                if (_forecast.Count < 2)
                {
                    _forecast.Add(fi);
                }
                _extendedForecast.Add(fi);
                if (_extendedForecast.Count > 5)
                {
                    break;                              //limit to 6 days
                }
            }
        }
        public VideoItems()
        {
            m_Choice = new Choice();
            List     = new ArrayListDataSet();
            string junk = "test";

            //workaround to add list without crashing
            //this is a known issue - if you bind an empty list to a choice, it crashes.
            List.Add(junk);
            m_Choice.Options = List;
            List.Clear();
        }
        public Application(HistoryOrientedPageSession session, AddInHost host)
        {
            this.session = session;
            this.host = host;

            _myData = new ArrayListDataSet();
            var list = GetFeedList();
            foreach (var radio in list)
            {
                _myData.Add(radio);

            }
        }
Beispiel #13
0
        /// <summary>
        /// Construct a SearchPage object. This is carried out by the Application
        /// because the search page is global and not owned by any single
        /// Experience.
        /// NOTE: This is public to enable debug markup access.
        /// </summary>
        public SearchPage CreateSearchPage()
        {
            SearchPage page = new SearchPage();

            page.Description = Z.Resources.Search;
            page.Content     = new VirtualList();


            //
            // Create one on/off filter for each experience.
            //

            ArrayListDataSet filters = new ArrayListDataSet(page);

            foreach (ApplicationExperience experience in experiences)
            {
                filters.Add(CreateSearchPageFilter(page, experience));
            }
            page.Filters = filters;

            return(page);
        }
Beispiel #14
0
        private ArrayListDataSet ParseDocument(XmlDocument xDoc)
        {
            ArrayListDataSet trailers = new ArrayListDataSet();
            XPathNavigator   nav      = xDoc.CreateNavigator();

            if (nav.MoveToChild("records", ""))
            {
                XPathNodeIterator nIter = nav.SelectChildren("movieinfo", "");
                nav.MoveToFirstChild();
                XPathNavigator localNav = nav.CreateNavigator();
                nav.MoveToParent();

                for (int i = 0; i < nIter.Count; i++)
                {
                    AppleTrailer currentTrailer = new AppleTrailer();

                    if (localNav.MoveToChild("info", ""))
                    {
                        currentTrailer.Copyright   = GetChildNodesValue(localNav, "copyright");
                        currentTrailer.description = GetChildNodesValue(localNav, "description");
                        currentTrailer.Director    = GetChildNodesValue(localNav, "director");
                        currentTrailer.Postdate    = GetChildNodesValue(localNav, "postdate");
                        currentTrailer.Rating      = GetChildNodesValue(localNav, "rating");
                        currentTrailer.ReleaseDate = GetChildNodesValue(localNav, "releasedate");
                        currentTrailer.Runtime     = GetChildNodesValue(localNav, "runtime");
                        currentTrailer.Studio      = GetChildNodesValue(localNav, "studio");
                        currentTrailer.Title       = GetChildNodesValue(localNav, "title");
                        localNav.MoveToParent();
                    }

                    if (localNav.MoveToChild("cast", ""))
                    {
                        XPathNodeIterator castIter = localNav.SelectChildren("name", "");
                        if (localNav.MoveToFirstChild())
                        {
                            XPathNavigator castNav = localNav.CreateNavigator();

                            for (int j = 0; j < castIter.Count; j++)
                            {
                                currentTrailer.Actors.Add(castNav.Value);
                                castNav.MoveToNext("name", "");
                            }
                            localNav.MoveToParent();
                        }
                        localNav.MoveToParent();
                    }

                    if (localNav.MoveToChild("genre", ""))
                    {
                        XPathNodeIterator genreIter = localNav.SelectChildren("name", "");
                        if (localNav.MoveToFirstChild())
                        {
                            XPathNavigator genreNav = localNav.CreateNavigator();

                            for (int k = 0; k < genreIter.Count; k++)
                            {
                                currentTrailer.Genres.Add(genreNav.Value);
                                genreNav.MoveToNext("name", "");
                            }
                            localNav.MoveToParent();
                        }
                        localNav.MoveToParent();
                    }

                    if (localNav.MoveToChild("poster", ""))
                    {
                        if (localNav.MoveToChild("location", ""))
                        {
                            currentTrailer.PosterUrl = localNav.Value;
                            localNav.MoveToParent();
                        }

                        if (localNav.MoveToChild("xlarge", ""))
                        {
                            currentTrailer.XLargePosterUrl = localNav.Value;
                            localNav.MoveToParent();
                        }

                        localNav.MoveToParent();
                    }

                    if (localNav.MoveToChild("preview", ""))
                    {
                        if (localNav.MoveToChild(XPathNodeType.Element))
                        {
                            currentTrailer.TrailerUrl = localNav.Value;
                            currentTrailer.Filesize   = localNav.GetAttribute("filesize", "");
                            localNav.MoveToParent();
                        }
                        localNav.MoveToParent();
                    }

                    trailers.Add(currentTrailer);
                    localNav.MoveToNext();
                }
            }
            return(trailers);
        }
        private ArrayListDataSet ParseDocument(XmlDocument xDoc)
        {
            ArrayListDataSet trailers = new ArrayListDataSet();
            XPathNavigator nav = xDoc.CreateNavigator();

            if (nav.MoveToChild("records", ""))
            {
                XPathNodeIterator nIter = nav.SelectChildren("movieinfo", "");
                nav.MoveToFirstChild();
                XPathNavigator localNav = nav.CreateNavigator();
                nav.MoveToParent();

                for (int i = 0; i < nIter.Count; i++)
                {
                    AppleTrailer currentTrailer = new AppleTrailer();

                    if (localNav.MoveToChild("info", ""))
                    {
                        currentTrailer.Copyright = GetChildNodesValue(localNav, "copyright");
                        currentTrailer.description = GetChildNodesValue(localNav, "description");
                        currentTrailer.Director = GetChildNodesValue(localNav, "director");
                        currentTrailer.Postdate = GetChildNodesValue(localNav, "postdate");
                        currentTrailer.Rating = GetChildNodesValue(localNav, "rating");
                        currentTrailer.ReleaseDate = GetChildNodesValue(localNav, "releasedate");
                        currentTrailer.Runtime = GetChildNodesValue(localNav, "runtime");
                        currentTrailer.Studio = GetChildNodesValue(localNav, "studio");
                        currentTrailer.Title = GetChildNodesValue(localNav, "title");
                        localNav.MoveToParent();
                    }

                    if (localNav.MoveToChild("cast", ""))
                    {
                        XPathNodeIterator castIter = localNav.SelectChildren("name", "");
                        if (localNav.MoveToFirstChild())
                        {
                            XPathNavigator castNav = localNav.CreateNavigator();

                            for (int j = 0; j < castIter.Count; j++)
                            {
                                currentTrailer.Actors.Add(castNav.Value);
                                castNav.MoveToNext("name", "");
                            }
                            localNav.MoveToParent();
                        }
                        localNav.MoveToParent();
                    }

                    if (localNav.MoveToChild("genre", ""))
                    {
                        XPathNodeIterator genreIter = localNav.SelectChildren("name", "");
                        if (localNav.MoveToFirstChild())
                        {
                            XPathNavigator genreNav = localNav.CreateNavigator();

                            for (int k = 0; k < genreIter.Count; k++)
                            {
                                currentTrailer.Genres.Add(genreNav.Value);
                                genreNav.MoveToNext("name", "");
                            }
                            localNav.MoveToParent();
                        }
                        localNav.MoveToParent();
                    }

                    if (localNav.MoveToChild("poster", ""))
                    {
                        if (localNav.MoveToChild("location", ""))
                        {
                            currentTrailer.PosterUrl = localNav.Value;
                            localNav.MoveToParent();
                        }

                        if (localNav.MoveToChild("xlarge", ""))
                        {
                            currentTrailer.XLargePosterUrl = localNav.Value;
                            localNav.MoveToParent();
                        }

                        localNav.MoveToParent();
                    }

                    if (localNav.MoveToChild("preview", ""))
                    {
                        if (localNav.MoveToChild(XPathNodeType.Element))
                        {
                            currentTrailer.TrailerUrl = localNav.Value;
                            currentTrailer.Filesize = localNav.GetAttribute("filesize", "");
                            localNav.MoveToParent();
                        }
                        localNav.MoveToParent();
                    }

                    trailers.Add(currentTrailer);
                    localNav.MoveToNext();
                }
            }
            return trailers;
        }
 public void AddInformation(InfomationItem info)
 {
     _item.Add(info);
 }
        public void Init(Settings settings)
        {
            _settings = settings;

            _ChoiceGalleryAdvancedSettingsItems = new Choice();
            ArrayListDataSet aryListDS = new ArrayListDataSet();

            aryListDS.Add(new SettingsItem(0, _settings.DimUnselectedCovers, "Dim Unselected Covers",false));
            aryListDS.Add(new SettingsItem(0, _settings.UseOnScreenAlpha, "Show Alpha Jump Bar", false));
            aryListDS.Add(new SettingsItem(0, _settings.ShowMovieDetails, "Show Movie Details", false));
            aryListDS.Add(new SettingsItem(0, _settings.ShowWatchedIcon, "Show Watched Icon", false));
            aryListDS.Add(new SettingsItem(0, _settings.UseOriginalCoverArt, "Use Original Cover Art(may slow browsing)", true));

            aryListDS.Add(new SettingsItem(1, _settings.CoverArtRows, "Cover Art Rows:", false));
            aryListDS.Add(new SettingsItem(1, _settings.CoverArtSpacing, "Cover Art Spacing:", true));
            aryListDS.Add(new SettingsItem(1, _settings.MainPageBackDropInterval, "Random Backdrop Interval:", false));

            aryListDS.Add(new SettingsItem(3, _settings.MainPageBackDropAlpha, "Backdrop Opacity:", true));

            _ChoiceGalleryAdvancedSettingsItems.Options = aryListDS;

            _ChoiceGalleryViewSettingsItems = new Choice();
            ArrayListDataSet aryListDS2 = new ArrayListDataSet();

            aryListDS2.Add(new SettingsItem(2, _settings.MovieView, "Movie Gallery View:", false));
            aryListDS2.Add(new SettingsItem(2, _settings.MovieSort, "Movie Sort:", false));
            aryListDS2.Add(new SettingsItem(2, _settings.StartPage, "Start Page:", false));

            _ChoiceGalleryViewSettingsItems.Options = aryListDS2;

            _ChoiceFilterOptions=new Choice();
            ArrayListDataSet aryListDS3=new ArrayListDataSet();

            aryListDS3.Add(new CheckBox(_settings.ShowFilterActors, "Actors"));
            aryListDS3.Add(new CheckBox(_settings.ShowFilterCountry, "Country"));
            aryListDS3.Add(new CheckBox(_settings.ShowFilterDateAdded, "Date Added"));
            aryListDS3.Add(new CheckBox(_settings.ShowFilterDirectors, "Directors"));
            aryListDS3.Add(new CheckBox(_settings.ShowFilterGenres, "Genres"));
            aryListDS3.Add(new CheckBox(_settings.ShowFilterParentalRating, "Parental Rating"));
            aryListDS3.Add(new CheckBox(_settings.ShowFilterYear, "Release Year"));
            aryListDS3.Add(new CheckBox(_settings.ShowFilterRuntime, "Runtime"));
            aryListDS3.Add(new CheckBox(_settings.ShowFilterTags, "Tags"));
            aryListDS3.Add(new CheckBox(_settings.ShowFilterTrailers, "Trailers"));
            aryListDS3.Add(new CheckBox(_settings.ShowFilterUserRating, "User Rating"));
            aryListDS3.Add(new CheckBox(_settings.ShowFilterUnwatched, "Unwatched"));
            aryListDS3.Add(new CheckBox(_settings.ShowFilterFormat, "Video Format"));

            _ChoiceFilterOptions.Options = aryListDS3;

            _ChoiceExtenderSettingsItems = new Choice();
            ArrayListDataSet aryListDS4 = new ArrayListDataSet();

            aryListDS4.Add(new SettingsItem(4, _settings.ImpersonationUsername, "Impersonation Username:"******"Impersonation Password:"******"Number Of Seconds To Delay:", true));
            aryListDS4.Add(new SettingsItem(0, _settings.TranscodeAVIFiles, "Transcode AVI Files", false));
            aryListDS4.Add(new SettingsItem(0, _settings.TranscodeMKVFiles, "Transcode MKV Files", false));
            aryListDS4.Add(new SettingsItem(0, _settings.TranscodeOGMFiles, "Transcode OGM Files", false));
            aryListDS4.Add(new SettingsItem(0, _settings.PreserveAudioOnTranscode, "Preserve audio format on transcode of non DVD files", false));
            aryListDS4.Add(new SettingsItem(0, _settings.DebugTranscoding, "Transcode ALL DVDs (DEBUG Only)", false));

            _ChoiceExtenderSettingsItems.Options = aryListDS4;
        }
Beispiel #18
0
        public void Init(Settings settings)
        {
            _settings = settings;

            _ChoiceGalleryAdvancedSettingsItems = new Choice();
            ArrayListDataSet aryListDS = new ArrayListDataSet();

            aryListDS.Add(new SettingsItem(0, _settings.DimUnselectedCovers, "Dim Unselected Covers", false));
            aryListDS.Add(new SettingsItem(0, _settings.UseOnScreenAlpha, "Show Alpha Jump Bar", false));
            aryListDS.Add(new SettingsItem(0, _settings.ShowMovieDetails, "Show Movie Details", false));
            aryListDS.Add(new SettingsItem(0, _settings.ShowWatchedIcon, "Show Watched Icon", false));
            aryListDS.Add(new SettingsItem(0, _settings.UseOriginalCoverArt, "Use Original Cover Art(may slow browsing)", true));

            aryListDS.Add(new SettingsItem(1, _settings.CoverArtRows, "Cover Art Rows:", false));
            aryListDS.Add(new SettingsItem(1, _settings.CoverArtSpacing, "Cover Art Spacing:", true));
            aryListDS.Add(new SettingsItem(1, _settings.MainPageBackDropInterval, "Random Backdrop Interval:", false));

            aryListDS.Add(new SettingsItem(3, _settings.MainPageBackDropAlpha, "Backdrop Opacity:", true));

            _ChoiceGalleryAdvancedSettingsItems.Options = aryListDS;

            _ChoiceGalleryViewSettingsItems = new Choice();
            ArrayListDataSet aryListDS2 = new ArrayListDataSet();

            aryListDS2.Add(new SettingsItem(2, _settings.MovieView, "Movie Gallery View:", false));
            aryListDS2.Add(new SettingsItem(2, _settings.MovieSort, "Movie Sort:", false));
            aryListDS2.Add(new SettingsItem(2, _settings.StartPage, "Start Page:", false));

            _ChoiceGalleryViewSettingsItems.Options = aryListDS2;

            _ChoiceFilterOptions = new Choice();
            ArrayListDataSet aryListDS3 = new ArrayListDataSet();

            aryListDS3.Add(new CheckBox(_settings.ShowFilterActors, "Actors"));
            aryListDS3.Add(new CheckBox(_settings.ShowFilterCountry, "Country"));
            aryListDS3.Add(new CheckBox(_settings.ShowFilterDateAdded, "Date Added"));
            aryListDS3.Add(new CheckBox(_settings.ShowFilterDirectors, "Directors"));
            aryListDS3.Add(new CheckBox(_settings.ShowFilterGenres, "Genres"));
            aryListDS3.Add(new CheckBox(_settings.ShowFilterParentalRating, "Parental Rating"));
            aryListDS3.Add(new CheckBox(_settings.ShowFilterYear, "Release Year"));
            aryListDS3.Add(new CheckBox(_settings.ShowFilterRuntime, "Runtime"));
            aryListDS3.Add(new CheckBox(_settings.ShowFilterTags, "Tags"));
            aryListDS3.Add(new CheckBox(_settings.ShowFilterTrailers, "Trailers"));
            aryListDS3.Add(new CheckBox(_settings.ShowFilterUserRating, "User Rating"));
            aryListDS3.Add(new CheckBox(_settings.ShowFilterUnwatched, "Unwatched"));
            aryListDS3.Add(new CheckBox(_settings.ShowFilterFormat, "Video Format"));

            _ChoiceFilterOptions.Options = aryListDS3;

            _ChoiceExtenderSettingsItems = new Choice();
            ArrayListDataSet aryListDS4 = new ArrayListDataSet();

            aryListDS4.Add(new SettingsItem(4, _settings.ImpersonationUsername, "Impersonation Username:"******"Impersonation Password:"******"Number Of Seconds To Delay:", true));
            aryListDS4.Add(new SettingsItem(0, _settings.TranscodeAVIFiles, "Transcode AVI Files", false));
            aryListDS4.Add(new SettingsItem(0, _settings.TranscodeMKVFiles, "Transcode MKV Files", false));
            aryListDS4.Add(new SettingsItem(0, _settings.TranscodeOGMFiles, "Transcode OGM Files", false));
            aryListDS4.Add(new SettingsItem(0, _settings.PreserveAudioOnTranscode, "Preserve audio format on transcode of non DVD files", false));
            aryListDS4.Add(new SettingsItem(0, _settings.DebugTranscoding, "Transcode ALL DVDs (DEBUG Only)", false));

            _ChoiceExtenderSettingsItems.Options = aryListDS4;
        }
        private void updateDiscArray()
        {
            ArrayListDataSet discArray = new ArrayListDataSet();
            if (OMLApplication.Current.MediaChangers.HasMediaChangers)
            {
                foreach (DiscDataEx disc in OMLApplication.Current.MediaChangers.KnownDiscs)
                {
                    DiscCommand discItem = new DiscCommand(this);
                    discItem.Description = disc.VolumeLabel;
                    discItem.Disc = disc;
                    if (!string.IsNullOrEmpty(disc.Title))
                        discItem.Description = disc.Title;

                    discItem.Invoked += delegate(object discSender, EventArgs discArgs)
                    {
                        if (discSender is DiscCommand)
                        {
                            ((DiscCommand)discSender).Disc.Eject();
                        }
                    };
                    discArray.Add(discItem);
                }
            }
            this.DiscArray = discArray;
        }
        public MediaChangerManagerPage()
        {
            this.managerCommands = new ArrayListDataSet(this);

            //save command
            Command rescanCmd = new Command();
            rescanCmd.Description = "Rescan Discs";
            rescanCmd.Invoked += new EventHandler(rescanCmd_Invoked);
            this.managerCommands.Add(rescanCmd);

            this.sortCommands = new Choice(this);
            ArrayListDataSet sortSet = new ArrayListDataSet();

            Command sortByName=new Command(this);
            sortByName.Description="Sort by Name";
            sortSet.Add(sortByName);

            Command sortByType = new Command(this);
            sortByType.Description = "Sort by Type";
            sortSet.Add(sortByType);

            this.sortCommands.Options = sortSet;
            this.SortCommands.ChosenChanged += new EventHandler(SortCommands_ChosenChanged);

            this.enableMediaChangers = new BooleanChoice(this, "Enable support for media changers");
            this.enableMediaChangers.Value = Properties.Settings.Default.MediaChangersEnabled;
            this.detectMediaChangers = new BooleanChoice(this, "Detect new discs added to your changer");
            this.detectMediaChangers.Value = Properties.Settings.Default.MediaChangersDetect;
            this.retrieveMetaData = new BooleanChoice(this, "Retrieve MetaData from Microsoft");
            this.retrieveMetaData.Value = Properties.Settings.Default.MediaChangersRetrieveMetaData;
            this.manageChangers = new Command(this);
            this.manageChangers.Description = "Manage Discs";
            this.manageChangers.Invoked += delegate(object changerSender, EventArgs changerArgs)
            {
                Dictionary<string, object> manageProperties = new Dictionary<string, object>();
                manageProperties["Page"] = this;
                manageProperties["Application"] = Library.OMLApplication.Current;
                Library.OMLApplication.Current.Session.GoToPage("resx://Library/Library.Resources/V3_MediaChangerManagerPage", manageProperties);
            };

            this.commands = new ArrayListDataSet(this);

            //save command
            Command saveCmd = new Command();
            saveCmd.Description = "Save";
            saveCmd.Invoked += new EventHandler(saveCmd_Invoked);
            this.commands.Add(saveCmd);

            //cancel command
            Command cancelCmd = new Command();
            cancelCmd.Description = "Cancel";
            cancelCmd.Invoked += new EventHandler(cancelCmd_Invoked);
            this.commands.Add(cancelCmd);

            this.discArray = new ArrayListDataSet();
            if (OMLApplication.Current.MediaChangers.HasMediaChangers)
            {
                foreach (DiscDataEx disc in OMLApplication.Current.MediaChangers.KnownDiscs)
                {
                    DiscCommand discItem = new DiscCommand(this);
                    discItem.Description = disc.VolumeLabel;
                    discItem.Disc = disc;
                    if (!string.IsNullOrEmpty(disc.Title))
                        discItem.Description = disc.Title;

                    discItem.Invoked += delegate(object discSender, EventArgs discArgs)
                    {
                        if(discSender is DiscCommand)
                        {
                            this.IsBusy = true;
                            Microsoft.MediaCenter.UI.Application.DeferredInvokeOnWorkerThread(beginEject, endEject, (object)discSender);
                            //((DiscCommand)discSender).Disc.Eject();
                            //this.updateDiscArray();
                        }
                    };
                    this.discArray.Add(discItem);
                }
            }

            this.DiscManagerSort = DiscManagerSortType.Name;
            this.SortList();
            //for (int i = 0; i < 20; ++i)
            //{
            //    Command c = new Command(this);
            //    c.Description = string.Format("This is a very long description of a Test Disc {0}", i.ToString());
            //    this.discArray.Add(c);
            //}
            this.DetermineShowErrorMessage();
        }
        public void Test()
        {
            RemoteResourceUri RRU = new RemoteResourceUri();

            RRU.Uri = new Uri("http://www.cellartracker.com/api_read.asp");
            Dictionary <string, string> Querys = new Dictionary <string, string>();

            Querys.Add("user", "gt1485a");
            Querys.Add("password", "Darwin1");
            Querys.Add("API", "list");
            Querys.Add("Format", "XML");
            Querys.Add("Page", "1");
            Querys.Add("Records", "2");
            RRU.QueryPairs       = Querys;
            XRR                  = new XmlRemoteResource();
            XRR.PropertyChanged += new PropertyChangedEventHandler(XRR_PropertyChanged);
            XRR.RequestUri       = RRU;

            XmlRemoteValueList Wines = new XmlRemoteValueList();

            Wines.Source = "//row";
            XmlRemoteValue Vintage = new XmlRemoteValue();

            Vintage.Source = "//row/Vintage";
            XmlRemoteValue Wine = new XmlRemoteValue();

            Wine.Source = "//row/Wine";
            XmlRemoteValue Type = new XmlRemoteValue();

            Type.Source = "//row/Type";
            ArrayList D = new ArrayList();

            D.Add(Type);
            D.Add(Vintage);
            D.Add(Wine);

            Wines.Mappings = D;


            //    <Mappings>
            //  <da:XmlRemoteValueList Name="Wines" RepeatedType="PropertySet" Source="//row">
            //    <Mappings>
            //      <da:XmlRemoteValue Property="Entries.#Wine" Source="//row/Wine"/>
            //      <da:XmlRemoteValue Property="Entries.#Vintage" Source="//row/Vintage"/>
            //      <da:XmlRemoteValue Property="Entries.#Type" Source="//row/Type"/>
            //    </Mappings>
            //  </da:XmlRemoteValueList>
            //</Mappings>
            PropertySet PS = new PropertySet();

            PS.Entries.Add("Wines", Wines);

            XRR.Mappings = PS;


            XRR.GetDataFromResource();

            ArrayListDataSet F = new ArrayListDataSet();

            F.Add(new EditableText());
        }
Beispiel #22
0
        public MediaChangerManagerPage()
        {
            this.managerCommands = new ArrayListDataSet(this);

            //save command
            Command rescanCmd = new Command();

            rescanCmd.Description = "Rescan Discs";
            rescanCmd.Invoked    += new EventHandler(rescanCmd_Invoked);
            this.managerCommands.Add(rescanCmd);

            this.sortCommands = new Choice(this);
            ArrayListDataSet sortSet = new ArrayListDataSet();

            Command sortByName = new Command(this);

            sortByName.Description = "Sort by Name";
            sortSet.Add(sortByName);

            Command sortByType = new Command(this);

            sortByType.Description = "Sort by Type";
            sortSet.Add(sortByType);

            this.sortCommands.Options        = sortSet;
            this.SortCommands.ChosenChanged += new EventHandler(SortCommands_ChosenChanged);


            this.enableMediaChangers        = new BooleanChoice(this, "Enable support for media changers");
            this.enableMediaChangers.Value  = Properties.Settings.Default.MediaChangersEnabled;
            this.detectMediaChangers        = new BooleanChoice(this, "Detect new discs added to your changer");
            this.detectMediaChangers.Value  = Properties.Settings.Default.MediaChangersDetect;
            this.retrieveMetaData           = new BooleanChoice(this, "Retrieve MetaData from Microsoft");
            this.retrieveMetaData.Value     = Properties.Settings.Default.MediaChangersRetrieveMetaData;
            this.manageChangers             = new Command(this);
            this.manageChangers.Description = "Manage Discs";
            this.manageChangers.Invoked    += delegate(object changerSender, EventArgs changerArgs)
            {
                Dictionary <string, object> manageProperties = new Dictionary <string, object>();
                manageProperties["Page"]        = this;
                manageProperties["Application"] = Library.OMLApplication.Current;
                Library.OMLApplication.Current.Session.GoToPage("resx://Library/Library.Resources/V3_MediaChangerManagerPage", manageProperties);
            };

            this.commands = new ArrayListDataSet(this);

            //save command
            Command saveCmd = new Command();

            saveCmd.Description = "Save";
            saveCmd.Invoked    += new EventHandler(saveCmd_Invoked);
            this.commands.Add(saveCmd);

            //cancel command
            Command cancelCmd = new Command();

            cancelCmd.Description = "Cancel";
            cancelCmd.Invoked    += new EventHandler(cancelCmd_Invoked);
            this.commands.Add(cancelCmd);

            this.discArray = new ArrayListDataSet();
            if (OMLApplication.Current.MediaChangers.HasMediaChangers)
            {
                foreach (DiscDataEx disc in OMLApplication.Current.MediaChangers.KnownDiscs)
                {
                    DiscCommand discItem = new DiscCommand(this);
                    discItem.Description = disc.VolumeLabel;
                    discItem.Disc        = disc;
                    if (!string.IsNullOrEmpty(disc.Title))
                    {
                        discItem.Description = disc.Title;
                    }

                    discItem.Invoked += delegate(object discSender, EventArgs discArgs)
                    {
                        if (discSender is DiscCommand)
                        {
                            this.IsBusy = true;
                            Microsoft.MediaCenter.UI.Application.DeferredInvokeOnWorkerThread(beginEject, endEject, (object)discSender);
                            //((DiscCommand)discSender).Disc.Eject();
                            //this.updateDiscArray();
                        }
                    };
                    this.discArray.Add(discItem);
                }
            }

            this.DiscManagerSort = DiscManagerSortType.Name;
            this.SortList();
            //for (int i = 0; i < 20; ++i)
            //{
            //    Command c = new Command(this);
            //    c.Description = string.Format("This is a very long description of a Test Disc {0}", i.ToString());
            //    this.discArray.Add(c);
            //}
            this.DetermineShowErrorMessage();
        }