Procedure

TTemplate.SetPersonalOwner

Module

uTemplates

Last Modified

7/15/2014 3:26:44 PM

Visibility

Protected

Owner

TTemplate

Declaration

procedure SetPersonalOwner(Value: Int64);

Calls Hierarchy


TTemplate.SetPersonalOwner
 ├TTemplate.CanModify
 │ ├TTemplate.ValidID
 │ └LockTemplate
 ├TTemplate.ValidID
 ├TTemplate.GetItems
 │ └ExpandTemplate
 │   ├TTemplate.GetChildren
 │   ├GetTemplateChildren
 │   ├AddTemplate
 │   │ ├TTemplate.Create
 │   │ │ └TTemplate.ReminderDialogIEN
 │   │ └TTemplate.AddChild
 │   │   └TTemplate.GetItems...
 │   └TTemplate.ItemIENs
 │     └TTemplate.GetItems...
 └..(rec)..

Called-By Hierarchy


              TTemplate.SetPersonalOwner
                             ..(rec)..┤ 
     TfrmTemplateEditor.tvTreeDragDrop┘ 
  TfrmTemplateEditor.sbCopyLeftClick┤   
 TfrmTemplateEditor.sbCopyRightClick┤   
TfrmTemplateEditor.mnuNodePasteClick┘   

Calls

Name Declaration Comments
TTemplate.CanModify function CanModify: boolean; -
TTemplate.GetItems function GetItems: TList; -
TTemplate.SetPersonalOwner procedure SetPersonalOwner(Value: Int64); -
TTemplate.ValidID function ValidID: boolean; -

Called-By

Name Declaration Comments
TTemplate.SetPersonalOwner procedure SetPersonalOwner(Value: Int64); -
TfrmTemplateEditor.tvTreeDragDrop procedure tvTreeDragDrop(Sender, Source: TObject; X, Y: Integer); -


Source

1924  procedure TTemplate.SetPersonalOwner(Value: Int64);
1925  var
1926    i: integer;
1927    ok: boolean;
1928  
1929  begin
1930    if(FPersonalOwner <> Value) then
1931    begin
1932      ok := CanModify;
1933      if ok then
1934      begin
1935        with FBkup do
1936        begin
1937          if(not SavedPersonalOwner) and ValidID then
1938          begin
1939            BPersonalOwner := FPersonalOwner;
1940            SavedPersonalOwner := TRUE;
1941          end;
1942        end;
1943        FPersonalOwner := Value;
1944      end;
1945    end
1946    else
1947      ok := TRUE;
1948    if ok and (Value = 0) then // No Shared Template can have personal items within it.
1949    begin
1950      GetItems;
1951      for i := 0 to FItems.Count-1 do
1952        TTemplate(FItems[i]).SetPersonalOwner(0);
1953    end;
1954  end;