Neal's Blog


  • Home

  • About

  • Schedule

The starting of Mind-Exploding project - design

Posted on 2019-06-09

Introduction

I am going to develop a website which’s name is Mind-Exploding. In this website, users can create or import a mind map file. And all of the users’ files will be stored on this website. All users need to do to get their file is to sign on this website, then it will post all of your files as a list, you can edit or view your mind map by click the file’s title. It is really easy for people to create a mind file and collect their minds.

Now, this website is developing, and I will record the useful knowledge and the base theories when I use the ASP.NET MVC.

This blog is the first part of this series - the design.

Read more »

How does Asp.NET MVC translate ActionResult into Html? (Part 1)

Posted on 2019-06-04

Introduction

As we all know, the UI of the website is rendered by web browsers. And the web browsers create kinds of controls depends on the HTML code provided by the website. So, when we visit a website, the web browsers will try to get the HTML code of the website and the relative sources it needed according to Http protocol, then the browsers will create and render all the controls in this website correctly.

The View in the ASP.NET MVC determines the rendering of the website. And we can notice that the name of View is the same as Action‘s name. When an Action is executed, the ASP.NET MVC will get the View as a result by the name of the Action. Then the View will be translated into HTML code and sent to browsers as a return.

Read more »

.NET/C# exception handling: writing important code inside `finally` block with an empty `try` block

Posted on 2019-05-28

Introduction

Have you seen an empty try block before? In this situation, there are some important codes in the finally block. So, why do developers use the try {} finally {} at this way?

In this article, we will talk about this usage of the try {} finally {}.

Read more »

Learn about default TaskScheduler and ThreadPool in .NET to avoid reducing performance of Task.Run drastically

Posted on 2019-05-27

Introduction

Task.Run method is introduced in .NET Framework 4.5, and it’s simple for us to use async/await keywords. Also, use this method can help us manage threads with ThreadPool, so we can write asynchronous codes as simple as synchronous codes.

But, if Task.Run method is abused, it will reduce the application’s performance drastically. In this article, we will introduce more details about the default thread pool task scheduler. And we will introduce the right way to use Task.Run, to avoid reducing the application’s performance.

Read more »

Learn more about how WPF Dispatcher works.(Part 2 - PushFrame)

Posted on 2019-05-21

Introduction

In the previous article “Learn more about how WPF Dispatcher works. (Invoke and InvokeAsync)”, we found that Dispatcher.Invoke depends on Dispatcher.PushFrame method to wait without blocking. But how does Dispatcher.PushFrame work?

In this blog, we will introduce more details about Dispatcher.

Read more »

Learn more about how WPF Dispatcher works.(Invoke and InvokeAsync)

Posted on 2019-05-16

Introduction

The WPF developers cannot avoid using the Dispatcher class. When we have to access controls or other UI parts on other threads (not UI thread), we should use Dispatcher.InvokeAsync or Dispatcher.Invoke method. Also, Dispatcher can be used to delay a task until the current task is executed.

Developers often used Dispatcher.BeginInvoke in the past. And Microsoft adds a new method which’s name is Dispatcher.InvokeAsync in .NET Framework 4.5.

Are there any differences between these methods? And how does Dispatcher work?

Read more »

Transfer of execution rights - Task.Yield, Dispatcher.Yield

Posted on 2019-05-15

Introduction

As the word Yield means, the Yield() method transfers the execution right of the current task, after that other tasks may get the right to execute. And the method of Yield() is existed in Task, Dispatcher, Thread class, and as the name shows, all of these methods are to transfer the current task’s execution right.

Are there any differences? How do they work?

In this article, we will see more details about the Yield() methods.

Read more »

The usages and suggestions about Thead.Sleep(0),Task.Delay(0),Thread.Yield(),Task.Yield()

Posted on 2019-05-14

Introduction

There are some methods to release current thread excution right in .NET/C#. They are Thread.Sleep(0),Task.Delay(0),Thread.Yield(),Task.Yeild(). The function of these methods is to tell the program to give up current thread and then run another thread. But there are some differences among these methods.

This article is about their differences and theories.

Read more »

How does WPF application get mouse position when the mouse is outside the window?

Posted on 2019-05-13

Introduction

As we all know, we have two methods to get the mouse position which is relative to other controls. One is Mouse.GetPosition(IInputElement relativeTo) , the other is MouseEventArgs.GetPosition(IInputElement relativeTo). But, what will we get when the mouse is outside the window’s client area? And how does it calculate?

This article is to tell developers about what and how we get the mouse coordinate.

Read more »

Lesser known technologies in Xaml

Posted on 2019-05-12

Introduction

This article is going to introduce some lesser known technologies about the Xaml file.

Read more »
12
Neal chen

Neal chen

.NET Core\WPF\.NET

12 posts
2 tags
E-Mail
© 2019 Neal chen
PV: | UV: |
Powered by Hexo
|
Theme — NexT.Gemini v5.1.4