Skip to content

Conversation

caigen
Copy link
Contributor

@caigen caigen commented Sep 10, 2025

Support msagl, dot, dmgl. Then we can enrich it to one viewer/editor based on current test01.

@caigen caigen changed the title Add FileType Support in Test01 Add File Type Support When Open File and Update Test Project to NET 8 Sep 10, 2025
@levnach levnach requested a review from Copilot September 11, 2025 00:08
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for multiple file types (MSAGL, DOT, and DGML) in the file open dialog and updates the test projects from .NET 6 to .NET 8.

  • Updates target framework from .NET 6 to .NET 8 for test projects
  • Adds DGML file type support by integrating DgmlParser
  • Enhances file type detection and parsing logic with extension-based routing

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
TestGraphmaps.csproj Updates target framework to net8.0-windows
TestFormForGViewer.csproj Adds DgmlParser project reference
FormStuff.cs Implements multi-format file support with extension-based parsing
MSAGLTests.csproj Updates target framework to net8.0-windows
Program.cs Adds STAThread attribute and System using
build.yml Updates test path to reflect net8.0-windows framework

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

}
msaglFile = false;
return null;
return graph;
Copy link
Preview

Copilot AI Sep 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function can return null when all parsing attempts fail, but the method signature doesn't indicate this possibility. Consider returning a default empty graph or updating the method signature to make the nullable return explicit.

Suggested change
return graph;
return graph ?? new Graph();

Copilot uses AI. Check for mistakes.

Comment on lines +127 to +129
catch (Exception) {
System.Diagnostics.Debug.WriteLine("cannot read " + fileName);
}
Copy link
Preview

Copilot AI Sep 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Catching generic Exception without re-throwing or proper error handling can mask important errors. Consider catching specific exceptions or logging more detailed error information for debugging.

Copilot uses AI. Check for mistakes.

Comment on lines +145 to +147
catch (Exception) {
System.Diagnostics.Debug.WriteLine("cannot read " + fileName);
}
Copy link
Preview

Copilot AI Sep 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Catching generic Exception without re-throwing or proper error handling can mask important errors. Consider catching specific exceptions or logging more detailed error information for debugging.

Copilot uses AI. Check for mistakes.

}
break;
case ".msagl":
default:
Copy link
Preview

Copilot AI Sep 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default case assumes MSAGL format for unknown extensions, which may not be intuitive. Consider adding explicit handling for .msagl extension and making the default case more explicit about fallback behavior.

Copilot uses AI. Check for mistakes.

@levnach levnach merged commit 8d7c4a1 into microsoft:master Sep 11, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants