示例#1
0
        /// <summary>
        /// Saves Docs
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private async void Save_log_event(object sender, RoutedEventArgs e)
        {
            var btn     = sender as Button;
            var str_btn = btn.Name as string;

            try
            {
                switch (str_btn)
                {
                case "Save_Graph":
                    await log.SaveAsync(Graph.ToString());

                    break;

                case "Save_adjList":
                    await log.SaveAsync(Graph.AdjListToString());

                    break;

                case "Save_adjMatrix":
                    await log.SaveAsync(Graph.MatrixListToString());

                    break;

                case "Save_Console":
                    await log.SaveAsync(myConsole.ToString());

                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                msgdi = new MessageDialog($"Erro {ex.Message}\nGrafo = {Graph}");
                await msgdi.ShowAsync();
            }
            Save_Sttgs.Visibility = Visibility.Collapsed;
        }