CachedUserInfo.cs 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665
  1. /*
  2. * Copyright (c) Contributors, http://opensimulator.org/
  3. * See CONTRIBUTORS.TXT for a full list of copyright holders.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions are met:
  7. * * Redistributions of source code must retain the above copyright
  8. * notice, this list of conditions and the following disclaimer.
  9. * * Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. * * Neither the name of the OpenSim Project nor the
  13. * names of its contributors may be used to endorse or promote products
  14. * derived from this software without specific prior written permission.
  15. *
  16. * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
  17. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  18. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  19. * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
  20. * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  21. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  22. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  23. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  24. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  25. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. */
  27. using System;
  28. using System.Collections.Generic;
  29. using System.Reflection;
  30. using System.Threading;
  31. using libsecondlife;
  32. using log4net;
  33. namespace OpenSim.Framework.Communications.Cache
  34. {
  35. internal delegate void AddItemDelegate(InventoryItemBase itemInfo);
  36. internal delegate void UpdateItemDelegate(InventoryItemBase itemInfo);
  37. internal delegate void DeleteItemDelegate(LLUUID itemID);
  38. internal delegate void CreateFolderDelegate(string folderName, LLUUID folderID, ushort folderType, LLUUID parentID);
  39. internal delegate void MoveFolderDelegate(LLUUID folderID, LLUUID parentID);
  40. internal delegate void PurgeFolderDelegate(LLUUID folderID);
  41. internal delegate void UpdateFolderDelegate(string name, LLUUID folderID, ushort type, LLUUID parentID);
  42. internal delegate void SendInventoryDescendentsDelegate(
  43. IClientAPI client, LLUUID folderID, bool fetchFolders, bool fetchItems);
  44. /// <summary>
  45. /// Stores user profile and inventory data received from backend services for a particular user.
  46. /// </summary>
  47. public class CachedUserInfo
  48. {
  49. private static readonly ILog m_log
  50. = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
  51. /// <summary>
  52. /// The comms manager holds references to services (user, grid, inventory, etc.)
  53. /// </summary>
  54. private readonly CommunicationsManager m_commsManager;
  55. public UserProfileData UserProfile { get { return m_userProfile; } }
  56. private readonly UserProfileData m_userProfile;
  57. /// <summary>
  58. /// Has we received the user's inventory from the inventory service?
  59. /// </summary>
  60. private bool m_hasInventory;
  61. /// <summary>
  62. /// Inventory requests waiting for receipt of this user's inventory from the inventory service.
  63. /// </summary>
  64. private readonly IList<IInventoryRequest> m_pendingRequests = new List<IInventoryRequest>();
  65. /// <summary>
  66. /// Has this user info object yet received its inventory information from the invetnroy service?
  67. /// </summary>
  68. public bool HasInventory { get { return m_hasInventory; } }
  69. private InventoryFolderImpl m_rootFolder;
  70. public InventoryFolderImpl RootFolder { get { return m_rootFolder; } }
  71. /// <summary>
  72. /// FIXME: This could be contained within a local variable - it doesn't need to be a field
  73. /// </summary>
  74. private IDictionary<LLUUID, IList<InventoryFolderImpl>> pendingCategorizationFolders
  75. = new Dictionary<LLUUID, IList<InventoryFolderImpl>>();
  76. /// <summary>
  77. /// Constructor
  78. /// </summary>
  79. /// <param name="commsManager"></param>
  80. /// <param name="userProfile"></param>
  81. public CachedUserInfo(CommunicationsManager commsManager, UserProfileData userProfile)
  82. {
  83. m_commsManager = commsManager;
  84. m_userProfile = userProfile;
  85. }
  86. /// <summary>
  87. /// This allows a request to be added to be processed once we receive a user's inventory
  88. /// from the inventory service. If we already have the inventory, the request
  89. /// is executed immediately instead.
  90. /// </summary>
  91. /// <param name="parent"></param>
  92. public void AddRequest(IInventoryRequest request)
  93. {
  94. lock (m_pendingRequests)
  95. {
  96. if (m_hasInventory)
  97. {
  98. request.Execute();
  99. }
  100. else
  101. {
  102. m_pendingRequests.Add(request);
  103. }
  104. }
  105. }
  106. /// <summary>
  107. /// Store a folder pending arrival of its parent
  108. /// </summary>
  109. /// <param name="folder"></param>
  110. private void AddPendingFolder(InventoryFolderImpl folder)
  111. {
  112. LLUUID parentFolderId = folder.ParentID;
  113. if (pendingCategorizationFolders.ContainsKey(parentFolderId))
  114. {
  115. pendingCategorizationFolders[parentFolderId].Add(folder);
  116. }
  117. else
  118. {
  119. IList<InventoryFolderImpl> folders = new List<InventoryFolderImpl>();
  120. folders.Add(folder);
  121. pendingCategorizationFolders[parentFolderId] = folders;
  122. }
  123. }
  124. /// <summary>
  125. /// Add any pending folders which were received before the given folder
  126. /// </summary>
  127. /// <param name="parentId">
  128. /// A <see cref="LLUUID"/>
  129. /// </param>
  130. private void ResolvePendingFolders(InventoryFolderImpl newFolder)
  131. {
  132. if (pendingCategorizationFolders.ContainsKey(newFolder.ID))
  133. {
  134. foreach (InventoryFolderImpl folder in pendingCategorizationFolders[newFolder.ID])
  135. {
  136. // m_log.DebugFormat(
  137. // "[INVENTORY CACHE]: Resolving pending received folder {0} {1} into {2} {3}",
  138. // folder.name, folder.folderID, parent.name, parent.folderID);
  139. lock (newFolder.SubFolders)
  140. {
  141. if (!newFolder.SubFolders.ContainsKey(folder.ID))
  142. {
  143. newFolder.SubFolders.Add(folder.ID, folder);
  144. }
  145. }
  146. }
  147. }
  148. }
  149. /// <summary>
  150. /// Callback invoked when the inventory is received from an async request to the inventory service
  151. /// </summary>
  152. /// <param name="userID"></param>
  153. /// <param name="inventoryCollection"></param>
  154. public void InventoryReceive(ICollection<InventoryFolderImpl> folders, ICollection<InventoryItemBase> items)
  155. {
  156. // FIXME: Exceptions thrown upwards never appear on the console. Could fix further up if these
  157. // are simply being swallowed
  158. try
  159. {
  160. foreach (InventoryFolderImpl folder in folders)
  161. {
  162. FolderReceive(folder);
  163. }
  164. foreach (InventoryItemBase item in items)
  165. {
  166. ItemReceive(item);
  167. }
  168. }
  169. catch (Exception e)
  170. {
  171. m_log.ErrorFormat("[INVENTORY CACHE]: Error processing inventory received from inventory service, {0}", e);
  172. }
  173. // Deal with pending requests
  174. lock (m_pendingRequests)
  175. {
  176. // We're going to change inventory status within the lock to avoid a race condition
  177. // where requests are processed after the AddRequest() method has been called.
  178. m_hasInventory = true;
  179. foreach (IInventoryRequest request in m_pendingRequests)
  180. {
  181. request.Execute();
  182. }
  183. }
  184. }
  185. /// <summary>
  186. /// Callback invoked when a folder is received from an async request to the inventory service.
  187. /// </summary>
  188. /// <param name="userID"></param>
  189. /// <param name="folderInfo"></param>
  190. private void FolderReceive(InventoryFolderImpl newFolder)
  191. {
  192. // m_log.DebugFormat(
  193. // "[INVENTORY CACHE]: Received folder {0} {1} for user {2}",
  194. // folderInfo.Name, folderInfo.ID, userID);
  195. if (RootFolder == null)
  196. {
  197. if (newFolder.ParentID == LLUUID.Zero)
  198. {
  199. m_rootFolder = newFolder;
  200. }
  201. else
  202. {
  203. AddPendingFolder(newFolder);
  204. }
  205. }
  206. else
  207. {
  208. InventoryFolderImpl parentFolder = RootFolder.FindFolder(newFolder.ParentID);
  209. if (parentFolder != null)
  210. {
  211. lock (parentFolder.SubFolders)
  212. {
  213. if (!parentFolder.SubFolders.ContainsKey(newFolder.ID))
  214. {
  215. parentFolder.SubFolders.Add(newFolder.ID, newFolder);
  216. }
  217. else
  218. {
  219. m_log.WarnFormat(
  220. "[INVENTORY CACHE]: Received folder {0} {1} from inventory service which has already been received",
  221. newFolder.Name, newFolder.ID);
  222. }
  223. }
  224. }
  225. else
  226. {
  227. AddPendingFolder(newFolder);
  228. }
  229. }
  230. ResolvePendingFolders(newFolder);
  231. }
  232. /// <summary>
  233. /// Callback invoked when an item is received from an async request to the inventory service.
  234. ///
  235. /// We're assuming here that items are always received after all the folders
  236. /// received.
  237. /// </summary>
  238. /// <param name="folderInfo"></param>
  239. private void ItemReceive(InventoryItemBase itemInfo)
  240. {
  241. // m_log.DebugFormat(
  242. // "[INVENTORY CACHE]: Received item {0} {1} for user {2}",
  243. // itemInfo.Name, itemInfo.ID, userID);
  244. InventoryFolderImpl folder = RootFolder.FindFolder(itemInfo.Folder);
  245. if (null == folder)
  246. {
  247. m_log.WarnFormat(
  248. "Received item {0} {1} but its folder {2} does not exist",
  249. itemInfo.Name, itemInfo.ID, itemInfo.Folder);
  250. return;
  251. }
  252. lock (folder.Items)
  253. {
  254. folder.Items[itemInfo.ID] = itemInfo;
  255. }
  256. }
  257. /// <summary>
  258. /// Create a folder in this agent's inventory.
  259. ///
  260. /// If the inventory service has not yet delievered the inventory
  261. /// for this user then the request will be queued.
  262. /// </summary>
  263. /// <param name="parentID"></param>
  264. /// <returns></returns>
  265. public bool CreateFolder(string folderName, LLUUID folderID, ushort folderType, LLUUID parentID)
  266. {
  267. // m_log.DebugFormat(
  268. // "[AGENT INVENTORY]: Creating inventory folder {0} {1} for {2} {3}", folderID, folderName, remoteClient.Name, remoteClient.AgentId);
  269. if (HasInventory)
  270. {
  271. InventoryFolderImpl parentFolder = RootFolder.FindFolder(parentID);
  272. if (null == parentFolder)
  273. {
  274. m_log.WarnFormat(
  275. "[AGENT INVENTORY]: Tried to create folder {0} {1} but the parent {2} does not exist",
  276. folderName, folderID, parentID);
  277. return false;
  278. }
  279. InventoryFolderImpl createdFolder = parentFolder.CreateChildFolder(folderID, folderName, folderType);
  280. if (createdFolder != null)
  281. {
  282. InventoryFolderBase createdBaseFolder = new InventoryFolderBase();
  283. createdBaseFolder.Owner = createdFolder.Owner;
  284. createdBaseFolder.ID = createdFolder.ID;
  285. createdBaseFolder.Name = createdFolder.Name;
  286. createdBaseFolder.ParentID = createdFolder.ParentID;
  287. createdBaseFolder.Type = createdFolder.Type;
  288. createdBaseFolder.Version = createdFolder.Version;
  289. m_commsManager.InventoryService.AddFolder(createdBaseFolder);
  290. return true;
  291. }
  292. else
  293. {
  294. m_log.WarnFormat(
  295. "[AGENT INVENTORY]: Tried to create folder {0} {1} but the folder already exists",
  296. folderName, folderID);
  297. return false;
  298. }
  299. }
  300. else
  301. {
  302. AddRequest(
  303. new InventoryRequest(
  304. Delegate.CreateDelegate(typeof(CreateFolderDelegate), this, "CreateFolder"),
  305. new object[] { folderName, folderID, folderType, parentID }));
  306. return true;
  307. }
  308. }
  309. /// <summary>
  310. /// Handle a client request to update the inventory folder
  311. ///
  312. /// If the inventory service has not yet delievered the inventory
  313. /// for this user then the request will be queued.
  314. ///
  315. /// FIXME: We call add new inventory folder because in the data layer, we happen to use an SQL REPLACE
  316. /// so this will work to rename an existing folder. Needless to say, to rely on this is very confusing,
  317. /// and needs to be changed.
  318. /// </summary>
  319. ///
  320. /// <param name="folderID"></param>
  321. /// <param name="type"></param>
  322. /// <param name="name"></param>
  323. /// <param name="parentID"></param>
  324. public bool UpdateFolder(string name, LLUUID folderID, ushort type, LLUUID parentID)
  325. {
  326. // m_log.DebugFormat(
  327. // "[AGENT INVENTORY]: Updating inventory folder {0} {1} for {2} {3}", folderID, name, remoteClient.Name, remoteClient.AgentId);
  328. if (HasInventory)
  329. {
  330. InventoryFolderBase baseFolder = new InventoryFolderBase();
  331. baseFolder.Owner = m_userProfile.ID;
  332. baseFolder.ID = folderID;
  333. baseFolder.Name = name;
  334. baseFolder.ParentID = parentID;
  335. baseFolder.Type = (short) type;
  336. baseFolder.Version = RootFolder.Version;
  337. m_commsManager.InventoryService.AddFolder(baseFolder);
  338. }
  339. else
  340. {
  341. AddRequest(
  342. new InventoryRequest(
  343. Delegate.CreateDelegate(typeof(UpdateFolderDelegate), this, "UpdateFolder"),
  344. new object[] { name, folderID, type, parentID }));
  345. }
  346. return true;
  347. }
  348. /// <summary>
  349. /// Handle an inventory folder move request from the client.
  350. ///
  351. /// If the inventory service has not yet delievered the inventory
  352. /// for this user then the request will be queued.
  353. /// </summary>
  354. ///
  355. /// <param name="folderID"></param>
  356. /// <param name="parentID"></param>
  357. public bool MoveFolder(LLUUID folderID, LLUUID parentID)
  358. {
  359. // m_log.DebugFormat(
  360. // "[AGENT INVENTORY]: Moving inventory folder {0} into folder {1} for {2} {3}",
  361. // parentID, remoteClient.Name, remoteClient.Name, remoteClient.AgentId);
  362. if (HasInventory)
  363. {
  364. InventoryFolderBase baseFolder = new InventoryFolderBase();
  365. baseFolder.Owner = m_userProfile.ID;
  366. baseFolder.ID = folderID;
  367. baseFolder.ParentID = parentID;
  368. m_commsManager.InventoryService.MoveFolder(baseFolder);
  369. return true;
  370. }
  371. else
  372. {
  373. AddRequest(
  374. new InventoryRequest(
  375. Delegate.CreateDelegate(typeof(MoveFolderDelegate), this, "MoveFolder"),
  376. new object[] { folderID, parentID }));
  377. return true;
  378. }
  379. }
  380. /// <summary>
  381. /// This method will delete all the items and folders in the given folder.
  382. ///
  383. /// If the inventory service has not yet delievered the inventory
  384. /// for this user then the request will be queued.
  385. /// </summary>
  386. ///
  387. /// <param name="folderID"></param>
  388. public bool PurgeFolder(LLUUID folderID)
  389. {
  390. // m_log.InfoFormat("[AGENT INVENTORY]: Purging folder {0} for {1} uuid {2}",
  391. // folderID, remoteClient.Name, remoteClient.AgentId);
  392. if (HasInventory)
  393. {
  394. InventoryFolderImpl purgedFolder = RootFolder.FindFolder(folderID);
  395. if (purgedFolder != null)
  396. {
  397. // XXX Nasty - have to create a new object to hold details we already have
  398. InventoryFolderBase purgedBaseFolder = new InventoryFolderBase();
  399. purgedBaseFolder.Owner = purgedFolder.Owner;
  400. purgedBaseFolder.ID = purgedFolder.ID;
  401. purgedBaseFolder.Name = purgedFolder.Name;
  402. purgedBaseFolder.ParentID = purgedFolder.ParentID;
  403. purgedBaseFolder.Type = purgedFolder.Type;
  404. purgedBaseFolder.Version = purgedFolder.Version;
  405. m_commsManager.InventoryService.PurgeFolder(purgedBaseFolder);
  406. purgedFolder.Purge();
  407. return true;
  408. }
  409. }
  410. else
  411. {
  412. AddRequest(
  413. new InventoryRequest(
  414. Delegate.CreateDelegate(typeof(PurgeFolderDelegate), this, "PurgeFolder"),
  415. new object[] { folderID }));
  416. return true;
  417. }
  418. return false;
  419. }
  420. /// <summary>
  421. /// Add an item to the user's inventory
  422. /// </summary>
  423. /// <param name="itemInfo"></param>
  424. public void AddItem(InventoryItemBase item)
  425. {
  426. if (HasInventory)
  427. {
  428. if (item.Folder == LLUUID.Zero)
  429. {
  430. InventoryFolderImpl f=FindFolderForType(item.AssetType);
  431. if (f != null)
  432. item.Folder=f.ID;
  433. else
  434. item.Folder=RootFolder.ID;
  435. }
  436. ItemReceive(item);
  437. m_commsManager.InventoryService.AddItem(item);
  438. }
  439. else
  440. {
  441. AddRequest(
  442. new InventoryRequest(
  443. Delegate.CreateDelegate(typeof(AddItemDelegate), this, "AddItem"),
  444. new object[] { item }));
  445. }
  446. }
  447. /// <summary>
  448. /// Update an item in the user's inventory
  449. /// </summary>
  450. /// <param name="userID"></param>
  451. /// <param name="itemInfo"></param>
  452. public void UpdateItem(InventoryItemBase item)
  453. {
  454. if (HasInventory)
  455. {
  456. m_commsManager.InventoryService.UpdateItem(item);
  457. }
  458. else
  459. {
  460. AddRequest(
  461. new InventoryRequest(
  462. Delegate.CreateDelegate(typeof(UpdateItemDelegate), this, "UpdateItem"),
  463. new object[] { item }));
  464. }
  465. }
  466. /// <summary>
  467. /// Delete an item from the user's inventory
  468. ///
  469. /// If the inventory service has not yet delievered the inventory
  470. /// for this user then the request will be queued.
  471. /// </summary>
  472. /// <param name="itemID"></param>
  473. /// <returns>
  474. /// true on a successful delete or a if the request is queued.
  475. /// Returns false on an immediate failure
  476. /// </returns>
  477. public bool DeleteItem(LLUUID itemID)
  478. {
  479. if (HasInventory)
  480. {
  481. // XXX For historical reasons (grid comms), we need to retrieve the whole item in order to delete, even though
  482. // really only the item id is required.
  483. InventoryItemBase item = RootFolder.FindItem(itemID);
  484. if (null == item)
  485. {
  486. m_log.WarnFormat("[AGENT INVENTORY]: Tried to delete item {0} which does not exist", itemID);
  487. return false;
  488. }
  489. if (RootFolder.DeleteItem(item.ID))
  490. {
  491. return m_commsManager.InventoryService.DeleteItem(item);
  492. }
  493. }
  494. else
  495. {
  496. AddRequest(
  497. new InventoryRequest(
  498. Delegate.CreateDelegate(typeof(DeleteItemDelegate), this, "DeleteItem"),
  499. new object[] { itemID }));
  500. return true;
  501. }
  502. return false;
  503. }
  504. /// <summary>
  505. /// Send details of the inventory items and/or folders in a given folder to the client.
  506. /// </summary>
  507. /// <param name="client"></param>
  508. /// <param name="folderID"></param>
  509. /// <param name="fetchFolders"></param>
  510. /// <param name="fetchItems"></param>
  511. /// <returns>true if the request was queued or successfully processed, false otherwise</returns>
  512. public bool SendInventoryDecendents(IClientAPI client, LLUUID folderID, bool fetchFolders, bool fetchItems)
  513. {
  514. if (HasInventory)
  515. {
  516. InventoryFolderImpl folder;
  517. if ((folder = RootFolder.FindFolder(folderID)) != null)
  518. {
  519. // m_log.DebugFormat(
  520. // "[AGENT INVENTORY]: Found folder {0} for client {1}",
  521. // folderID, remoteClient.AgentId);
  522. client.SendInventoryFolderDetails(
  523. client.AgentId, folderID, folder.RequestListOfItems(),
  524. folder.RequestListOfFolders(), fetchFolders, fetchItems);
  525. return true;
  526. }
  527. else
  528. {
  529. m_log.WarnFormat(
  530. "[AGENT INVENTORY]: Could not find folder {0} requested by user {1} {2}",
  531. folderID, client.Name, client.AgentId);
  532. return false;
  533. }
  534. }
  535. else
  536. {
  537. AddRequest(
  538. new InventoryRequest(
  539. Delegate.CreateDelegate(typeof(SendInventoryDescendentsDelegate), this, "SendInventoryDecendents"),
  540. new object[] { client, folderID, fetchFolders, fetchItems }));
  541. return true;
  542. }
  543. }
  544. private InventoryFolderImpl FindFolderForType(int type)
  545. {
  546. if (RootFolder == null)
  547. return null;
  548. lock (RootFolder.SubFolders)
  549. {
  550. foreach (InventoryFolderImpl f in RootFolder.SubFolders.Values)
  551. {
  552. if (f.Type == type)
  553. return f;
  554. }
  555. }
  556. return null;
  557. }
  558. }
  559. /// <summary>
  560. /// Should be implemented by callers which require a callback when the user's inventory is received
  561. /// </summary>
  562. public interface IInventoryRequest
  563. {
  564. /// <summary>
  565. /// This is the method executed once we have received the user's inventory by which the request can be fulfilled.
  566. /// </summary>
  567. void Execute();
  568. }
  569. /// <summary>
  570. /// Generic inventory request
  571. /// </summary>
  572. class InventoryRequest : IInventoryRequest
  573. {
  574. private Delegate m_delegate;
  575. private Object[] m_args;
  576. internal InventoryRequest(Delegate delegat, Object[] args)
  577. {
  578. m_delegate = delegat;
  579. m_args = args;
  580. }
  581. public void Execute()
  582. {
  583. m_delegate.DynamicInvoke(m_args);
  584. }
  585. }
  586. }