亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? propfilereh.pas

?? 一個功能強大的DBGRID控件
?? PAS
?? 第 1 頁 / 共 4 頁
字號:
{*******************************************************}
{                                                       }
{    Delphi / Kylix Cross-Platform Runtime Library      }
{                                                       }
{                     EhLib v4.2.1                      }
{                                                       }
{          TPropWriter, TPropReader objects             }
{                                                       }
{   Copyright (c) 2002-2006 by Dmitry V. Bolshakov      }
{                                                       }
{*******************************************************}

{$I EhLib.Inc}
//{$I EhLibClx.Inc}

{$IFDEF EH_LIB_CLX}
unit QPropFilerEh;
{$ELSE}
unit PropFilerEh {$IFDEF CIL} platform {$ENDIF};
{$ENDIF}

interface

uses
{$IFDEF EH_LIB_CLX}
  Types, QForms, QGraphics, QControls,
{$ELSE}
  Windows, Forms, Controls,
  {$IFDEF EH_LIB_6} Variants, Types, {$ENDIF}

{$IFDEF CIL}
  EhLibVCLNET,
  System.Runtime.InteropServices, System.Reflection,
{$ELSE}
  EhLibVCL,
{$ENDIF}

{$ENDIF} //$ELSE EH_LIB_CLX
  SysUtils, Classes, TypInfo;

type
  TPropWriterEh = class;
  TPropReaderEh = class;

  TWriteOwnerPropsEventEh = procedure(Writer: TPropWriterEh) of object;
  TReadOwnerPropEventEh = procedure(Reader: TPropReaderEh; PropName: String;
    var Processed: Boolean) of object;

 {TPropWriterEh}

  TPropWriterEh = class(TWriter)
  private
    FCurRootsList: TList;
    FDefnBinPropList: TStringList;
    FDefnPropList: TStringList;
    FInterceptorList: TList;
    FLastRootsList: TList;
//    FLookupRoot: TComponent;
    FPropPath: String;
    FOnWriteOwnerProps: TWriteOwnerPropsEventEh;
    procedure BuildPropsList(AObject: TObject; sl: TStrings);
  protected
    procedure WriteAllProperties(Instance: TObject);
  public
    constructor Create(Stream: TStream; BufSize: Integer);
    destructor Destroy; override;
    procedure WritePropName(const PropName: string);
    procedure DefineBinaryProperty(const Name: string; ReadData, WriteData: TStreamProc; HasData: Boolean); override;
    procedure DefineObjectProperties(Instance: TObject);
    procedure DefineProperty(const Name: string; ReadData: TReaderProc; WriteData: TWriterProc; HasData: Boolean); override;
    procedure SaveObjectProperyValue(Instance: TObject; Path, FullPath: String);
    procedure WriteCollection(Value: TCollection);
    procedure WriteOwnerProperties(Owner: TComponent; PropList: TStrings);
    property OnWriteOwnerProps: TWriteOwnerPropsEventEh read FOnWriteOwnerProps write FOnWriteOwnerProps;
  end;

 {TPropReaderEh}

  TPropReaderEh = class(TReader)
  private
    FCanHandleExcepts: Boolean;
    FCollectionList: TList;
    FInterceptorList: TList;
    FPropName: String;
    FOnReadOwnerProp: TReadOwnerPropEventEh;
    function ReadSet(SetType: PTypeInfo): Integer;
    procedure SkipSetBody;
{$IFNDEF EH_LIB_5}
    procedure SkipValue;
    procedure SkipProperty;
    procedure PropertyError;
{$ENDIF}
  protected
    function Error(const Message: string): Boolean; override;
    procedure ReadCollection(Collection: TCollection);
    procedure ReadProperty(AInstance: TPersistent);
    procedure ReadPropValue(Instance: TPersistent; PropInfo: PPropInfo);
  public
    constructor Create(Stream: TStream; BufSize: Integer);
    destructor Destroy; override;
    procedure DefineBinaryProperty(const Name: string; ReadData,
      WriteData: TStreamProc; HasData: Boolean); override;
    procedure DefineProperty(const Name: string; ReadData: TReaderProc;
      WriteData: TWriterProc; HasData: Boolean); override;
    procedure ReadComponent(Component: TComponent);
    procedure ReadOwnerProperties(Component: TComponent);
    property OnReadOwnerProp: TReadOwnerPropEventEh read FOnReadOwnerProp write FOnReadOwnerProp;
  end;

{ TStoragePropertyInterceptor }

  TStoragePropertyInterceptor = class(TPersistent)
    FTarget: TObject;
  public
    constructor Create(ATarget: TObject); virtual;
    function NeedIntercept: Boolean; virtual;
    procedure Readed; virtual;
    property Target: TObject read FTarget;
  end;

{ TFormStoragePropertyInterceptor }

  TFormStoragePropertyInterceptor = class(TStoragePropertyInterceptor)
  private
    FActiveControl: TWinControl;
    FHeight: Integer;
    FLeft: Integer;
    FPixelsPerInch: Integer;
    FPosPresent: Boolean;
    FTop: Integer;
    FWidth: Integer;
    FWindowState: TWindowState;
    function GetHeight: Integer;
    function GetLeft: Integer;
    function GetTop: Integer;
    function GetWidth: Integer;
    procedure SetLeft(const Value: Integer);
    procedure SetTop(const Value: Integer);
  public
    constructor Create(ATarget: TObject); override;
    procedure Readed; override;
    function GetNotmalFormPlacement: TRect;
  published
    property ActiveControl: TWinControl write FActiveControl;
    property Height: Integer read GetHeight write FHeight;
    property Left: Integer read GetLeft write SetLeft;
    property PixelsPerInch: Integer write FPixelsPerInch;
    property Top: Integer read GetTop write SetTop;
    property Width: Integer read GetWidth write FWidth;
    property WindowState: TWindowState write FWindowState;
  end;

  TReadPropertyInterceptorClass = class of TStoragePropertyInterceptor;

  procedure RegisterReadPropertyInterceptor(Target: TClass; Interceptor: TReadPropertyInterceptorClass);
  procedure UnregisterReadPropertyInterceptor(Target: TClass; Interceptor: TReadPropertyInterceptorClass);
  function GetInterceptorForTarget(Target: TClass): TReadPropertyInterceptorClass;

  function GetNextPointSeparatedToken(Path: String): String;

  procedure GetComponentChildListEh(ParentComp, Root: TComponent; cl: TStrings; CheckInline: Boolean);
  function FindChildComponent(ParentComp, Root: TComponent; const AName: string; CheckInline: Boolean): TComponent;

var
  IsRaiseReadErrorEh: Boolean = False;

implementation

uses {$IFDEF EH_LIB_6} ConvUtils, RTLConsts {$ELSE} Consts {$ENDIF};

{$IFDEF CIL}

function CanRead(APropInfo: TPropInfo): Boolean;
begin
  Result := Borland.Vcl.TypInfo.CanRead(APropInfo);
end;

function CanWrite(APropInfo: TPropInfo): Boolean;
begin
  Result := Borland.Vcl.TypInfo.CanWrite(APropInfo);
end;

{$ELSE}

function CanRead(APropInfo: PPropInfo): Boolean;
begin
  Result := APropInfo^.GetProc <> nil;
end;

function CanWrite(APropInfo: PPropInfo): Boolean;
begin
  Result := APropInfo^.SetProc <> nil;
end;

{$ENDIF}

type

  TForChildListObj = class(TObject)
  private
    FChildList: TStringList;
    procedure GetChildList(ParentComp, Root: TComponent; cl: TStrings);
    procedure GetChildProc(Child: TComponent);
  public
    constructor Create;
    destructor Destroy; override;
  end;

constructor TForChildListObj.Create;
begin
  inherited Create;
  FChildList := TStringList.Create;
end;

destructor TForChildListObj.Destroy;
begin
  FreeAndNil(FChildList);
end;

procedure TForChildListObj.GetChildList(ParentComp, Root: TComponent; cl: TStrings);
var
  FilerAccess: TFilerAccess;
begin
  FChildList.Clear;
  FilerAccess := TFilerAccess.Create(ParentComp);
  FilerAccess.GetChildren(GetChildProc, Root);
  FilerAccess.Free;
  cl.Assign(FChildList);
end;

procedure TForChildListObj.GetChildProc(Child: TComponent);
begin
  FChildList.AddObject(Child.Name, Child);
end;

var
  ForChildListObj: TForChildListObj;

procedure GetComponentChildListEh(ParentComp, Root: TComponent; cl: TStrings; CheckInline: Boolean);
begin
  if ForChildListObj = nil then
    ForChildListObj := TForChildListObj.Create;

{$IFDEF EH_LIB_5}
  if CheckInline and (csInline in ParentComp.ComponentState) then
    ForChildListObj.GetChildList(ParentComp, ParentComp, cl)
  else
{$ENDIF}
  if CheckInline and (ParentComp <> Root) then
    ForChildListObj.GetChildList(ParentComp, ParentComp.Owner, cl)
  else
    ForChildListObj.GetChildList(ParentComp, Root, cl);
end;

function FindChildComponent(ParentComp, Root: TComponent; const AName: string; CheckInline: Boolean): TComponent;
var
  ChildList: TStringList;
  Idx: Integer;
begin
  ChildList := TStringList.Create;
  try
    GetComponentChildListEh(ParentComp, Root, ChildList, CheckInline);

    Idx := ChildList.IndexOf(AName);
    if Idx > -1
      then Result := TComponent(ChildList.Objects[Idx])
      else Result := nil;

  finally
    ChildList.Free;
  end;
end;

function GetNextPointSeparatedToken(Path: String): String;
var
  PPos: Integer;
begin
  PPos := Pos('.', Path);
  if PPos > 0
    then Result := Copy(Path, 1, PPos-1)
    else Result := Path;
end;

type
//  PMethod = ^TMethod;
  TIntegerSet = set of 0..SizeOf(Integer) * 8 - 1;

  TMethodObj = class(TObject)
  private
    FMethod: TMethod;
  public
    property Method: TMethod read FMethod write FMethod;
  end;

  TStreamProcObj = class(TObject)
  private
    FMethod: TStreamProc;
  public
    property Method: TStreamProc read FMethod write FMethod;
  end;


var
  InterceptorList: TList;
  TargetList: TList;

procedure RegisterReadPropertyInterceptor(Target: TClass; Interceptor: TReadPropertyInterceptorClass);
var
  i: Integer;
begin
  if InterceptorList = nil then
  begin
    InterceptorList := TList.Create;
    TargetList := TList.Create;
  end;
  for i:= TargetList.Count - 1 downto 0 do
    if (TargetList[i] = TObject(Target)) then
      UnregisterReadPropertyInterceptor(Target, TReadPropertyInterceptorClass(InterceptorList[i]));
  InterceptorList.Add(TObject(Interceptor));
  TargetList.Add(TObject(Target));
end;

procedure UnregisterReadPropertyInterceptor(Target: TClass; Interceptor: TReadPropertyInterceptorClass);
var
  i: Integer;
begin
  for i:= TargetList.Count - 1 downto 0 do
    if (TargetList[i] = TObject(Target)) and (InterceptorList[i] = TObject(Interceptor)) then
    begin
      InterceptorList.Delete(i);
      TargetList.Delete(i);
    end;
end;

function GetInterceptorForTarget(Target: TClass): TReadPropertyInterceptorClass;

  function GetClassDeep(Target: TClass; ClassName: String): Integer;
  var
    ParentTarget: TClass;
  begin
    Result := 0;
    ParentTarget := Target;
    while True do
    begin
      if UpperCase(ParentTarget.ClassName) = UpperCase(ClassName) then
        Exit;
      Inc(Result);
      ParentTarget := ParentTarget.ClassParent;
      if ParentTarget = nil then
      begin
        Result := MAXINT;
        Exit;
      end;
    end;
  end;

var
  Deep, MeenDeep, i: Integer;
begin
  Result := nil;
  if TargetList = nil then Exit;
  MeenDeep := MAXINT;
  for i := 0 to TargetList.Count - 1 do
  begin
    if Target.InheritsFrom(TClass(TargetList[i])) then
    begin
      Deep := GetClassDeep(Target, TClass(TargetList[i]).ClassName);
      if Deep < MeenDeep then
      begin
        MeenDeep := Deep;
        Result := TReadPropertyInterceptorClass(InterceptorList[i]);
      end;
    end;
  end;
end;

function SameText(const S1, S2: string): Boolean;
begin
  Result := (CompareText(S1, S2) = 0)
end;


{$IFNDEF EH_LIB_5}

function FindNestedComponent(Root: TComponent; const NamePath: string): TComponent;
var
  Current, Found: TComponent;
  S, P: PChar;
  Name: string;
begin
  Result := nil;
  if NamePath = '' then Exit;
  Current := Root;
  P := PChar(Pointer(NamePath));
  while P^ <> #0 do
  begin
    S := P;
    while not (P^ in ['.', '-', #0]) do Inc(P);
    SetString(Name, S, P - S);
    Found := Current.FindComponent(Name);
    if (Found = nil) and SameText(Name, 'Owner') then  { Do not translate }
      Found := Current;
    if Found = nil then Exit;
    if P^ = '.' then Inc(P);
    if P^ = '-' then Inc(P);
    if P^ = '>' then Inc(P);
    Current := Found;
  end;
  Result := Current;
end;

{$ENDIF}

{ TPropWriterEh }

constructor TPropWriterEh.Create(Stream: TStream; BufSize: Integer);
begin
  inherited Create(Stream, BufSize);
  FDefnPropList := TStringList.Create;
  FDefnBinPropList := TStringList.Create;
  FLastRootsList := TList.Create;
  FCurRootsList := TList.Create;
end;

destructor TPropWriterEh.Destroy;
var
 i: Integer;
begin
  for i := 0 to FDefnPropList.Count-1 do
    FDefnPropList.Objects[i].Free;
  FreeAndNil(FDefnPropList);
  for i := 0 to FDefnBinPropList.Count-1 do
    FDefnBinPropList.Objects[i].Free;
  FreeAndNil(FDefnBinPropList);
  FreeAndNil(FLastRootsList);
  FreeAndNil(FCurRootsList);
  inherited Destroy;
end;

procedure TPropWriterEh.BuildPropsList(AObject: TObject; sl: TStrings);
var
//  PropList: PPropList;
  PropList: TPropListArray;
//  {PropCount,} FSize: Integer;
  i, j: Integer;
  SubO: TObject;
  subsl: TStrings;
begin
  subsl := TStringList.Create;
{  PropCount := GetPropList(AObject.ClassInfo, tkProperties, nil);
  FSize := PropCount * SizeOf(Pointer);
  GetMem(PropList, FSize);
  GetPropList(AObject.ClassInfo, tkProperties, PropList);}
  PropList := GetPropListAsArray(AObject.ClassInfo, tkProperties);
  for i := 0 to Length(PropList) - 1 do
  begin
    if PropType_getKind(PropInfo_getPropType(PropList[i])) = tkClass then
    begin
      SubO := GetObjectProp(AObject, PropList[i]);
      if Assigned(SubO) then
      begin
        subsl.Clear;
        if not (SubO is TComponent) then
        begin
          BuildPropsList(SubO, subsl);
          for j := 0 to subsl.Count - 1 do
            sl.Add(PropList[i].Name + '.' + subsl[j]);
        end;
        if (SubO is TCollection) then
          sl.Add(PropList[i].Name);
      end;
    end else
      sl.Add(PropList[i].Name);
  end;
//  FreeMem(PropList, FSize);
  subsl.Clear;

  DefineObjectProperties(AObject);
  sl.AddStrings(FDefnPropList);
  sl.AddStrings(FDefnBinPropList);

  subsl.Free;
end;

procedure TPropWriterEh.WriteOwnerProperties(Owner: TComponent; PropList: TStrings);
var
  i, j, Level: Integer;
  Path: String;
  PPos: Integer;
  CompName: String;
  NewComponent, CurOwner: TComponent;
begin
  Root := Owner;
//  FLookupRoot := Root;
  WriteSignature;
  WriteStr(Owner.ClassName);
  WriteStr(Owner.Name);

  FInterceptorList := TList.Create;

  //Write Owner properties
  for i := 0 to PropList.Count-1 do
  begin
    Path := PropList[i];
    PPos := Pos('.', Path);
    if PPos > 0

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲国产中文字幕在线视频综合| 日本va欧美va欧美va精品| 日韩女优av电影| 亚洲欧洲国产日本综合| 奇米影视在线99精品| 色哟哟一区二区三区| 久久久www成人免费毛片麻豆 | 国产综合色视频| 欧美日韩在线播放一区| 亚洲视频免费在线| 国产电影精品久久禁18| 日韩免费性生活视频播放| 亚洲国产精品久久不卡毛片| 国产成人av电影在线观看| 欧美一区二区三区四区在线观看 | 日韩精品综合一本久道在线视频| 亚洲九九爱视频| 岛国精品在线观看| 久久精子c满五个校花| 久久精品99国产精品| 欧美男人的天堂一二区| 亚洲制服丝袜一区| 欧美综合亚洲图片综合区| 亚洲区小说区图片区qvod| 丁香五精品蜜臀久久久久99网站 | 久久综合一区二区| 欧美aaaaa成人免费观看视频| 欧美调教femdomvk| 亚洲无人区一区| 欧美日韩日日夜夜| 午夜电影网亚洲视频| 在线不卡免费av| 视频一区在线播放| 91精品国产一区二区人妖| 亚洲国产精品影院| 欧美精品一卡两卡| 日韩精品每日更新| 91精品国产综合久久蜜臀| 视频一区视频二区在线观看| 欧美一区二区三区视频在线观看| 婷婷久久综合九色综合绿巨人| 欧美私人免费视频| 丝袜美腿亚洲色图| 日韩欧美在线一区二区三区| 久久99久国产精品黄毛片色诱| 亚洲精品在线免费播放| 国产一区二区剧情av在线| 国产精品无人区| 色狠狠色狠狠综合| 性做久久久久久| 日韩欧美国产综合一区| 九色综合狠狠综合久久| 国产香蕉久久精品综合网| 成人综合在线观看| 一区二区高清视频在线观看| 欧美精品黑人性xxxx| 国内偷窥港台综合视频在线播放| 国产精品网友自拍| 色国产精品一区在线观看| 免费在线看成人av| 亚洲国产成人午夜在线一区| 91影院在线观看| 欧美a一区二区| 国产精品美女视频| 欧美日韩在线免费视频| 国产乱妇无码大片在线观看| 亚洲精品日韩专区silk| 欧美成人综合网站| av不卡免费在线观看| 日韩黄色在线观看| 国产精品久久久久久久久免费相片 | 欧美日韩夫妻久久| 国产麻豆欧美日韩一区| 亚洲在线免费播放| 日本一区二区三区久久久久久久久不| 欧美丝袜第三区| 成人黄色在线视频| 另类欧美日韩国产在线| 亚洲黄色尤物视频| 国产日韩欧美精品一区| 欧美久久久久久久久久| 97se亚洲国产综合自在线观| 蜜臀精品一区二区三区在线观看| 亚洲欧美综合色| 久久久www成人免费无遮挡大片| 欧美日韩精品三区| 99久久综合国产精品| 久久99国内精品| 视频一区在线播放| 亚洲精品videosex极品| 久久综合色婷婷| 欧美日韩成人在线| 一本色道a无线码一区v| 国产白丝精品91爽爽久久| 日韩—二三区免费观看av| 亚洲欧洲日产国产综合网| wwwwww.欧美系列| 日韩一二三区不卡| 欧美日本国产一区| 欧美伊人久久久久久午夜久久久久| 国产精品一区二区久久不卡 | 日本一区免费视频| 日韩一区二区在线观看| 欧美自拍丝袜亚洲| 91老师国产黑色丝袜在线| 成人一区二区视频| 国产精品1区2区3区| 久久99九九99精品| 精品影院一区二区久久久| 视频一区二区不卡| 亚洲综合免费观看高清完整版| 亚洲女女做受ⅹxx高潮| 最新国产精品久久精品| 中文字幕一区二区三区在线不卡| 国产欧美一区二区精品性色超碰| 久久无码av三级| 久久久777精品电影网影网 | 欧美日韩一级片网站| 在线观看视频一区二区| 在线观看av不卡| 欧美狂野另类xxxxoooo| 91精品国模一区二区三区| 日韩精品一区二区三区视频| 精品国产成人在线影院| 久久久精品国产免大香伊| 国产精品区一区二区三| 亚洲欧美日韩国产中文在线| 亚洲黄色小视频| 日韩电影在线一区二区三区| 久久99热狠狠色一区二区| 国产伦理精品不卡| 不卡大黄网站免费看| 日本久久电影网| 欧美精品亚洲二区| 日韩美女视频在线| 国产精品久久久久久妇女6080 | 亚洲综合激情小说| 奇米综合一区二区三区精品视频| 精品一区二区免费在线观看| 久久成人精品无人区| 懂色av中文字幕一区二区三区| 色老汉一区二区三区| 欧美一区二区三区在线看| 国产亚洲精品7777| 一区二区高清视频在线观看| 美日韩一级片在线观看| 成人av免费在线播放| 欧美日韩极品在线观看一区| 亚洲精品一区在线观看| 亚洲精品乱码久久久久久久久| 午夜婷婷国产麻豆精品| 国产伦精品一区二区三区免费| 色哟哟精品一区| 欧美精品一区二区蜜臀亚洲| 最新日韩在线视频| 精品在线免费视频| 91福利国产成人精品照片| 欧美一区二区观看视频| 亚洲丝袜精品丝袜在线| 久久er99精品| 欧美日本不卡视频| 中文在线资源观看网站视频免费不卡 | 成人av网址在线| 日韩亚洲欧美高清| 亚洲柠檬福利资源导航| 韩国三级电影一区二区| 欧美制服丝袜第一页| 国产免费观看久久| 日本欧洲一区二区| 91国偷自产一区二区三区观看| 久久久国产精品麻豆| 男女视频一区二区| 欧美在线小视频| 成人免费在线视频| 国产乱对白刺激视频不卡| 欧美午夜电影一区| 亚洲三级免费电影| 成人免费毛片片v| 国产无人区一区二区三区| 日韩国产精品大片| 欧美色视频一区| 一区二区三区高清| 99综合影院在线| 国产日产精品一区| 韩国在线一区二区| 精品美女一区二区三区| 亚洲成人综合网站| 欧美性感一区二区三区| 亚洲激情第一区| 在线看国产日韩| 一区二区三区免费| 日本久久精品电影| 伊人夜夜躁av伊人久久| 色综合咪咪久久| 亚洲精品成人精品456| 在线视频国内自拍亚洲视频| 最新不卡av在线| 色就色 综合激情| 亚洲一级在线观看| 欧美美女激情18p|