Keyword readonly and static in C#

Access restriction of a variable in a class is a broad topic in C#; we define the restriction by adding the keyword in front of our variables. In some cases, we may have some member or variables in our class, and we don’t want other objects or classes amend their value. In this case, keyword…

Add a test file to C# project via Command Line Terminal

Unit Test is important in C# development journey. In this post, I am going to talk about how to add a test file via command line terminal in Windows 10 and we compile the project in Visual Studio Code. Start A New Project I start a new project in a directory named TestProject. Type in…

Reflection on Flow Control in C#

In C#, Flow-Control is used regularly.  It determines our program’s logic.   I have encountered some issues while using them, even though the syntax is quite simple.  These issues are not complex, but it can be serious if I ignore them. While in C# The While statement is straight forward, it keeps running till the variable i reaches…

一句不经意的话

今天见了一个女生,26岁。说了一句让我印象深刻的话,当你不再寻找自己的另一半的时候,那个人就会不经意的出现在你的生活中。 但愿以后如你所说。谢谢那些总是不经意间为我指点迷津的人,愿你们一切安好! 这句话也让我想起了以前看过的一句话 你要相信世界上一定会有一个你的爱人,无论你此刻正被光芒环绕,被掌声淹没,还是那时你正孤独地走在寒冷的街道上被大雨淋湿,无论是飘着小雪的微凉清晨,还是被热浪炙烤的薄暮黄昏,他一定会穿越这个世界上汹涌的人群,他一一地走过他们,怀着一颗用力跳动的心脏走向你。他一定会捧着满腔的热和目光里沉甸甸的爱,走向你、抓紧你。 他会迫不及待地走到你的身边,如果他年轻,那他一定会像顽劣的孩童霸占着自己的玩具不肯与人分享般的拥抱你。如果他已经不再年轻,那他一定会像披荆斩棘归来的猎人,在你身旁燃气篝火。然后拥抱着你疲惫而放心地睡去。他一定会找到你。你要等。

Namespace in C#

Introduction Namespace in C# development is very heavily used regularly; it is helpful when we develop a relatively large or complex project.  For instance, .NET uses namespace to organise its classes. When it comes to using namespace in C#, it allows us to access the class of namespace by using namespace.classname syntax.  Alternatively, we can use keyword…

Some Concepts of C# Development

Overview – An Interesting Framework C# is an OOP programming language, which is developed by Microsoft.  It can be a bit boring if we just talk about the language itself.  When I started learning to program, I always asked myself what I can do with this language or Framework.   With the Framework, it begins with a general…

有时候我还会突然想起你

已经分开了很久,但是不经意间还是回想起… 8月的一个雨夜,我开车走过Armdale购物中心的停车场;我看到了你在车里坐着,你没有看见我,我没有迟疑,直接开车离开了那里… 我记得你搬走那天,当你搬走后,你发了短信给我,回到家后看到空空的房间,那晚是我一生中度过的最长的一夜… 今天和朋友聊起你,我告诉了他们,我选择了原谅。原谅对我自己也是一种解脱,这是很久以前父亲告诉我的话。谢谢你对我的伤害,让我变得更加坚强。 不知道你的处境如何?也许比以前好,也许不如以前好,但愿一切随你所愿… 《美丽的错误》 我打江南走过 那等在季节里的容颜如莲花的开落 东风不来,三月的柳絮不飞 你的心如小小的寂寞的城 恰若青石的街道向晚 跫音不响,三月的春帷不揭 你的心是小小的窗扉紧掩 我达达的马蹄是美丽的错误 我不是归人,是个过客……

Activity Diagram in UML

In UML, Activity Diagram is used for workflow and process modelling, which can capture paralleled behaviour and multiple behaviours. Key Element Start and Nodes Actions Flows Fork & Joint Decision & Merge Basic Diagram There are five actions in the above diagram, one Start, one Finish and one Merge. As we can see, the diagram…

Keyword: Static in C#

In C#, static means something cannot be instantiated in our development. In other words, we cannot create an object of a static class, and we access the static members without instantiating an object of a static class. Static Class Apply the static modifier before the class name and after the access modifier (public and private)…

Keyword: Internal & Public, Abstract & Sealed

Internal & Public In C#, once we defined a class and we can instantiate it anywhere else in our project that has access to the definition. By default, classes are declared as internal. With internal, it means the class is only accessible to the code in our current project. On contrast, keyword public allows classes…