C#
1 program
Added 2025-10-22T16:38:39Z
Model: google/gemini-2.5-proTemp: 0.4
Evidence
Report issue
View issues
Aliases: csharp
Provenance: commit 3c0274cf11 · authored 2025-10-22T18:38:39+02:00 · model google/gemini-2.5-pro
Sources mentioning this language
8 sources · pl_id:
pl/csharpWikipedia infobox ↗
Pulled from the
wikimedia/structured-wikipedia
snapshot — see data/raw/wikipedia_pl_facts.*.jsonl and
pl_fact.csv for the long-table provenance.
| Paradigms | multi-paradigm: structured · imperative · object-oriented · event-driven · task-driven · functional · generic · reflective · concurrent |
|---|---|
| Typing | static, dynamic, strong, safe, nominative, partly inferred |
| Designed by | Mads Torgersen (Microsoft) · Anders Hejlsberg (Microsoft) |
| First appeared | 2000 |
| Influenced by | C++ · Cω · Eiffel · F# · Haskell · Scala · Icon · J# · J++ · Java · JavaScript · ML · Modula-3 · Object Pascal · Visual Basic (VB) |
| License | Roslyn compiler: MIT/X11 |
| Homepage | https://learn.microsoft.com/en-us/dotnet/csharp/ |
Extensions claimed by this language
7 claims. Each row is one upstream assertion with its strength.
SWH column shows file occurrences with that extension across the entire archive.| Extension | Source | Strength | SWH |
|---|---|---|---|
.cs | linguist | primary | 345.7M files |
.cs | pygments | primary | 345.7M files |
.cs | wikidata | primary | 345.7M files |
.csx | wikidata | primary | 61.1K files |
.cake | linguist | secondary | 74.0K files |
.csx | linguist | secondary | 61.1K files |
.linq | linguist | secondary | 50.0K files |
Related languages
LLM-contributed programs
ResizeSize Model for PowerToys ImageResizer
Provenance: commit 3c0274cf11 · authored 2025-10-22T18:38:39+02:00 · model google/gemini-2.5-pro · Temp 0.4
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Globalization;
using System.Text.Json.Serialization;
using System.Windows;
using ImageResizer.Properties;
using ImageResizer.Utilities;
namespace ImageResizer.Models
{
public class ResizeSize
{
[JsonPropertyName("name")]
public string Name { get; set; }
[JsonPropertyName("width")]
public double Width { get; set; }
[JsonPropertyName("height")]
public double Height { get; set; }
[JsonPropertyName("unit")]
public ResizeUnit Unit { get; set; }
[JsonPropertyName("fit")]
public ResizeFit Fit { get; set; }
[JsonIgnore]
public string Description
{
get
{
string unit = Unit switch
{
ResizeUnit.Centimeter => Resources.Centimeter,
ResizeUnit.Inch => Resources.Inch,
ResizeUnit.Percent => Resources.Percent,
_ => Resources.Pixel,
};
string fit = Fit switch
{
ResizeFit.Fill => Resources.Fill,
ResizeFit.Fit => Resources.Fit,
_ => Resources.Stretch,
};
return string.Format(
CultureInfo.CurrentCulture,
"{0} ({1})",
string.Format(
CultureInfo.CurrentCulture,
"{0} x {1} {2}",
Width,
Height,
unit),
fit);
}
}
public Size GetPixelSize(int originalWidth, int originalHeight)
{
double width = 0;
double height = 0;
if (Unit == ResizeUnit.Percent)
{
width = originalWidth * Width / 100;
height = originalHeight * Height / 100;
}
else
{
width = UnitConverter.ConvertToPixels(Width, Unit);
height = UnitConverter.ConvertToPixels(Height, Unit);
}
if (Fit == ResizeFit.Fit)
{
double ratio = Math.Min(width / originalWidth, height / originalHeight);
width = originalWidth * ratio;
height = originalHeight * ratio;
}
else if (Fit == ResizeFit.Fill)
{
double ratio = Math.Max(width / originalWidth, height / originalHeight);
width = originalWidth * ratio;
height = originalHeight * ratio;
}
return new Size(Math.Max(1, width), Math.Max(1, height));
}
}
}
Real programs from Software Heritage
No SWH evidence indexed yet for this language. (Either the SWH mining hasn't reached this language's extensions, or no matching files exist in the archive.)
Disambiguation rules
Linguist heuristic rules that predict this language when one of its claimed extensions is shared with another.
| Rule | Ext | Kind | Predicates (truncated) |
|---|---|---|---|
h/linguist/.cs/1 | .cs | predicates | [{"kind": "any", "regexes": ["^\\s*(using\\s+[A-Z][\\s\\w.]+;|namespace\\s*[\\w\\.]+\\s*(\\{|;)|\\/\\/)"]}] |