public List<ContentPackDB> GetAllLocalContentPacks(LOLCodeLibrary.GenericEnumsContentPackType contentPackType)
        {
            lock (this.cacheLock) {
                List<ContentPackDB> allContentPacks =
                    dbm.GetAllContentPacks (contentPackType);
                List<ContentPackDB> toReturn = new List<ContentPackDB> ();

                foreach (ContentPackDB eachContentPack in allContentPacks) {
                    if (this.CheckContentPackDataExist (eachContentPack)) {
                        eachContentPack.ContentPackIcon = GetBufferFromPropertyFile (eachContentPack.ContentPackIconFile);
                        eachContentPack.ContentPackAd = GetBufferFromPropertyFile (eachContentPack.ContentPackAdFile);

                        toReturn.Add (eachContentPack);
                    }//end if
                }//end foreach

                return toReturn;
            }//end lock
        }
 private List<ContentPackDB> GetAllLocalContentPacks(LOLCodeLibrary.GenericEnumsContentPackType contentPackType)
 {
     List<ContentPackDB> allContentPacks = dbm.GetAllContentPacks(packType);
     List<ContentPackDB> toReturn = new List<ContentPackDB>();
     foreach (ContentPackDB eachContentPack in allContentPacks)
     {
         if (CheckContentPackDataExists(eachContentPack))
         {
             eachContentPack.ContentPackIcon = GetBufferFromPropertyFile(eachContentPack.ContentPackIconFile);
             eachContentPack.ContentPackAd = GetBufferFromPropertyFile(eachContentPack.ContentPackAdFile);
             toReturn.Add(eachContentPack);
         }
     }
     return toReturn;
 }
        private void playAudio(ProgressBar pb, LOLCodeLibrary.GenericEnumsContentPackType pack)
        {
            string temppath = "";
            if (packType == LOLCodeLibrary.GenericEnumsContentPackType.SoundFX)
                temppath = System.IO.Path.Combine(wowZapp.LaffOutOut.Singleton.ContentDirectory, "tempaudio-soundFX.wav");
            else
                temppath = System.IO.Path.Combine(wowZapp.LaffOutOut.Singleton.ContentDirectory, "tempaudio-comicon.wav");
            if (!File.Exists(temppath))
                return;

            AudioPlayer csfx = new AudioPlayer(context);
            int duration = csfx.findDuration(temppath);
            pb.Max = duration / 2;

            new Thread(new ThreadStart(() => {
                csfx.playFromFile(temppath);
                for (int i = 0; i <= duration / 2; i++)
                {
                    this.RunOnUiThread(() => {
                        pb.Progress = i;
                    });
                    Thread.Sleep(1);
                }
            })).Start();
        }
Пример #4
0
        public static DrawingLayerType GetDrawingTypeForContentPackType(LOLCodeLibrary.GenericEnumsContentPackType packType)
        {
            switch (packType) {

            case LOLCodeLibrary.GenericEnumsContentPackType.Callout:

                return DrawingLayerType.Callout;

            case LOLCodeLibrary.GenericEnumsContentPackType.Comix:

                return DrawingLayerType.Comix;

            case LOLCodeLibrary.GenericEnumsContentPackType.RubberStamp:

                return DrawingLayerType.Stamp;

            default:

                throw new InvalidOperationException ("There is no equivalent drawing type for this content pack type!");

            }//end switch
        }