C# Introduction
C# Introduction
INTRODUCTION
?
• Required the developer to understand the
production processes.
Pipeline Automation
• Asset Management / Processing
• Automatic rigging
• Dialogue builder
Build Automation
• Automated Testing
• Pushing to the right audience
…
Very specific per organization / Project
WHAT FRAMEWORKS /
LANGUAGES?
Ease of use > Performance
• Frameworks that are visual
?
• Quick to add / modify functionality
Examples:
• WPF C# + XAML
• Blazor C# + HTML
• QT C++ or Python
• Electron HTML + JS
• ...
SEMESTER
OVERVIEW
C# Introduction
WORKING WITH
GIT
Version Control: Git
- Online “backups”
- Collaboration
How?
Commit Fetch
Snapshot of the changes made to one or Get the latest changes. Only affects the
more files at a certain time. Contains a history, not the actual files.
commit message provided by the user.
Possible changes are Add, Rename, Modify
and Delete.
Git Workflows: Basic Workflow
Pull at the start of work, Commit then Push when ready with a
task.
Basic Workflow Example: Handling conflicts
Remote
• Initial state • Person A pulls and starts working. Makes several local commits.
• Commit A01 • Person B pulls and starts working. Makes several local commits.
• Commit A02 • Person A pushes commits to Remote.
• Commit B01
• Person B pushes commits to Remote -> Remote returns error
• Commit B02 “Unable to push because there are commits on the remote that are not
Pull Pull present on your local branch.”
• Commit
<Merge…
Push Push • Person B Pulls remote to have the latest version.
Main
e st
u
Req
ll
Feature Pu
• Clear messages
C# and .NET
Brief history
of .NET .NET FRAMEWORK 1.0
Developed by Microsoft
.NET Framework .NET FRAMEWORK 2.0
• Runtime environment
• Exception handling
C# Continued
Consume
Webservices
MVVM
C# Introduction
vs
vs
At first glance
• High Level language • Low Level Language
• Closer to human language • Closer to machine code
• Easier to read/write • Harder to read/write
vs
Development speed Performance
• Easer to read/write • Closer to machine code
• Higher accessibility • More control over memory usage
• Cross-platform • Faster execution
• Automatic Memory Management • Danger of memory leaks
• Less efficient
vs
Conclusion: The right tool for the right job
C# Project
Structure
HANDS-ON
C# Console
application
PROJECT CREATION
Solution:
PROJECT
CONFIGURATION
• Select .NET Version
• Check “Do not use top-level
statements” ON
• Checked off:
SOLUTION EXPLORER
• Solution
• Project
• Dependencies
• Code Files
PROJECT PROPERTIES
• Application
• Output type (console Application,
DLL,…)
• .NET Version
• Target OS
• …
• Package information
= all information that will be stored
into the application / package on Build.
• Package ID
• Title
• Description
• Version
• Copyright
• …
DEPENDENCIES
= Referenced Projects / Libraries
• Default Dependencies (included
with .NET version)
• Add references (right-click)
• Project Reference
• DLL
• NuGet Packages
LIBRARIES
• Managed DLL
‘Reusable’ objects and functionality
packed into an assembly (= library)
• .NET Framework = Huge set of
libraries
• System.Xml > XML functionality
• System.Net > Networking
functionality
• …
• Third Party Libraries
(Don’t try to write everything yourself)
• SharpDX (DirectX Wrapper)
• Json.NET (Managed Json Parser)
• …
• Create your own
• Class Library Project
WORKING WITH
REFERENCES
Add the reference to the
Dependencies
Access in code with the using
keyword, followed by the namespace
at the top of the file.
using <namespace>;
.NET Documentation
• Select an object in your project
• Press F1
FLASH QUIZ
Which namespace is not part of the .NET 8
Library?
A. System.Reflection
B. System.Threading
C. System.Net
D. System.Error
E. System.Drawing
CODE FILES (.cs files)
• No header files.
• Default Program.cs file with a
static Main() method as entry
point.
EXERCISE
• Write multiple lines to the console.
• Read a line from the console.