Ejemplo n.º 1
0
        /// <inheritdoc />
        public async Task LoadProjectAsync()
        {
            var openDialogOptions = new OpenDialogOptions
            {
                Title      = Translator.Translate("Please choose your Project File"),
                Properties = new[] { OpenDialogProperty.openFile },
                Filters    = new[]
                {
                    new FileFilter
                    {
                        Extensions = new[] { "json" }, Name = Translator.Translate("Project File")
                    }
                }
            };

            var projectFilePath = (await ElectronHelper.ShowOpenDialogAsync(ElectronHelper.GetBrowserWindow(), openDialogOptions))
                                  .FirstOrDefault();

            if (!string.IsNullOrWhiteSpace(projectFilePath))
            {
                await CurrentProject.LoadAsync(projectFilePath);
            }
        }