Exemple #1
0
        private void SaveButton_Click(object sender, RoutedEventArgs e)
        {
            var dialog = new SaveFileDialog()
            {
                Filter = "Text Files (*.txt)|*.txt|Comma-Separated Values (.csv)|*.csv"
            };

            if (dialog.ShowDialog() == true)
            {
                using (var stream = dialog.OpenFile())
                {
                    using (var writer = new StreamWriter(stream))
                    {
                        var str = IOStringFunctions.GlobalSettingsToUrl();
                        if (!string.IsNullOrWhiteSpace(str))
                        {
                            writer.WriteLine(str);
                        }
                        str = IOStringFunctions.TargetShapeToUrl(TargetShapeStream);
                        if (!string.IsNullOrWhiteSpace(str))
                        {
                            writer.WriteLine(str);
                        }
                        writer.WriteLine(IOStringFunctions.MechanismString);
                        writer.Write(JointData.ConvertDataToText('\n'));
                    }
                }
            }
        }
Exemple #2
0
        private void OpenButton_Click(object sender, RoutedEventArgs e)
        {
            var dialog = new OpenFileDialog
            {
                Filter = "Text Files (*.txt)|*.txt|Comma-Separated Values (.csv)|*.csv"
            };

            if (dialog.ShowDialog() == true)
            {
                var fileText = dialog.File.OpenText().ReadToEnd();
                if (IOStringFunctions.OpenConfigFromTextFile(fileText))
                {
                    App.main.ParseData(true);
                    return;
                }
            }
            App.main.JointsInfo.Data.Add(new JointData());
            App.main.ParseData();
        }
Exemple #3
0
        private void MakeURLButton_Click(object sender, RoutedEventArgs e)
        {
            string url = HtmlPage.Document.DocumentUri.AbsoluteUri;

            url  = url.Split(' ', '?', '&')[0];
            url += "?";

            var str = IOStringFunctions.GlobalSettingsToUrl();

            if (!string.IsNullOrWhiteSpace(str))
            {
                url += str + "&";
            }
            str = IOStringFunctions.TargetShapeToUrl(TargetShapeStream);
            if (!string.IsNullOrWhiteSpace(str))
            {
                url += str + "&";
            }
            url            += IOStringFunctions.MechanismToUrl();
            UrlTextBox.Text = url;
            UrlPopUpStackPanel.Visibility = Visibility.Visible;
            UrlTextBox.Focus();
            UrlTextBox.SelectAll();
        }