public void CopyBin()
        {
            var proj     = item.ContainingProject;
            var projname = proj.FullName;
            var dest     = Path.GetDirectoryName(projname);
            var conf     = Path.Combine(dest, "web.config");
            var src      = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);

            // Copy to MSBuild extensions
            msbuild = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), @"MSBuild\johnshope.com\XamlImageConverter");
            Directory.CreateDirectory(msbuild);

            /*Files.Copy(Path.Combine(src, "XamlImageConverter.targets"), msbuild);
             * Files.Copy(Path.Combine(src, "XamlImageConverter.dll"), msbuild);
             * Files.Copy(Path.Combine(src, "XamlImageConverter.pdb"), msbuild);
             * Files.Copy(Path.Combine(src, "Awesomium"), msbuild, );
             * Files.Copy(Path.Combine(src, "gxps"), msbuild);
             * Files.Copy(Path.Combine(src, "html2xaml"), msbuild);
             * Files.Copy(Path.Combine(src, "ImageMagick"), msbuild);
             * Files.Copy(Path.Combine(src, "psd2xaml"), msbuild);*/
            CopyDirectory.Copy(src, msbuild);


            var IsWeb = File.Exists(conf);

            if (!IsWeb)
            {
                return;
            }

            // copy lazy dll's
            var    bin        = Path.Combine(dest, "Bin");
            var    Silversite = File.Exists(Path.Combine(bin, "Silversite.Core.dll"));
            string binlazy;

            //if (Silversite) binlazy = Path.Combine(dest, "Silversite\\Bin");
            //else
            binlazy = Path.Combine(bin, "Lazy");
            if (IsWeb && !Directory.Exists(binlazy))
            {
                Directory.CreateDirectory(binlazy);
                CopyDirectory.Copy(src, binlazy);

                /*Files.Copy(Path.Combine(src, "XamlImageConverter.dll"), binlazy);
                 * Files.Copy(Path.Combine(src, "XamlImageConverter.pdb"), binlazy);
                 * Files.Copy(Path.Combine(src, "Awesomium"), binlazy);
                 * Files.Copy(Path.Combine(src, "gxps"), binlazy);
                 * Files.Copy(Path.Combine(src, "html2xaml"), binlazy);
                 * Files.Copy(Path.Combine(src, "ImageMagick"), binlazy);
                 * Files.Copy(Path.Combine(src, "psd2xaml"), binlazy);*/
                //var cache = Path.Combine(dest, "Images\\Cache");
                //if (!Directory.Exists(cache)) Directory.CreateDirectory(cache);
            }

            // copy XamlImageConverter.Web.dll when not using Silversite.
            if (!Silversite && IsWeb)
            {
                Files.Copy(Path.Combine(src, "XamlImageConverter.Web.*"), bin);
            }
        }
        public void CopyToStore(string noitaPath)
        {
            if (!Directory.Exists(Location))
            {
                Directory.CreateDirectory(Location);
            }

            WriteSaveInfo();

            GameHandler.ClearSave(Location);

            if (Directory.Exists(Path.Combine(noitaPath, "world")))
            {
                CopyDirectory.Copy(Path.Combine(noitaPath, "world"), Path.Combine(Location, "world"));
            }

            if (File.Exists(Path.Combine(noitaPath, "player.salakieli")))
            {
                File.Copy(Path.Combine(noitaPath, "player.salakieli"), Path.Combine(Location, "player.salakieli"));
            }

            if (File.Exists(Path.Combine(noitaPath, "world_state.salakieli")))
            {
                File.Copy(Path.Combine(noitaPath, "world_state.salakieli"), Path.Combine(Location, "world_state.salakieli"));
            }
        }
示例#3
0
        public void RestoreFromStore(string noitaPath)
        {
            GameHandler.ClearSave(noitaPath);

            if (Directory.Exists(Path.Combine(Location, "world")))
            {
                CopyDirectory.Copy(Path.Combine(Location, "world"), Path.Combine(noitaPath, "world"));
            }

            if (File.Exists(Path.Combine(Location, "player.salakieli")))
            {
                File.Copy(Path.Combine(Location, "player.salakieli"), Path.Combine(noitaPath, "player.salakieli"));
            }

            if (File.Exists(Path.Combine(Location, "player.xml")))
            {
                File.Copy(Path.Combine(Location, "player.xml"), Path.Combine(noitaPath, "player.xml"));
            }

            if (File.Exists(Path.Combine(Location, "world_state.salakieli")))
            {
                File.Copy(Path.Combine(Location, "world_state.salakieli"), Path.Combine(noitaPath, "world_state.salakieli"));
            }

            if (File.Exists(Path.Combine(Location, "world_state.xml")))
            {
                File.Copy(Path.Combine(Location, "world_state.xml"), Path.Combine(noitaPath, "world_state.xml"));
            }
        }
示例#4
0
        private void RestoreScriptingExamplesIfNeeded()
        {
            if (ScriptingDirectory.Contains(_scriptingRawDir) && !Directory.Exists(ScriptingDirectory))
            {
                if (Directory.Exists(GlobalConfig.FullPath(_scriptingRawDir)))
                {
                    CopyDirectory.Copy(GlobalConfig.FullPath(_scriptingRawDir), ScriptingDirectory);
                }
                else
                {
                    throw new FileNotFoundException(
                              $"Scripting examples not found in {GlobalConfig.FullPath(_scriptingRawDir)}");
                }
            }

            if (CustomFunctionsDirectory.Contains(_customFunctionsRawDir) &&
                !Directory.Exists(CustomFunctionsDirectory))
            {
                if (Directory.Exists(GlobalConfig.FullPath(_customFunctionsRawDir)))
                {
                    CopyDirectory.Copy(GlobalConfig.FullPath(_customFunctionsRawDir), CustomFunctionsDirectory);
                }
                else
                {
                    throw new FileNotFoundException(
                              $"Custom functions examples not found in {GlobalConfig.FullPath(_customFunctionsRawDir)}");
                }
            }
        }
示例#5
0
        public void RestoreScriptingExamples()
        {
            if (!Directory.Exists(DefaultScriptingDirectory) || !Directory.EnumerateFiles(DefaultScriptingDirectory).Any())
            {
                if (Directory.Exists(PathUtility.GetFullPath(ScriptingRawDir)))
                {
                    CopyDirectory.Copy(PathUtility.GetFullPath(ScriptingRawDir), DefaultScriptingDirectory);
                }
                else
                {
                    throw new FileNotFoundException(
                              $"Scripting examples not found in {PathUtility.GetFullPath(ScriptingRawDir)}");
                }
            }


            if (!Directory.Exists(DefaultCustomFunctionsDirectory) || !Directory.EnumerateFiles(DefaultCustomFunctionsDirectory).Any())
            {
                if (Directory.Exists(PathUtility.GetFullPath(CustomFunctionsRawDir)))
                {
                    CopyDirectory.Copy(PathUtility.GetFullPath(CustomFunctionsRawDir), DefaultCustomFunctionsDirectory);
                }
                else
                {
                    throw new FileNotFoundException(
                              $"Custom functions examples not found in {PathUtility.GetFullPath(CustomFunctionsRawDir)}");
                }
            }
        }
示例#6
0
    static void Main(string[] args)
    {
        string srcIn, dstIn;

        Console.WriteLine("Enter source path: ");
        srcIn = Console.ReadLine().ToLower();
        Console.WriteLine("Enter destination path: ");
        dstIn = Console.ReadLine().ToLower();

        CopyDirectory cDir = new CopyDirectory(srcIn, dstIn);

        cDir.Copy();
    }
示例#7
0
    private static void AddUnityShaderPluginToVSC()
    {
        string message           = null;
        string pluginSourcePath  = null;
        string pluginInstallPath = null;

        //OSX
        if (Application.platform == RuntimePlatform.OSXEditor)
        {
            pluginSourcePath  = Application.dataPath + "/../VSCUnity/" + UnityShaderPluginName;
            pluginInstallPath = VSCPluginsPathOSX + "/" + UnityShaderPluginName;
        }

        //Win
        else if (Application.platform == RuntimePlatform.WindowsEditor)
        {
            pluginSourcePath  = Application.dataPath + "\\..\\VSCUnity\\" + UnityShaderPluginName;
            pluginInstallPath = VSCPluginsPathWin + "\\" + UnityShaderPluginName;
        }
        else
        {
            message = "Adding Unity shader plugin to Visual Studio Code is not currently supported on " + Application.platform;
        }

        bool supportedPlatform = message == null;

        if (supportedPlatform)
        {
            if (Directory.Exists(pluginSourcePath))
            {
                if (Directory.Exists(pluginInstallPath))
                {
                    Directory.Delete(pluginInstallPath, true);
                }

                CopyDirectory.Copy(pluginSourcePath, pluginInstallPath);

                message = "Successfully added Unity shader plugin to Visual Studio Code";
            }
            else
            {
                message = "Couldn't find the Unity shader plugin:\n\n" + pluginSourcePath;
            }
        }

        EditorUtility.DisplayDialog("Add Unity shader plugin", message, "Ok");
    }
示例#8
0
 private void bg_DoWork(object sender, DoWorkEventArgs args)
 {
     cDir.Copy();
 }