home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 March / Chip_2002-03_cd1.bin / zkuste / delphi / kompon / d56 / MSYSINFO.ZIP / Demos / GUI / PropsDlg.pas < prev    next >
Pascal/Delphi Source File  |  2002-01-04  |  3KB  |  127 lines

  1. unit PropsDlg;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   StdCtrls, ExtCtrls, ProcessProps, ServiceProps, MiTeC_PerfLibNT, MiTeC_PerfLib9x,
  8.   CounterProps, WindowProps, EventLogProps, ShareProps, GroupProps,
  9.   UserProps, DeviceProps;
  10.  
  11. type
  12.   TPropertyType = (ptProcess,ptService,ptPerf,ptWindow,ptLog,ptShare,ptUser,
  13.                    ptGroup,ptGlobalGroup,ptDevice);
  14.  
  15.   TdlgProperties = class(TForm)
  16.     Panel1: TPanel;
  17.     Panel2: TPanel;
  18.     Panel8: TPanel;
  19.     bOK: TButton;
  20.     propService: TpropService;
  21.     propCounter: TpropCounter;
  22.     propWindow: TpropWindow;
  23.     propProcess: TpropProcess;
  24.     propShare: TpropShare;
  25.     propGroup: TpropGroup;
  26.     propUser: TpropUser;
  27.     propDevice: TpropDevice;
  28.     propEventLog: TpropEventLog;
  29.     procedure FormShow(Sender: TObject);
  30.   private
  31.     FPerfLib9x: TPerfLib9x;
  32.     FPerfLibNT: TPerfLibNT;
  33.     FPropertyType: TPropertyType;
  34.     FParameter: TObject;
  35.     FIndex: integer;
  36.     { Private declarations }
  37.   public
  38.     { Public declarations }
  39.     property PropertyType: TPropertyType read FPropertyType write FPropertyType;
  40.     property Parameter: TObject read FParameter write FParameter;
  41.     property Idx: integer read FIndex write FIndex;
  42.     property PerfLibNT: TPerfLibNT write FPerfLibNT;
  43.     property PerfLib9x: TPerfLib9x write FPerfLib9x;
  44.   end;
  45.  
  46. var
  47.   dlgProperties: TdlgProperties;
  48.  
  49. implementation
  50.  
  51. {$R *.DFM}
  52.  
  53. procedure TdlgProperties.FormShow(Sender: TObject);
  54. begin
  55.   case PropertyType of
  56.     ptProcess:
  57.       with propProcess do begin
  58.         PerfLib:=FPerfLibNT;
  59.         Process:=Parameter;
  60.         Refresh;
  61.         Show;
  62.       end;
  63.     ptService:
  64.       with propService do begin
  65.         Service:=Parameter;
  66.         Refresh;
  67.         Show;
  68.       end;
  69.     ptPerf:
  70.       with propCounter do begin
  71.         Counter:=Parameter;
  72.         PerfLib9x:=FPerfLib9x;
  73.         Refresh;
  74.         Show;
  75.       end;
  76.     ptWindow:
  77.       with propWindow do begin
  78.         Window:=Parameter;
  79.         Refresh;
  80.         Show;
  81.       end;
  82.     ptLog:
  83.       with propEventLog do begin
  84.         Event:=Parameter;
  85.         Refresh;
  86.         Show;
  87.       end;
  88.     ptShare:
  89.       with propShare do begin
  90.         Share:=Parameter;
  91.         Refresh;
  92.         Show;
  93.       end;
  94.     ptUser:
  95.       with propUser do begin
  96.         Accounts:=Parameter;
  97.         UserIndex:=Idx;
  98.         Refresh;
  99.         Show;
  100.       end;
  101.     ptGroup:
  102.       with propGroup do begin
  103.         Accounts:=Parameter;
  104.         GroupIndex:=Idx;
  105.         GlobalLevel:=False;
  106.         Refresh;
  107.         Show;
  108.       end;
  109.     ptGlobalGroup:
  110.       with propGroup do begin
  111.         Accounts:=Parameter;
  112.         GroupIndex:=Idx;
  113.         GlobalLevel:=True;
  114.         Refresh;
  115.         Show;
  116.       end;
  117.     ptDevice:
  118.       with propDevice do begin
  119.         Device:=Parameter;
  120.         Refresh;
  121.         Show;
  122.       end;
  123.   end;
  124. end;
  125.  
  126. end.
  127.