コード例 #1
0
ファイル: MOStore.cs プロジェクト: strnguv/marketplaceconfig
 /// <summary>
 /// Converts this MO Store to a generic Store object
 /// </summary>
 /// <returns>Store object</returns>
 public Store toStore()
 {
     Store ret = new Store(base.displayName, base.storeName, base.storeID,
         base.storeEnabled, base.storeImage, base.storeLocale);
     ret.datVersion = this.datVersion;
     return ret;
 }
コード例 #2
0
ファイル: Store.cs プロジェクト: strnguv/marketplaceconfig
 public static string saveStore(Store store)
 {
     DataContractSerializer serializer = new DataContractSerializer(typeof(Store));
     Stream stream = new MemoryStream();
     serializer.WriteObject(stream, store);
     stream.Position = 0;
     return new StreamReader(stream).ReadToEnd();
 }
コード例 #3
0
        /// <summary>
        /// Sets the provided marketplace as the current
        /// </summary>
        /// <param name="store">OEM Marketplace to set</param>
        public static void setOEMStore(Store store)
        {
            // Unlock the file if marked as read-only
            if (WP7RootToolsSDK.FileSystem.FileExists(@"\My Documents\Zune\PimentoCache\Keepers\LKG_OEMStoreConfig.xml"))
            {
                FileAttributes attributes = File.GetAttributes(@"\My Documents\Zune\PimentoCache\Keepers\LKG_OEMStoreConfig.xml");
                if (attributes.ReadOnly)
                    File.SetAttributes(@"\My Documents\Zune\PimentoCache\Keepers\LKG_OEMStoreConfig.xml", new FileAttributes(FileAttributesEnum.Archive));
            }

            // Overwrite the file with the desired market
            File.WriteAllBytes(@"\My Documents\Zune\PimentoCache\Keepers\LKG_OEMStoreConfig.new",
                System.Text.Encoding.UTF8.GetBytes(store.generateXML().ToString()));
            File.Copy(@"\My Documents\Zune\PimentoCache\Keepers\LKG_OEMStoreConfig.new", @"\My Documents\Zune\PimentoCache\Keepers\LKG_OEMStoreConfig.xml");
            File.Delete(@"\My Documents\Zune\PimentoCache\Keepers\LKG_OEMStoreConfig.new");

            // Set the correct attributes
            if ((bool)SettingsManager.getInstance().loadValue("permanent"))
                File.SetAttributes(@"\My Documents\Zune\PimentoCache\Keepers\LKG_OEMStoreConfig.xml", new FileAttributes(FileAttributesEnum.Archive | FileAttributesEnum.Readonly));
            else
                File.SetAttributes(@"\My Documents\Zune\PimentoCache\Keepers\LKG_OEMStoreConfig.xml", new FileAttributes(FileAttributesEnum.Archive));

            // Check if this is the all OEMs market
            if (string.IsNullOrEmpty(store.storeID))
            {
                /* =====================================================
                 * NOTE TO THOSE ADDING THIS FUNCTIONALITY TO THEIR APPS
                 * =====================================================
                 * Feel free to review what I do and incorporate it into your own apps. However, you'll notice
                 * that I am using my own server (foxingworth.com) for hosting the new store files. Please host
                 * these files on YOUR OWN server and don't simply have your app point towards mine. I included the
                 * source of the program I wrote to generate these modified files, so use that program or use the source
                 * to write your own. Until the day that I get my dedicated server for free, I would rather be in control
                 * of the traffic to it. Thank you.
                 */

                // Have the marketplace look at my server for the OEM hub
                setXMLValue(@"\My Documents\Zune\PimentoCache\Keepers\LKG_TunerConfig.xml", "ep", "id", "OEMApplications",
                    "http://winpho.foxingworth.com/oemstore/oemstore_{CatalogLocale}.xml", true, "url");

                // Tweak the other application URLs to allow all oem stores
                setXMLValue(@"\My Documents\Zune\PimentoCache\Keepers\LKG_TunerConfig.xml", "ep", "id", "Application",
                    "http://catalog.{ZestDomain}/v3.2/{CatalogLocale}/apps/{objectid}?clientType={YPV}&store=Zest&store={MOStoreID}&store=Nokia&store=HTC&store=LGE&store=SAMSUNG&store=Dell&store=Fujitsu&store=Acer&;store=ZTE{urltail}",
                    true, "url");
                /*  Can't just tack on extra stores like in 'Application', it breaks search for some reason...
                setXMLValue(@"\My Documents\Zune\PimentoCache\Keepers\LKG_TunerConfig.xml", "ep", "id", "ApplicationSearch",
                    "http://catalog.{ZestDomain}/v3.2/{CatalogLocale}/apps?q={query}&chunkSize={appsearchchunksize}&clientType={YPV}&store=Zest&store={MOStoreID}&store=Nokia&store=HTC&store=LGE&store=SAMSUNG&store=Dell&store=Fujitsu&store=Acer&store=ZTE{urltail}",
                    true, "url");*/
            }
        }
コード例 #4
0
ファイル: MOStore.cs プロジェクト: strnguv/marketplaceconfig
 public MOStore(Store x)
     : base(x.displayName, x.storeName, x.storeID, x.storeEnabled, x.storeImage, x.storeLocale)
 {
     this.datVersion = x.datVersion;
 }