اشتراکها
توابع سیستمی در Sql server
اشتراکها
درک Coupling و Cohesion
I invited some of my friends to discuss the nebulous concepts of coupling and cohesion in software design. How do we think about these topics? How do we understand the terms? How do we use that in our work as programmers? How do we teach it to others? How much does any of it even matter?
Our invited guests: Corey Haines, Curtis Cooley, Dale Emery, J. B. Rainsberger, Jim Weirich, Kent Beck, Nat Pryce, Ron Jeffries.
اشتراکها
برنامهنویسی شیگرا شکست بود؟
اشتراکها
NET Core 3.1.2. منتشر شد
- .NET Core 3.1.2 and .NET Core SDK ( Download | Release Notes )
- .NET Core 3.0.3 and .NET Core SDK ( Download | Release Notes )
- .NET Core 2.1.16 and .NET Core SDK ( Download | Release Notes )
اشتراکها
پروژهی IKVM هنوز برقرار است
امکان تبدیل رخدادهای توکار مرورگرها به دایرکتیوهای Blazor در Blazor6x
یکسری دایرکتیو مانند onclick@ و امثال آن، از پیش در Blazor تعریف شدهاند که امکان مدیریت رویدادهای جاوااسکریپتی را در کدهای سیشارپ میسر میکنند. اما تعداد اینها زیاد نیست. برای مثال تعداد رویدادهای قابل تعریف و پشتیبانی شدهی توسط مرورگرها قابل ملاحظهاست. در Blazor 6x روشی جهت دسترسی سادهتر به این رویدادها ارائه شدهاست که شامل این مراحل است. برای نمونه فرض کنید میخواهیم به رویداد paste مرورگر دسترسی پیدا کنیم و یک دایرکتیو سفارشی oncustompaste@ را برای آن تهیه کنیم:
<input @oncustompaste="HandleCustomPaste" />
<script> Blazor.registerCustomEventType('custompaste', { browserEventName: 'paste', createEventArgs: event => { // This example only deals with pasting text, but you could use arbitrary JavaScript APIs // to deal with users pasting other types of data, such as images return { eventTimestamp: new Date(), pastedData: event.clipboardData.getData('text') }; } }); </script>
پس از اینکار، معادل دو پارامتر بازگشت داده شده را به صورت زیر در کدهای سیشارپ تهیه میکنیم:
namespace BlazorCustomEventArgs.CustomEvents { [EventHandler("oncustompaste", typeof(CustomPasteEventArgs), enableStopPropagation: true, enablePreventDefault: true)] public static class EventHandlers { // This static class doesn't need to contain any members. It's just a place where we can put // [EventHandler] attributes to configure event types on the Razor compiler. This affects the // compiler output as well as code completions in the editor. } public class CustomPasteEventArgs : EventArgs { // Data for these properties will be supplied by custom JavaScript logic public DateTime EventTimestamp { get; set; } public string PastedData { get; set; } } }
یک نکته: در اینجا نام oncustompaste به همان نام custompaste کدهای جاوااسکریپتی اشاره میکند. نام تعریف شدهی در قسمت سیشارپ، یک on در ابتدا اضافهتر دارد. اینکار سبب میشود که اکنون بتوان یک رویدادگردان oncustompaste@ سفارشی را که قابل مدیریت در کدهای سیشارپ است، داشت:
@page "/" <p>Try pasting into the following text box:</p> <input @oncustompaste="HandleCustomPaste" /> <p>@message</p> @code { string message; void HandleCustomPaste(CustomPasteEventArgs eventArgs) { message = $"At {eventArgs.EventTimestamp.ToShortTimeString()}, you pasted: {eventArgs.PastedData}"; } }
اشتراکها
Angular 10 منتشر شد
Version 10.0.0 is here! This is a major release that spans the entire platform, including the framework, Angular Material, and the CLI. This release is smaller than typical; it has only been 4 months since we released version 9.0 of Angular.
اشتراکها