{"id":219685,"date":"2014-04-16T22:31:02","date_gmt":"2014-04-16T18:31:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=219685"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=219685","title":{"rendered":"<span class=\"post_title\">\u0422\u0440\u044e\u043a\u0438 \u0441 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430\u043c\u0438 \u0432 Delphi<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/f3d\/d8f\/d80\/f3dd8fd80c60f6e7dbd37dfccd49cdae.jpg\" align=\"left\"\/>\u041f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e.<br \/>  \u0411\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u043e\u0431\u0441\u0443\u0436\u0434\u0430\u043b \u0441 \u043a\u043e\u043b\u043b\u0435\u0433\u043e\u0439 \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b. \u041e\u043d \u043c\u043d\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u043b \u043e \u0441\u0432\u043e\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u043c \u043f\u0440\u0438\u0435\u043c\u0435, \u044f \u0435\u043c\u0443 \u043e \u0441\u0432\u043e\u0435\u043c, \u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e \u0434\u043e\u0440\u043e\u0433\u0435 \u0434\u043e\u043c\u043e\u0439 \u044f \u043e\u0441\u043e\u0437\u043d\u0430\u043b \u0432\u0441\u044e \u043c\u043e\u0449\u044c \u044d\u0442\u0438\u0445 \u043f\u0440\u0438\u0435\u043c\u043e\u0432, \u0432 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0435\u0441\u043b\u0438 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u0438\u0445 \u0432\u043c\u0435\u0441\u0442\u0435.<br \/>  \u041b\u044e\u0431\u0438\u0442\u0435\u043b\u0438 \u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u043a\u0438 \u0438 MVC \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u0432 \u2014 \u043f\u0440\u043e\u0448\u0443 \u043f\u043e\u0434 \u043a\u0430\u0442.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h4>\u0422\u0440\u044e\u043a 1. \u0423\u043c\u043d\u044b\u0435 Weak \u0441\u0441\u044b\u043b\u043a\u0438<\/h4>\n<p>  \u0414\u043b\u044f \u0442\u0435\u0445 \u043a\u0442\u043e \u043d\u0435 \u0432 \u043a\u0443\u0440\u0441\u0435 \u2014 Weak (\u0441\u043b\u0430\u0431\u044b\u0435) \u0441\u0441\u044b\u043b\u043a\u0438 \u2014 \u0441\u0441\u044b\u043b\u043a\u0438, \u043d\u0435 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u044e\u0449\u0438\u0435 \u0441\u0447\u0435\u0442\u0447\u0438\u043a. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0434\u0435\u0440\u0435\u0432\u043e:  <\/p>\n<pre><code class=\"delphi\">INode = interface   function GetParent: INode;   function ChildCount: Integer;   function GetChild(Index: Integer): INode; end; <\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0431\u044b \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043b\u0430\u0441\u0441\u0430, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 INode \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c \u0438 \u043f\u043e\u0442\u043e\u043c\u043a\u0438 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0441\u044c \u0431\u044b \u0442\u0430\u043a:  <\/p>\n<pre><code class=\"delphi\">TNode = class(TInterfacedObject, INode) private   FParent: INode;   FChild: array of INode; end; <\/code><\/pre>\n<p>\u0442\u043e \u0434\u0435\u0440\u0435\u0432\u043e \u0431\u044b \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0438\u043b\u043e\u0441\u044c. \u0420\u043e\u0434\u0438\u0442\u0435\u043b\u044c \u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0434\u0435\u0442\u0435\u0439 (\u0438 \u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0438\u043c \u0441\u0447\u0435\u0442\u0447\u0438\u043a), \u0430 \u0434\u0435\u0442\u0438 \u043d\u0430 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044f. \u042d\u0442\u043e \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0441\u0441\u044b\u043b\u043e\u043a, \u0438 \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u0438\u0431\u0435\u0433\u0430\u044e\u0442 \u043a weak \u0441\u0441\u044b\u043b\u043a\u0430\u043c. \u0412 \u043d\u043e\u0432\u044b\u0445 XE \u0434\u0435\u043b\u0444\u044f\u0445 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0430\u043a:  <\/p>\n<pre><code class=\"delphi\">TNode = class(TInterfacedObject, INode) private   [weak] FParent: INode;   FChild: array of INode; end; <\/code><\/pre>\n<p>\u0430 \u0432 \u0441\u0442\u0430\u0440\u044b\u0445 \u2014 \u0445\u0440\u0430\u043d\u044f\u0442 Pointer:  <\/p>\n<pre><code class=\"delphi\">TNode = class(TInterfacedObject, INode) private   FParent: Pointer;   FChild: array of INode; end; <\/code><\/pre>\n<p>\u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0431\u043e\u0439\u0442\u0438 \u0430\u0432\u0442\u043e\u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442 \u0441\u0447\u0435\u0442\u0447\u0438\u043a\u043e\u0432, \u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u0435\u0441\u043b\u0438 \u043c\u044b \u043f\u043e\u0442\u0435\u0440\u044f\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044f \u2014 \u0432\u0441\u0435 \u0434\u0435\u0440\u0435\u0432\u043e \u043f\u0440\u0438\u0431\u044c\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0438 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c.<\/p>\n<p>  \u041d\u043e \u0443 weak \u0441\u0441\u044b\u043b\u043e\u043a \u0435\u0441\u0442\u044c \u0434\u0440\u0443\u0433\u0430\u044f \u0441\u0442\u043e\u0440\u043e\u043d\u0430. \u0415\u0441\u043b\u0438 \u0432\u0434\u0440\u0443\u0433 \u0443 \u0432\u0430\u0441 \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0438\u043b\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442, \u0430 \u043a\u0442\u043e-\u0442\u043e \u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0430 \u043d\u0435\u0433\u043e weak \u0441\u0441\u044b\u043b\u043a\u0443 \u2014 \u0432\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u044d\u0442\u043e \u043e\u0442\u0441\u043b\u0435\u0434\u0438\u0442\u044c. \u041f\u043e \u0444\u0430\u043a\u0442\u0443 \u2014 \u0443 \u0432\u0430\u0441 \u043f\u0440\u043e\u0441\u0442\u043e \u043c\u0443\u0441\u043e\u0440\u043d\u044b\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c, \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0438 \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0431\u0443\u0434\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0430. \u0418 \u044d\u0442\u043e \u0443\u0436\u0430\u0441\u043d\u043e. \u041d\u0443\u0436\u043d\u043e \u043b\u0435\u043f\u0438\u0442\u044c \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0447\u0438\u0441\u0442\u043a\u0438 \u044d\u0442\u0438\u0445 \u0441\u0430\u043c\u044b\u0445 \u0441\u0441\u044b\u043b\u043e\u043a.<\/p>\n<p>  \u041d\u043e \u0435\u0441\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u044d\u043b\u0435\u0433\u0430\u043d\u0442\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435. \u0418 \u0432\u043e\u0442 \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u041c\u044b \u043f\u0438\u0448\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 weak \u0441\u0441\u044b\u043b\u043a\u0438 \u0438 \u043a\u043b\u0430\u0441\u0441, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0438\u0439 \u0435\u0433\u043e:  <\/p>\n<pre><code class=\"delphi\">  IWeakRef = interface     function IsAlive: Boolean;     function Get: IUnknown;   end;    TWeakRef = class(TInterfacedObject, IWeakRef)   private     FOwner: Pointer;   public     procedure _Clean;     function IsAlive: Boolean;     function Get: IUnknown;   end;  procedure TWeakRef._Clean; begin   FOwner := nil; end;  function TWeakRef.Get: IUnknown; begin   Result := IUnknown(FOwner); end;  function TWeakRef.IsAlive: Boolean; begin   Result := Assigned(FOwner); end; <\/code><\/pre>\n<p>\u0422\u0443\u0442 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 typecast \u0434\u043e Pointer-\u0430. \u0418\u043c\u0435\u043d\u043d\u043e \u0442\u0430 weak \u0441\u0441\u044b\u043b\u043a\u0430, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u043b \u0432\u044b\u0448\u0435. \u041d\u043e \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0439 \u043c\u0435\u0442\u043e\u0434 \u2014 <b>IsAlive<\/b>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <b>True<\/b> \u2014 \u0435\u0441\u043b\u0438 \u043e\u0431\u044a\u0435\u043a\u0442 \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0441\u044b\u043b\u0430\u0435\u0442\u0441\u044f weak \u0441\u0441\u044b\u043b\u043a\u0430 \u2014 \u0435\u0449\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442. \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043d\u044f\u0442\u044c \u043a\u0430\u043a \u043a\u0440\u0430\u0441\u0438\u0432\u043e \u043f\u043e\u0447\u0438\u0441\u0442\u0438\u0442\u044c <b>FOwner<\/b>.<br \/>  \u041f\u0438\u0448\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441:  <\/p>\n<pre><code class=\"delphi\">  IWeakly = interface   ['{F1DFE67A-B796-4B95-ADE1-8AA030A7546D}']     function WeakRef: IWeakRef;   end; <\/code><\/pre>\n<p>\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 weak \u0441\u0441\u044b\u043b\u043a\u0443 \u0438 \u043f\u0438\u0448\u0435\u043c \u043a\u043b\u0430\u0441\u0441, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0438\u0439 \u044d\u0442\u043e\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441:  <\/p>\n<pre><code class=\"delphi\">  TWeaklyInterfacedObject = class(TInterfacedObject, IWeakly)   private     FWeakRef: IWeakRef;   public     function WeakRef: IWeakRef;     destructor Destroy; override;   end;  destructor TWeaklyInterfacedObject.Destroy; begin   inherited;   FWeakRef._Clean; end;  function TWeaklyInterfacedObject.WeakRef: IWeakRef; var obj: TWeakRef; begin   if FWeakRef = nil then    begin     obj := TWeakRef.Create;     obj.FOwner := Self;     FWeakRef := obj;   end;   Result := FWeakRef; end; <\/code><\/pre>\n<p>\u041c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043c\u0435\u0442\u043e\u0434, \u0440\u0430\u0437\u0434\u0430\u044e\u0449\u0438\u0439 \u0432\u0441\u0435\u043c \u043e\u0434\u043d\u0443 weak \u0441\u0441\u044b\u043b\u043a\u0443. \u0410 \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0441\u0430\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u0432\u0441\u0435\u0433\u0434\u0430 \u0437\u043d\u0430\u0435\u0442 \u043e \u0441\u0432\u043e\u0435\u0439 weak \u0441\u0441\u044b\u043b\u043a\u0435 \u2014 \u043e\u043d \u043f\u0440\u043e\u0441\u0442\u043e \u0447\u0438\u0441\u0442\u0438\u0442 \u0435\u0451 \u0432 \u0441\u0432\u043e\u0435\u043c \u0434\u0435\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435. \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0442\u0435\u043f\u0435\u0440\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0442 <b>TWeaklyInterfacedObject<\/b> \u0432\u043c\u0435\u0441\u0442\u043e <b>TInterfacedObject<\/b>, \u0438 \u0432\u0441\u0435. \u041d\u0438\u043a\u0430\u043a\u0438\u0445 \u0431\u043e\u043b\u044c\u0448\u0435 unsafe \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u0439 \u0442\u0438\u043f\u043e\u0432, \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u043e\u0432 \u0432 \u043d\u043e\u0433\u0443, \u0438 \u043d\u0435\u0446\u0435\u043d\u0437\u0443\u0440\u043d\u043e\u0439 \u0431\u0440\u0430\u043d\u0438.<\/p>\n<h4>\u0422\u0440\u044e\u043a 2. \u041c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043f\u043e\u0434\u043f\u0438\u0441\u0447\u0438\u043a\u043e\u0432<\/h4>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0435\u0449\u0435 \u043d\u0435 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434\u0438\u043b\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432 \u0432 \u0434\u0435\u043b\u0444\u0438 \u0438 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 MVC \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u0432 \u2014 \u0442\u043e \u0432\u044b \u0441\u0447\u0430\u0441\u0442\u043b\u0438\u0432\u0447\u0438\u043a. \u0412 \u0434\u0435\u043b\u0444\u0438 \u0432\u0441\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0434\u0438\u043d \u0438\u043b\u0438 \u0434\u0432\u0430 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044e(\u0438 \u0438\u043d\u0441\u0442\u0430\u043d\u0441). \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0441\u043b\u0438 \u0432\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u043a\u043b\u0430\u0441\u0441, \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u0435\u043c\u0443 <b>OnBlaBla<\/b> \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u2014 \u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u0442\u043e-\u0442\u043e \u043e\u0434\u0438\u043d \u043c\u043e\u0436\u0435\u0442 \u0443\u0437\u043d\u0430\u0442\u044c, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u0441\u0430\u043c\u044b\u0439 <b>BlaBla<\/b> \u043d\u0430\u043a\u043e\u043d\u0435\u0446 \u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u0435\u043b. \u041f\u043e\u0441\u0435\u043c\u0443 \u0432\u0441\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442 \u043f\u0438\u043b\u0438\u0442\u044c \u0441\u0432\u043e\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043f\u043e\u0434\u043f\u0438\u0441\u043e\u043a, \u0438 \u0447\u0430\u0441\u0442\u043e \u0442\u043e\u043d\u0443\u0442 \u0432 \u043e\u0442\u043b\u0430\u0434\u043a\u0435 \u044d\u0442\u0438\u0445 \u0441\u0430\u043c\u044b\u0445 \u043f\u043e\u0434\u043f\u0438\u0441\u043e\u043a.<br \/>  \u0421\u043e\u0431\u044b\u0442\u0438\u044f \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430\u0445 \u043e\u0431\u044b\u0447\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0442 \u0442\u0430\u043a. \u0414\u0435\u043b\u0430\u044e\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0435\u0432\u0435\u043d\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443:  <\/p>\n<pre><code class=\"delphi\">IMouseEvents = interface   procedure OnMouseMove(...);   procedure OnMouseDown(...);   procedure OnMouseUp(...); end; <\/code><\/pre>\n<p>\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442 \u0435\u0433\u043e, \u0432\u043c\u0435\u0441\u0442\u043e \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e procedure of object; \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0432 \u043f\u0430\u0440\u0443 Subscribe\/Unsubscribe \u043c\u0435\u0442\u043e\u0434\u043e\u0432:  <\/p>\n<pre><code class=\"delphi\">IForm = interface   procedure SubscribeMouse(const subscriber: IMouseEvents);   procedure UnsubscribeMouse(const subscriber: IMouseEvents); end; <\/code><\/pre>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043a\u043e\u0434 \u0440\u0430\u0437\u0440\u0430\u0441\u0442\u0430\u0435\u0442\u0441\u044f, \u0430 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 <b>IMouseEvents<\/b> \u0447\u0443\u0442\u044c-\u0447\u0443\u0442\u044c \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043c\u0435\u0442\u043e\u0434) \u2014 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0441\u0438\u043b\u044c\u043d\u043e \u043d\u0430\u043f\u0440\u044f\u0433\u0430\u0442\u044c \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 <b>IMouseEvents<\/b> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 <b>IForm<\/b>, <b>IButton<\/b>, <b>IImage<\/b> \u0438 \u043f\u0440\u043e\u0447\u0435\u0439 \u043d\u0435\u0447\u0438\u0441\u0442\u0438. \u0412\u0435\u0437\u0434\u0435 \u043d\u0430\u0434\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0443, \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043e\u0431\u0445\u043e\u0434 \u043f\u043e \u043f\u043e\u0434\u043f\u0438\u0441\u0447\u0438\u043a\u0430\u043c \u0438 \u0442.\u043f.<br \/>  \u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0442\u0440\u044e\u043a. \u041f\u0438\u0448\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441:  <\/p>\n<pre><code class=\"delphi\">  IPublisher = interface   ['{CDE9EE5C-021F-4942-A92A-39FC74395B4B}']     procedure Subscribe  (const ASubscriber: IUnknown);     procedure Unsubscribe(const ASubscriber: IUnknown);   end; <\/code><\/pre>\n<p>\u041a\u043b\u0430\u0441\u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 (\u043f\u0443\u0441\u0442\u044c \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 <b>TBasePublisher<\/b>) \u0443\u043c\u0435\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0438 \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430 \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b. \u0412 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043c\u044b \u043f\u0438\u0448\u0435\u043c \u043a\u043b\u0430\u0441\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u043d\u0430\u0437\u044b\u0432\u0430\u044e \u0431\u0440\u043e\u0430\u0434\u043a\u0430\u0441\u0442\u0435\u0440\u044b. \u0412\u043e\u0442 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0435\u0432\u0435\u043d\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441:  <\/p>\n<pre><code class=\"delphi\">  IGraphEvents = interface   ['{2C7EF06A-2D63-4F25-80BC-7BA747463DB6}']     procedure OnAddItem(const ASender: IGraphList; const AItem: TGraphItem);     procedure OnClear(const ASender: IGraphList);   end; \u041c\u044b \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u043c\u0441\u044f \u043e\u0442 TBasePublisher \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u0431\u0440\u043e\u0430\u0434\u043a\u0430\u0441\u0442\u0435\u0440:   TGraphEventsBroadcaster = class(TBasePublisher, IGraphEvents)   private     procedure OnAddItem(const ASender: IGraphList; const AItem: TGraphItem);     procedure OnClear(const ASender: IGraphList);   end;  procedure TGraphEventsBroadcaster.OnAddItem(const ASender: IGraphList; const AItem: TGraphItem); var arr: TInterfacesArray;     i: Integer;     ev: IGraphEvents; begin   arr := GetItems;   for i := 0 to Length(arr) - 1 do       if Supports(arr[i], IGraphEvents, ev) then ev.OnAddItem(ASender, AItem); end;  procedure TGraphEventsBroadcaster.OnClear(const ASender: IGraphList); var arr: TInterfacesArray;     i: Integer;     ev: IGraphEvents; begin   arr := GetItems;   for i := 0 to Length(arr) - 1 do       if Supports(arr[i], IGraphEvents, ev) then ev.OnClear(ASender); end; <\/code><\/pre>\n<p>\u0442\u043e \u0435\u0441\u0442\u044c \u0441\u0430\u043c \u0431\u0440\u043e\u0430\u0434\u043a\u0430\u0441\u0442\u0435\u0440 \u0443 \u043d\u0430\u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0435\u0432\u0435\u043d\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u0438 \u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0430\u0441\u0441\u044b\u043b\u0430\u0435\u0442 \u0432\u0441\u0435\u043c \u043f\u043e\u0434\u043f\u0438\u0441\u0447\u0438\u043a\u0430\u043c \u0442\u043e\u0442 \u0436\u0435 \u0435\u0432\u0435\u043d\u0442. \u041f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e \u2014 \u0432\u0441\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u0432 \u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435, \u043e\u043d\u043e \u043d\u0435 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0435\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u044c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u0435\u0442\u0435 <b>IGraphEvents<\/b>. \u0422\u0435\u043f\u0435\u0440\u044c \u0437\u043e\u043e\u043f\u0430\u0440\u043a <b>IForm<\/b>, <b>IButton<\/b>, <b>IImage<\/b> \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u044e\u0442 \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0435\u0431\u044f <b>TGraphEventsBroadcaster<\/b> \u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442 \u0435\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u044b, \u043a\u0430\u043a \u0431\u0443\u0434\u0442\u043e \u0443 <b>IForm<\/b> \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u0438\u043d \u043f\u043e\u0434\u043f\u0438\u0441\u0447\u0438\u043a.<\/p>\n<h4>\u0422\u0440\u044e\u043a 3. \u0423\u043c\u043d\u044b\u0435 Weak \u0441\u0441\u044b\u043b\u043a\u0438 + \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043f\u043e\u0434\u043f\u0438\u0441\u0447\u0438\u043a\u043e\u0432<\/h4>\n<p>  \u041d\u043e \u0432\u0441\u0435 \u0447\u0442\u043e \u044f \u043e\u043f\u0438\u0441\u0430\u043b \u0432\u044b\u0448\u0435 \u043f\u0440\u043e \u043f\u043e\u0434\u043f\u0438\u0441\u0447\u0438\u043a\u043e\u0432 \u2014 \u043f\u043b\u043e\u0445\u043e. \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0442\u0443\u0442 \u0441\u043f\u043b\u043e\u0448\u044c \u0438 \u0440\u044f\u0434\u043e\u043c \u0431\u0443\u0434\u0443\u0442 \u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0441\u0441\u044b\u043b\u043a\u0438, \u0432\u044b \u0437\u0430\u043c\u0430\u0445\u0430\u0435\u0442\u0435\u0441\u044c \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u043f\u043e\u0440\u044f\u0434\u043a\u043e\u043c \u0444\u0438\u043d\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u043e\u0442\u043f\u0438\u0441\u044b\u0432\u0430\u043d\u0438\u0435\u043c. \u0412\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u0435 \u0441\u043b\u0430\u0431\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438, \u043d\u043e \u043f\u043e\u0433\u0440\u044f\u0437\u043d\u0435\u0442\u0435 \u0432 \u043e\u0442\u043b\u0430\u0434\u043a\u0435 \u043c\u0443\u0441\u043e\u0440\u043d\u044b\u0445 \u0441\u0441\u044b\u043b\u043e\u043a. \u0412\u043e\u0442 \u0442\u0443\u0442 \u0442\u043e \u0438 \u043f\u0440\u0438\u0433\u043e\u0434\u044f\u0442\u0441\u044f \u0443\u043c\u043d\u044b\u0435 \u0441\u043b\u0430\u0431\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0432 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435. \u041c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0438\u0448\u0435\u043c \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0438\u0437\u0434\u0430\u0442\u0435\u043b\u044f (\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 <b>IWeakly<\/b> \u0438\u0437 \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0442\u0430\u0442\u044c\u0438):  <\/p>\n<pre><code class=\"delphi\">  IPublisher = interface   ['{CDE9EE5C-021F-4942-A92A-39FC74395B4B}']     procedure Subscribe  (const ASubscriber: IWeakly);     procedure Unsubscribe(const ASubscriber: IWeakly);   end; <\/code><\/pre>\n<p>\u0412\u043d\u0443\u0442\u0440\u0438 \u0441\u0435\u0431\u044f \u0438\u0437\u0434\u0430\u0442\u0435\u043b\u044c TBasePublisher \u0445\u0440\u0430\u043d\u0438\u0442 \u043c\u0430\u0441\u0441\u0438\u0432 \u0441\u043b\u0430\u0431\u044b\u0445 \u0441\u0441\u044b\u043b\u043e\u043a TWeakRefArr = array of IWeakRef;  <\/p>\n<pre><code class=\"delphi\">  TBasePublisher = class(TInterfacedObject, IPublisher)   private     FItems: TWeakRefArr;   protected     function GetItems: TWeakRefArr;   public     procedure Subscribe  (const ASubscriber: IWeakly);     procedure Unsubscribe(const ASubscriber: IWeakly);   end; <\/code><\/pre>\n<p>\u0410 \u0431\u0440\u043e\u0430\u0434\u043a\u0430\u0441\u0442\u0435\u0440 \u0442\u0435\u043f\u0435\u0440\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0441\u043b\u0430\u0431\u0443\u044e \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0436\u0438\u0437\u043d\u0435\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u0443\u044e, \u0438 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0435\u0432\u0435\u043d\u0442 \u0432 \u043d\u0435\u0451. \u0411\u0440\u043e\u0430\u0434\u043a\u0430\u0441\u0442\u0435\u0440 \u043f\u043e\u043c\u0435\u043d\u044f\u043b\u0441\u044f \u0432\u043e\u0442 \u0442\u0430\u043a:  <\/p>\n<pre><code class=\"delphi\">procedure TGraphEventsBroadcaster.OnAddItem(const ASender: IGraphList; const AItem: TGraphItem); var arr: TWeakRefArr;     i: Integer;     ev: IGraphEvents; begin   arr := GetItems;   for i := 0 to Length(arr) - 1 do     if IsAlive(arr[i]) then       if Supports(arr[i].Get, IGraphEvents, ev) then ev.OnAddItem(ASender, AItem); end;  procedure TGraphEventsBroadcaster.OnClear(const ASender: IGraphList); var arr: TWeakRefArr;     i: Integer;     ev: IGraphEvents; begin   arr := GetItems;   for i := 0 to Length(arr) - 1 do     if IsAlive(arr[i]) then       if Supports(arr[i].Get, IGraphEvents, ev) then ev.OnClear(ASender); end; <\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0441 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u043d\u0435 \u0437\u0430\u0431\u043e\u0442\u0438\u0442 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u043e\u0442\u043f\u0438\u0441\u044b\u0432\u0430\u043d\u0438\u044f. \u0415\u0441\u043b\u0438 \u043c\u044b \u0437\u0430\u0431\u044b\u043b\u0438 \u043e\u0442\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f \u2014 \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u0442\u0440\u0430\u0448\u043d\u043e\u0433\u043e. \u0412\u0441\u0435 \u0441\u0442\u0430\u043b\u043e \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e, \u043a\u0430\u043a <s>\u0432 \u0434\u043e\u0442\u043d\u0435\u0442\u0435<\/s> \u0438 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b\u0442\u044c.<\/p>\n<h4>\u0422\u0440\u044e\u043a 4. \u041f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0430 \u0432 \u043f\u043e\u043c\u043e\u0449\u044c<\/h4>\n<p>  \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0448\u0442\u0440\u0438\u0445:  <\/p>\n<pre><code class=\"delphi\">  TAutoPublisher = packed record     Publisher: IPublisher;     class operator Add(const APublisher: TAutoPublisher; const ASubscriber: IWeakly): Boolean;     class operator Subtract(const APublisher: TAutoPublisher; const ASubscriber: IWeakly): Boolean;   end;  class operator TAutoPublisher.Add(const APublisher: TAutoPublisher;   const ASubscriber: IWeakly): Boolean; begin   APublisher.Publisher.Subscribe(ASubscriber);   Result := True; end;  class operator TAutoPublisher.Subtract(const APublisher: TAutoPublisher;   const ASubscriber: IWeakly): Boolean; begin   APublisher.Publisher.Unsubscribe(ASubscriber);   Result := True; end; <\/code><\/pre>\n<p>\u042f \u0434\u0443\u043c\u0430\u044e \u043e\u043d \u043f\u043e\u043d\u044f\u0442\u0435\u043d \u0431\u0435\u0437 \u0441\u043b\u043e\u0432. \u041c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u043c <b>MyForm.MyEvents + MySubscriber<\/b>; \u2014 \u043c\u044b \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u043b\u0438\u0441\u044c. \u0412\u044b\u0447\u043b\u0438: <b>MyForm.MyEvents \u2014 MySubscriber<\/b>; \u2014 \u043e\u0442\u043f\u0438\u0441\u0430\u043b\u0438\u0441\u044c.<\/p>\n<p>  \u0421\u0442\u0430\u0442\u044c\u044f \u0431\u044b\u043b\u0430 \u0431\u044b \u043d\u0435 \u043f\u043e\u043b\u043d\u043e\u0439, \u0435\u0441\u043b\u0438 \u0431\u044b \u044f \u043d\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u043b \u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 <a href=\"http:\/\/screenup.org\/habr\/weakref.zip\">\u0432\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440<\/a>. \u0412 \u043a\u0440\u0430\u0442\u0446\u0435:<br \/>  \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 4 \u043e\u043a\u043d\u0430. \u041d\u0430 \u043b\u044e\u0431\u043e\u043c \u0438\u0437 \u043e\u043a\u043e\u043d \u043c\u043e\u0436\u043d\u043e \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u043c\u044b\u0448\u043a\u043e\u0439. \u041d\u0430\u0440\u0438\u0441\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432 \u0441\u043f\u0438\u0441\u043e\u043a, \u0438 \u0447\u0435\u0440\u0435\u0437 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043f\u043e\u0434\u043f\u0438\u0441\u043e\u043a \u0432\u0441\u0435 \u043e\u043a\u043d\u0430 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u044f\u044e\u0442\u0441\u044f \u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u0440\u0438\u0441\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0444\u0438\u0433\u0443\u0440\u0430 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0432\u0441\u0435\u0445 \u0444\u043e\u0440\u043c\u0430\u0445. \u041d\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u0444\u043e\u0440\u043c\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u0442\u043e\u043b\u0449\u0438\u043d\u0443 \u043b\u0438\u043d\u0438\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0442\u0440\u0435\u043a\u0431\u0430\u0440\u0430.<\/p>\n<p>  <i>IntfEx.pas<\/i> \u2014 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0443\u043c\u043d\u044b\u0445 \u0441\u043b\u0430\u0431\u044b\u0445 \u0441\u0441\u044b\u043b\u043e\u043a, \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0438\u0437\u0434\u0430\u0442\u0435\u043b\u044f <b>TBasePublisher<\/b> \u043d\u0430 \u0441\u043b\u0430\u0431\u044b\u0445 \u0441\u0441\u044b\u043b\u043a\u0430\u0445 + \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0430 \u0447\u0435\u0440\u0435\u0437 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 <b>TAutoPublisher<\/b><br \/>  <i>Datas.pas<\/i> \u2014 \u0441\u043f\u0438\u0441\u043e\u043a \u043d\u0430\u0440\u0438\u0441\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043e\u0431\u0435\u043a\u0442\u043e\u0432 + \u0435\u0432\u0435\u043d\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u044d\u0442\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430<br \/>  <i>DrawForm.pas<\/i> \u2014 \u043a\u043b\u0430\u0441\u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0438\u0439 \u0444\u043e\u0440\u043c\u0443 \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c. \u0422\u0430\u043c \u0436\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0430 \u043d\u0430 \u0435\u0432\u0435\u043d\u0442\u044b.<br \/>  <i>HiddenForm.pas<\/i> \u2014 \u0441\u043a\u0440\u044b\u0442\u0430\u044f \u0433\u043b\u0430\u0432\u043d\u0430\u044f \u0444\u043e\u0440\u043c\u0430 (\u043d\u0443\u0436\u043d\u0430 \u043b\u0438\u0448\u044c \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b Application \u043a\u0440\u0443\u0442\u0438\u043b \u043e\u043a\u043e\u043d\u043d\u044b\u0439 \u0446\u0438\u043a\u043b)<br \/>  \u043d\u0443 \u0438 \u0444\u0430\u0439\u043b \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0447\u0443\u0442\u044c-\u0447\u0443\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d (\u0442\u0430\u043c \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u0444\u043e\u0440\u043c\u044b \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c)    \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/219685\/\"> http:\/\/habrahabr.ru\/post\/219685\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/f3d\/d8f\/d80\/f3dd8fd80c60f6e7dbd37dfccd49cdae.jpg\" align=\"left\"\/>\u041f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e.<br \/>  \u0411\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u043e\u0431\u0441\u0443\u0436\u0434\u0430\u043b \u0441 \u043a\u043e\u043b\u043b\u0435\u0433\u043e\u0439 \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b. \u041e\u043d \u043c\u043d\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u043b \u043e \u0441\u0432\u043e\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u043c \u043f\u0440\u0438\u0435\u043c\u0435, \u044f \u0435\u043c\u0443 \u043e \u0441\u0432\u043e\u0435\u043c, \u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e \u0434\u043e\u0440\u043e\u0433\u0435 \u0434\u043e\u043c\u043e\u0439 \u044f \u043e\u0441\u043e\u0437\u043d\u0430\u043b \u0432\u0441\u044e \u043c\u043e\u0449\u044c \u044d\u0442\u0438\u0445 \u043f\u0440\u0438\u0435\u043c\u043e\u0432, \u0432 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0435\u0441\u043b\u0438 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u0438\u0445 \u0432\u043c\u0435\u0441\u0442\u0435.<br \/>  \u041b\u044e\u0431\u0438\u0442\u0435\u043b\u0438 \u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u043a\u0438 \u0438 MVC \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u0432 \u2014 \u043f\u0440\u043e\u0448\u0443 \u043f\u043e\u0434 \u043a\u0430\u0442.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-219685","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/219685","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=219685"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/219685\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=219685"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=219685"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=219685"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}