C# 7 is a major update with a lot of interesting new capabilities. And while there are plenty of articles on what you can do with it, there aren't quite as many on what you should do with it. Using the principles found in the .NET Framework Design Guidelines, we're going to take a first pass at laying down strategies for getting the most from these new features.
3.Visual Studio 2017 15.6 منتشر شد
These are the customer-reported issues addressed in this release:
- Esc key doesn't close Peek Definition Window.
-
wpp.targets
file execution not working after update to version 15.6. - Project loaded via File->Open->CMake throws exception and CMake cache is not generated..
- Version 15.6 update crashes Xamarin code with NullReferenceException with next scenario.
- XCode Tools installation fails after version 15.6 update.
- Anaconda 5.0.0 Completion DB is not up to date and hitting refresh fails.
- Cannot run NUnit tests after version 15.6.1 update.
- Visual Studio 2017 fails to launch from the command line when launched using 8.3 file name path.
- Version 15.6.0 breaks when VisualStudio\Telemetry\TurnOffSwitch is set to 0.
- Visual Studio Community 2017 auto closes after version 15.6 update..
- CMake generation never stops after version 15.6.1 update.
- Opening a solution with tests, and clicking any toolbar item in Test Explorer causes VS to crash.
حجم تقریبی بروزرسانی از نسخه 15.6.2 به 15.6.3 برابر 1.47GB میباشد
This type of CollectionView does not support changes to its SourceCollection from a thread different from the Dispatcher thread
Adding to an ObservableCollection from a background thread
مشکل!
اگر همین برنامه را که برای دات نت 4 کامپایل شدهاست، بر روی سیستمی که دات نت 4.5 بر روی آن نصب است اجرا کنیم، برنامه با خطای ذیل متوقف میشود:
System.InvalidOperationException: This exception was thrown because the generator for control 'System.Windows.Controls.ListView Items.Count:62' with name '(unnamed)' has received sequence of CollectionChanged events that do not agree with the current state of the Items collection. The following differences were detected: Accumulated count 61 is different from actual count 62.
مشکل از کجاست؟
در دات نت 4 و نیم، دیگر نیازی به استفاده از کلاس MTObservableCollection یاد شده نیست و به صورت توکار امکان کار با Collectionها از طریق تردی دیگر میسر است. فقط برای فعال سازی آن باید نوشت:
private static object _lock = new object(); //... BindingOperations.EnableCollectionSynchronization(persons, _lock);
برای برنامهی دات نت 4 ایی که قرار است در سیستمهای مختلف اجرا شود چطور؟
در اینجا باید از Reflection کمک گرفت. اگر متد EnableCollectionSynchronization بر روی کلاس BindingOperations یافت شد، یعنی برنامهی دات نت 4، در محیط جدید در حال اجرا است:
public static void EnableCollectionSynchronization(IEnumerable collection, object lockObject) { MethodInfo method = typeof(BindingOperations).GetMethod("EnableCollectionSynchronization", new Type[] { typeof(IEnumerable), typeof(object) }); if (method != null) { method.Invoke(null, new object[] { collection, lockObject }); } }
همچنین اگر بخواهیم کلاس MTObservableCollection معرفی شده را جهت سازگاری با دات نت 4 و نیم به روز کنیم، به کلاس ذیل خواهیم رسید. این کلاس با دات نت 4 و 4.5 سازگار است و جهت کار با ObservableCollectionها از طریق تردهای مختلف تهیه شدهاست:
using System; using System.Collections; using System.Collections.ObjectModel; using System.Collections.Specialized; using System.Linq; using System.Windows.Data; using System.Windows.Threading; namespace WpfAsyncCollection { public class AsyncObservableCollection<T> : ObservableCollection<T> { public override event NotifyCollectionChangedEventHandler CollectionChanged; private static object _syncLock = new object(); public AsyncObservableCollection() { enableCollectionSynchronization(this, _syncLock); } protected override void OnCollectionChanged(NotifyCollectionChangedEventArgs e) { using (BlockReentrancy()) { var eh = CollectionChanged; if (eh == null) return; var dispatcher = (from NotifyCollectionChangedEventHandler nh in eh.GetInvocationList() let dpo = nh.Target as DispatcherObject where dpo != null select dpo.Dispatcher).FirstOrDefault(); if (dispatcher != null && dispatcher.CheckAccess() == false) { dispatcher.Invoke(DispatcherPriority.DataBind, (Action)(() => OnCollectionChanged(e))); } else { foreach (NotifyCollectionChangedEventHandler nh in eh.GetInvocationList()) nh.Invoke(this, e); } } } private static void enableCollectionSynchronization(IEnumerable collection, object lockObject) { var method = typeof(BindingOperations).GetMethod("EnableCollectionSynchronization", new Type[] { typeof(IEnumerable), typeof(object) }); if (method != null) { // It's .NET 4.5 method.Invoke(null, new object[] { collection, lockObject }); } } } }
داستان پیدایش NET.
تاریخچهای از گرافیک وب
Short Bytes: Web graphics have come a long way from the time images were the only graphics on mostly static pages, to WebGL’s powerful animation, GPU and gaming capabilities, all powered by canvas HTML element’s 2D and 3D contexts. Now Webkit browser engine has proposed a new low level web graphics API standard to leverage the computing powers and hardware acceleration that latest GPU systems provide
20 نکته از CSS برای طراحی مدرن
- Update extension to handle upcoming breaking change to launch.json configurations in VS Code 1.28.
- Fixed launch.json
envFile
option on Windows - Fixed a bug where OmniSharp flame was red inspite of OmniSharp loading the projects without any errors.
- Fixed a problem with tracking virtual documents from other providers
معرفی کنترل چارت زیبای NVD3
- گروه بندی سطری و ستونی در چارت
- چارتهای خطی انباشته (cumulative)
- Pie Chart
- تولتیپ بر روی نودهای سریها
- چارتهای پشته ای (Stacked Area)
- چارتهای Discrete Bar
- چارتهای حبابی
- چارتهای گلوله ای (Bullet Chart)
This project is an attempt to build re-usable charts and chart components for d3.js without taking away the power that d3.js gives you. This is a very young collection of components, with the goal of keeping these components very customizeable, staying away from your standard cookie cutter solutions.
بررسی NET Standard.
Description
There has been a lot of talk lately about .NET Standard, both in the community and on Channel 9. But there is also still confusion about it. In this episode, Kathleen Dollard clears up some of this confusion. She and Robert chat about why .NET Standard was created, as well as how and when you should take advantage of it.