⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 uinterface.pas

📁 观察者模式delphi实例实现,同时注意软件的设计
💻 PAS
字号:
unit uInterface;

interface
uses
    Windows, Messages, SysUtils, Graphics, Forms, Dialogs, Controls, classes;

type
    //属性描述
    TPhotoProp = record
        Name:string;
        Desc:string;
        Data:TDateTime;
        Size:Integer;
    end;
    
    //通知接口
    //由photoMgr发送有关照片变更的消息通知界面组件。
    //通知的内容
    //增加,删除,刷新,属性变化
    IPhotoNotify = interface
        function SelPhoto(const photoID:Integer):Boolean;
        function NewPhoto(const photoID:Integer):Boolean;
        function DelPhoto(const photoID:Integer):Boolean;
        function Refresh():Boolean;
        function PropChange(const photoID:Integer):Boolean;
    end;

{------------------------------------------------------------------------------}
    //实现PhotoMgr接口
    //由PhotoMgr类来实现
    IPhotoMgr = interface
        function GetPhotoCount(var Count:Integer):Boolean;
        function GetPhotoID(const idx:Integer; var PhotoID:Integer):Boolean;
        function GetSelPhotoID(var PhotoID:Integer):Boolean;
        function GetPhotoPorp(const photoID:Integer;var PhotoProp:TPhotoProp):Boolean;
        function GetBmp(const PhotoID:Integer;var bmp:TBitmap):Boolean;
    end;

implementation

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -