{\r
string loggingMessage = RenderLoggingEvent(le);\r
\r
+ RadegastInstance.GlobalInstance.MainForm.AddLogMessage(loggingMessage, le.Level);\r
+\r
lock (this)\r
{\r
StreamWriter logfile = File.AppendText(RadegastInstance.GlobalInstance.GlobalLogFile);\r
logfile.Close();\r
logfile.Dispose();\r
}\r
-\r
string regex = @"^(?<Front>.*?)\[(?<Category>[^\]]+)\]:?(?<End>.*)";\r
\r
Regex RE = new Regex(regex, RegexOptions.Multiline);\r
{\r
if (disposing && (components != null))\r
{\r
+ if (InventoryUpdate != null)\r
+ {\r
+ InventoryUpdate.Abort();\r
+ InventoryUpdate = null;\r
+ }\r
+\r
+ if (_EditTimer != null)\r
+ {\r
+ _EditTimer.Dispose();\r
+ _EditTimer = null;\r
+ }\r
+\r
+ if (TreeUpdateTimer != null)\r
+ {\r
+ TreeUpdateTimer.Dispose();\r
+ TreeUpdateTimer = null;\r
+ }\r
+\r
components.Dispose();\r
}\r
base.Dispose(disposing);\r
public InventoryItem Item;\r
public UUID InventoryID;\r
public UUID PrimID;\r
+ public bool MarkedAttached = false;\r
+\r
public AttachmentPoint Point\r
{\r
get\r
private Dictionary<UUID, AttachmentInfo> attachments = new Dictionary<UUID, AttachmentInfo>();\r
private System.Threading.Timer TreeUpdateTimer;\r
private Queue<InventoryBase> ItemsToAdd = new Queue<InventoryBase>();\r
+ private Queue<InventoryBase> ItemsToUpdate = new Queue<InventoryBase>();\r
private bool TreeUpdateInProgress = false;\r
private Dictionary<UUID, TreeNode> UUID2NodeCache = new Dictionary<UUID, TreeNode>();\r
- private int updateInterval = 500;\r
+ private int updateInterval = 1000;\r
private Thread InventoryUpdate;\r
\r
#region Construction and disposal\r
attachments.Remove(oldAttachmentUUID);\r
if (oldAttachment.Item != null)\r
{\r
+ attachment.MarkedAttached = false;\r
Store_OnInventoryObjectUpdated(oldAttachment.Item, oldAttachment.Item);\r
}\r
}\r
}\r
else\r
{\r
- attachments[attachment.InventoryID].Prim = prim;\r
+ attachment = attachments[attachment.InventoryID];\r
+ if (attachment.Prim == null)\r
+ {\r
+ attachment.Prim = prim;\r
+ }\r
}\r
\r
// Don't update the tree yet if we're still updating invetory tree from server\r
{\r
if (Inventory.Contains(attachment.InventoryID))\r
{\r
- InventoryItem item = (InventoryItem)Inventory[attachment.InventoryID];\r
- attachments[attachment.InventoryID].Item = item;\r
- Store_OnInventoryObjectUpdated(attachments[attachment.InventoryID].Item, attachments[attachment.InventoryID].Item);\r
+ if (attachment.Item == null)\r
+ {\r
+ InventoryItem item = (InventoryItem)Inventory[attachment.InventoryID];\r
+ attachment.Item = item;\r
+ }\r
+ if (!attachment.MarkedAttached)\r
+ {\r
+ attachment.MarkedAttached = true;\r
+ Store_OnInventoryObjectUpdated(attachments[attachment.InventoryID].Item, attachments[attachment.InventoryID].Item);\r
+ }\r
}\r
else\r
{\r
\r
void Store_OnInventoryObjectAdded(InventoryBase obj)\r
{\r
- if (TreeUpdateTimer != null)\r
+ if (TreeUpdateInProgress)\r
{\r
lock (ItemsToAdd)\r
{\r
\r
void Store_OnInventoryObjectUpdated(InventoryBase oldObject, InventoryBase newObject)\r
{\r
+ if (TreeUpdateInProgress)\r
+ {\r
+ lock (ItemsToUpdate)\r
+ {\r
+ if (newObject is InventoryFolder)\r
+ {\r
+ TreeNode currentNode = findNodeForItem(newObject.UUID);\r
+ if (currentNode != null && currentNode.Text == newObject.Name) return;\r
+ }\r
+\r
+ if (!ItemsToUpdate.Contains(newObject))\r
+ {\r
+ ItemsToUpdate.Enqueue(newObject);\r
+ }\r
+ }\r
+ }\r
+ else\r
+ {\r
+ Exec_OnInventoryObjectUpdated(oldObject, newObject);\r
+ }\r
+ }\r
+\r
+ void Exec_OnInventoryObjectUpdated(InventoryBase oldObject, InventoryBase newObject)\r
+ {\r
if (InvokeRequired)\r
{\r
BeginInvoke(new MethodInvoker(delegate()\r
TreeNode AddDir(TreeNode parentNode, InventoryFolder f)\r
{\r
TreeNode dirNode = new TreeNode();\r
- dirNode.Name = f.Name;\r
+ dirNode.Name = f.UUID.ToString();\r
dirNode.Text = f.Name;\r
dirNode.Tag = f;\r
dirNode.ImageIndex = GetDirImageIndex(f.PreferredType.ToString().ToLower());\r
TreeNode AddItem(TreeNode parent, InventoryItem item)\r
{\r
TreeNode itemNode = new TreeNode();\r
- itemNode.Name = item.Name;\r
+ itemNode.Name = item.UUID.ToString();\r
itemNode.Text = ItemLabel(item, false);\r
itemNode.Tag = item;\r
int img = -1;\r
\r
private void TraverseNodes(InventoryNode start)\r
{\r
- List<InventoryNode> items = new List<InventoryNode>();\r
+ bool has_items = false;\r
+\r
foreach (InventoryNode node in start.Nodes.Values)\r
{\r
if (node.Data is InventoryItem)\r
{\r
- items.Add(node);\r
+ has_items = true;\r
+ break;\r
}\r
}\r
\r
- if (items.Count == 0 || start.NeedsUpdate)\r
+ if (!has_items || start.NeedsUpdate)\r
{\r
InventoryFolder f = (InventoryFolder)start.Data;\r
AutoResetEvent gotFolderEvent = new AutoResetEvent(false);\r
{\r
if (Inventory.Contains(a.InventoryID))\r
{\r
+ a.MarkedAttached = true;\r
a.Item = (InventoryItem)Inventory[a.InventoryID];\r
+ Store_OnInventoryObjectUpdated(a.Item, a.Item);\r
}\r
else\r
{\r
return;\r
}\r
}\r
- Store_OnInventoryObjectUpdated(a.Item, a.Item);\r
}\r
}\r
\r
Logger.Log("Finished updating invenory folders, saving cache...", Helpers.LogLevel.Debug, client);\r
- Inventory.SaveToDisk(instance.InventoryCacheFileName);\r
+ Thread saveInvToDisk = new Thread(new ThreadStart(\r
+ delegate()\r
+ {\r
+ Inventory.SaveToDisk(instance.InventoryCacheFileName);\r
+ }));\r
+ saveInvToDisk.Name = "Save inventory to disk";\r
+ saveInvToDisk.Start();\r
}\r
\r
private void reloadInventoryToolStripMenuItem_Click(object sender, EventArgs e)\r
{\r
if (InvokeRequired)\r
{\r
+ try\r
+ {\r
Invoke(new MethodInvoker(delegate()\r
{\r
TreeUpdateTimerTick(sender);\r
}\r
));\r
+ }\r
+ catch (Exception) { }\r
return;\r
}\r
\r
lock (ItemsToAdd)\r
{\r
- invTree.BeginUpdate();\r
- while (ItemsToAdd.Count > 0)\r
+ if (ItemsToAdd.Count > 0)\r
+ {\r
+ invTree.BeginUpdate();\r
+ while (ItemsToAdd.Count > 0)\r
+ {\r
+ InventoryBase item = ItemsToAdd.Dequeue();\r
+ TreeNode node = findNodeForItem(item.ParentUUID);\r
+ if (node != null)\r
+ {\r
+ AddBase(node, item);\r
+ }\r
+ }\r
+ invTree.EndUpdate();\r
+ }\r
+ }\r
+\r
+ lock (ItemsToUpdate)\r
+ {\r
+ if (ItemsToUpdate.Count > 0)\r
{\r
- InventoryBase item = ItemsToAdd.Dequeue();\r
- TreeNode node = findNodeForItem(item.ParentUUID);\r
- if (node != null)\r
+ invTree.BeginUpdate();\r
+ while (ItemsToUpdate.Count > 0)\r
{\r
- AddBase(node, item);\r
+ InventoryBase item = ItemsToUpdate.Dequeue();\r
+ Exec_OnInventoryObjectUpdated(item, item);\r
}\r
+ invTree.EndUpdate();\r
}\r
- invTree.EndUpdate();\r
- UpdateStatus("Loading... " + UUID2NodeCache.Count.ToString() + " items");\r
+ }\r
+\r
+ UpdateStatus("Loading... " + UUID2NodeCache.Count.ToString() + " items");\r
+ try\r
+ {\r
if (TreeUpdateTimer != null)\r
{\r
TreeUpdateTimer.Change(updateInterval, System.Threading.Timeout.Infinite);\r
}\r
}\r
+ catch (Exception) { }\r
}\r
\r
#endregion\r
/// </summary>\r
private void InitializeComponent()\r
{\r
+ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmDebugLog));\r
this.tabLogs = new System.Windows.Forms.TabControl();\r
this.tpgInfo = new System.Windows.Forms.TabPage();\r
- this.rtbInfo = new System.Windows.Forms.RichTextBox();\r
- this.tpgWarning = new System.Windows.Forms.TabPage();\r
- this.rtbWarning = new System.Windows.Forms.RichTextBox();\r
- this.tpgError = new System.Windows.Forms.TabPage();\r
- this.rtbError = new System.Windows.Forms.RichTextBox();\r
- this.tpgDebug = new System.Windows.Forms.TabPage();\r
- this.rtbDebug = new System.Windows.Forms.RichTextBox();\r
+ this.rtbLog = new System.Windows.Forms.RichTextBox();\r
this.btnClose = new System.Windows.Forms.Button();\r
this.tabLogs.SuspendLayout();\r
this.tpgInfo.SuspendLayout();\r
- this.tpgWarning.SuspendLayout();\r
- this.tpgError.SuspendLayout();\r
- this.tpgDebug.SuspendLayout();\r
this.SuspendLayout();\r
// \r
// tabLogs\r
| System.Windows.Forms.AnchorStyles.Left)\r
| System.Windows.Forms.AnchorStyles.Right)));\r
this.tabLogs.Controls.Add(this.tpgInfo);\r
- this.tabLogs.Controls.Add(this.tpgWarning);\r
- this.tabLogs.Controls.Add(this.tpgError);\r
- this.tabLogs.Controls.Add(this.tpgDebug);\r
this.tabLogs.Location = new System.Drawing.Point(12, 12);\r
this.tabLogs.Name = "tabLogs";\r
this.tabLogs.SelectedIndex = 0;\r
// \r
// tpgInfo\r
// \r
- this.tpgInfo.Controls.Add(this.rtbInfo);\r
+ this.tpgInfo.Controls.Add(this.rtbLog);\r
this.tpgInfo.Location = new System.Drawing.Point(4, 22);\r
this.tpgInfo.Name = "tpgInfo";\r
this.tpgInfo.Padding = new System.Windows.Forms.Padding(3);\r
this.tpgInfo.Size = new System.Drawing.Size(540, 359);\r
this.tpgInfo.TabIndex = 0;\r
- this.tpgInfo.Text = "Info";\r
+ this.tpgInfo.Text = "Log";\r
this.tpgInfo.UseVisualStyleBackColor = true;\r
// \r
- // rtbInfo\r
+ // rtbLog\r
// \r
- this.rtbInfo.BackColor = System.Drawing.Color.White;\r
- this.rtbInfo.Dock = System.Windows.Forms.DockStyle.Fill;\r
- this.rtbInfo.Location = new System.Drawing.Point(3, 3);\r
- this.rtbInfo.Name = "rtbInfo";\r
- this.rtbInfo.ReadOnly = true;\r
- this.rtbInfo.Size = new System.Drawing.Size(534, 353);\r
- this.rtbInfo.TabIndex = 0;\r
- this.rtbInfo.Text = "";\r
- this.rtbInfo.WordWrap = false;\r
- // \r
- // tpgWarning\r
- // \r
- this.tpgWarning.Controls.Add(this.rtbWarning);\r
- this.tpgWarning.Location = new System.Drawing.Point(4, 22);\r
- this.tpgWarning.Name = "tpgWarning";\r
- this.tpgWarning.Padding = new System.Windows.Forms.Padding(3);\r
- this.tpgWarning.Size = new System.Drawing.Size(540, 359);\r
- this.tpgWarning.TabIndex = 1;\r
- this.tpgWarning.Text = "Warning";\r
- this.tpgWarning.UseVisualStyleBackColor = true;\r
- // \r
- // rtbWarning\r
- // \r
- this.rtbWarning.BackColor = System.Drawing.Color.White;\r
- this.rtbWarning.Dock = System.Windows.Forms.DockStyle.Fill;\r
- this.rtbWarning.Location = new System.Drawing.Point(3, 3);\r
- this.rtbWarning.Name = "rtbWarning";\r
- this.rtbWarning.ReadOnly = true;\r
- this.rtbWarning.Size = new System.Drawing.Size(534, 353);\r
- this.rtbWarning.TabIndex = 1;\r
- this.rtbWarning.Text = "";\r
- this.rtbWarning.WordWrap = false;\r
- // \r
- // tpgError\r
- // \r
- this.tpgError.Controls.Add(this.rtbError);\r
- this.tpgError.Location = new System.Drawing.Point(4, 22);\r
- this.tpgError.Name = "tpgError";\r
- this.tpgError.Padding = new System.Windows.Forms.Padding(3);\r
- this.tpgError.Size = new System.Drawing.Size(540, 359);\r
- this.tpgError.TabIndex = 2;\r
- this.tpgError.Text = "Error";\r
- this.tpgError.UseVisualStyleBackColor = true;\r
- // \r
- // rtbError\r
- // \r
- this.rtbError.BackColor = System.Drawing.Color.White;\r
- this.rtbError.Dock = System.Windows.Forms.DockStyle.Fill;\r
- this.rtbError.Location = new System.Drawing.Point(3, 3);\r
- this.rtbError.Name = "rtbError";\r
- this.rtbError.ReadOnly = true;\r
- this.rtbError.Size = new System.Drawing.Size(534, 353);\r
- this.rtbError.TabIndex = 1;\r
- this.rtbError.Text = "";\r
- this.rtbError.WordWrap = false;\r
- // \r
- // tpgDebug\r
- // \r
- this.tpgDebug.Controls.Add(this.rtbDebug);\r
- this.tpgDebug.Location = new System.Drawing.Point(4, 22);\r
- this.tpgDebug.Name = "tpgDebug";\r
- this.tpgDebug.Padding = new System.Windows.Forms.Padding(3);\r
- this.tpgDebug.Size = new System.Drawing.Size(540, 359);\r
- this.tpgDebug.TabIndex = 3;\r
- this.tpgDebug.Text = "Debug";\r
- this.tpgDebug.UseVisualStyleBackColor = true;\r
- // \r
- // rtbDebug\r
- // \r
- this.rtbDebug.BackColor = System.Drawing.Color.White;\r
- this.rtbDebug.Dock = System.Windows.Forms.DockStyle.Fill;\r
- this.rtbDebug.Location = new System.Drawing.Point(3, 3);\r
- this.rtbDebug.Name = "rtbDebug";\r
- this.rtbDebug.ReadOnly = true;\r
- this.rtbDebug.Size = new System.Drawing.Size(534, 353);\r
- this.rtbDebug.TabIndex = 1;\r
- this.rtbDebug.Text = "";\r
- this.rtbDebug.WordWrap = false;\r
+ this.rtbLog.BackColor = System.Drawing.Color.White;\r
+ this.rtbLog.Dock = System.Windows.Forms.DockStyle.Fill;\r
+ this.rtbLog.Location = new System.Drawing.Point(3, 3);\r
+ this.rtbLog.Name = "rtbLog";\r
+ this.rtbLog.ReadOnly = true;\r
+ this.rtbLog.Size = new System.Drawing.Size(534, 353);\r
+ this.rtbLog.TabIndex = 0;\r
+ this.rtbLog.Text = "";\r
+ this.rtbLog.WordWrap = false;\r
// \r
// btnClose\r
// \r
this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));\r
- this.btnClose.Location = new System.Drawing.Point(485, 403);\r
+ this.btnClose.Location = new System.Drawing.Point(481, 396);\r
this.btnClose.Name = "btnClose";\r
this.btnClose.Size = new System.Drawing.Size(75, 23);\r
this.btnClose.TabIndex = 1;\r
this.Controls.Add(this.btnClose);\r
this.Controls.Add(this.tabLogs);\r
this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+ this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));\r
this.Name = "frmDebugLog";\r
this.ShowIcon = false;\r
- this.Text = "Debug Log - SLeek";\r
- this.Shown += new System.EventHandler(this.frmDebugLog_Shown);\r
+ this.Text = "Debug Log";\r
+ this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmDebugLog_FormClosing);\r
this.tabLogs.ResumeLayout(false);\r
this.tpgInfo.ResumeLayout(false);\r
- this.tpgWarning.ResumeLayout(false);\r
- this.tpgError.ResumeLayout(false);\r
- this.tpgDebug.ResumeLayout(false);\r
this.ResumeLayout(false);\r
\r
}\r
\r
private System.Windows.Forms.TabControl tabLogs;\r
private System.Windows.Forms.TabPage tpgInfo;\r
- private System.Windows.Forms.TabPage tpgWarning;\r
private System.Windows.Forms.Button btnClose;\r
- private System.Windows.Forms.TabPage tpgError;\r
- private System.Windows.Forms.TabPage tpgDebug;\r
- private System.Windows.Forms.RichTextBox rtbInfo;\r
- private System.Windows.Forms.RichTextBox rtbWarning;\r
- private System.Windows.Forms.RichTextBox rtbError;\r
- private System.Windows.Forms.RichTextBox rtbDebug;\r
+ private System.Windows.Forms.RichTextBox rtbLog;\r
}\r
}
\ No newline at end of file
public partial class frmDebugLog : Form\r
{\r
private RadegastInstance instance;\r
- private RadegastNetcom netcom;\r
- private GridClient client;\r
-\r
- //Workaround for window handle exception on login\r
- private List<DebugLogMessage> initQueue = new List<DebugLogMessage>();\r
\r
public frmDebugLog(RadegastInstance instance)\r
{\r
InitializeComponent();\r
-\r
this.instance = instance;\r
- netcom = this.instance.Netcom;\r
- client = this.instance.Client;\r
- AddClientEvents();\r
-\r
- this.Disposed += new EventHandler(frmDebugLog_Disposed);\r
- }\r
-\r
- private void frmDebugLog_Disposed(object sender, EventArgs e)\r
- {\r
}\r
\r
- private void AddClientEvents()\r
+ private void btnClose_Click(object sender, EventArgs e)\r
{\r
+ Hide();\r
}\r
\r
- //called on GUI thread\r
- private void ReceivedLogMessage(string message, Helpers.LogLevel level)\r
+ public void AddLogMessage(string msg, log4net.Core.Level level)\r
{\r
- RichTextBox rtb = null;\r
-\r
- switch (level)\r
+ if (InvokeRequired)\r
{\r
- case Helpers.LogLevel.Info:\r
- rtb = rtbInfo;\r
- break;\r
-\r
- case Helpers.LogLevel.Warning:\r
- rtb = rtbWarning;\r
- break;\r
-\r
- case Helpers.LogLevel.Error:\r
- rtb = rtbError;\r
- break;\r
-\r
- case Helpers.LogLevel.Debug:\r
- rtb = rtbDebug;\r
- break;\r
+ BeginInvoke(new MethodInvoker(delegate() { AddLogMessage(msg, level); }));\r
+ return;\r
}\r
\r
- rtb.AppendText("[" + DateTime.Now.ToString() + "] " + message + "\n");\r
+ rtbLog.AppendText(msg);\r
+ rtbLog.AppendText(Environment.NewLine);\r
}\r
\r
- private void ProcessLogMessage(DebugLogMessage logMessage)\r
- {\r
- ReceivedLogMessage(logMessage.Message, logMessage.Level);\r
- }\r
-\r
- private void btnClose_Click(object sender, EventArgs e)\r
+ private void frmDebugLog_FormClosing(object sender, FormClosingEventArgs e)\r
{\r
+ e.Cancel = true;\r
Hide();\r
}\r
-\r
- private void frmDebugLog_Shown(object sender, EventArgs e)\r
- {\r
- if (initQueue.Count > 0)\r
- foreach (DebugLogMessage msg in initQueue) ProcessLogMessage(msg);\r
- }\r
}\r
}
\ No newline at end of file
<resheader name="writer">\r
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r
</resheader>\r
+ <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />\r
+ <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">\r
+ <value>\r
+ AAABAAEAEBAAAAAAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAAAAAAAAAAAAAAAAAAAAA\r
+ AAAAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAA\r
+ AAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAA\r
+ AAEAAAABAAAAAQAAAAHCmW8HPUFD/ygrKwcAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAAB/ceQ+f/I\r
+ kf89QUP9AAAAAQAAAAHuu4dX/8iR/z1BQ/89QUP/PUFD/z1BQ/84PD1BAAAAAeu5hkn/yJH//8iR///I\r
+ kf//yJH/PUFD/z1BQ/86PkCB/8iR///Ikf89QUP/PUFD/z1BQ/89QUP/PUFD/0VGRv//yJH//8iR///I\r
+ kf//yJH//8iR/z1BQ/89QUP/PUFD///Ikf//yJH/PUFD/z1BQ/89QUP/PUFD/z1BQ/9FRkb//8iR///I\r
+ kf//yJH//8iR///Ikf89QUP/PUFD/z1BQ///yJH//8iR/z1BQ/89QUP/PUFD/z1BQ/89QUP/RUZG///I\r
+ kf//yJH//8iR///Ikf//yJH/PUFD/z1BQ/89QUP//8iR///Ikf89QUP/PUFD/z1BQ/89QUP/PUFD/0VG\r
+ Rv//yJH//8iR///Ikf//yJH//8iR/z1BQ/89QUP/PUFD///Ikf//yJH/PUFD/z1BQ/89QUP/PUFD/z1B\r
+ Q/9FRkb//8iR///Ikf//yJH//8iR///Ikf89QUP/PUFD/z1BQ//3woyR98KMkTs/QZE7P0GROz9BkZF8\r
+ Zf+RfGX/knxl/6qNb/+qjW//qo1v//fCjJH3woyROz9BkTs/QZE7P0GRAAAAAQAAAAEAAAABAAAAAQAA\r
+ AAH/yJH//8iR//fCjv89QUP/PUFD/z1BQ/8AAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAA\r
+ AAEAAAAB/8iR///Ikf/3wo7/PUFD/z1BQ/89QUP/AAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAA\r
+ AAEAAAABAAAAAf/Ikf//yJH/98KO/z1BQ/89QUP/PUFD/wAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAA\r
+ AAEAAAABAAAAAQAAAAH/yJH//8iR//fCjv89QUP/PUFD/z1BQ/8AAAABAAAAAQAAAAEAAAABAAAAAQAA\r
+ AAEAAAABAAAAAQAAAAEAAAABAAAAAf/Ikf/3wo7/PUFD/zs/Qa8AAAABAAAAAQAAAAEAAAABAAAAAQAA\r
+ AAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAA\r
+ AAEAAAABAAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA\r
+ //8AAP//AAD//w==\r
+</value>\r
+ </data>\r
</root>
\ No newline at end of file
//\r
using System;\r
using System.Collections.Generic;\r
-using System.ComponentModel;\r
-using System.Configuration;\r
-using System.Data;\r
using System.Drawing;\r
using System.Text;\r
using System.Text.RegularExpressions;\r
using System.Timers;\r
+using System.Threading;\r
using System.Windows.Forms;\r
using System.Resources;\r
using System.IO;\r
using System.Web;\r
using Radegast.Netcom;\r
using OpenMetaverse;\r
-using OpenMetaverse.Imaging;\r
\r
namespace Radegast\r
{\r
\r
private void frmMain_FormClosing(object sender, FormClosingEventArgs e)\r
{\r
- if (debugLogForm != null) {\r
+ if (debugLogForm != null)\r
+ {\r
debugLogForm.Close();\r
debugLogForm = null;\r
}\r
worldMap.Close();\r
worldMap = null;\r
}\r
- \r
+\r
if (netcom.IsLoggedIn)\r
{\r
- client.Inventory.Store.SaveToDisk(instance.InventoryCacheFileName);\r
+ Thread saveInvToDisk = new Thread(new ThreadStart(\r
+ delegate()\r
+ {\r
+ client.Inventory.Store.SaveToDisk(instance.InventoryCacheFileName);\r
+ }));\r
+ saveInvToDisk.Name = "Save inventory to disk";\r
+ saveInvToDisk.Start();\r
+\r
netcom.Logout();\r
}\r
-\r
instance.Config.CurrentConfig.MainWindowState = (int)this.WindowState;\r
}\r
#endregion\r
#endregion\r
\r
#region Public methods\r
+\r
+ public void AddLogMessage(string msg, log4net.Core.Level level)\r
+ {\r
+ if (debugLogForm != null)\r
+ {\r
+ BeginInvoke(new MethodInvoker(delegate() { debugLogForm.AddLogMessage(msg, level); }));\r
+ }\r
+ }\r
+\r
public void processLink(string link)\r
{\r
if (!link.Contains("://"))\r
<appSettings>
</appSettings>
<log4net>
- <appender name="Console" type="Radegast.RadegastAppender">
+ <appender name="RadegastLog" type="Radegast.RadegastAppender">
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date{HH:mm:ss} [%level] - %message" />
</layout>
</appender>
<root>
- <level value="DEBUG" />
- <appender-ref ref="Console" />
+ <level value="ALL" />
+ <appender-ref ref="RadegastLog" />
</root>
</log4net>
</configuration>