Esempio n. 1
0
        public async void ListCategories(bool obj)
        {
            IFileSystem fileSystem    = FileSystem.Current;
            var         rootFolder    = fileSystem.LocalStorage;
            var         reportsFolder = await rootFolder.CreateFolderAsync("reports", CreationCollisionOption.OpenIfExists);

            var reportFile = await reportsFolder.CreateFileAsync("report.txt", CreationCollisionOption.ReplaceExisting);

            using (StreamWriter sw = new StreamWriter(reportFile.Path))
            {
                foreach (var progress in Progresses)
                {
                    sw.WriteLine($"{progress.Name} - {progress.ProgressValue:p}");
                }
            }

            IShare shareDependency = DependencyService.Get <IShare>();
            await shareDependency.Show("Reporte de Gastos", "Reporte de gastos por categoria", reportFile.Path);
        }
        public async void ShareReport()
        {
            IFileSystem fileSystem    = FileSystem.Current;
            IFolder     rootFolder    = fileSystem.LocalStorage;
            IFolder     reportsFolder = await rootFolder.CreateFolderAsync("reports", CreationCollisionOption.OpenIfExists);

            var txtFile = await reportsFolder.CreateFileAsync("report.txt", CreationCollisionOption.ReplaceExisting);

            using (StreamWriter sw = new StreamWriter(txtFile.Path))
            {
                foreach (var ce in CategoryExpensesCollection)
                {
                    sw.WriteLine($"{ce.Category} - {ce.ExpensesPercentage:p}");
                }
            }

            IShare shareDependency = DependencyService.Get <IShare>();
            await shareDependency.Show("Expense Report", "Here is your expenses report", txtFile.Path);
        }
Esempio n. 3
0
 private void HandleShareAction()
 {
     _shareDependencyService.Show("Share", "Share your UniCalendar.ics file.", _fileService.GetFilePath(CalendarFileName));
 }
Esempio n. 4
0
        public void ShareReport()
        {
            IShare shareDependency = DependencyService.Get <IShare>(); // instantiate using interface and Dependency Service

            shareDependency.Show("", "", "");                          // use Show method of implemented IShare interface
        }
Esempio n. 5
0
        public void Share()
        {
            IShare share = DependencyService.Get <IShare>();

            share.Show("Post from Finance", SelectedPost.ItemLink);
        }