Qyoto.QCoreApplication.GenerateArgs C# (CSharp) Method

GenerateArgs() private method

private GenerateArgs ( string argv ) : string[]
argv string
return string[]
        string[] GenerateArgs(string[] argv)
        {
            string[] args = new string[argv.Length + 1];
            Assembly a = System.Reflection.Assembly.GetEntryAssembly();

            if(a == null)
                a = System.Reflection.Assembly.GetExecutingAssembly();

            object[] attrs = a.GetCustomAttributes(typeof(AssemblyTitleAttribute), false);
            if (attrs.Length > 0) {
                args[0] = ((AssemblyTitleAttribute) attrs[0]).Title;
            } else {
                QFileInfo info = new QFileInfo(a.Location);
                args[0] = info.BaseName();
            }
            argv.CopyTo(args, 1);

            return args;
        }