예제 #1
0
        public Boolean Initialise()
        {
            String SampleData;

            if (!InputPath.EndsWith("\\"))
            {
                InputPath += "\\";
            }
            SampleData = InputPath + "wqu.json";

            if (!ResponsePath.EndsWith("\\"))
            {
                ResponsePath += "\\";
            }

            return(true);
        }
예제 #2
0
        public bool Clean()
        {
            if (!File.Exists(InputPath) || !InputPath.EndsWith(".cs"))
            {
                return(false);
            }

            SlnPath = SlnPath ?? FindSolution(InputPath, 5);
            if (!File.Exists(SlnPath) || !SlnPath.EndsWith(".sln"))
            {
                return(false);
            }

            OutputPath = OutputPath ?? InputPath.Substring(0, (InputPath.Length - ".cs".Length)) + ".swift";

            return(OutputPath.EndsWith(".swift"));
        }
예제 #3
0
        private bool ValidateInput()
        {
            ListObject foundObject = SettingsManager.Settings.ItemCollection.Find(x => x != cachedListObject && x.Name == InputName);

            if (foundObject != null)
            {
                MessageBox.Show("Name is already in use.");
                return(false);
            }

            // We only want to make sure it's an APK, it doesn't matter if the file doesn't exist
            if (!InputPath.EndsWith(".apk", StringComparison.InvariantCultureIgnoreCase))
            {
                MessageBox.Show("Invalid path, it must direct to a valid .apk");
                return(false);
            }

            return(true);
        }
예제 #4
0
        private void OnExecute()
        {
            var assetsManager = new AssetsManager();

            if (InputPath.EndsWith(".apk"))
            {
                assetsManager.LoadAPK(this.InputPath);
            }
            else
            {
                assetsManager.LoadFolder(this.InputPath);
            }

            System.Console.WriteLine("Load {0}", InputPath);

            foreach (var assetFile in assetsManager.assetsFileList)
            {
                foreach (var asset in assetFile.Objects)
                {
                    if (asset.type == ClassIDType.Sprite ||
                        asset.type == ClassIDType.SpriteAtlas)
                    {
                        var sprite         = (NamedObject)asset;
                        var name           = sprite.m_Name;
                        var exportFullName = Path.Combine(this.OutputPath, name + ".png");
                        try
                        {
                            var bitmap = (sprite as Sprite).GetImage();
                            bitmap.Save(exportFullName, ImageFormat.Png);
                            bitmap.Dispose();
                        }
                        catch
                        {
                            System.Console.WriteLine("catch exception.");
                        }
                    }
                }
            }
        }
예제 #5
0
        public Boolean Initialise()
        {
            String SampleData;

            if (!InputPath.EndsWith("\\"))
            {
                InputPath += "\\";
            }
            SampleData = InputPath + "Getdata.json";

            if (!ResponsePath.EndsWith("\\"))
            {
                ResponsePath += "\\";
            }

            objReq = objJSON.ParseFile(SampleData);
            if (objReq == null)
            {
                return(false);
            }

            return(true);
        }