Ng.CommandHelpers.GetCopySrcLuceneDirectory C# (CSharp) Метод

GetCopySrcLuceneDirectory() публичный статический Метод

public static GetCopySrcLuceneDirectory ( string>.IDictionary arguments, bool required = true ) : Lucene.Net.Store.Directory
arguments string>.IDictionary
required bool
Результат Lucene.Net.Store.Directory
        public static Lucene.Net.Store.Directory GetCopySrcLuceneDirectory(IDictionary<string, string> arguments, bool required = true)
        {
            IDictionary<string, string> names = new Dictionary<string, string>
            {
                { Arguments.DirectoryType, Arguments.SrcDirectoryType },
                { Arguments.Path, Arguments.SrcPath },
                { Arguments.StorageAccountName, Arguments.SrcStorageAccountName },
                { Arguments.StorageKeyValue, Arguments.SrcStorageKeyValue },
                { Arguments.StorageContainer, Arguments.SrcStorageContainer }
            };

            return GetLuceneDirectoryImpl(arguments, names, required);
        }

Usage Example

        public static void Run(string[] args)
        {
            IDictionary <string, string> arguments = CommandHelpers.GetArguments(args, 1);

            if (arguments == null || arguments.Count == 0)
            {
                PrintUsage();
                return;
            }

            Lucene.Net.Store.Directory srcDirectory = CommandHelpers.GetCopySrcLuceneDirectory(arguments);
            if (srcDirectory == null)
            {
                Console.WriteLine("problem with src arguments");
                PrintUsage();
                return;
            }

            Lucene.Net.Store.Directory destDirectory = CommandHelpers.GetCopyDestLuceneDirectory(arguments);
            if (destDirectory == null)
            {
                Console.WriteLine("problem with dest arguments");
                PrintUsage();
                return;
            }

            Lucene.Net.Store.Directory.Copy(srcDirectory, destDirectory, true);

            Console.WriteLine("All Done");
        }