自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(12)
  • 收藏
  • 关注

原创 Nullable Operators (C#)

Null-Coalescing Operator (??) It is a shorthand to check if the variable is null before accessing its value.int? i = null;string? temp="I'm not null!";int index = i ?? 0;string result = temp ?? "Null";Console.WriteLine(index);Console.WriteLin..

2022-05-03 18:07:55 76

原创 Nullable Types (?) (C#)

Nullable Value Type The ? suffix is a shorthand for creating an instance of the generic System.Nullable<T> structure.static void NullableItems(){ int? item1 = 0; // Nullable<int> item1 = 0; bool? item2 = null; // Nullabl..

2022-05-03 17:49:41 210

原创 Value Types and Reference Types (C#)

C# structs are derived from System.ValueType which overrides the virtual methods in System.Object to use value-based semanitcs instead of reference-based ones.System.ValueType is allocated on stack rather than on garbage-collected heap. Its lifetime is i

2022-05-03 16:33:42 65

原创 enum (C#)

Default storage type of enum is System.Int32.The storage type could be changed to byte, short, int and long,var vehicle1 = VehiclesTypeEnum.MiniVan;Console.WriteLine($"The result is " + $"{Enum.GetUnderlyingType(vehicle1.GetType())}");Console.W

2022-05-03 14:59:35 184

原创 Method Parameter Modifiers (C#)

Modifier Remarks (None) value type: passed by value (a copy of data) reference type: passed by reference out out parameters are passed by reference. Must be assigned in the method. in to indicates that the ref parameters are r

2022-05-03 10:03:16 108

原创 switch (C#)

switch on an enumeration data type; static void SwitchOnEnum() { Console.WriteLine("Enter your favorite day of the week: "); DayOfWeek day; try { day=(DayOfWeek) Enum.Parse(t.

2022-05-02 17:36:17 701

原创 Conditional Operator (?:) (C#)

condition ? expression1 : expression2;When condition is true, expression1 is executed.Experssion2 is executed when false.It is used only in assignment statement.Expression1 and experssion2 must have implicit conversions from one to another.It can .

2022-05-02 16:06:48 382

原创 Pattern Matching (C#)

if/else Pattern Matching (C# 7.0)Use "is" keyword to check the type of an objectExample: static void FindPattern() { object item1 = 10; object item2 = "Hello!"; if(item1 is int value1) {

2022-05-02 15:37:34 251

原创 struct (C#)

C#, structure, struct

2022-04-12 16:14:39 250

原创 Tuple (C#)

C# Tuple

2022-04-12 10:14:53 134

原创 3DEXPERIENCE:如何获取Service Object (C#)

1)用Application.GetSessionService获取Service ObjectUse the GetSessionService method of the Application object to return a session-level Service object.VisuServices oVisuService= CATIA.GetSessionService("VisuServices")The table below lists the service i

2022-03-24 17:13:53 173

原创 WPF and XAML

1. Definitions of WPF and XAML2. Defference between WPF and Windows Form

2021-06-26 09:26:59 59

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除