コード例 #1
0
        public Boolean Initialise()
        {
            String SampleData;

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

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

            return(true);
        }
コード例 #2
0
ファイル: ArgData.cs プロジェクト: stormmann666/SharpSwift
        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
ファイル: ItemWindow.xaml.cs プロジェクト: strawlink/ADBTool
        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
ファイル: Program.cs プロジェクト: huiliu/AssetStudio
        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
ファイル: GetData.cs プロジェクト: Yogeswaran66/Testing
        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);
        }