Пример #1
0
            internal void Install()
            {
                if (IsEnabled)
                {
                    FileInfo target = new FileInfo(Destination);

                    if (!target.Directory.Exists)
                    {
                        target.Directory.Create();
                    }

                    if (IsOkayToOverwrite(target))
                    {
                        Log.WriteLine("   Installing " + Destination);

                        Source.CopyTo(Destination, true);
                    }
                }
            }
        // This applies the conversion command to each of the files checked
        // in the 'Source Files' control, and installs the results into the
        // checked repositories.
        private void ConvertFiles()
        {
            m_Log.Clear();

            if (0 == sourceFileSelector1.CheckedFiles.Count)
            {
                throw new WarningException(
                          "No COLLADA files are selected; you must check at\n" +
                          "least one file in the 'COLLADA Files' tab.");
            }

            foreach (FileInfo info in sourceFileSelector1.CheckedFiles)
            {
                try
                {
                    string workingFilename = CopyToWorkingFolder(info);

                    DateTime startTime = ConvertOneFile(workingFilename);

                    InstallResultFiles(workingFilename, startTime);
                }
                catch (WarningException ex)
                {
                    throw ex;
                }
                catch (Exception ex)
                {
                    m_Log.WriteLine(String.Format(
                                        "\nCommand failed on file <{0}>\n" +
                                        "Details:\n  " +
                                        ex.Message,
                                        info.Name));
                }
            }
        }