-
Notifications
You must be signed in to change notification settings - Fork 319
Add File Type Support When Open File and Update Test Project to NET 8 #393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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; |
There was a problem hiding this comment.
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.
return graph; | |
return graph ?? new Graph(); |
Copilot uses AI. Check for mistakes.
catch (Exception) { | ||
System.Diagnostics.Debug.WriteLine("cannot read " + fileName); | ||
} |
There was a problem hiding this comment.
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.
catch (Exception) { | ||
System.Diagnostics.Debug.WriteLine("cannot read " + fileName); | ||
} |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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.
Support msagl, dot, dmgl. Then we can enrich it to one viewer/editor based on current test01.