/// <summary>
 /// About window.
 /// </summary>
 /// <param name = "mainWindow">
 /// The parent window.
 /// </param>
 /// <param name="programInfo">
 /// This program's information (main project info).
 /// </param>
 /// <param name="assemblies">
 /// Assemblies to use.
 /// </param>
 public About(MainProgramElements mainWindow, FileVersionInfo programInfo, ProjectAssemblies assemblies)
 {
     this.VersionInfo = new VersionInfo(programInfo, assemblies, disclaimer);
     this.DataContext = this.VersionInfo;
     this.mainWindow  = mainWindow;
     InitializeComponent();
 }
 void aboutMenuItem_Click(object sender, RoutedEventArgs e)
 {
     this.embeddedLibraries = this.embeddedLibraries ?? new ProjectAssemblies(true);
     (new About(this, FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetExecutingAssembly().Location), this.embeddedLibraries)).Show();
     if (this.embeddedLibraries.RecallIsSafe)
     {
         this.embeddedLibraries = null;
     }
     this.MainProgramElements.WindowEnabled = false;
 }
示例#3
0
        public static object CreateInstance(string typeFullName, BindingFlags bindingAttr = BindingFlags.CreateInstance, object[] args = null)
        {
            if (string.IsNullOrEmpty(typeFullName))
            {
                throw new ArgumentNullException("typeFullName");
            }

            Type type = ProjectAssemblies.GetType(typeFullName);

            return(ReflectionUtil.CreateInstance(type, bindingAttr, args));
        }
示例#4
0
        /// <summary>
        /// Invokes the static method.
        /// </summary>
        /// <param name="typeName">Name of the type.</param>
        /// <param name="methodName">Name of the method.</param>
        /// <param name="parameters">The parameters.</param>
        /// <returns>The object of method return.</returns>
        public static object InvokeStaticMethod(string typeName,
                                                string methodName,
                                                object[] parameters = null)
        {
            Type type = ProjectAssemblies.GetType(typeName);

            if (type != null)
            {
                return(ReflectionUtil.InvokeStaticMethod(type, methodName, parameters));
            }

            return(null);
        }
示例#5
0
        /// <summary>
        /// Generates the database files.
        /// </summary>
        private static void GenerateDBFiles()
        {
            string path            = ExcelFilesPath;
            string namespaceString = GetNamespace();

            DeleteOldDBFiles();

            ForEachExcelFile(path, (DataTable table, string fileName, int index, int length) =>
            {
                EditorUtility.DisplayProgressBar(importProgressBarTitle,
                                                 string.Format(savingDataProgressBarInfo, fileName, index + 1, length), (float)(index + 1) / length);
                List <DataTableRowInfo> rowInfos = GenerateDataTableRowInfos(table);
                List <DataTableRow> collection   = GenerateDataTableRowCollection(table, namespaceString, fileName, rowInfos);

                string classFullName = string.Format("{0}.{1}", namespaceString, fileName);
                Type type            = ProjectAssemblies.GetType(classFullName);

                if (type != null)
                {
                    ReflectionUtil.InvokeStaticGenericMethod(typeof(DataImport),
                                                             "SaveData",
                                                             type,
                                                             new object[] { fileName, rowInfos, collection, index });
                }
                else
                {
                    Debug.LogErrorFormat(null, "Can not find the Type: {0}", classFullName);
                }
            });

            DeleteDBConfigFiles();
            RenameDBFiles();
            AssetDatabase.Refresh();
            AssetDatabase.SaveAssets();
            EditorUtility.ClearProgressBar();
            QuickUnityEditorApplication.DisplaySimpleDialog("", DialogMessages.DataImportDoneMessage);
        }
 /// <summary>
 /// Container for the UI values for the About window of this program.
 /// </summary>
 /// <param name="fileInfo">
 /// This program's information (main project info).
 /// </param>
 /// <param name="assemblies">
 /// Assemblies to use.
 /// </param>
 /// <param name="disclaimer">
 /// Disclaimer for this program.
 /// </param>
 public VersionInfo(FileVersionInfo fileInfo, ProjectAssemblies assemblies, string disclaimer)
 {
     this.ProgramInformation = fileInfo;
     this.embeddedLibraries  = assemblies;
     this.Disclaimer         = disclaimer;
 }