We are proud to present the first beta release of Kendo UI for Angular 2. It’s been designed specifically for Angular 2. Written in Typescript, built as native Query-free components and distributed as NPM packages, Kendo UI for Angular 2 makes integrating UI components into ng2 a piece of cake for developers. In this beta release, you’ll find the business application essential building blocks — form elements, grid and data visualization components.
با توجه به تجزیه و تحلیل انجام شده تمامی اشیا از کلاس پایه به نام Shape ارث بری دارند حال به توضیح کدهای این کلاس میپردازیم. (به دلیل اینکه توضیحات این کلاس در دو پست نوشته خواهد شد برای این کلاسها از partial class استفاده شده است)
using System; using System.Drawing; using System.Drawing.Drawing2D; using System.Net; namespace PWS.ObjectOrientedPaint.Models { /// <summary> /// Shape (Base Class) /// </summary> public abstract partial class Shape { #region Fields (1) private Brush _backgroundBrush; #endregion Fields #region Properties (16) /// <summary> /// Gets or sets the brush. /// </summary> /// <value> /// The brush. /// </value> public Brush BackgroundBrush { get { return _backgroundBrush ?? (_backgroundBrush = new SolidBrush(BackgroundColor)); } private set { _backgroundBrush = value ?? new SolidBrush(BackgroundColor); } } /// <summary> /// Gets or sets the color of the background. /// </summary> /// <value> /// The color of the background. /// </value> public Color BackgroundColor { get; set; } /// <summary> /// Gets or sets the end point. /// </summary> /// <value> /// The end point. /// </value> public PointF EndPoint { get; set; } /// <summary> /// Gets or sets the color of the fore. /// </summary> /// <value> /// The color of the fore. /// </value> public Color ForeColor { get; set; } /// <summary> /// Gets or sets the height. /// </summary> /// <value> /// The height. /// </value> public float Height { get { return Math.Abs(StartPoint.Y - EndPoint.Y); } set { if (value > 0) EndPoint = new PointF(EndPoint.X, StartPoint.Y + value); } } /// <summary> /// Gets or sets a value indicating whether this instance is fill. /// </summary> /// <value> /// <c>true</c> if this instance is fill; otherwise, <c>false</c>. /// </value> public bool IsFill { get; set; } /// <summary> /// Gets or sets a value indicating whether this instance is selected. /// </summary> /// <value> /// <c>true</c> if this instance is selected; otherwise, <c>false</c>. /// </value> public bool IsSelected { get; set; } /// <summary> /// Gets or sets my pen. /// </summary> /// <value> /// My pen. /// </value> public Pen Pen { get { return new Pen(ForeColor, Thickness); } } /// <summary> /// Gets or sets the type of the shape. /// </summary> /// <value> /// The type of the shape. /// </value> public ShapeType ShapeType { get; protected set; } /// <summary> /// Gets the size. /// </summary> /// <value> /// The size. /// </value> public SizeF Size { get { return new SizeF(Width, Height); } } /// <summary> /// Gets or sets the start point. /// </summary> /// <value> /// The start point. /// </value> public PointF StartPoint { get; set; } /// <summary> /// Gets or sets the thickness. /// </summary> /// <value> /// The thickness. /// </value> public byte Thickness { get; set; } /// <summary> /// Gets or sets the width. /// </summary> /// <value> /// The width. /// </value> public float Width { get { return Math.Abs(StartPoint.X - EndPoint.X); } set { if (value > 0) EndPoint = new PointF(StartPoint.X + value, EndPoint.Y); } } /// <summary> /// Gets or sets the X. /// </summary> /// <value> /// The X. /// </value> public float X { get { return StartPoint.X; } set { if (value > 0) StartPoint = new PointF(value, StartPoint.Y); } } /// <summary> /// Gets or sets the Y. /// </summary> /// <value> /// The Y. /// </value> public float Y { get { return StartPoint.Y; } set { if (value > 0) StartPoint = new PointF(StartPoint.X, value); } } /// <summary> /// Gets or sets the index of the Z. /// </summary> /// <value> /// The index of the Z. /// </value> public int Zindex { get; set; } #endregion Properties } }
خصوصیات:
- BackgroundColor: در صورتی که شی مورد نظر به صورت توپررسم شود، این خاصیت رنگ پس زمینه شی را مشخص میکند.
- BackgroundBrush: خاصیتی است که با توجه به خاصیت BackgroundColor یک الگوی پر کردن زمینه شی میسازد.
- StartPoint: نقطه شروع شی را در خود نگهداری میکند.
- EndPoint: نقطه انتهای شی را در خود نگهداری میکند. (قبلا گفته شد که هر شی را در صورتی که در یک مستطیل فرض کنیم یک نقطه شروع و یک نقطه پایان دارد)
- ForeColor: رنگ قلم ترسیم شی مورد نظر را تعیین میکند.
- Height: ارتفاع شی مورد نظر را تعیین میکند ( این خصوصیت اختلاف عمودی StartPoint.Y و EndPoint.Y را محاسبه میکند و در زمان مقدار دهی EndPoint جدیدی ایجاد میکند).
- Width: عرض شی مورد نظر را تعیین میکند ( این خصوصیت اختلاف افقیStartPoint.X و EndPoint.X را محاسبه میکند و در زمان مقدار دهی EndPoint جدیدی ایجاد میکند).
- IsFill: این خصوصیت تعیین کننده توپر و یا توخالی بودن شی است.
- IsSelected: این خاصیت تعیین میکند که آیا شی انتخاب شده است یا خیر (در زمان انتخاب شی چهار مربع کوچک روی شی رسم میشود).
- Pen: قلم خط ترسیم شی را مشخص میکند. (قلم با ضخامت دلخواه)
- ShapeType: این خصوصیت نوع شی را مشخص میکند (این خاصیت بیشتر برای زمان پیش نمایش ترسیم شی در زمان اجراست البته به نظر خودم اضافه هست اما راه بهتری به ذهنم نرسید)
- Size: با استفاده از خصوصیات Height و Width ایجاد شده و تعیین کننده Size شی است.
- Thickness: ضخامت خط ترسیمی شی را مشخص میکند، این خاصیت در خصوصیت Pen استفاده شده است.
- X: مقدار افقی نقطه شروع شی را تعیین میکند در واقع StartPoint.X را برمیگرداند (این خاصیت اضافی بوده و جهت راحتی کار استفاده شده میتوان آن را ننوشت).
- Y: مقدار عمودی نقطه شروع شی را تعیین میکند در واقع StartPoint.Y را برمیگرداند (این خاصیت اضافی بوده و جهت راحتی کار استفاده شده میتوان آن را ننوشت).
- Zindex: در زمان ترسیم اشیا ممکن است اشیا روی هم ترسیم شوند، در واقع Zindex تعیین کننده عمق شی روی بوم گرافیکی است.
در پست بعدی به توضیح متدهای این کلاس میپردازیم.
As anyone in the .NET community who hasn't been living under a rock will know, there's a lot of exciting things happening with .NET at the moment with the announcement of the open source, cross platform, .NET Core. However, partly due to the very open nature of its evolution, there's been a whole host of names associated with its development - vNext, ASP.NET 5, ASP.NET Core, .NET generations etc.
In this post I'm going to try and clarify some of the naming and terminology surrounding the evolution of the .NET framework. I'll discuss some of the challenges the latest iteration is attempting to deal with and how the latest developments aim to address these.
This is really for those that have seen some of the big announcements but aren't sure about the intricacies of this new framework and how it relates to the existing ecosystem, which was my situation before I really started digging into it all properly!
Hopefully by the end of this article you'll have a clearer grasp of the latest in .NET!
اسرارِ یک دات نت کار حرفه ای
Working as a .NET Professional is a tumultuous rollercoaster ride of emotional highs and crushing lows. It’s likely the same for other communities, with different flavors of success and failures. I have over a decade of .NET development work, and I am here to share some general mantras that have served me well.
When you go to https://vscode.dev, you'll be presented with a lightweight version of VS Code running fully in the browser. Open a folder on your local machine and start coding.
No install required.
بازیابی منابع از اسمبلی
Intermediate & Advanced