示例#1
0
        public AppOverviewViewModel( PluginManifest pluginManifest )
        {
            _pluginManifest = pluginManifest;

            Filters = Enum.GetNames( typeof( PluginState ) ).ToList();
            Filters.Insert( 0, "All" );

            _applicationPlugins = new Dictionary<ApplicationViewModel, List<PluginManifestPlugin>>();

            // Set the filter and show applications + plug-ins.
            SelectedFilter = Filters.First();
        }
示例#2
0
        public void RefreshManifest()
        {
            if ( !HasInternetConnection() )
            {
                return;
            }

            // Retrieving the available applications stream.
            Stream appsStream = null;
            while ( appsStream == null )
            {
                var client = new WebClient();
                appsStream = client.OpenRead( AppsFeed );
            }

            var serializer = new XmlSerializer( typeof( PluginManifest ) );
            var reader = XmlReader.Create( appsStream );

            // Use Deserialize method to restore the object's state.
            PluginManifest = (PluginManifest)serializer.Deserialize( reader );
        }
示例#3
0
        public void Populate( PluginManifest pluginManifest )
        {
            Mouse.OverrideCursor = Cursors.Wait;

            PluginState state;
            if ( Enum.TryParse( SelectedFilter, out state ) )
            {
                FilterApps( state );
            }
            else
            {
                FilterApps();
            }

            Mouse.OverrideCursor = Cursors.Arrow;
        }