Merge branch 'dev-v3-audit-style' into dev-v3

This commit is contained in:
Ima Mechanique 2013-07-16 14:04:50 +01:00
commit e08b64474d
28 changed files with 2524 additions and 2299 deletions

View file

@ -1,22 +1,60 @@
namespace LSLEditor namespace LSLEditor
{ {
partial class About /// <summary>
/// About dialogue box form.
/// </summary>
public partial class About
{ {
/// <summary> /// <summary>
/// Required designer variable. /// Required designer variable.
/// </summary> /// </summary>
private System.ComponentModel.IContainer components = null; private System.ComponentModel.IContainer components = null;
/// <summary>
/// Container for LSLife picture.
/// </summary>
private System.Windows.Forms.PictureBox pictureBox1;
/// <summary>
/// Container to hold all the elements.
/// </summary>
private System.Windows.Forms.GroupBox groupBox1;
/// <summary>
/// OK Button.
/// </summary>
private System.Windows.Forms.Button button1;
/// <summary>
/// Web Browser.
/// </summary>
private System.Windows.Forms.WebBrowser webBrowser1;
/// <summary>
/// Link label.
/// </summary>
private System.Windows.Forms.LinkLabel linkLabel1;
/// <summary>
/// Version label.
/// </summary>
private System.Windows.Forms.Label label1;
/// <summary>
/// LSL Editor label.
/// </summary>
private System.Windows.Forms.Label label2;
/// <summary> /// <summary>
/// Clean up any resources being used. /// Clean up any resources being used.
/// </summary> /// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> /// <param name="disposing">True if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing) protected override void Dispose(bool disposing)
{ {
if (disposing && (components != null)) if (disposing && (this.components != null)) {
{ this.components.Dispose();
components.Dispose();
} }
base.Dispose(disposing); base.Dispose(disposing);
} }
@ -133,13 +171,5 @@ namespace LSLEditor
} }
#endregion #endregion
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.WebBrowser webBrowser1;
private System.Windows.Forms.LinkLabel linkLabel1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
} }
} }

View file

@ -42,18 +42,23 @@
// ******** // ********
// */ // */
using System; using System;
using System.ComponentModel;
using System.IO; using System.IO;
using System.Reflection; using System.Reflection;
using System.ComponentModel;
using System.Windows.Forms; using System.Windows.Forms;
namespace LSLEditor namespace LSLEditor
{ {
/// <summary>About dialogue box form.</summary>
public partial class About : Form public partial class About : Form
{ {
/// <summary>
/// Initialises a new instance of the <see cref="About" /> class.
/// </summary>
/// <param name="parent">The parent form.</param>
public About(LSLEditorForm parent) public About(LSLEditorForm parent)
{ {
InitializeComponent(); this.InitializeComponent();
this.Icon = parent.Icon; this.Icon = parent.Icon;
@ -61,20 +66,35 @@ namespace LSLEditor
this.label2.Text = strVersion; this.label2.Text = strVersion;
} }
/// <summary>
/// OK/Close button.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void button1_Click(object sender, EventArgs e) private void button1_Click(object sender, EventArgs e)
{ {
this.Close(); this.Close();
} }
/// <summary>
/// Link to SourceForge page.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{ {
System.Diagnostics.Process.Start(Properties.Settings.Default.ContactUrl); System.Diagnostics.Process.Start(Properties.Settings.Default.ContactUrl);
} }
/// <summary>
/// Loads the page.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void About_Load(object sender, EventArgs e) private void About_Load(object sender, EventArgs e)
{ {
string strExeFileName = Path.GetFileName(Assembly.GetExecutingAssembly().CodeBase); string strExeFileName = Path.GetFileName(Assembly.GetExecutingAssembly().CodeBase);
this.webBrowser1.Navigate("res://" + strExeFileName + "/"+ Properties.Settings.Default.About); this.webBrowser1.Navigate("res://" + strExeFileName + "/" + Properties.Settings.Default.About);
} }
} }
} }

View file

@ -69,46 +69,37 @@ namespace LSLEditor
{ {
WebBrowser axWebBrowser1 = sender as WebBrowser; WebBrowser axWebBrowser1 = sender as WebBrowser;
ToolStripStatusLabel status = axWebBrowser1.Tag as ToolStripStatusLabel; ToolStripStatusLabel status = axWebBrowser1.Tag as ToolStripStatusLabel;
if (status == null) if (status != null) {
return; status.Text = axWebBrowser1.StatusText;
status.Text = axWebBrowser1.StatusText; }
} }
private void axWebBrowser1_Navigating(object sender, WebBrowserNavigatingEventArgs e) private void axWebBrowser1_Navigating(object sender, WebBrowserNavigatingEventArgs e)
{ {
string strUrl = e.Url.ToString(); string strUrl = e.Url.ToString();
if (strUrl.EndsWith(".lsl")) if (strUrl.EndsWith(".lsl")) {
{
e.Cancel = true; e.Cancel = true;
if (MessageBox.Show("Import LSL script?", "Import script", MessageBoxButtons.OKCancel) == DialogResult.Cancel) if (MessageBox.Show("Import LSL script?", "Import script", MessageBoxButtons.OKCancel) != DialogResult.Cancel) {
return; WebBrowser axWebBrowser1 = sender as WebBrowser;
axWebBrowser1.Stop();
WebBrowser axWebBrowser1 = sender as WebBrowser; this.lslEditorForm.OpenFile(strUrl, Guid.NewGuid());
axWebBrowser1.Stop(); }
this.lslEditorForm.OpenFile(strUrl,Guid.NewGuid());
} }
} }
public void ShowWebBrowser(string strTabName, string strUrl) public void ShowWebBrowser(string strTabName, string strUrl)
{ {
WebBrowser axWebBrowser1 = null; WebBrowser axWebBrowser1 = null;
try try {
{ if (!Properties.Settings.Default.HelpNewTab) {
if (!Properties.Settings.Default.HelpNewTab)
{
TabPage tabPage = this.tabControl1.TabPages[0]; TabPage tabPage = this.tabControl1.TabPages[0];
tabPage.Text = strTabName + " "; tabPage.Text = strTabName + " ";
axWebBrowser1 = tabPage.Controls[0] as WebBrowser; axWebBrowser1 = tabPage.Controls[0] as WebBrowser;
} }
} } catch { }
catch
{
}
if (axWebBrowser1 == null) if (axWebBrowser1 == null) {
{
TabPage tabPage = new TabPage(strTabName + " "); TabPage tabPage = new TabPage(strTabName + " ");
tabPage.BackColor = Color.White; tabPage.BackColor = Color.White;
@ -117,7 +108,7 @@ namespace LSLEditor
ToolStripStatusLabel toolStripStatusLabel1 = new ToolStripStatusLabel(); ToolStripStatusLabel toolStripStatusLabel1 = new ToolStripStatusLabel();
StatusStrip statusStrip1 = new StatusStrip(); StatusStrip statusStrip1 = new StatusStrip();
statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { toolStripStatusLabel1}); statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { toolStripStatusLabel1 });
statusStrip1.Location = new System.Drawing.Point(0, 318); statusStrip1.Location = new System.Drawing.Point(0, 318);
statusStrip1.Name = "statusStrip1"; statusStrip1.Name = "statusStrip1";
statusStrip1.Size = new System.Drawing.Size(584, 22); statusStrip1.Size = new System.Drawing.Size(584, 22);
@ -148,29 +139,26 @@ namespace LSLEditor
private void closeToolStripMenuItem_Click(object sender, EventArgs e) private void closeToolStripMenuItem_Click(object sender, EventArgs e)
{ {
int intTabToClose = (int)this.contextMenuStrip1.Tag; int intTabToClose = (int)this.contextMenuStrip1.Tag;
if (intTabToClose >= this.tabControl1.TabCount) if (intTabToClose < this.tabControl1.TabCount) {
return; this.tabControl1.TabPages.RemoveAt(intTabToClose);
this.tabControl1.TabPages.RemoveAt(intTabToClose); }
} }
private void tabControl1_MouseDown(object sender, MouseEventArgs e) private void tabControl1_MouseDown(object sender, MouseEventArgs e)
{ {
TabControl tabControl = sender as TabControl; TabControl tabControl = sender as TabControl;
if (tabControl == null) if (tabControl != null) {
return; if (e.Button == MouseButtons.Right) {
if (e.Button == MouseButtons.Right) for (int intI = 0; intI < tabControl.TabCount; intI++) {
{ Rectangle rt = tabControl.GetTabRect(intI);
for (int intI = 0; intI < tabControl.TabCount; intI++) if (e.X > rt.Left && e.X < rt.Right
{ && e.Y > rt.Top && e.Y < rt.Bottom) {
Rectangle rt = tabControl.GetTabRect(intI); this.contextMenuStrip1.Tag = intI;
if (e.X > rt.Left && e.X < rt.Right this.contextMenuStrip1.Show(this.tabControl1, new Point(e.X, e.Y));
&& e.Y > rt.Top && e.Y < rt.Bottom) }
{
this.contextMenuStrip1.Tag = intI;
this.contextMenuStrip1.Show(this.tabControl1, new Point(e.X, e.Y));
} }
} }
} }
} }
} }
} }

View file

@ -58,25 +58,21 @@ namespace LSLEditor
private string m_FullPathName; private string m_FullPathName;
private Guid m_Guid; private Guid m_Guid;
// private bool sOutline = true; // private bool sOutline = true;
public LSLEditorForm parent; public LSLEditorForm parent;
public Encoding encodedAs = null; public Encoding encodedAs = null;
private const int WM_NCACTIVATE = 0x0086; private const int WM_NCACTIVATE = 0x0086;
protected override void WndProc(ref Message m) protected override void WndProc(ref Message m)
{ {
if (m.Msg == WM_NCACTIVATE) if (m.Msg == WM_NCACTIVATE) {
{ if (m.LParam != IntPtr.Zero) {
if (m.LParam != IntPtr.Zero)
{
m.WParam = new IntPtr(1); m.WParam = new IntPtr(1);
} } else {
else
{
this.numberedTextBoxUC1.TextBox.MakeAllInvis(); this.numberedTextBoxUC1.TextBox.MakeAllInvis();
} }
} }
try { base.WndProc(ref m); } catch {} try { base.WndProc(ref m); } catch { }
} }
public SyntaxRichTextBox TextBox public SyntaxRichTextBox TextBox
@ -123,10 +119,11 @@ namespace LSLEditor
} }
set set
{ {
if(value) if (value) {
this.tabPage1.Text = "Script"; this.tabPage1.Text = "Script";
else } else {
this.tabPage1.Text = "Text"; this.tabPage1.Text = "Text";
}
this.TextBox.ToolTipping = value; this.TextBox.ToolTipping = value;
} }
} }
@ -141,7 +138,7 @@ namespace LSLEditor
this.Icon = lslEditorForm.Icon; this.Icon = lslEditorForm.Icon;
this.parent = lslEditorForm; this.parent = lslEditorForm;
this.numberedTextBoxUC1.TextBox.setEditform(this); this.numberedTextBoxUC1.TextBox.setEditform(this);
this.numberedTextBoxUC1.TextBox.Init(this.parent, this.parent.ConfLSL); this.numberedTextBoxUC1.TextBox.Init(this.parent, this.parent.ConfLSL);
this.numberedTextBoxUC1.TextBox.OnDirtyChanged += new IsDirtyHandler(TextBox_OnDirtyChanged); this.numberedTextBoxUC1.TextBox.OnDirtyChanged += new IsDirtyHandler(TextBox_OnDirtyChanged);
@ -149,25 +146,22 @@ namespace LSLEditor
this.Resize += new EventHandler(EditForm_Position); this.Resize += new EventHandler(EditForm_Position);
this.Layout += new LayoutEventHandler(EditForm_Layout); this.Layout += new LayoutEventHandler(EditForm_Layout);
ImageList imageList = new ImageList(); ImageList imageList = new ImageList();
imageList.Images.Add(new Bitmap(this.GetType(), "Images.Unknown.gif")); imageList.Images.Add(new Bitmap(this.GetType(), "Images.Unknown.gif"));
imageList.Images.Add(new Bitmap(this.GetType(), "Images.Functions.gif")); imageList.Images.Add(new Bitmap(this.GetType(), "Images.Functions.gif"));
imageList.Images.Add(new Bitmap(this.GetType(), "Images.Events.gif")); imageList.Images.Add(new Bitmap(this.GetType(), "Images.Events.gif"));
imageList.Images.Add(new Bitmap(this.GetType(), "Images.Constants.gif")); imageList.Images.Add(new Bitmap(this.GetType(), "Images.Constants.gif"));
imageList.Images.Add(new Bitmap(this.GetType(), "Images.Class.gif")); imageList.Images.Add(new Bitmap(this.GetType(), "Images.Class.gif"));
imageList.Images.Add(new Bitmap(this.GetType(), "Images.Vars.gif")); imageList.Images.Add(new Bitmap(this.GetType(), "Images.Vars.gif"));
imageList.Images.Add(new Bitmap(this.GetType(), "Images.Properties.gif")); imageList.Images.Add(new Bitmap(this.GetType(), "Images.Properties.gif"));
imageList.Images.Add(new Bitmap(this.GetType(), "Images.States.gif")); imageList.Images.Add(new Bitmap(this.GetType(), "Images.States.gif"));
this.tvOutline.ImageList = imageList; this.tvOutline.ImageList = imageList;
if (lslEditorForm.outlineToolStripMenuItem.Checked) if (lslEditorForm.outlineToolStripMenuItem.Checked) {
{ splitContainer1.Panel2Collapsed = false;
splitContainer1.Panel2Collapsed = false; } else {
} splitContainer1.Panel2Collapsed = true;
else }
{
splitContainer1.Panel2Collapsed = true;
}
SetFont(); SetFont();
} }
@ -178,8 +172,9 @@ namespace LSLEditor
void EditForm_Layout(object sender, LayoutEventArgs e) void EditForm_Layout(object sender, LayoutEventArgs e)
{ {
if (this.WindowState == FormWindowState.Minimized) if (this.WindowState == FormWindowState.Minimized) {
this.numberedTextBoxUC1.TextBox.MakeAllInvis(); this.numberedTextBoxUC1.TextBox.MakeAllInvis();
}
} }
void EditForm_Position(object sender, EventArgs e) void EditForm_Position(object sender, EventArgs e)
@ -190,16 +185,18 @@ namespace LSLEditor
void TextBox_OnDirtyChanged(object sender, EventArgs e) void TextBox_OnDirtyChanged(object sender, EventArgs e)
{ {
this.Text = this.ScriptName; this.Text = this.ScriptName;
if (this.numberedTextBoxUC1.TextBox.Dirty) if (this.numberedTextBoxUC1.TextBox.Dirty) {
this.Text = this.Text.Trim()+"* "; this.Text = this.Text.Trim() + "* ";
else } else {
this.Text = this.Text.Trim()+" "; this.Text = this.Text.Trim() + " ";
}
TabPage tabPage = this.Tag as TabPage; TabPage tabPage = this.Tag as TabPage;
if (tabPage != null) if (tabPage != null) {
tabPage.Text = this.Text; tabPage.Text = this.Text;
}
this.parent.OnDirtyChanged(this.numberedTextBoxUC1.TextBox.Dirty); this.parent.OnDirtyChanged(this.numberedTextBoxUC1.TextBox.Dirty);
} }
private void exitToolStripMenuItem_Click(object sender, EventArgs e) private void exitToolStripMenuItem_Click(object sender, EventArgs e)
{ {
@ -216,20 +213,19 @@ namespace LSLEditor
{ {
this.m_FullPathName = value; this.m_FullPathName = value;
string strDirectory = Path.GetDirectoryName(this.m_FullPathName); string strDirectory = Path.GetDirectoryName(this.m_FullPathName);
if (Directory.Exists(strDirectory)) if (Directory.Exists(strDirectory)) {
{
Properties.Settings.Default.WorkingDirectory = strDirectory; Properties.Settings.Default.WorkingDirectory = strDirectory;
} } else {
else if (!Directory.Exists(Properties.Settings.Default.WorkingDirectory)) {
{
if(!Directory.Exists(Properties.Settings.Default.WorkingDirectory))
Properties.Settings.Default.WorkingDirectory = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); Properties.Settings.Default.WorkingDirectory = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
}
this.m_FullPathName = Path.Combine(Properties.Settings.Default.WorkingDirectory, this.m_FullPathName); this.m_FullPathName = Path.Combine(Properties.Settings.Default.WorkingDirectory, this.m_FullPathName);
} }
this.Text = this.ScriptName; this.Text = this.ScriptName;
TabPage tabPage = this.Tag as TabPage; TabPage tabPage = this.Tag as TabPage;
if (tabPage != null) if (tabPage != null) {
tabPage.Text = this.Text + " "; tabPage.Text = this.Text + " ";
}
} }
} }
@ -263,53 +259,50 @@ namespace LSLEditor
private int PercentageIndentTab() private int PercentageIndentTab()
{ {
int intResult;
int intSpaces = 0; int intSpaces = 0;
int intTabs = 0; int intTabs = 0;
StringReader sr = new StringReader(this.TextBox.Text); StringReader sr = new StringReader(this.TextBox.Text);
while (true) while (true) {
{
string strLine = sr.ReadLine(); string strLine = sr.ReadLine();
if (strLine == null) if (strLine == null) break;
break; if (strLine.Length == 0) continue;
if (strLine.Length == 0) if (strLine[0] == ' ') {
continue;
if (strLine[0] == ' ')
intSpaces++; intSpaces++;
else if (strLine[0] == '\t') } else if (strLine[0] == '\t') {
intTabs++; intTabs++;
}
} }
if (intTabs == 0 && intSpaces==0) if (intTabs == 0 && intSpaces == 0) {
return 50; intResult = 50;
return (int)Math.Round((100.0 * intTabs) / (intTabs + intSpaces)); } else {
intResult = (int)Math.Round((100.0 * intTabs) / (intTabs + intSpaces));
}
return intResult;
} }
public void LoadFile(string strPath) public void LoadFile(string strPath)
{ {
if(strPath.StartsWith("http://")) if (strPath.StartsWith("http://")) {
this.FullPathName = Path.GetFileName(strPath); this.FullPathName = Path.GetFileName(strPath);
else } else {
this.FullPathName = strPath; this.FullPathName = strPath;
}
this.encodedAs = this.numberedTextBoxUC1.TextBox.LoadFile(strPath); this.encodedAs = this.numberedTextBoxUC1.TextBox.LoadFile(strPath);
if (!this.IsScript) if (this.IsScript) {
return;
if (Properties.Settings.Default.IndentAutoCorrect) if (Properties.Settings.Default.IndentAutoCorrect) {
{ this.TextBox.FormatDocument();
this.TextBox.FormatDocument(); this.TextBox.ClearUndoStack();
this.TextBox.ClearUndoStack(); } else {
} if (Properties.Settings.Default.IndentWarning) {
else if ((PercentageIndentTab() > 50 && Properties.Settings.Default.SL4SpacesIndent) ||
{ (PercentageIndentTab() < 50 && !Properties.Settings.Default.SL4SpacesIndent)) {
if (Properties.Settings.Default.IndentWarning) if (MessageBox.Show("Indent scheme differs from settings\nDo you want to correct it?\nIt can also be corrected by pressing Ctrl-D or turn on Autocorrection (tools menu)", "Indent Warning!!", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == DialogResult.OK) {
{ this.TextBox.FormatDocument();
if ((PercentageIndentTab() > 50 && Properties.Settings.Default.SL4SpacesIndent) || //this.TextBox.ClearUndoStack();
(PercentageIndentTab() < 50 && !Properties.Settings.Default.SL4SpacesIndent)) }
{
if (MessageBox.Show("Indent scheme differs from settings\nDo you want to correct it?\nIt can also be corrected by pressing Ctrl-D or turn on Autocorrection (tools menu)", "Indent Warning!!", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == DialogResult.OK)
{
this.TextBox.FormatDocument();
//this.TextBox.ClearUndoStack();
} }
} }
} }
@ -319,32 +312,28 @@ namespace LSLEditor
public void SaveCurrentFile(string strPath) public void SaveCurrentFile(string strPath)
{ {
this.FullPathName = strPath; this.FullPathName = strPath;
Encoding encodeAs = this.encodedAs; Encoding encodeAs = this.encodedAs;
if (this.IsScript && encodeAs == null) if (this.IsScript && encodeAs == null) {
{ switch (Properties.Settings.Default.OutputFormat) {
switch (Properties.Settings.Default.OutputFormat) case "UTF8":
{ encodeAs = Encoding.UTF8;
case "UTF8": break;
encodeAs = Encoding.UTF8; case "Unicode":
break; encodeAs = Encoding.Unicode;
case "Unicode": break;
encodeAs = Encoding.Unicode; case "BigEndianUnicode":
break; encodeAs = Encoding.BigEndianUnicode;
case "BigEndianUnicode": break;
encodeAs = Encoding.BigEndianUnicode; default:
break; encodeAs = Encoding.Default;
default: break;
encodeAs = Encoding.Default; }
break; } else if (encodeAs == null) {
} encodeAs = Encoding.UTF8;
} }
else if (encodeAs == null)
{
encodeAs = Encoding.UTF8;
}
this.numberedTextBoxUC1.TextBox.SaveCurrentFile(strPath, encodeAs); this.numberedTextBoxUC1.TextBox.SaveCurrentFile(strPath, encodeAs);
this.encodedAs = encodeAs; this.encodedAs = encodeAs;
} }
public void SaveCurrentFile() public void SaveCurrentFile()
@ -381,16 +370,15 @@ namespace LSLEditor
{ {
this.numberedTextBoxUC1.TextBox.MakeAllInvis(); this.numberedTextBoxUC1.TextBox.MakeAllInvis();
if (runtime != null) if (runtime != null) {
{
this.components.Remove(runtime); this.components.Remove(runtime);
if (!runtime.IsDisposed) if (!runtime.IsDisposed) {
runtime.Dispose(); runtime.Dispose();
}
runtime = null; runtime = null;
} }
for (int intI = this.tabControl1.TabPages.Count - 1; intI > 0; intI--) for (int intI = this.tabControl1.TabPages.Count - 1; intI > 0; intI--) {
{
this.tabControl1.TabPages.RemoveAt(intI); this.tabControl1.TabPages.RemoveAt(intI);
} }
} }
@ -400,65 +388,62 @@ namespace LSLEditor
public bool StartCompiler() public bool StartCompiler()
{ {
bool blnResult = false;
//if (this.disableCompilesyntaxCheckToolStripMenuItem.Checked) //if (this.disableCompilesyntaxCheckToolStripMenuItem.Checked)
// return false; // return false;
if (!this.IsScript) if (this.IsScript) {
return false; StopCompiler();
StopCompiler(); if (this.parent != null) {
runtime = new RuntimeConsole(this.parent);
if (this.parent == null) // for disposing
return false; this.components.Add(runtime);
runtime = new RuntimeConsole(this.parent); if (!runtime.Compile(this)) {
this.tabControl1.SelectedIndex = 0;
return false;
}
// for disposing TabPage tabPage = new TabPage("Debug");
this.components.Add(runtime); tabPage.Controls.Add(runtime);
this.tabControl1.TabPages.Add(tabPage);
if (!runtime.Compile(this)) this.tabControl1.SelectedIndex = 1;
{ blnResult = true;
this.tabControl1.SelectedIndex = 0; }
return false;
} }
return blnResult;
TabPage tabPage = new TabPage("Debug");
tabPage.Controls.Add(runtime);
this.tabControl1.TabPages.Add(tabPage);
this.tabControl1.SelectedIndex = 1;
return true;
} }
public bool SyntaxCheck() public bool SyntaxCheck()
{ {
bool blnResult = false;
//if (this.disableCompilesyntaxCheckToolStripMenuItem.Checked) //if (this.disableCompilesyntaxCheckToolStripMenuItem.Checked)
// return false; // return false;
if (!this.IsScript) if (this.IsScript) {
return false; LSL2CSharp translator = new LSL2CSharp(ConfLSL);
string strCSharp = translator.Parse(SourceCode);
LSL2CSharp translator = new LSL2CSharp(ConfLSL); if (System.Diagnostics.Debugger.IsAttached) {
string strCSharp = translator.Parse(SourceCode); for (int intI = this.tabControl1.TabPages.Count - 1; intI > 0; intI--) {
this.tabControl1.TabPages.RemoveAt(intI);
}
if (System.Diagnostics.Debugger.IsAttached) // TODO
{ TabPage tabPage = new TabPage("C#");
for (int intI = this.tabControl1.TabPages.Count - 1; intI > 0; intI--) NumberedTextBox.NumberedTextBoxUC numberedTextBoxUC1 = new NumberedTextBox.NumberedTextBoxUC();
{ numberedTextBoxUC1.TextBox.Init(null, this.ConfCSharp);
this.tabControl1.TabPages.RemoveAt(intI); numberedTextBoxUC1.TextBox.Text = strCSharp;
numberedTextBoxUC1.TextBox.ReadOnly = true;
numberedTextBoxUC1.Dock = DockStyle.Fill;
tabPage.Controls.Add(numberedTextBoxUC1);
this.tabControl.TabPages.Add(tabPage);
} }
blnResult = (null != CompilerHelper.CompileCSharp(this, strCSharp));
// TODO
TabPage tabPage = new TabPage("C#");
NumberedTextBox.NumberedTextBoxUC numberedTextBoxUC1 = new NumberedTextBox.NumberedTextBoxUC();
numberedTextBoxUC1.TextBox.Init(null, this.ConfCSharp);
numberedTextBoxUC1.TextBox.Text = strCSharp;
numberedTextBoxUC1.TextBox.ReadOnly = true;
numberedTextBoxUC1.Dock = DockStyle.Fill;
tabPage.Controls.Add(numberedTextBoxUC1);
this.tabControl.TabPages.Add(tabPage);
} }
return blnResult;
return (null != CompilerHelper.CompileCSharp(this, strCSharp));
} }
public int Find(string strSearch, int intStart, int intEnd, RichTextBoxFinds options) public int Find(string strSearch, int intStart, int intEnd, RichTextBoxFinds options)
@ -476,13 +461,13 @@ namespace LSLEditor
private void EditForm_FormClosing(object sender, FormClosingEventArgs e) private void EditForm_FormClosing(object sender, FormClosingEventArgs e)
{ {
this.parent.CancelClosing = false; this.parent.CancelClosing = false;
if (this.Dirty) if (this.Dirty) {
{
DialogResult dialogResult = MessageBox.Show(this, @"Save """ + this.ScriptName + @"""?", "File has changed", MessageBoxButtons.YesNoCancel); DialogResult dialogResult = MessageBox.Show(this, @"Save """ + this.ScriptName + @"""?", "File has changed", MessageBoxButtons.YesNoCancel);
if (dialogResult == DialogResult.Yes) if (dialogResult == DialogResult.Yes) {
e.Cancel = !this.parent.SaveFile(this,false); e.Cancel = !this.parent.SaveFile(this, false);
else } else {
e.Cancel = (dialogResult == DialogResult.Cancel); e.Cancel = (dialogResult == DialogResult.Cancel);
}
} }
this.parent.CancelClosing = e.Cancel; this.parent.CancelClosing = e.Cancel;
} }
@ -492,44 +477,42 @@ namespace LSLEditor
//this.disableCompilesyntaxCheckToolStripMenuItem.Checked = !this.disableCompilesyntaxCheckToolStripMenuItem.Checked; //this.disableCompilesyntaxCheckToolStripMenuItem.Checked = !this.disableCompilesyntaxCheckToolStripMenuItem.Checked;
} }
private void tvOutline_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) private void tvOutline_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
{ {
this.parent.BeginInvoke(new TreeNodeMouseClickEventHandler( this.parent.BeginInvoke(new TreeNodeMouseClickEventHandler(
delegate(object sender2, TreeNodeMouseClickEventArgs e2) delegate(object sender2, TreeNodeMouseClickEventArgs e2)
{ {
if (e.Node.Tag is Helpers.OutlineHelper) if (e.Node.Tag is Helpers.OutlineHelper) {
{ Helpers.OutlineHelper ohOutline = (Helpers.OutlineHelper)e.Node.Tag;
Helpers.OutlineHelper ohOutline = (Helpers.OutlineHelper)e.Node.Tag; if (ohOutline.line < this.TextBox.Lines.Length) {
if (ohOutline.line < this.TextBox.Lines.Length) //editForm.Focus();
{ //editForm.TextBox.Select();
//editForm.Focus(); //editForm.TextBox.Goto(ohOutline.line + 1);
//editForm.TextBox.Select();
//editForm.TextBox.Goto(ohOutline.line + 1);
//TextBox.Focus(); //TextBox.Focus();
this.TextBox.Select(); this.TextBox.Select();
this.TextBox.SelectionStart = this.TextBox.GetFirstCharIndexFromLine(ohOutline.line); this.TextBox.SelectionStart = this.TextBox.GetFirstCharIndexFromLine(ohOutline.line);
}
}
}), sender, e);
}
private void tvOutline_AfterSelect(object sender, TreeViewEventArgs e) }
{ }
}), sender, e);
//this.TextBox.Select }
}
private void splitContainer1_Click(object sender, EventArgs e) private void tvOutline_AfterSelect(object sender, TreeViewEventArgs e)
{ {
} //this.TextBox.Select
}
private void tvOutline_VisibleChanged(object sender, EventArgs e) private void splitContainer1_Click(object sender, EventArgs e)
{ {
this.tvOutline.ExpandAll();
} }
private void tvOutline_VisibleChanged(object sender, EventArgs e)
{
this.tvOutline.ExpandAll();
}
} }
} }

View file

@ -89,14 +89,12 @@ namespace LSLEditor
set set
{ {
this.label1.Text = ""; // clear out message this.label1.Text = ""; // clear out message
if (value != "") if (value != "") {
{
this.comboBoxFind.Text = value; this.comboBoxFind.Text = value;
} } else {
else if (this.comboBoxFind.Items.Count > 0) {
{
if (this.comboBoxFind.Items.Count > 0)
this.comboBoxFind.SelectedIndex = this.comboBoxFind.Items.Count - 1; this.comboBoxFind.SelectedIndex = this.comboBoxFind.Items.Count - 1;
}
} }
} }
} }
@ -106,17 +104,16 @@ namespace LSLEditor
string strText = comboBox.Text; string strText = comboBox.Text;
bool Found = false; bool Found = false;
foreach (string strC in comboBox.Items) foreach (string strC in comboBox.Items) {
{ if (strC == strText) {
if (strC == strText)
{
Found = true; Found = true;
break; break;
} }
} }
if (!Found) if (!Found) {
comboBox.Items.Add(strText); comboBox.Items.Add(strText);
}
return Found; return Found;
} }
@ -124,40 +121,35 @@ namespace LSLEditor
{ {
this.label1.Text = ""; this.label1.Text = "";
EditForm editForm = this.lslEditForm.ActiveMdiForm as EditForm; EditForm editForm = this.lslEditForm.ActiveMdiForm as EditForm;
if (editForm == null) if (editForm != null) {
return; if (!UpdateComboBox(this.comboBoxFind)) {
editForm.TextBox.SelectionLength = 0;
editForm.TextBox.SelectionStart = 0;
}
if (!UpdateComboBox(this.comboBoxFind)) RichTextBoxFinds options = RichTextBoxFinds.None;
{
editForm.TextBox.SelectionLength = 0;
editForm.TextBox.SelectionStart = 0;
}
RichTextBoxFinds options = RichTextBoxFinds.None; if (this.checkBoxMatchCase.Checked) options |= RichTextBoxFinds.MatchCase;
if (this.checkBoxReverse.Checked) options |= RichTextBoxFinds.Reverse;
if (this.checkBoxWholeWord.Checked) options |= RichTextBoxFinds.WholeWord;
if (this.checkBoxMatchCase.Checked) options |= RichTextBoxFinds.MatchCase; if (this.checkBoxReverse.Checked) {
if (this.checkBoxReverse.Checked) options |= RichTextBoxFinds.Reverse; intStart = 0; // start cant change ;-)
if (this.checkBoxWholeWord.Checked) options |= RichTextBoxFinds.WholeWord; intEnd = editForm.TextBox.SelectionStart;
} else {
intStart = editForm.TextBox.SelectionStart + editForm.TextBox.SelectionLength;
if (intStart == editForm.TextBox.Text.Length) {
intStart = 0;
}
intEnd = editForm.TextBox.Text.Length - 1; // length can change!!
}
if (this.checkBoxReverse.Checked) string strFind = this.comboBoxFind.Text;
{ int intIndex = editForm.Find(strFind, intStart, intEnd, options);
intStart = 0; // start cant change ;-) if (intIndex < 0) {
intEnd = editForm.TextBox.SelectionStart; this.label1.Text = "Not found...";
} return;
else }
{
intStart = editForm.TextBox.SelectionStart + editForm.TextBox.SelectionLength;
if (intStart == editForm.TextBox.Text.Length)
intStart = 0;
intEnd = editForm.TextBox.Text.Length - 1; // length can change!!
}
string strFind = this.comboBoxFind.Text;
int intIndex = editForm.Find(strFind, intStart, intEnd, options);
if (intIndex < 0)
{
this.label1.Text = "Not found...";
return;
} }
} }
@ -169,15 +161,11 @@ namespace LSLEditor
private void comboBoxFind_KeyDown(object sender, KeyEventArgs e) private void comboBoxFind_KeyDown(object sender, KeyEventArgs e)
{ {
if (e.KeyCode == Keys.Return) if (e.KeyCode == Keys.Return) {
{ if (this.Replace.Enabled) {
if (this.Replace.Enabled)
{
this.comboBoxReplace.Focus(); this.comboBoxReplace.Focus();
e.SuppressKeyPress = true; e.SuppressKeyPress = true;
} } else {
else
{
Find(); Find();
e.SuppressKeyPress = true; e.SuppressKeyPress = true;
} }
@ -187,30 +175,26 @@ namespace LSLEditor
private void Replace_Click(object sender, EventArgs e) private void Replace_Click(object sender, EventArgs e)
{ {
EditForm editForm = this.lslEditForm.ActiveMdiForm as EditForm; EditForm editForm = this.lslEditForm.ActiveMdiForm as EditForm;
if (editForm == null) if (editForm != null) {
return; UpdateComboBox(this.comboBoxReplace);
UpdateComboBox(this.comboBoxReplace); if (editForm.TextBox.SelectionLength > 0) {
string strReplacement = this.comboBoxReplace.Text;
editForm.TextBox.ReplaceSelectedText(strReplacement);
}
if (editForm.TextBox.SelectionLength > 0) Find();
{ this.Focus();
string strReplacement = this.comboBoxReplace.Text;
editForm.TextBox.ReplaceSelectedText(strReplacement);
} }
Find();
this.Focus();
} }
// WildCardToRegex not used!! // WildCardToRegex not used!!
private string WildCardToRegex(string strWildCard) private string WildCardToRegex(string strWildCard)
{ {
StringBuilder sb = new StringBuilder(strWildCard.Length + 8); StringBuilder sb = new StringBuilder(strWildCard.Length + 8);
for (int intI = 0; intI < strWildCard.Length; intI++) for (int intI = 0; intI < strWildCard.Length; intI++) {
{
char chrC = strWildCard[intI]; char chrC = strWildCard[intI];
switch (chrC) switch (chrC) {
{
case '*': case '*':
sb.Append(".*"); sb.Append(".*");
break; break;
@ -233,42 +217,41 @@ namespace LSLEditor
private void ReplaceAll_Click(object sender, EventArgs e) private void ReplaceAll_Click(object sender, EventArgs e)
{ {
EditForm editForm = this.lslEditForm.ActiveMdiForm as EditForm; EditForm editForm = this.lslEditForm.ActiveMdiForm as EditForm;
if (editForm == null) if (editForm == null) {
return; UpdateComboBox(this.comboBoxReplace);
UpdateComboBox(this.comboBoxReplace); string strPattern;
string strFind = Regex.Escape(this.comboBoxFind.Text);
string strReplacement = this.comboBoxReplace.Text;
string strSourceCode = editForm.SourceCode;
string strPattern; RegexOptions regexOptions = RegexOptions.Compiled;
string strFind = Regex.Escape(this.comboBoxFind.Text); if (!this.checkBoxMatchCase.Checked) {
string strReplacement = this.comboBoxReplace.Text; regexOptions |= RegexOptions.IgnoreCase;
string strSourceCode = editForm.SourceCode; }
if (this.checkBoxWholeWord.Checked) {
strPattern = @"\b" + strFind + @"\b";
} else {
strPattern = strFind;
}
RegexOptions regexOptions = RegexOptions.Compiled; Regex regex = new Regex(strPattern, regexOptions);
if (!this.checkBoxMatchCase.Checked)
regexOptions |= RegexOptions.IgnoreCase;
if (this.checkBoxWholeWord.Checked)
strPattern = @"\b" + strFind + @"\b";
else
strPattern = strFind;
Regex regex = new Regex(strPattern, regexOptions); int intCount = 0;
foreach (Match m in regex.Matches(strSourceCode)) {
int intCount = 0; if (m.Value.Length > 0) {
foreach(Match m in regex.Matches(strSourceCode)) intCount++;
{ }
if (m.Value.Length > 0) }
intCount++; if (intCount == 0) {
MessageBox.Show("No matches found");
} else {
if (MessageBox.Show("There are " + intCount + " occurences, replace them all?", "Find and Replace", MessageBoxButtons.YesNoCancel) == DialogResult.Yes) {
editForm.SourceCode = regex.Replace(strSourceCode, strReplacement);
}
}
this.Focus();
} }
if (intCount == 0)
{
MessageBox.Show("No matches found");
}
else
{
if (MessageBox.Show("There are " + intCount + " occurences, replace them all?", "Find and Replace", MessageBoxButtons.YesNoCancel) == DialogResult.Yes)
editForm.SourceCode = regex.Replace(strSourceCode, strReplacement);
}
this.Focus();
} }
private void FindWindow_FormClosing(object sender, FormClosingEventArgs e) private void FindWindow_FormClosing(object sender, FormClosingEventArgs e)
@ -281,22 +264,19 @@ namespace LSLEditor
private void FindWindow_KeyDown(object sender, KeyEventArgs e) private void FindWindow_KeyDown(object sender, KeyEventArgs e)
{ {
if (e.KeyData == Keys.Escape) if (e.KeyData == Keys.Escape) {
{
this.Visible = false; this.Visible = false;
e.SuppressKeyPress = true; e.SuppressKeyPress = true;
e.Handled = true; e.Handled = true;
} }
if (e.KeyCode == Keys.Return) if (e.KeyCode == Keys.Return) {
{
Find(); Find();
e.SuppressKeyPress = true; e.SuppressKeyPress = true;
this.Focus(); this.Focus();
} }
if (e.KeyCode == Keys.F3) if (e.KeyCode == Keys.F3) {
{
Find(); Find();
e.SuppressKeyPress = true; e.SuppressKeyPress = true;
this.Focus(); this.Focus();
@ -309,7 +289,5 @@ namespace LSLEditor
{ {
this.comboBoxFind.Focus(); this.comboBoxFind.Focus();
} }
} }
} }

View file

@ -56,7 +56,7 @@ namespace LSLEditor
this.lslEditForm = lslEditForm; this.lslEditForm = lslEditForm;
EditForm editForm = this.lslEditForm.ActiveMdiForm as EditForm; EditForm editForm = this.lslEditForm.ActiveMdiForm as EditForm;
this.label1.Text = "Line number (1-"+editForm.TextBox.Lines.Length+")"; this.label1.Text = "Line number (1-" + editForm.TextBox.Lines.Length + ")";
} }
private void button1_Click(object sender, EventArgs e) private void button1_Click(object sender, EventArgs e)
@ -67,16 +67,12 @@ namespace LSLEditor
private void Goto() private void Goto()
{ {
EditForm editForm = this.lslEditForm.ActiveMdiForm as EditForm; EditForm editForm = this.lslEditForm.ActiveMdiForm as EditForm;
if (editForm == null) if (editForm != null) {
return; try {
try int intLine = Convert.ToInt32(this.textBox1.Text);
{ editForm.TextBox.Goto(intLine);
int intLine = Convert.ToInt32(this.textBox1.Text); this.Close();
editForm.TextBox.Goto(intLine); } catch { }
this.Close();
}
catch
{
} }
} }
@ -87,12 +83,11 @@ namespace LSLEditor
private void textBox1_KeyDown(object sender, KeyEventArgs e) private void textBox1_KeyDown(object sender, KeyEventArgs e)
{ {
if (e.KeyCode == Keys.Return) if (e.KeyCode == Keys.Return) {
{
Goto(); Goto();
e.SuppressKeyPress = true; e.SuppressKeyPress = true;
} }
} }
} }
} }

File diff suppressed because it is too large Load diff

View file

@ -72,28 +72,35 @@ namespace LSLEditor
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
if ((intPermissions & SecondLife.PERMISSION_DEBIT) == SecondLife.PERMISSION_DEBIT) if ((intPermissions & SecondLife.PERMISSION_DEBIT) == SecondLife.PERMISSION_DEBIT) {
sb.AppendLine("Take Linden dollars (L$) from you"); sb.AppendLine("Take Linden dollars (L$) from you");
}
if ((intPermissions & SecondLife.PERMISSION_TAKE_CONTROLS) == SecondLife.PERMISSION_TAKE_CONTROLS) if ((intPermissions & SecondLife.PERMISSION_TAKE_CONTROLS) == SecondLife.PERMISSION_TAKE_CONTROLS) {
sb.AppendLine("Act on your control inputs"); sb.AppendLine("Act on your control inputs");
}
if ((intPermissions & SecondLife.PERMISSION_TRIGGER_ANIMATION) == SecondLife.PERMISSION_TRIGGER_ANIMATION) if ((intPermissions & SecondLife.PERMISSION_TRIGGER_ANIMATION) == SecondLife.PERMISSION_TRIGGER_ANIMATION) {
sb.AppendLine("Animate your avatar"); sb.AppendLine("Animate your avatar");
}
if ((intPermissions & SecondLife.PERMISSION_ATTACH) == SecondLife.PERMISSION_ATTACH) if ((intPermissions & SecondLife.PERMISSION_ATTACH) == SecondLife.PERMISSION_ATTACH) {
sb.AppendLine("Attach to your avatar"); sb.AppendLine("Attach to your avatar");
}
if ((intPermissions & SecondLife.PERMISSION_CHANGE_LINKS) == SecondLife.PERMISSION_CHANGE_LINKS) if ((intPermissions & SecondLife.PERMISSION_CHANGE_LINKS) == SecondLife.PERMISSION_CHANGE_LINKS) {
sb.AppendLine("Link and delink from other objects"); sb.AppendLine("Link and delink from other objects");
}
if ((intPermissions & SecondLife.PERMISSION_TRACK_CAMERA) == SecondLife.PERMISSION_TRACK_CAMERA) if ((intPermissions & SecondLife.PERMISSION_TRACK_CAMERA) == SecondLife.PERMISSION_TRACK_CAMERA) {
sb.AppendLine("Track your camera"); sb.AppendLine("Track your camera");
}
if ((intPermissions & SecondLife.PERMISSION_CONTROL_CAMERA) == SecondLife.PERMISSION_CONTROL_CAMERA) if ((intPermissions & SecondLife.PERMISSION_CONTROL_CAMERA) == SecondLife.PERMISSION_CONTROL_CAMERA) {
sb.AppendLine("Control your camera"); sb.AppendLine("Control your camera");
}
this.label1.Text = "'"+strObjectName+"', an object owned by '"+strOwner + "',\nwould like to:"; this.label1.Text = "'" + strObjectName + "', an object owned by '" + strOwner + "',\nwould like to:";
this.label2.Text = sb.ToString(); this.label2.Text = sb.ToString();
} }
@ -109,4 +116,4 @@ namespace LSLEditor
this.Close(); this.Close();
} }
} }
} }

View file

@ -70,7 +70,7 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Revision and Build Numbers // You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// We use a Major.Minor.Bugfix.Build pattern. // We use a Major.Minor.Bugfix.Build pattern.
[assembly: AssemblyVersion("2.999.999.7")] [assembly: AssemblyVersion("2.999.999.117")]
// //
// In order to sign your assembly you must specify a key to use. Refer to the // In order to sign your assembly you must specify a key to use. Refer to the
@ -100,4 +100,4 @@ using System.Runtime.InteropServices;
[assembly: AssemblyDelaySign(false)] [assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyName("")] //[assembly: AssemblyKeyName("")]
[assembly: ComVisibleAttribute(false)] [assembly: ComVisibleAttribute(false)]
[assembly: AssemblyFileVersionAttribute("2.999.999.7")] [assembly: AssemblyFileVersionAttribute("2.999.999.117")]

View file

@ -74,27 +74,29 @@ namespace LSLEditor
private bool GetNewHost() private bool GetNewHost()
{ {
bool blnResult = false;
Assembly assembly = CompilerHelper.CompileCSharp(editForm, CSharpCode); Assembly assembly = CompilerHelper.CompileCSharp(editForm, CSharpCode);
if (assembly == null) if (assembly != null) {
return false; if (SecondLifeHost != null) {
SecondLifeHost.Dispose();
}
SecondLifeHost = null;
if(SecondLifeHost!=null) SecondLifeHost = new SecondLifeHost(this.mainForm, assembly, editForm.FullPathName, editForm.guid);
SecondLifeHost.Dispose(); SecondLifeHost.OnChat += editForm.ChatHandler;
SecondLifeHost = null; SecondLifeHost.OnMessageLinked += editForm.MessageLinkedHandler;
SecondLifeHost.OnDie += new EventHandler(host_OnDie);
SecondLifeHost.OnReset += new EventHandler(SecondLifeHost_OnReset);
SecondLifeHost.OnListenChannelsChanged += new EventHandler(SecondLifeHost_OnListenChannelsChanged);
SecondLifeHost = new SecondLifeHost(this.mainForm, assembly, editForm.FullPathName, editForm.guid); SecondLifeHost.OnVerboseMessage += new SecondLifeHost.SecondLifeHostMessageHandler(host_OnVerboseMessage);
SecondLifeHost.OnChat += editForm.ChatHandler; SecondLifeHost.OnStateChange += new SecondLifeHost.SecondLifeHostMessageHandler(host_OnStateChange);
SecondLifeHost.OnMessageLinked += editForm.MessageLinkedHandler;
SecondLifeHost.OnDie += new EventHandler(host_OnDie);
SecondLifeHost.OnReset += new EventHandler(SecondLifeHost_OnReset);
SecondLifeHost.OnListenChannelsChanged += new EventHandler(SecondLifeHost_OnListenChannelsChanged);
SecondLifeHost.OnVerboseMessage += new SecondLifeHost.SecondLifeHostMessageHandler(host_OnVerboseMessage); SecondLifeHost.State("default", true);
SecondLifeHost.OnStateChange += new SecondLifeHost.SecondLifeHostMessageHandler(host_OnStateChange);
SecondLifeHost.State("default", true); blnResult = true;
}
return true; return blnResult;
} }
public bool Compile(EditForm editForm) public bool Compile(EditForm editForm)
@ -119,8 +121,7 @@ namespace LSLEditor
private void ResetScriptWatch() private void ResetScriptWatch()
{ {
while (true) while (true) {
{
this.ResetScriptEvent.WaitOne(); this.ResetScriptEvent.WaitOne();
SecondLifeHost.Dispose(); SecondLifeHost.Dispose();
@ -131,13 +132,10 @@ namespace LSLEditor
private delegate void AddListenChannelsDelegate(ComboBox comboBox, string[] channels); private delegate void AddListenChannelsDelegate(ComboBox comboBox, string[] channels);
private void AddListenChannelsToComboxBox(ComboBox comboBox, string[] channels) private void AddListenChannelsToComboxBox(ComboBox comboBox, string[] channels)
{ {
if (comboBox.InvokeRequired) if (comboBox.InvokeRequired) {
{
comboBox.Invoke(new AddListenChannelsDelegate(AddListenChannelsToComboxBox), comboBox.Invoke(new AddListenChannelsDelegate(AddListenChannelsToComboxBox),
new object[] { comboBox , channels }); new object[] { comboBox, channels });
} } else {
else
{
comboBox.Items.Clear(); comboBox.Items.Clear();
comboBox.Items.AddRange(channels); comboBox.Items.AddRange(channels);
comboBox.SelectedIndex = 0; comboBox.SelectedIndex = 0;
@ -145,18 +143,19 @@ namespace LSLEditor
} }
private void SecondLifeHost_OnListenChannelsChanged(object sender, EventArgs e) private void SecondLifeHost_OnListenChannelsChanged(object sender, EventArgs e)
{ {
foreach (Control control in this.panel4.Controls) foreach (Control control in this.panel4.Controls) {
{
GroupboxEvent gbe = control as GroupboxEvent; GroupboxEvent gbe = control as GroupboxEvent;
if (gbe == null) if (gbe == null) {
continue; continue;
foreach (Control control1 in gbe.Controls) }
{ foreach (Control control1 in gbe.Controls) {
GroupBox gb = control1 as GroupBox; GroupBox gb = control1 as GroupBox;
if (gb == null) if (gb == null) {
continue; continue;
if (gb.Name!="listen_0") }
if (gb.Name != "listen_0") {
continue; continue;
}
ComboBox comboBox = gb.Controls[0] as ComboBox; ComboBox comboBox = gb.Controls[0] as ComboBox;
AddListenChannelsToComboxBox(comboBox, SecondLifeHost.GetListenChannels()); AddListenChannelsToComboxBox(comboBox, SecondLifeHost.GetListenChannels());
} }
@ -165,13 +164,10 @@ namespace LSLEditor
void host_OnDie(object sender, EventArgs e) void host_OnDie(object sender, EventArgs e)
{ {
if(this.panel1.InvokeRequired) if (this.panel1.InvokeRequired) {
{
// using Evenhandler definition as a delegate // using Evenhandler definition as a delegate
this.panel1.Invoke(new EventHandler(host_OnDie)); this.panel1.Invoke(new EventHandler(host_OnDie));
} } else {
else
{
this.panel1.Enabled = false; this.panel1.Enabled = false;
} }
} }
@ -185,16 +181,11 @@ namespace LSLEditor
private delegate void SetStateComboboxDelegate(string strName); private delegate void SetStateComboboxDelegate(string strName);
public void SetStateCombobox(string strName) public void SetStateCombobox(string strName)
{ {
if (this.comboBox1.InvokeRequired) if (this.comboBox1.InvokeRequired) {
{
this.comboBox1.Invoke(new SetStateComboboxDelegate(SetStateCombobox), new object[] { strName }); this.comboBox1.Invoke(new SetStateComboboxDelegate(SetStateCombobox), new object[] { strName });
} } else {
else for (int intI = 0; intI < this.comboBox1.Items.Count; intI++) {
{ if (this.comboBox1.Items[intI].ToString() == strName) {
for (int intI = 0; intI < this.comboBox1.Items.Count; intI++)
{
if (this.comboBox1.Items[intI].ToString() == strName)
{
this.comboBox1.SelectedIndex = intI; this.comboBox1.SelectedIndex = intI;
break; break;
} }
@ -204,13 +195,13 @@ namespace LSLEditor
private void comboBox1_SelectedIndexChanged(object sender, System.EventArgs e) private void comboBox1_SelectedIndexChanged(object sender, System.EventArgs e)
{ {
if (SecondLifeHost == null) if (SecondLifeHost != null) {
return; string strStateName = (string)this.comboBox1.Items[this.comboBox1.SelectedIndex];
string strStateName = (string)this.comboBox1.Items[this.comboBox1.SelectedIndex]; if (strStateName != "") {
if (strStateName != "") if (SecondLifeHost.CurrentStateName != strStateName) {
{ SecondLifeHost.State(strStateName, true);
if (SecondLifeHost.CurrentStateName != strStateName) }
SecondLifeHost.State(strStateName,true); }
} }
} }
@ -230,8 +221,7 @@ namespace LSLEditor
strC = translator.Parse(strC); strC = translator.Parse(strC);
foreach (string strState in translator.States) foreach (string strState in translator.States) {
{
this.comboBox1.Items.Add(strState); this.comboBox1.Items.Add(strState);
} }
return strC; return strC;
@ -240,18 +230,14 @@ namespace LSLEditor
private delegate void ShowLifeEventsDelegate(); private delegate void ShowLifeEventsDelegate();
private void ShowLifeEvents() private void ShowLifeEvents()
{ {
if (this.panel4.InvokeRequired) if (this.panel4.InvokeRequired) {
{
this.panel4.Invoke(new ShowLifeEventsDelegate(ShowLifeEvents), null); this.panel4.Invoke(new ShowLifeEventsDelegate(ShowLifeEvents), null);
} } else {
else
{
int intX = 8; int intX = 8;
int intY = 0; int intY = 0;
this.panel4.Controls.Clear(); this.panel4.Controls.Clear();
foreach (string strEventName in SecondLifeHost.GetEvents()) foreach (string strEventName in SecondLifeHost.GetEvents()) {
{
string strArgs = SecondLifeHost.GetArgumentsFromMethod(strEventName); string strArgs = SecondLifeHost.GetArgumentsFromMethod(strEventName);
GroupboxEvent ge = new GroupboxEvent(new Point(intX, intY), strEventName, strArgs, new System.EventHandler(this.buttonEvent_Click)); GroupboxEvent ge = new GroupboxEvent(new Point(intX, intY), strEventName, strArgs, new System.EventHandler(this.buttonEvent_Click));
this.panel4.Controls.Add(ge); this.panel4.Controls.Add(ge);
@ -265,28 +251,23 @@ namespace LSLEditor
// Verbose // Verbose
public void VerboseConsole(string strLine) public void VerboseConsole(string strLine)
{ {
if (this.textBox2.IsDisposed) if (!this.textBox2.IsDisposed) {
return; if (this.textBox2.InvokeRequired) {
if (this.textBox2.InvokeRequired) this.textBox2.Invoke(new AppendTextDelegate(VerboseConsole), new object[] { strLine });
{ } else {
this.textBox2.Invoke(new AppendTextDelegate(VerboseConsole), new object[] { strLine }); this.textBox2.AppendText(strLine.Replace("\n", "\r\n") + "\r\n");
} }
else
{
this.textBox2.AppendText(strLine.Replace("\n", "\r\n") + "\r\n");
} }
} }
private string GetArgumentValue(string strName) private string GetArgumentValue(string strName)
{ {
foreach (Control parent in this.panel4.Controls) foreach (Control parent in this.panel4.Controls) {
{ if (parent.Name == "GroupboxTextbox") {
if (parent.Name == "GroupboxTextbox") foreach (Control c in parent.Controls) {
{ if (c.Name == strName) {
foreach (Control c in parent.Controls)
{
if (c.Name == strName)
return c.Controls[0].Text; return c.Controls[0].Text;
}
} }
} }
} }
@ -295,71 +276,62 @@ namespace LSLEditor
private object[] GetArguments(string strName, string strArgs) private object[] GetArguments(string strName, string strArgs)
{ {
if (strArgs == "") object[] objResult = new object[0];
return new object[0]; if (strArgs != "") {
try {
try string[] args = strArgs.Trim().Split(new char[] { ',' });
{ object[] argobjects = new object[args.Length];
string[] args = strArgs.Trim().Split(new char[] { ',' }); for (int intI = 0; intI < argobjects.Length; intI++) {
object[] argobjects = new object[args.Length]; string[] argument = args[intI].Trim().Split(new char[] { ' ' });
for (int intI = 0; intI < argobjects.Length; intI++) if (argument.Length == 2) {
{ string[] arArgs;
string[] argument = args[intI].Trim().Split(new char[] { ' ' }); string strArgumentValue = GetArgumentValue(strName + "_" + intI);
if (argument.Length == 2) string strArgumentName = argument[1];
{ string strArgumentType = argument[0];
string[] arArgs; switch (strArgumentType) {
string strArgumentValue = GetArgumentValue(strName + "_" + intI); case "System.String":
string strArgumentName = argument[1]; argobjects[intI] = strArgumentValue;
string strArgumentType = argument[0]; break;
switch (strArgumentType) case "System.Int32":
{ argobjects[intI] = int.Parse(strArgumentValue);
case "System.String": break;
argobjects[intI] = strArgumentValue; case "LSLEditor.SecondLife+Float":
break; argobjects[intI] = new SecondLife.Float(strArgumentValue);
case "System.Int32": break;
argobjects[intI] = int.Parse(strArgumentValue); case "LSLEditor.SecondLife+integer":
break; argobjects[intI] = new SecondLife.integer(int.Parse(strArgumentValue));
case "LSLEditor.SecondLife+Float": break;
argobjects[intI] = new SecondLife.Float(strArgumentValue); case "LSLEditor.SecondLife+String":
break; argobjects[intI] = new SecondLife.String(strArgumentValue);
case "LSLEditor.SecondLife+integer": break;
argobjects[intI] = new SecondLife.integer(int.Parse(strArgumentValue)); case "LSLEditor.SecondLife+key":
break; argobjects[intI] = new SecondLife.key(strArgumentValue);
case "LSLEditor.SecondLife+String": break;
argobjects[intI] = new SecondLife.String(strArgumentValue); case "LSLEditor.SecondLife+list":
break; argobjects[intI] = new SecondLife.list(new string[] { strArgumentValue });
case "LSLEditor.SecondLife+key": break;
argobjects[intI] = new SecondLife.key(strArgumentValue); case "LSLEditor.SecondLife+rotation":
break; arArgs = strArgumentValue.Replace("<", "").Replace(">", "").Replace(" ", "").Split(new char[] { ',' });
case "LSLEditor.SecondLife+list": argobjects[intI] = new SecondLife.rotation(double.Parse(arArgs[0]), double.Parse(arArgs[1]), double.Parse(arArgs[2]), double.Parse(arArgs[3]));
argobjects[intI] = new SecondLife.list(new string[] { strArgumentValue } ); break;
break; case "LSLEditor.SecondLife+vector":
case "LSLEditor.SecondLife+rotation": arArgs = strArgumentValue.Replace("<", "").Replace(">", "").Replace(" ", "").Split(new char[] { ',' });
arArgs = strArgumentValue.Replace("<", "").Replace(">", "").Replace(" ", "").Split(new char[] { ',' }); argobjects[intI] = new SecondLife.vector(double.Parse(arArgs[0]), double.Parse(arArgs[1]), double.Parse(arArgs[2]));
argobjects[intI] = new SecondLife.rotation(double.Parse(arArgs[0]), double.Parse(arArgs[1]), double.Parse(arArgs[2]), double.Parse(arArgs[3])); break;
break; default:
case "LSLEditor.SecondLife+vector": MessageBox.Show("Compiler->GetArguments->[" + strArgumentType + "][" + strArgumentName + "]");
arArgs = strArgumentValue.Replace("<", "").Replace(">", "").Replace(" ", "").Split(new char[] { ',' }); argobjects[intI] = null;
argobjects[intI] = new SecondLife.vector(double.Parse(arArgs[0]), double.Parse(arArgs[1]), double.Parse(arArgs[2])); break;
break; }
default: } else {
MessageBox.Show("Compiler->GetArguments->[" + strArgumentType + "][" + strArgumentName + "]"); MessageBox.Show("Argument must be 'type name' [" + args[intI] + "]");
argobjects[intI] = null; break;
break;
} }
} }
else objResult = argobjects;
{ } catch { }
MessageBox.Show("Argument must be 'type name' [" + args[intI] + "]");
break;
}
}
return argobjects;
}
catch
{
return new object[0];
} }
return objResult;
} }
private void buttonEvent_Click(object sender, System.EventArgs e) private void buttonEvent_Click(object sender, System.EventArgs e)
@ -374,8 +346,9 @@ namespace LSLEditor
private void Die() private void Die()
{ {
if (this.SecondLifeHost != null) if (this.SecondLifeHost != null) {
this.SecondLifeHost.Die(); this.SecondLifeHost.Die();
}
} }
// Die // Die
@ -386,8 +359,9 @@ namespace LSLEditor
private void textBox2_KeyDown(object sender, KeyEventArgs e) private void textBox2_KeyDown(object sender, KeyEventArgs e)
{ {
if (e.Control && e.KeyCode == Keys.A) if (e.Control && e.KeyCode == Keys.A) {
this.textBox2.SelectAll(); this.textBox2.SelectAll();
}
} }
private void selectAllToolStripMenuItem_Click(object sender, EventArgs e) private void selectAllToolStripMenuItem_Click(object sender, EventArgs e)

View file

@ -280,6 +280,7 @@ namespace LSLEditor
public const int INVENTORY_ANIMATION = 20; public const int INVENTORY_ANIMATION = 20;
public const int INVENTORY_GESTURE = 21; public const int INVENTORY_GESTURE = 21;
public const int JSON_APPEND = -1;
public static readonly string JSON_ARRAY = "\uFDD2"; public static readonly string JSON_ARRAY = "\uFDD2";
public static readonly string JSON_FALSE = "\uFDD7"; public static readonly string JSON_FALSE = "\uFDD7";
public static readonly string JSON_INVALID = "\uFDD0"; public static readonly string JSON_INVALID = "\uFDD0";

View file

@ -50,41 +50,41 @@ namespace LSLEditor
public partial class SecondLife public partial class SecondLife
{ {
#region events as virtuals, if one is used, use override #region events as virtuals, if one is used, use override
virtual public void at_rot_target(integer number, rotation target_rotation, rotation our_rotation) { } virtual public void at_rot_target(integer iHandle, rotation rTargetRotation, rotation rCurrentRotation) { }
virtual public void at_target(integer tnum, vector targetpos, vector ourpos) { } virtual public void at_target(integer iHandle, vector vTargetPosition, vector vCurrrentPosition) { }
virtual public void attach(key attached) { } virtual public void attach(key kAttached) { }
virtual public void changed(integer changed) { } virtual public void changed(integer iChangedFlags) { }
virtual public void collision(integer total_number) { } virtual public void collision(integer iCollisionCount) { }
virtual public void collision_end(integer total_number) { } virtual public void collision_end(integer iCollisionCount) { }
virtual public void collision_start(integer total_number) { } virtual public void collision_start(integer iCollisionCount) { }
virtual public void control(key name, integer levels, integer edges) { } virtual public void control(key kID, integer iLevels, integer iEdges) { }
virtual public void dataserver(key requested, String data) { } virtual public void dataserver(key kRequestID, String sData) { }
virtual public void email(String time, String address, String subject, String body, integer remaining) { } virtual public void email(String sTime, String sAddress, String sSubject, String sBody, integer iRemaining) { }
virtual public void http_response(key request_id, integer status, list metadata, String body) { } virtual public void http_response(key kRequestID, integer iStatus, list lMetadata, String sBody) { }
virtual public void http_request(key request_id, String method, String body) { } virtual public void http_request(key kRequestID, String sMethod, String sBody) { }
virtual public void land_collision(vector position) { } virtual public void land_collision(vector vPosition) { }
virtual public void land_collision_end(vector position) { } virtual public void land_collision_end(vector vPosition) { }
virtual public void land_collision_start(vector position) { } virtual public void land_collision_start(vector vPosition) { }
virtual public void link_message(integer sender_number, integer number, String message, key id) { } virtual public void link_message(integer iSenderLinkIndex, integer iNumber, String sText, key kID) { }
virtual public void listen(integer channel, String name, key id, String message) { } virtual public void listen(integer iChannel, String sName, key kID, String sText) { }
virtual public void money(key giver, integer amount) { } virtual public void money(key kPayerID, integer iAmount) { }
virtual public void moving_end() { } virtual public void moving_end() { }
virtual public void moving_start() { } virtual public void moving_start() { }
virtual public void no_sensor() { } virtual public void no_sensor() { }
virtual public void not_at_rot_target() { } virtual public void not_at_rot_target() { }
virtual public void not_at_target() { } virtual public void not_at_target() { }
virtual public void object_rez(key id) { } virtual public void object_rez(key kID) { }
virtual public void on_rez(integer start_param) { } virtual public void on_rez(integer iStartParameter) { }
virtual public void path_update(integer iType, list lReserved) { } virtual public void path_update(integer iType, list lReserved) { }
virtual public void remote_data(integer event_type, key channel, key message_id, String sender, integer idata, String sdata) { } virtual public void remote_data(integer iEventType, key kChannelID, key kMessageID, String sSender, integer iData, String sData) { }
virtual public void run_time_permissions(integer permissions) { } virtual public void run_time_permissions(integer iPermissionsFlags) { }
virtual public void sensor(integer total_number) { } virtual public void sensor(integer iSensedCount) { }
virtual public void state_entry() { } virtual public void state_entry() { }
virtual public void state_exit() { } virtual public void state_exit() { }
virtual public void timer() { } virtual public void timer() { }
virtual public void touch(integer total_number) { } virtual public void touch(integer iTouchesCount) { }
virtual public void touch_end(integer total_number) { } virtual public void touch_end(integer iTouchesCount) { }
virtual public void touch_start(integer total_number) { } virtual public void touch_start(integer iTouchesCount) { }
virtual public void transaction_result(key kID, integer iSuccess, String sMessage) { } virtual public void transaction_result(key kID, integer iSuccess, String sMessage) { }
#endregion #endregion
} }

View file

@ -67,29 +67,31 @@ namespace LSLEditor
public void llAddToLandBanList(key kID, Float fHours) public void llAddToLandBanList(key kID, Float fHours)
{ {
Verbose("llAddToLandBanList({0}, {1})", kID, fHours); Verbose("llAddToLandBanList({0}, {1})", kID, fHours);
if (m_LandBanList.ContainsKey(kID)) if (htLandBanList.ContainsKey(kID)) {
m_LandBanList.Remove(kID); htLandBanList.Remove(kID);
m_LandBanList.Add(kID, fHours); }
htLandBanList.Add(kID, fHours);
} }
public void llAddToLandPassList(key kID, Float fHours) public void llAddToLandPassList(key kID, Float fHours)
{ {
Verbose("llAddToLandPassList({0}, {1})", kID, fHours); Verbose("llAddToLandPassList({0}, {1})", kID, fHours);
if (m_LandPassList.ContainsKey(kID)) if (htLandPassList.ContainsKey(kID)) {
m_LandPassList.Remove(kID); htLandPassList.Remove(kID);
m_LandPassList.Add(kID, fHours); }
htLandPassList.Add(kID, fHours);
} }
public void llAdjustSoundVolume(Float fVolume) public void llAdjustSoundVolume(Float fVolume)
{ {
Verbose("llAdjustSoundVolume({0}), fVolume"); Verbose("llAdjustSoundVolume({0}), fVolume");
m_Volume = fVolume; this.fVolume = fVolume;
} }
public void llAllowInventoryDrop(integer iAllowDrop) public void llAllowInventoryDrop(integer iAllowDrop)
{ {
Verbose("llAllowInventoryDrop({0})", iAllowDrop); Verbose("llAllowInventoryDrop({0})", iAllowDrop);
m_AllowDrop = (Boolean)iAllowDrop; blnAllowDrop = (Boolean)iAllowDrop;
} }
public Float llAngleBetween(rotation a, rotation b) public Float llAngleBetween(rotation a, rotation b)
@ -386,8 +388,9 @@ namespace LSLEditor
} }
list lResult = new list(); list lResult = new list();
for (int intI = 0; intI < src.Count; intI++) { for (int intI = 0; intI < src.Count; intI++) {
if (src[intI] != null) if (src[intI] != null) {
lResult.Add(src[intI]); lResult.Add(src[intI]);
}
} }
Verbose(string.Format("llDeleteSubList({0}, {1}, {2})={3}", lSource.ToVerboseString(), iStart, iEnd, lResult.ToVerboseString())); Verbose(string.Format("llDeleteSubList({0}, {1}, {2})={3}", lSource.ToVerboseString(), iStart, iEnd, lResult.ToVerboseString()));
return lResult; return lResult;
@ -403,20 +406,24 @@ namespace LSLEditor
if (CorrectIt(intLength, ref start, ref end)) { if (CorrectIt(intLength, ref start, ref end)) {
if (start <= end) { if (start <= end) {
for (int intI = start; intI <= end; intI++) for (int intI = start; intI <= end; intI++) {
src[intI] = '\0'; src[intI] = '\0';
}
} else // excluding } else // excluding
{ {
for (int intI = 0; intI <= end; intI++) for (int intI = 0; intI <= end; intI++) {
src[intI] = '\0'; src[intI] = '\0';
for (int intI = start; intI < intLength; intI++) }
for (int intI = start; intI < intLength; intI++) {
src[intI] = '\0'; src[intI] = '\0';
}
} }
} }
StringBuilder result = new StringBuilder(); StringBuilder result = new StringBuilder();
for (int intI = 0; intI < src.Length; intI++) { for (int intI = 0; intI < src.Length; intI++) {
if (src[intI] != '\0') if (src[intI] != '\0') {
result.Append(src[intI]); result.Append(src[intI]);
}
} }
Verbose(string.Format(@"llDeleteSubString(""{0}"", {1}, {2})=""{3}""", sSource, iStart, iEnd, result)); Verbose(string.Format(@"llDeleteSubString(""{0}"", {1}, {2})=""{3}""", sSource, iStart, iEnd, result));
@ -556,8 +563,9 @@ namespace LSLEditor
{ {
StringBuilder result = new StringBuilder(); StringBuilder result = new StringBuilder();
for (int intI = 0; intI < lSource.Count; intI++) { for (int intI = 0; intI < lSource.Count; intI++) {
if (intI > 0) if (intI > 0) {
result.Append(sSeparator.ToString()); result.Append(sSeparator.ToString());
}
result.Append(lSource[intI].ToString()); result.Append(lSource[intI].ToString());
} }
Verbose(@"llDumpList2String({0},""{1}"")=""{2}""", lSource.ToVerboseString(), sSeparator, result.ToString()); Verbose(@"llDumpList2String({0},""{1}"")=""{2}""", lSource.ToVerboseString(), sSeparator, result.ToString());
@ -588,12 +596,11 @@ namespace LSLEditor
byte[] data = Encoding.UTF8.GetBytes(sURL.ToString()); byte[] data = Encoding.UTF8.GetBytes(sURL.ToString());
for (int intI = 0; intI < data.Length; intI++) { for (int intI = 0; intI < data.Length; intI++) {
byte chrC = data[intI]; byte chrC = data[intI];
if ((chrC >= 'a' && chrC <= 'z') || if ((chrC >= 'a' && chrC <= 'z') || (chrC >= 'A' && chrC <= 'Z') || (chrC >= '0' && chrC <= '9')) {
(chrC >= 'A' && chrC <= 'Z') ||
(chrC >= '0' && chrC <= '9'))
sb.Append((char)chrC); sb.Append((char)chrC);
else } else {
sb.AppendFormat("%{0:X2}", (int)chrC); sb.AppendFormat("%{0:X2}", (int)chrC);
}
} }
Verbose(string.Format(@"EscapeURL(""{0}"")=""{1}""", sURL, sb.ToString())); Verbose(string.Format(@"EscapeURL(""{0}"")=""{1}""", sURL, sb.ToString()));
return sb.ToString(); return sb.ToString();
@ -652,7 +659,7 @@ namespace LSLEditor
public Float llFrand(Float fMaximum) public Float llFrand(Float fMaximum)
{ {
double dblValue = fMaximum * m_random.NextDouble(); double dblValue = fMaximum * rdmRandom.NextDouble();
Verbose("llFrand({0})={1}", fMaximum, dblValue); Verbose("llFrand({0})={1}", fMaximum, dblValue);
return dblValue; return dblValue;
} }
@ -709,11 +716,11 @@ namespace LSLEditor
public Float llGetAndResetTime() public Float llGetAndResetTime()
{ {
// get time // get time
double dTime = llGetTime(); double dblTime = llGetTime();
Verbose("llGetAndResetTime()=" + dTime); Verbose("llGetAndResetTime()=" + dblTime);
// reset time // reset time
llResetTime(); llResetTime();
return dTime; return dblTime;
} }
public String llGetAnimation(key kID) public String llGetAnimation(key kID)
@ -976,11 +983,12 @@ namespace LSLEditor
{ {
integer iEntryType; integer iEntryType;
if (iIndex < 0) if (iIndex < 0) {
iIndex = lSource.Count + iIndex; iIndex = lSource.Count + iIndex;
if (iIndex >= lSource.Count || iIndex < 0) }
if (iIndex >= lSource.Count || iIndex < 0) {
iEntryType = 0; iEntryType = 0;
else { } else {
switch (lSource[iIndex].GetType().ToString().Replace("LSLEditor.SecondLife+", "")) { switch (lSource[iIndex].GetType().ToString().Replace("LSLEditor.SecondLife+", "")) {
case "System.Double": case "System.Double":
case "Float": case "Float":
@ -1021,14 +1029,14 @@ namespace LSLEditor
public vector llGetLocalPos() public vector llGetLocalPos()
{ {
Verbose("llGetLocalPos()={0}", m_pos); Verbose("llGetLocalPos()={0}", vPosition);
return m_pos; return vPosition;
} }
public rotation llGetLocalRot() public rotation llGetLocalRot()
{ {
Verbose("llGetLocalRot()={0}", m_rotlocal); Verbose("llGetLocalRot()={0}", rRotationlocal);
return m_rotlocal; return rRotationlocal;
} }
public Float llGetMass() public Float llGetMass()
@ -1096,8 +1104,9 @@ namespace LSLEditor
{ {
list lObjectDetails = new list(); list lObjectDetails = new list();
for (int intI = 0; intI < lObjectFlags.Count; intI++) { for (int intI = 0; intI < lObjectFlags.Count; intI++) {
if (!(lObjectFlags[intI] is integer)) if (!(lObjectFlags[intI] is integer)) {
continue; continue;
}
switch ((int)(integer)lObjectFlags[intI]) { switch ((int)(integer)lObjectFlags[intI]) {
case OBJECT_NAME: case OBJECT_NAME:
lObjectDetails.Add((SecondLife.String)host.GetObjectName(new Guid(kID.guid))); lObjectDetails.Add((SecondLife.String)host.GetObjectName(new Guid(kID.guid)));
@ -1177,7 +1186,7 @@ namespace LSLEditor
public key llGetOwnerKey(key kID) public key llGetOwnerKey(key kID)
{ {
key kAvatarID = llGetOwner(); // This is incorrect, as the owner of this object may not be the owner of kID key kAvatarID = llGetOwner(); // This is incorrect, as the owner of this object may not be the owner of kID
Verbose("llGetOwnerKey({0})={1}", kID, kAvatarID); Verbose("llGetOwnerKey({0})={1}", kID, kAvatarID);
return kAvatarID; return kAvatarID;
} }
@ -1241,8 +1250,8 @@ namespace LSLEditor
public string llGetParcelMusicURL() public string llGetParcelMusicURL()
{ {
Verbose(@"llGetParcelMaxPrims()=""{0}""", m_ParcelMusicURL); Verbose(@"llGetParcelMaxPrims()=""{0}""", sParcelMusicURL);
return m_ParcelMusicURL; return sParcelMusicURL;
} }
public integer llGetParcelPrimCount(vector vPosition, integer iCategory, integer iSimWide) public integer llGetParcelPrimCount(vector vPosition, integer iCategory, integer iSimWide)
@ -1282,8 +1291,8 @@ namespace LSLEditor
public vector llGetPos() public vector llGetPos()
{ {
Verbose("llGetPos()={0}", m_pos); Verbose("llGetPos()={0}", vPosition);
return m_pos; return vPosition;
} }
public list llGetPrimMediaParams(integer iFace, list lDesiredParams) public list llGetPrimMediaParams(integer iFace, list lDesiredParams)
@ -1360,8 +1369,8 @@ namespace LSLEditor
public rotation llGetRot() public rotation llGetRot()
{ {
Verbose("llGetRot()={0}", m_rot); Verbose("llGetRot()={0}", rRotation);
return m_rot; return rRotation;
} }
public integer llGetSPMaxMemory() public integer llGetSPMaxMemory()
@ -1373,8 +1382,8 @@ namespace LSLEditor
public vector llGetScale() public vector llGetScale()
{ {
Verbose("llGetScale()=" + m_scale); Verbose("llGetScale()=" + vScale);
return m_scale; return vScale;
} }
public String llGetScriptName() public String llGetScriptName()
@ -1407,8 +1416,8 @@ namespace LSLEditor
public integer llGetStartParameter() public integer llGetStartParameter()
{ {
Verbose("llGetStartParameter()={0}" + m_start_parameter); Verbose("llGetStartParameter()={0}" + iStartParameter);
return m_start_parameter; return iStartParameter;
} }
public list llGetStaticPath(vector vStart, vector vEnd, Float fRadius, list lParameters) public list llGetStaticPath(vector vStart, vector vEnd, Float fRadius, list lParameters)
@ -1439,12 +1448,13 @@ namespace LSLEditor
if (start <= end) { if (start <= end) {
for (int intI = start; intI <= end; intI++) for (int intI = start; intI <= end; intI++)
sResult.Append(src[intI]); sResult.Append(src[intI]);
} else // excluding } else {// excluding
{ for (int intI = 0; intI <= end; intI++) {
for (int intI = 0; intI <= end; intI++)
sResult.Append(src[intI]); sResult.Append(src[intI]);
for (int intI = start; intI < intLength; intI++) }
for (int intI = start; intI < intLength; intI++) {
sResult.Append(src[intI]); sResult.Append(src[intI]);
}
} }
} }
Verbose(string.Format(@"GetSubString(""{0}"", {1}, {2})=""{3}""", sSource, iStart, iEnd, sResult)); Verbose(string.Format(@"GetSubString(""{0}"", {1}, {2})=""{3}""", sSource, iStart, iEnd, sResult));
@ -1488,7 +1498,7 @@ namespace LSLEditor
public Float llGetTime() public Float llGetTime()
{ {
TimeSpan span = DateTime.Now.ToUniversalTime() - m_DateTimeScriptStarted; TimeSpan span = DateTime.Now.ToUniversalTime() - dtDateTimeScriptStarted;
Verbose("llGetTime()={0}", span.TotalSeconds); Verbose("llGetTime()={0}", span.TotalSeconds);
return span.TotalSeconds; return span.TotalSeconds;
} }
@ -1615,15 +1625,15 @@ namespace LSLEditor
public String llInsertString(String sDestination, integer iIndex, String sSource) public String llInsertString(String sDestination, integer iIndex, String sSource)
{ {
string dst = sDestination; string strDestination = sDestination;
string src = sSource; string strSource = sSource;
int position = iIndex; int intPosition = iIndex;
string sResult; string sResult;
if (position < dst.Length) { if (intPosition < strDestination.Length) {
sResult = dst.Substring(0, position) + src + dst.Substring(position); sResult = strDestination.Substring(0, intPosition) + strSource + strDestination.Substring(intPosition);
} else if (position >= 0) { } else if (intPosition >= 0) {
sResult = dst + src; sResult = strDestination + strSource;
} else { } else {
sResult = "**ERROR**"; sResult = "**ERROR**";
} }
@ -1784,18 +1794,17 @@ namespace LSLEditor
{ {
int iLength = lSource.Count; int iLength = lSource.Count;
int start = iStart; int intStart = iStart;
int end = iEnd; int intEnd = iEnd;
list lTemp = new list(); list lTemp = new list();
if (CorrectIt(iLength, ref start, ref end)) { if (CorrectIt(iLength, ref intStart, ref intEnd)) {
if (start <= end) { if (intStart <= intEnd) {
for (int intI = start; intI <= end; intI++) lTemp.Add(lSource[intI]); for (int intI = intStart; intI <= intEnd; intI++) lTemp.Add(lSource[intI]);
} else // excluding } else { // excluding
{ for (int intI = 0; intI <= intEnd; intI++) lTemp.Add(lSource[intI]);
for (int intI = 0; intI <= end; intI++) lTemp.Add(lSource[intI]); for (int intI = intStart; intI < iLength; intI++) lTemp.Add(lSource[intI]);
for (int intI = start; intI < iLength; intI++) lTemp.Add(lSource[intI]);
} }
} }
list lResult = new list(); list lResult = new list();
@ -1803,13 +1812,13 @@ namespace LSLEditor
if (iStride <= 0) { if (iStride <= 0) {
sRemark = " ** stride must be > 0 **"; sRemark = " ** stride must be > 0 **";
} else { } else {
if (start == 0) { if (intStart == 0) {
for (int intI = 0; intI < lTemp.Count; intI += iStride) lResult.Add(lTemp[intI]); for (int intI = 0; intI < lTemp.Count; intI += iStride) lResult.Add(lTemp[intI]);
} else { } else {
for (int intI = iStride - 1; intI < lTemp.Count; intI += iStride) lResult.Add(lTemp[intI]); for (int intI = iStride - 1; intI < lTemp.Count; intI += iStride) lResult.Add(lTemp[intI]);
} }
} }
Verbose(@"llList2ListStrided({0}, {1}, {2}, {3})={4}{5}", lSource.ToVerboseString(), start, end, iStride, lResult.ToVerboseString(), sRemark); Verbose(@"llList2ListStrided({0}, {1}, {2}, {3})={4}{5}", lSource.ToVerboseString(), intStart, intEnd, iStride, lResult.ToVerboseString(), sRemark);
return lResult; return lResult;
} }
@ -1890,8 +1899,9 @@ namespace LSLEditor
{ {
int intLength = lDestination.Count; int intLength = lDestination.Count;
list lResult = new list(); list lResult = new list();
if (iIndex < 0) if (iIndex < 0) {
iIndex = lDestination.Count + iIndex; iIndex = lDestination.Count + iIndex;
}
for (int intI = 0; intI < Math.Min(iIndex, intLength); intI++) lResult.Add(lDestination[intI]); for (int intI = 0; intI < Math.Min(iIndex, intLength); intI++) lResult.Add(lDestination[intI]);
@ -2131,8 +2141,9 @@ namespace LSLEditor
System.Security.Cryptography.MD5 md5 = new System.Security.Cryptography.MD5CryptoServiceProvider(); System.Security.Cryptography.MD5 md5 = new System.Security.Cryptography.MD5CryptoServiceProvider();
byte[] hash = md5.ComputeHash(Encoding.ASCII.GetBytes(sSource + ":" + iNonce.ToString())); byte[] hash = md5.ComputeHash(Encoding.ASCII.GetBytes(sSource + ":" + iNonce.ToString()));
StringBuilder sbResult = new StringBuilder(); StringBuilder sbResult = new StringBuilder();
foreach (byte hex in hash) foreach (byte hex in hash) {
sbResult.Append(hex.ToString("x2")); //convert to standard MD5 form sbResult.Append(hex.ToString("x2")); //convert to standard MD5 form
}
Verbose("llMD5String({0}, {1})={2}", sSource, iNonce, sbResult); Verbose("llMD5String({0}, {1})={2}", sSource, iNonce, sbResult);
return sbResult.ToString(); return sbResult.ToString();
} }
@ -2377,16 +2388,16 @@ namespace LSLEditor
public void llRemoveFromLandBanList(key kAvatarID) public void llRemoveFromLandBanList(key kAvatarID)
{ {
Verbose("llRemoveFromLandBanList({0})", kAvatarID); Verbose("llRemoveFromLandBanList({0})", kAvatarID);
if (m_LandBanList.ContainsKey(kAvatarID)) { if (htLandBanList.ContainsKey(kAvatarID)) {
m_LandBanList.Remove(kAvatarID); htLandBanList.Remove(kAvatarID);
} }
} }
public void llRemoveFromLandPassList(key kAvatarID) public void llRemoveFromLandPassList(key kAvatarID)
{ {
Verbose("llRemoveFromLandPassList({0})", kAvatarID); Verbose("llRemoveFromLandPassList({0})", kAvatarID);
if (m_LandPassList.ContainsKey(kAvatarID)) { if (htLandPassList.ContainsKey(kAvatarID)) {
m_LandPassList.Remove(kAvatarID); htLandPassList.Remove(kAvatarID);
} }
} }
@ -2487,13 +2498,13 @@ namespace LSLEditor
public void llResetLandBanList() public void llResetLandBanList()
{ {
m_LandBanList = new Hashtable(); htLandBanList = new Hashtable();
Verbose("llResetLandBanList()"); Verbose("llResetLandBanList()");
} }
public void llResetLandPassList() public void llResetLandPassList()
{ {
m_LandPassList = new Hashtable(); htLandPassList = new Hashtable();
Verbose("llResetLandPassList()"); Verbose("llResetLandPassList()");
} }
@ -2513,7 +2524,7 @@ namespace LSLEditor
public void llResetTime() public void llResetTime()
{ {
Verbose("llResetTime()"); Verbose("llResetTime()");
m_DateTimeScriptStarted = DateTime.Now.ToUniversalTime(); dtDateTimeScriptStarted = DateTime.Now.ToUniversalTime();
} }
public integer llReturnObjectsByID(list lObjects) public integer llReturnObjectsByID(list lObjects)
@ -2565,13 +2576,14 @@ namespace LSLEditor
if (m != 0) { if (m != 0) {
double n = 2 * (rRotation.y * rRotation.s + rRotation.x * rRotation.z); double n = 2 * (rRotation.y * rRotation.s + rRotation.x * rRotation.z);
double p = m * m - n * n; double p = m * m - n * n;
if (p > 0) if (p > 0) {
vEuler = new vector(Math.Atan2(2.0 * (rRotation.x * rRotation.s - rRotation.y * rRotation.z), (-t.x - t.y + t.z + t.s)), vEuler = new vector(Math.Atan2(2.0 * (rRotation.x * rRotation.s - rRotation.y * rRotation.z), (-t.x - t.y + t.z + t.s)),
Math.Atan2(n, Math.Sqrt(p)), Math.Atan2(2.0 * (rRotation.z * rRotation.s - rRotation.x * rRotation.y), (t.x - t.y - t.z + t.s))); Math.Atan2(n, Math.Sqrt(p)), Math.Atan2(2.0 * (rRotation.z * rRotation.s - rRotation.x * rRotation.y), (t.x - t.y - t.z + t.s)));
else if (n > 0) } else if (n > 0) {
vEuler = new vector(0, PI_BY_TWO, Math.Atan2((rRotation.z * rRotation.s + rRotation.x * rRotation.y), 0.5 - t.x - t.z)); vEuler = new vector(0, PI_BY_TWO, Math.Atan2((rRotation.z * rRotation.s + rRotation.x * rRotation.y), 0.5 - t.x - t.z));
else } else {
vEuler = new vector(0, -PI_BY_TWO, Math.Atan2((rRotation.z * rRotation.s + rRotation.x * rRotation.y), 0.5 - t.x - t.z)); vEuler = new vector(0, -PI_BY_TWO, Math.Atan2((rRotation.z * rRotation.s + rRotation.x * rRotation.y), 0.5 - t.x - t.z));
}
} }
Verbose("llRot2Euler({0})={1}", rRotation, vEuler); Verbose("llRot2Euler({0})={1}", rRotation, vEuler);
return vEuler; return vEuler;
@ -2821,7 +2833,7 @@ namespace LSLEditor
public void llSetLocalRot(rotation rRotation) public void llSetLocalRot(rotation rRotation)
{ {
this.m_rotlocal = rRotation; this.rRotationlocal = rRotation;
Verbose("llSetLocalRot({0})", rRotation); Verbose("llSetLocalRot({0})", rRotation);
} }
@ -2852,7 +2864,7 @@ namespace LSLEditor
public void llSetParcelMusicURL(String sURL) public void llSetParcelMusicURL(String sURL)
{ {
Verbose(@"llSetParcelMusicURL(""{0}"")", sURL); Verbose(@"llSetParcelMusicURL(""{0}"")", sURL);
m_ParcelMusicURL = sURL; sParcelMusicURL = sURL;
} }
public void llSetPayPrice(integer iPrice, list lButtons) public void llSetPayPrice(integer iPrice, list lButtons)
@ -2868,7 +2880,7 @@ namespace LSLEditor
public void llSetPos(vector vPosition) public void llSetPos(vector vPosition)
{ {
Verbose("llSetPos({0})", vPosition); Verbose("llSetPos({0})", vPosition);
m_pos = vPosition; this.vPosition = vPosition;
} }
public integer llSetPrimMediaParams(integer iFace, list lParameters) public integer llSetPrimMediaParams(integer iFace, list lParameters)
@ -2887,7 +2899,7 @@ namespace LSLEditor
{ {
integer iResult = true; integer iResult = true;
Verbose("llSetRegionPos({0})={1}", vPosition, iResult); Verbose("llSetRegionPos({0})={1}", vPosition, iResult);
m_pos = vPosition; this.vPosition = vPosition;
return iResult; return iResult;
} }
@ -2899,13 +2911,13 @@ namespace LSLEditor
public void llSetRot(rotation rRotation) public void llSetRot(rotation rRotation)
{ {
Verbose("llSetRot({0})", rRotation); Verbose("llSetRot({0})", rRotation);
m_rot = rRotation; this.rRotation = rRotation;
} }
public void llSetScale(vector vScale) public void llSetScale(vector vScale)
{ {
Verbose("llSetScale({0})", vScale); Verbose("llSetScale({0})", vScale);
m_scale = vScale; this.vScale = vScale;
} }
public void llSetScriptState(String sName, integer iRunState) public void llSetScriptState(String sName, integer iRunState)
@ -2916,7 +2928,7 @@ namespace LSLEditor
public void llSetSitText(String sText) public void llSetSitText(String sText)
{ {
Verbose(@"llSetSitText(""{0}"")", sText); Verbose(@"llSetSitText(""{0}"")", sText);
m_SitText = sText; sSitText = sText;
} }
public void llSetSoundQueueing(integer iQueueFlag) public void llSetSoundQueueing(integer iQueueFlag)
@ -2926,7 +2938,7 @@ namespace LSLEditor
public void llSetSoundRadius(Float fRadius) public void llSetSoundRadius(Float fRadius)
{ {
m_SoundRadius = fRadius; fSoundRadius = fRadius;
Verbose("llSetSoundRadius({0})", fRadius); Verbose("llSetSoundRadius({0})", fRadius);
} }
@ -3207,10 +3219,11 @@ namespace LSLEditor
for (int intI = 0; intI < data.Length; intI++) { for (int intI = 0; intI < data.Length; intI++) {
byte chrC = data[intI]; byte chrC = data[intI];
if (chrC == (byte)'%') { if (chrC == (byte)'%') {
if (intI < (data.Length - 2)) if (intI < (data.Length - 2)) {
list.Add((byte) list.Add((byte)
(HexToInt(data[intI + 1]) << 4 (HexToInt(data[intI + 1]) << 4
| HexToInt(data[intI + 2]))); | HexToInt(data[intI + 2])));
}
intI += 2; intI += 2;
} else { } else {
list.Add(chrC); list.Add(chrC);
@ -3218,8 +3231,9 @@ namespace LSLEditor
} }
data = list.ToArray(); data = list.ToArray();
int intLen = Array.IndexOf(data, (byte)0x0); int intLen = Array.IndexOf(data, (byte)0x0);
if (intLen < 0) if (intLen < 0) {
intLen = data.Length; intLen = data.Length;
}
string strTmp = Encoding.UTF8.GetString(data, 0, intLen); string strTmp = Encoding.UTF8.GetString(data, 0, intLen);
Verbose(string.Format(@"llUnescapeURL(""{0}"")=""{1}""", sURL, strTmp)); Verbose(string.Format(@"llUnescapeURL(""{0}"")=""{1}""", sURL, strTmp));
return strTmp; return strTmp;
@ -3306,14 +3320,17 @@ namespace LSLEditor
string S1 = Base64ToString(sText1.ToString()); string S1 = Base64ToString(sText1.ToString());
string S2 = Base64ToString(sText2.ToString()); string S2 = Base64ToString(sText2.ToString());
int intLength = S1.Length; int intLength = S1.Length;
if (S2.Length == 0) if (S2.Length == 0) {
S2 = " "; S2 = " ";
while (S2.Length < intLength) }
while (S2.Length < intLength) {
S2 += S2; S2 += S2;
}
S2 = S2.Substring(0, intLength); S2 = S2.Substring(0, intLength);
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
for (int intI = 0; intI < intLength; intI++) for (int intI = 0; intI < intLength; intI++) {
sb.Append((char)(S1[intI] ^ S2[intI])); sb.Append((char)(S1[intI] ^ S2[intI]));
}
string sResult = StringToBase64(sb.ToString()); string sResult = StringToBase64(sb.ToString());
Verbose(@"llXorBase64StringsCorrect(""{0}"",""{1}"")=""{2}""", sText1, sText2, sResult); Verbose(@"llXorBase64StringsCorrect(""{0}"",""{1}"")=""{2}""", sText1, sText2, sResult);
return sResult; return sResult;

View file

@ -66,17 +66,17 @@ namespace LSLEditor
public class SecondLifeHostMessageLinkedEventArgs : EventArgs public class SecondLifeHostMessageLinkedEventArgs : EventArgs
{ {
public SecondLife.integer linknum; public SecondLife.integer iLinkIndex;
public SecondLife.integer num; public SecondLife.integer iNumber;
public SecondLife.String str; public SecondLife.String sText;
public SecondLife.key id; public SecondLife.key kID;
public SecondLifeHostMessageLinkedEventArgs(SecondLife.integer linknum, SecondLife.integer num, SecondLife.String str, SecondLife.key id) public SecondLifeHostMessageLinkedEventArgs(SecondLife.integer iLinkIndex, SecondLife.integer iNumber, SecondLife.String sText, SecondLife.key kID)
{ {
this.linknum = linknum; this.iLinkIndex = iLinkIndex;
this.num = num; this.iNumber = iNumber;
this.str = str; this.sText = sText;
this.id = id; this.kID = kID;
} }
} }
@ -179,12 +179,10 @@ namespace LSLEditor
private void StateWatch() private void StateWatch()
{ {
while (true) while (true) {
{
this.StateChanged.WaitOne(); this.StateChanged.WaitOne();
this.taskQueue.Start(); // is implicit Stop() old Queue this.taskQueue.Start(); // is implicit Stop() old Queue
if (this.CurrentStateName != this.NewStateName) if (this.CurrentStateName != this.NewStateName) {
{
this.CurrentStateName = this.NewStateName; this.CurrentStateName = this.NewStateName;
ExecuteSecondLife("state_exit"); ExecuteSecondLife("state_exit");
@ -196,56 +194,55 @@ namespace LSLEditor
public void State(string strStateName, bool blnForce) public void State(string strStateName, bool blnForce)
{ {
if (this.CompiledAssembly == null) if (this.CompiledAssembly != null) {
return; if (blnForce) {
if (blnForce) this.CurrentStateName = "";
this.CurrentStateName = ""; }
this.NewStateName = strStateName; this.NewStateName = strStateName;
this.StateChanged.Set(); this.StateChanged.Set();
}
} }
private void SetState() private void SetState()
{ {
if (CompiledAssembly == null) if (CompiledAssembly != null) {
return; secondLife = CompiledAssembly.CreateInstance("LSLEditor.State_" + CurrentStateName) as SecondLife;
secondLife = CompiledAssembly.CreateInstance("LSLEditor.State_" + CurrentStateName) as SecondLife;
if (secondLife == null) if (secondLife == null) {
{ MessageBox.Show("State " + CurrentStateName + " does not exist!");
MessageBox.Show("State " + CurrentStateName+" does not exist!"); return;
return; }
ListenFilterList = new List<ListenFilter>();
LinkList = new List<Link>();
// Make friends
secondLife.host = this;
// Update runtime userinterface by calling event handler
if (OnStateChange != null) {
OnStateChange(this, new SecondLifeHostEventArgs(CurrentStateName));
}
ExecuteSecondLife("state_entry");
} }
ListenFilterList = new List<ListenFilter>();
LinkList = new List<Link>();
// Make friends
secondLife.host = this;
// Update runtime userinterface by calling event handler
if (OnStateChange != null)
OnStateChange(this, new SecondLifeHostEventArgs(CurrentStateName));
ExecuteSecondLife("state_entry");
} }
public string GetArgumentsFromMethod(string strName) public string GetArgumentsFromMethod(string strName)
{ {
if (this.secondLife == null)
return "";
MethodInfo mi = secondLife.GetType().GetMethod(strName, BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly);
if (mi == null)
return "";
int intI = 0;
string strArgs = ""; string strArgs = "";
foreach (ParameterInfo pi in mi.GetParameters()) if (this.secondLife != null) {
{ MethodInfo mi = secondLife.GetType().GetMethod(strName, BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly);
if (intI > 0) if (mi != null) {
strArgs += ","; int intI = 0;
strArgs += pi.ParameterType.ToString() + " " + pi.Name; foreach (ParameterInfo pi in mi.GetParameters()) {
intI++; if (intI > 0)
strArgs += ",";
strArgs += pi.ParameterType.ToString() + " " + pi.Name;
intI++;
}
}
} }
return strArgs; return strArgs;
} }
@ -256,10 +253,8 @@ namespace LSLEditor
sb.Append("*** "); sb.Append("*** ");
sb.Append(strEventName); sb.Append(strEventName);
sb.Append('('); sb.Append('(');
for (int intI = 0; intI < args.Length; intI++) for (int intI = 0; intI < args.Length; intI++) {
{ if (intI > 0) sb.Append(',');
if (intI > 0)
sb.Append(',');
sb.Append(args[intI].ToString()); sb.Append(args[intI].ToString());
} }
sb.Append(")"); sb.Append(")");
@ -268,21 +263,18 @@ namespace LSLEditor
public void ExecuteSecondLife(string strName, params object[] args) public void ExecuteSecondLife(string strName, params object[] args)
{ {
if (secondLife == null) if (secondLife != null) {
return; VerboseEvent(strName, args);
VerboseEvent(strName, args); this.taskQueue.Invoke(secondLife, strName, args);
}
this.taskQueue.Invoke(secondLife, strName, args);
} }
public ArrayList GetEvents() public ArrayList GetEvents()
{ {
ArrayList ar = new ArrayList(); ArrayList ar = new ArrayList();
if (secondLife != null) if (secondLife != null) {
{ foreach (MethodInfo mi in secondLife.GetType().GetMethods(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly)) {
foreach (MethodInfo mi in secondLife.GetType().GetMethods(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly))
{
ar.Add(mi.Name); ar.Add(mi.Name);
} }
} }
@ -292,17 +284,18 @@ namespace LSLEditor
public void Reset() public void Reset()
{ {
if (OnReset != null) if (OnReset != null) {
OnReset(this, new EventArgs()); OnReset(this, new EventArgs());
}
} }
public void Die() public void Die()
{ {
if (OnDie != null) if (OnDie != null) {
OnDie(this, new EventArgs()); OnDie(this, new EventArgs());
}
if (secondLife != null) if (secondLife != null) {
{
// stop all timers // stop all timers
this.timer.Stop(); this.timer.Stop();
this.sensor_timer.Stop(); this.sensor_timer.Stop();
@ -313,26 +306,21 @@ namespace LSLEditor
this.secondLife = null; this.secondLife = null;
} }
} }
public void Dispose() public void Dispose()
{ {
if (taskQueue != null) if (taskQueue != null) {
{
this.taskQueue.Stop(); this.taskQueue.Stop();
this.taskQueue.Dispose(); this.taskQueue.Dispose();
this.taskQueue = null; this.taskQueue = null;
} }
if (listXmlRpc != null) if (listXmlRpc != null) {
{ foreach (XMLRPC xmlRpc in listXmlRpc) {
foreach (XMLRPC xmlRpc in listXmlRpc)
{
xmlRpc.CloseChannel(); xmlRpc.CloseChannel();
} }
} }
if (secondLife != null) if (secondLife != null) {
{
this.timer.Stop(); this.timer.Stop();
this.sensor_timer.Stop(); this.sensor_timer.Stop();
this.mainForm = null; this.mainForm = null;
@ -364,10 +352,8 @@ namespace LSLEditor
public void llBreakLink(int linknum) public void llBreakLink(int linknum)
{ {
foreach (Link link in this.LinkList) foreach (Link link in this.LinkList) {
{ if (link.number == linknum) {
if (link.number == linknum)
{
this.LinkList.Remove(link); this.LinkList.Remove(link);
break; break;
} }
@ -381,8 +367,7 @@ namespace LSLEditor
public string[] GetListenChannels() // for GroupboxEvent public string[] GetListenChannels() // for GroupboxEvent
{ {
List<string> list = new List<string>(); List<string> list = new List<string>();
foreach (ListenFilter lf in ListenFilterList) foreach (ListenFilter lf in ListenFilterList) {
{
list.Add(lf.channel.ToString()); list.Add(lf.channel.ToString());
} }
return list.ToArray(); return list.ToArray();
@ -407,11 +392,9 @@ namespace LSLEditor
public void llListenControl(int number, int active) public void llListenControl(int number, int active)
{ {
for (int intI = 0; intI < ListenFilterList.Count; intI++) for (int intI = 0; intI < ListenFilterList.Count; intI++) {
{
ListenFilter lf = ListenFilterList[intI]; ListenFilter lf = ListenFilterList[intI];
if (lf.GetHashCode() == number) if (lf.GetHashCode() == number) {
{
lf.active = (active == 1); lf.active = (active == 1);
ListenFilterList[intI] = lf; ListenFilterList[intI] = lf;
break; break;
@ -421,11 +404,9 @@ namespace LSLEditor
public void llListenRemove(int intHandle) public void llListenRemove(int intHandle)
{ {
for (int intI = 0; intI < ListenFilterList.Count; intI++) for (int intI = 0; intI < ListenFilterList.Count; intI++) {
{
ListenFilter lf = ListenFilterList[intI]; ListenFilter lf = ListenFilterList[intI];
if (lf.GetHashCode() == intHandle) if (lf.GetHashCode() == intHandle) {
{
ListenFilterList.RemoveAt(intI); ListenFilterList.RemoveAt(intI);
break; break;
} }
@ -450,18 +431,12 @@ namespace LSLEditor
{ {
ListenFilter lfToCheck = new ListenFilter(channel, name, id, message); ListenFilter lfToCheck = new ListenFilter(channel, name, id, message);
foreach (ListenFilter lf in ListenFilterList) foreach (ListenFilter lf in ListenFilterList) {
{ if (!lf.active) continue;
if (!lf.active) if (lf.channel != lfToCheck.channel) continue;
continue; if (lf.name != "" && lf.name != lfToCheck.name) continue;
if (lf.channel != lfToCheck.channel) if (lf.id != Guid.Empty.ToString() && lf.id != "" && lf.id != lfToCheck.id) continue;
continue; if (lf.message != "" && lf.message != lfToCheck.message) continue;
if (lf.name != "" && lf.name != lfToCheck.name)
continue;
if (lf.id != Guid.Empty.ToString() && lf.id!="" && lf.id != lfToCheck.id)
continue;
if (lf.message != "" && lf.message != lfToCheck.message)
continue;
return true; return true;
} }
return false; return false;
@ -470,10 +445,11 @@ namespace LSLEditor
// sink listen // sink listen
public void Listen(SecondLifeHostChatEventArgs e) public void Listen(SecondLifeHostChatEventArgs e)
{ {
if (secondLife == null) if (secondLife != null) {
return; if (CheckListenFilter(e.channel, e.name, e.id, e.message)) {
if (CheckListenFilter(e.channel, e.name, e.id, e.message)) ExecuteSecondLife("listen", e.channel, e.name, e.id, e.message);
ExecuteSecondLife("listen", e.channel, e.name, e.id, e.message); }
}
} }
#endregion #endregion
@ -481,98 +457,99 @@ namespace LSLEditor
// raise // raise
public void Chat(object sender, int channel, string name, SecondLife.key id, string message, CommunicationType how) public void Chat(object sender, int channel, string name, SecondLife.key id, string message, CommunicationType how)
{ {
if (OnChat != null) if (OnChat != null) {
OnChat(sender, new SecondLifeHostChatEventArgs(channel, name, id, message, how)); OnChat(sender, new SecondLifeHostChatEventArgs(channel, name, id, message, how));
}
} }
// raise // raise
public void MessageLinked(SecondLife.integer linknum, SecondLife.integer num, SecondLife.String str, SecondLife.key id) public void MessageLinked(SecondLife.integer iLlinkIndex, SecondLife.integer iNumber, SecondLife.String sText, SecondLife.key kID)
{ {
if (OnMessageLinked != null) if (OnMessageLinked != null) {
OnMessageLinked(this, new SecondLifeHostMessageLinkedEventArgs(linknum, num, str, id)); OnMessageLinked(this, new SecondLifeHostMessageLinkedEventArgs(iLlinkIndex, iNumber, sText, kID));
}
} }
// sink // sink
public void LinkMessage(SecondLifeHostMessageLinkedEventArgs e) public void LinkMessage(SecondLifeHostMessageLinkedEventArgs e)
{ {
ExecuteSecondLife("link_message", e.linknum, e.num, e.str, e.id); ExecuteSecondLife("link_message", e.iLinkIndex, e.iNumber, e.sText, e.kID);
} }
public SecondLife.key Http(string Url, SecondLife.list Parameters, string Body) public SecondLife.key Http(string Url, SecondLife.list Parameters, string Body)
{ {
if (secondLife == null) SecondLife.key Key = SecondLife.NULL_KEY;
return SecondLife.NULL_KEY; if (secondLife != null) {
System.Net.WebProxy proxy = null;
if (Properties.Settings.Default.ProxyServer != "") {
proxy = new System.Net.WebProxy(Properties.Settings.Default.ProxyServer.Replace("http://", ""));
}
System.Net.WebProxy proxy = null; if (Properties.Settings.Default.ProxyUserid != "" && proxy != null) {
if (Properties.Settings.Default.ProxyServer != "") proxy.Credentials = new System.Net.NetworkCredential(Properties.Settings.Default.ProxyUserid, Properties.Settings.Default.ProxyPassword);
proxy = new System.Net.WebProxy(Properties.Settings.Default.ProxyServer.Replace("http://", "")); }
if (Properties.Settings.Default.ProxyUserid != "" && proxy != null) Key = new SecondLife.key(Guid.NewGuid());
proxy.Credentials = new System.Net.NetworkCredential(Properties.Settings.Default.ProxyUserid, Properties.Settings.Default.ProxyPassword); //WebRequestClass a = new WebRequestClass(proxy, secondLife, Url, Parameters, Body, Key);
try {
SecondLife.key Key = new SecondLife.key(Guid.NewGuid()); HTTPRequest.Request(proxy, secondLife, Url, Parameters, Body, Key);
//WebRequestClass a = new WebRequestClass(proxy, secondLife, Url, Parameters, Body, Key); } catch (Exception exception) {
try VerboseMessage(exception.Message);
{ }
HTTPRequest.Request(proxy, secondLife, Url, Parameters, Body, Key);
}
catch(Exception exception)
{
VerboseMessage(exception.Message);
} }
return Key; return Key;
} }
public void Email(string To, string Subject, string Body) public void Email(string To, string Subject, string Body)
{ {
if (secondLife == null) if (secondLife != null) {
return; SmtpClient client = new SmtpClient();
client.SmtpServer = Properties.Settings.Default.EmailServer;
SmtpClient client = new SmtpClient(); string strName = GetObjectName();
client.SmtpServer = Properties.Settings.Default.EmailServer; string strObjectName = string.Format("Object-Name: {0}", strName);
string strName = GetObjectName(); SecondLife.vector RegionCorner = secondLife.llGetRegionCorner();
string strObjectName = string.Format("Object-Name: {0}", strName); string strRegionName = secondLife.llGetRegionName();
string strRegion = string.Format("Region: {0} ({1},{2})", strRegionName, RegionCorner.x, RegionCorner.y);
SecondLife.vector RegionCorner = secondLife.llGetRegionCorner(); SecondLife.vector pos = secondLife.llGetPos();
string strRegionName = secondLife.llGetRegionName(); string strPosition = string.Format("Local-Position: ({0},{1},{2})", (int)pos.x, (int)pos.y, (int)pos.z);
string strRegion = string.Format("Region: {0} ({1},{2})", strRegionName, RegionCorner.x, RegionCorner.y);
SecondLife.vector pos = secondLife.llGetPos(); string strPrefix = strObjectName + "\r\n";
string strPosition = string.Format("Local-Position: ({0},{1},{2})", (int)pos.x, (int)pos.y, (int)pos.z); strPrefix += strRegion + "\r\n";
strPrefix += strPosition + "\r\n\r\n";
string strPrefix = strObjectName + "\r\n"; MailMessage msg = new MailMessage();
strPrefix += strRegion + "\r\n"; msg.To = To;
strPrefix += strPosition + "\r\n\r\n"; msg.Subject = Subject;
msg.Body = strPrefix + Body;
msg.From = Properties.Settings.Default.EmailAddress;
msg.Headers.Add("Reply-to", msg.From);
MailMessage msg = new MailMessage(); //MailAttachment myAttachment = new MailAttachment(strAttachmentFile);
msg.To = To; //msg.Attachments.Add(myAttachment);
msg.Subject = Subject;
msg.Body = strPrefix + Body;
msg.From = Properties.Settings.Default.EmailAddress;
msg.Headers.Add("Reply-to", msg.From);
//MailAttachment myAttachment = new MailAttachment(strAttachmentFile); VerboseMessage(client.Send(msg));
//msg.Attachments.Add(myAttachment); }
VerboseMessage(client.Send(msg));
} }
public void VerboseMessage(string Message) public void VerboseMessage(string Message)
{ {
if (OnVerboseMessage != null) if (OnVerboseMessage != null) {
OnVerboseMessage(this, new SecondLifeHostEventArgs(Message)); OnVerboseMessage(this, new SecondLifeHostEventArgs(Message));
}
} }
delegate void ShowDialogDelegate(SecondLifeHost host, delegate void ShowDialogDelegate(SecondLifeHost host,
SecondLife.String objectName, SecondLife.String objectName,
SecondLife.key k, SecondLife.key k,
SecondLife.String name, SecondLife.String name,
SecondLife.String message, SecondLife.String message,
SecondLife.list buttons, SecondLife.list buttons,
SecondLife.integer channel); SecondLife.integer channel);
private void Dialog(SecondLifeHost host, private void Dialog(SecondLifeHost host,
SecondLife.String objectName, SecondLife.String objectName,
SecondLife.key k, SecondLife.key k,
SecondLife.String name, SecondLife.String name,
@ -589,68 +566,62 @@ namespace LSLEditor
public void llDialog(SecondLife.key avatar, SecondLife.String message, SecondLife.list buttons, SecondLife.integer channel) public void llDialog(SecondLife.key avatar, SecondLife.String message, SecondLife.list buttons, SecondLife.integer channel)
{ {
if (message.ToString().Length >= 512) if (message.ToString().Length >= 512) {
{
VerboseMessage("llDialog: message too long, must be less than 512 characters"); VerboseMessage("llDialog: message too long, must be less than 512 characters");
return; return;
} }
if (message.ToString().Length == 0) if (message.ToString().Length == 0) {
{
VerboseMessage("llDialog: must supply a message"); VerboseMessage("llDialog: must supply a message");
return; return;
} }
for (int intI = 0; intI < buttons.Count; intI++) for (int intI = 0; intI < buttons.Count; intI++) {
{ if (buttons[intI].ToString() == "") {
if (buttons[intI].ToString() == "")
{
VerboseMessage("llDialog: all buttons must have label strings"); VerboseMessage("llDialog: all buttons must have label strings");
return; return;
} }
if (buttons[intI].ToString().Length > 24) if (buttons[intI].ToString().Length > 24) {
{
VerboseMessage("llDialog:Button Labels can not have more than 24 characters"); VerboseMessage("llDialog:Button Labels can not have more than 24 characters");
return; return;
} }
} }
if (buttons.Count == 0) if (buttons.Count == 0) {
buttons = new SecondLife.list(new string[] { "OK" }); buttons = new SecondLife.list(new string[] { "OK" });
}
this.mainForm.Invoke(new ShowDialogDelegate(Dialog), this, (SecondLife.String)GetObjectName(), secondLife.llGetOwner(), (SecondLife.String)Properties.Settings.Default.AvatarName, message, buttons, channel); this.mainForm.Invoke(new ShowDialogDelegate(Dialog), this, (SecondLife.String)GetObjectName(), secondLife.llGetOwner(), (SecondLife.String)Properties.Settings.Default.AvatarName, message, buttons, channel);
} }
delegate void ShowTextBoxDelegate(SecondLifeHost host, delegate void ShowTextBoxDelegate(SecondLifeHost host,
SecondLife.String objectName, SecondLife.String objectName,
SecondLife.key k, SecondLife.key k,
SecondLife.String name, SecondLife.String name,
SecondLife.String message, SecondLife.String message,
SecondLife.integer channel); SecondLife.integer channel);
private void TextBox(SecondLifeHost host, private void TextBox(SecondLifeHost host,
SecondLife.String objectName, SecondLife.String objectName,
SecondLife.key k, SecondLife.key k,
SecondLife.String name, SecondLife.String name,
SecondLife.String message, SecondLife.String message,
SecondLife.integer channel) SecondLife.integer channel)
{ {
llTextBoxForm TextBoxForm = new llTextBoxForm(host, objectName, k, name, message, channel); llTextBoxForm TextBoxForm = new llTextBoxForm(host, objectName, k, name, message, channel);
TextBoxForm.Left = this.mainForm.Left + this.mainForm.Width / 2 - TextBoxForm.Width / 2; TextBoxForm.Left = this.mainForm.Left + this.mainForm.Width / 2 - TextBoxForm.Width / 2;
TextBoxForm.Top = this.mainForm.Top + this.mainForm.Height / 2 - TextBoxForm.Height / 2; TextBoxForm.Top = this.mainForm.Top + this.mainForm.Height / 2 - TextBoxForm.Height / 2;
TextBoxForm.Show(this.mainForm); TextBoxForm.Show(this.mainForm);
this.mainForm.llTextBoxForms.Add(TextBoxForm); this.mainForm.llTextBoxForms.Add(TextBoxForm);
} }
public void llTextBox(SecondLife.key avatar, SecondLife.String message, SecondLife.integer channel) public void llTextBox(SecondLife.key avatar, SecondLife.String message, SecondLife.integer channel)
{ {
if (message.ToString().Length >= 512) if (message.ToString().Length >= 512) {
{ VerboseMessage("llTextBox: message too long, must be less than 512 characters");
VerboseMessage("llTextBox: message too long, must be less than 512 characters"); return;
return; }
} if (message.ToString().Length == 0) {
if (message.ToString().Length == 0) VerboseMessage("llTextBos: must supply a message");
{ return;
VerboseMessage("llTextBos: must supply a message"); }
return; this.mainForm.Invoke(new ShowTextBoxDelegate(TextBox), this, (SecondLife.String)GetObjectName(), secondLife.llGetOwner(), (SecondLife.String)Properties.Settings.Default.AvatarName, message, channel);
} }
this.mainForm.Invoke(new ShowTextBoxDelegate(TextBox), this, (SecondLife.String)GetObjectName(), secondLife.llGetOwner(), (SecondLife.String)Properties.Settings.Default.AvatarName, message, channel);
}
public void SetPermissions(SecondLife.integer intPermissions) public void SetPermissions(SecondLife.integer intPermissions)
{ {
@ -681,12 +652,12 @@ namespace LSLEditor
public void llRequestPermissions(SecondLife.key agent, SecondLife.integer intPermissions) public void llRequestPermissions(SecondLife.key agent, SecondLife.integer intPermissions)
{ {
this.mainForm.Invoke(new RequestPermissionsDelegate(RequestPermissions), this.mainForm.Invoke(new RequestPermissionsDelegate(RequestPermissions),
this, this,
(SecondLife.String)GetObjectName(), (SecondLife.String)GetObjectName(),
secondLife.llGetOwner(), secondLife.llGetOwner(),
(SecondLife.String)Properties.Settings.Default.AvatarName, (SecondLife.String)Properties.Settings.Default.AvatarName,
agent, agent,
intPermissions); intPermissions);
} }
@ -694,26 +665,22 @@ namespace LSLEditor
public void SendControl(Keys keys) public void SendControl(Keys keys)
{ {
if (m_intControls < 0) if (m_intControls >= 0 || this.secondLife != null) {
return; // check againt m_intControls TODO!!!!!
if (this.secondLife == null) int held = 0;
return; int change = 0;
// check againt m_intControls TODO!!!!! if ((keys & Keys.Up) == Keys.Up)
held |= SecondLife.CONTROL_UP;
if ((keys & Keys.Down) == Keys.Down)
held |= SecondLife.CONTROL_DOWN;
if ((keys & Keys.Left) == Keys.Left)
held |= SecondLife.CONTROL_LEFT;
if ((keys & Keys.Right) == Keys.Right)
held |= SecondLife.CONTROL_RIGHT;
int held = 0; ExecuteSecondLife("control", (SecondLife.key)Properties.Settings.Default.AvatarKey, (SecondLife.integer)held, (SecondLife.integer)change);
int change = 0; }
if ((keys & Keys.Up) == Keys.Up)
held |= SecondLife.CONTROL_UP;
if ((keys & Keys.Down) == Keys.Down)
held |= SecondLife.CONTROL_DOWN;
if ((keys & Keys.Left) == Keys.Left)
held |= SecondLife.CONTROL_LEFT;
if ((keys & Keys.Right) == Keys.Right)
held |= SecondLife.CONTROL_RIGHT;
ExecuteSecondLife("control", (SecondLife.key)Properties.Settings.Default.AvatarKey, (SecondLife.integer)held, (SecondLife.integer)change);
} }
public void TakeControls(int intControls, int accept, int pass_on) public void TakeControls(int intControls, int accept, int pass_on)
@ -732,11 +699,9 @@ namespace LSLEditor
StreamReader sr = new StreamReader(strPath); StreamReader sr = new StreamReader(strPath);
int intI = 0; int intI = 0;
string strData = SecondLife.EOF; string strData = SecondLife.EOF;
while (!sr.EndOfStream) while (!sr.EndOfStream) {
{
string strLine = sr.ReadLine(); string strLine = sr.ReadLine();
if (intI == line) if (intI == line) {
{
strData = strLine; strData = strLine;
break; break;
} }
@ -749,10 +714,10 @@ namespace LSLEditor
public SecondLife.key GetNotecardLine(string name, int line) public SecondLife.key GetNotecardLine(string name, int line)
{ {
string strPath = mainForm.SolutionExplorer.GetPath(this.guid, name); string strPath = mainForm.SolutionExplorer.GetPath(this.guid, name);
if(strPath == string.Empty) if (strPath == string.Empty) {
strPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), name); strPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), name);
if (!File.Exists(strPath)) }
{ if (!File.Exists(strPath)) {
VerboseMessage("Notecard: " + strPath + " not found"); VerboseMessage("Notecard: " + strPath + " not found");
taskQueue.Invoke(secondLife, "llSay", (SecondLife.integer)0, (SecondLife.String)("Couldn't find notecard " + name)); taskQueue.Invoke(secondLife, "llSay", (SecondLife.integer)0, (SecondLife.String)("Couldn't find notecard " + name));
return SecondLife.NULL_KEY; return SecondLife.NULL_KEY;
@ -767,8 +732,7 @@ namespace LSLEditor
{ {
StreamReader sr = new StreamReader(strPath); StreamReader sr = new StreamReader(strPath);
int intI = 0; int intI = 0;
while (!sr.EndOfStream) while (!sr.EndOfStream) {
{
string strLine = sr.ReadLine(); string strLine = sr.ReadLine();
intI++; intI++;
} }
@ -780,11 +744,11 @@ namespace LSLEditor
public SecondLife.key GetNumberOfNotecardLines(string name) public SecondLife.key GetNumberOfNotecardLines(string name)
{ {
string strPath = mainForm.SolutionExplorer.GetPath(this.guid, name); string strPath = mainForm.SolutionExplorer.GetPath(this.guid, name);
if (strPath == string.Empty) if (strPath == string.Empty) {
strPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), name); strPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), name);
}
if (!File.Exists(strPath)) if (!File.Exists(strPath)) {
{
VerboseMessage("Notecard: " + strPath + " not found"); VerboseMessage("Notecard: " + strPath + " not found");
taskQueue.Invoke(secondLife, "llSay", (SecondLife.integer)0, (SecondLife.String)("Couldn't find notecard " + name)); taskQueue.Invoke(secondLife, "llSay", (SecondLife.integer)0, (SecondLife.String)("Couldn't find notecard " + name));
return SecondLife.NULL_KEY; return SecondLife.NULL_KEY;
@ -800,8 +764,9 @@ namespace LSLEditor
private List<XMLRPC> listXmlRpc; private List<XMLRPC> listXmlRpc;
public void llOpenRemoteDataChannel() public void llOpenRemoteDataChannel()
{ {
if (listXmlRpc == null) if (listXmlRpc == null) {
listXmlRpc = new List<XMLRPC>(); listXmlRpc = new List<XMLRPC>();
}
XMLRPC xmlRpc = new XMLRPC(); XMLRPC xmlRpc = new XMLRPC();
xmlRpc.OnRequest += new XMLRPC.RequestEventHandler(xmlRpc_OnRequest); xmlRpc.OnRequest += new XMLRPC.RequestEventHandler(xmlRpc_OnRequest);
xmlRpc.OpenChannel(listXmlRpc.Count); xmlRpc.OpenChannel(listXmlRpc.Count);
@ -830,27 +795,23 @@ namespace LSLEditor
public void llCloseRemoteDataChannel(SecondLife.key channel) public void llCloseRemoteDataChannel(SecondLife.key channel)
{ {
if (listXmlRpc == null) if (listXmlRpc != null) {
return; foreach (XMLRPC xmlRpc in listXmlRpc) {
foreach (XMLRPC xmlRpc in listXmlRpc) if (xmlRpc.guid == channel.guid) {
{ xmlRpc.CloseChannel();
if (xmlRpc.guid == channel.guid) break;
{ }
xmlRpc.CloseChannel();
break;
} }
} }
} }
public void llRemoteDataReply(SecondLife.key channel, SecondLife.key message_id, string sdata, int idata) public void llRemoteDataReply(SecondLife.key channel, SecondLife.key message_id, string sdata, int idata)
{ {
if (listXmlRpc == null) if (listXmlRpc != null) {
return; foreach (XMLRPC xmlRpc in listXmlRpc) {
foreach (XMLRPC xmlRpc in listXmlRpc) if (xmlRpc.guid == channel.guid) {
{ xmlRpc.RemoteDataReply(channel.guid, message_id.guid, sdata, idata);
if (xmlRpc.guid == channel.guid) break;
{ }
xmlRpc.RemoteDataReply(channel.guid, message_id.guid, sdata, idata);
break;
} }
} }
} }
@ -880,10 +841,7 @@ namespace LSLEditor
public string GetObjectName(Guid guid) public string GetObjectName(Guid guid)
{ {
string strObjectName = mainForm.SolutionExplorer.GetObjectName(guid); string strObjectName = mainForm.SolutionExplorer.GetObjectName(guid);
if (strObjectName != string.Empty) return strObjectName != string.Empty ? strObjectName : this.ObjectName;
return strObjectName;
else
return this.ObjectName;
} }
public string GetObjectName() public string GetObjectName()
@ -893,17 +851,19 @@ namespace LSLEditor
public void SetObjectName(string name) public void SetObjectName(string name)
{ {
if (!mainForm.SolutionExplorer.SetObjectName(this.guid, name)) if (!mainForm.SolutionExplorer.SetObjectName(this.guid, name)) {
ObjectName = name; ObjectName = name;
}
} }
public string GetObjectDescription(Guid guid) public string GetObjectDescription(Guid guid)
{ {
string strObjectDescription = mainForm.SolutionExplorer.GetObjectDescription(guid); string strObjectDescription = mainForm.SolutionExplorer.GetObjectDescription(guid);
if (strObjectDescription != string.Empty) if (strObjectDescription != string.Empty) {
return strObjectDescription; return strObjectDescription;
else } else {
return this.ObjectDescription; return this.ObjectDescription;
}
} }
public string GetObjectDescription() public string GetObjectDescription()
@ -913,43 +873,49 @@ namespace LSLEditor
public void SetObjectDescription(string description) public void SetObjectDescription(string description)
{ {
if (!mainForm.SolutionExplorer.SetObjectDescription(this.guid, description)) if (!mainForm.SolutionExplorer.SetObjectDescription(this.guid, description)) {
this.ObjectDescription = description; this.ObjectDescription = description;
}
} }
public string GetScriptName() public string GetScriptName()
{ {
string strScriptName = mainForm.SolutionExplorer.GetScriptName(this.guid); string strScriptName = mainForm.SolutionExplorer.GetScriptName(this.guid);
if (strScriptName == string.Empty) if (strScriptName == string.Empty) {
strScriptName = this.FullPath; strScriptName = this.FullPath;
if (Properties.Settings.Default.llGetScriptName) }
if (Properties.Settings.Default.llGetScriptName) {
strScriptName = Path.GetFileNameWithoutExtension(strScriptName); strScriptName = Path.GetFileNameWithoutExtension(strScriptName);
else } else {
strScriptName = Path.GetFileName(strScriptName); strScriptName = Path.GetFileName(strScriptName);
}
return strScriptName; return strScriptName;
} }
public SecondLife.key GetKey() public SecondLife.key GetKey()
{ {
string strGuid = mainForm.SolutionExplorer.GetKey(this.guid); string strGuid = mainForm.SolutionExplorer.GetKey(this.guid);
if (strGuid == string.Empty) if (strGuid == string.Empty) {
return new SecondLife.key(this.guid); return new SecondLife.key(this.guid);
}
return new SecondLife.key(strGuid); return new SecondLife.key(strGuid);
} }
public SecondLife.String GetInventoryName(SecondLife.integer type, SecondLife.integer number) public SecondLife.String GetInventoryName(SecondLife.integer type, SecondLife.integer number)
{ {
string strInventoryName = mainForm.SolutionExplorer.GetInventoryName(this.guid, type, number); string strInventoryName = mainForm.SolutionExplorer.GetInventoryName(this.guid, type, number);
if (strInventoryName == string.Empty) if (strInventoryName == string.Empty) {
return "**GetInventoryName only works in SolutionExplorer**"; return "**GetInventoryName only works in SolutionExplorer**";
}
return strInventoryName; return strInventoryName;
} }
public SecondLife.key GetInventoryKey(SecondLife.String name) public SecondLife.key GetInventoryKey(SecondLife.String name)
{ {
string strInventoryKey = mainForm.SolutionExplorer.GetInventoryKey(this.guid, name); string strInventoryKey = mainForm.SolutionExplorer.GetInventoryKey(this.guid, name);
if (strInventoryKey == string.Empty) if (strInventoryKey == string.Empty) {
return new SecondLife.key(Guid.Empty); return new SecondLife.key(Guid.Empty);
}
return new SecondLife.key(strInventoryKey); return new SecondLife.key(strInventoryKey);
} }
@ -963,16 +929,17 @@ namespace LSLEditor
return mainForm.SolutionExplorer.GetInventoryType(this.guid, name); return mainForm.SolutionExplorer.GetInventoryType(this.guid, name);
} }
public void RemoveInventory(SecondLife.String name) public void RemoveInventory(SecondLife.String name)
{ {
mainForm.SolutionExplorer.RemoveInventory(this.guid, name); mainForm.SolutionExplorer.RemoveInventory(this.guid, name);
} }
public System.Media.SoundPlayer GetSoundPlayer(string sound) public System.Media.SoundPlayer GetSoundPlayer(string sound)
{ {
string strPath = mainForm.SolutionExplorer.GetPath(this.guid, sound); string strPath = mainForm.SolutionExplorer.GetPath(this.guid, sound);
if (strPath == string.Empty) if (strPath == string.Empty) {
strPath = sound; strPath = sound;
}
return new System.Media.SoundPlayer(strPath); return new System.Media.SoundPlayer(strPath);
} }

View file

@ -42,433 +42,478 @@
// ******** // ********
// */ // */
using System; using System;
using System.Text;
using System.Text.RegularExpressions;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
/*
//
// (C) 2006,2007 Alphons van der Heijden // (C) 2006,2007 Alphons van der Heijden
// mail: alphons@heijden.com // mail: alphons@heijden.com
// */
namespace LSLEditor namespace LSLEditor
{ {
/// <summary>
/// Enumeration of Communication Types that the host understands
/// </summary>
public enum CommunicationType public enum CommunicationType
{ {
Whisper, Say, Shout, OwnerSay, RegionSay, RegionSayTo Whisper, Say, Shout, OwnerSay, RegionSay, RegionSayTo
} }
public partial class SecondLife public partial class SecondLife
{ {
// Make friends with my host /// <summary>
public SecondLifeHost host; /// Holds the host object.
/// </summary>
private SecondLifeHost slhHost;
#region members #region members
// Random generator /// <summary>
private Random m_random; /// Random generator.
/// </summary>
private Random rdmRandom;
private DateTime m_DateTimeScriptStarted; /// <summary>
/// Holds the time of the script starting execution.
/// </summary>
private DateTime dtDateTimeScriptStarted;
private Boolean m_AllowDrop = false; /// <summary>
private Hashtable m_LandPassList; /// Contains a boolean value indicating wether this object accepts other items to be dropped into it.
/// </summary>
private bool blnAllowDrop = false;
private Hashtable m_LandBanList; /// <summary>
/// Contains a list of keys of avatars that may enter a parcel.
/// </summary>
private Hashtable htLandPassList;
private Float m_Volume; /// <summary>
/// Contains a list of keys of avatars that may NOT enter a parcel.
/// </summary>
private Hashtable htLandBanList;
private String m_ObjectName; /// <summary>
private String m_ParcelMusicURL; /// Volume of sound played by this prim.
private vector m_pos; /// </summary>
private rotation m_rot; private Float fVolume;
private rotation m_rotlocal;
private vector m_scale;
private String m_SitText;
private Float m_SoundRadius;
private vector m_RegionCorner; private String sObjectName;
private String sParcelMusicURL;
private vector vPosition;
private rotation rRotation;
private rotation rRotationlocal;
private vector vScale;
private String sSitText;
private Float fSoundRadius;
private integer m_start_parameter; private vector vRegionCorner;
#endregion private integer iStartParameter;
#region Properties
public vector GetLocalPos
{
// TODO change this to use a call to llGetLocalPos specifying NOT to be Verbose. After all functions have been changed to allow verbose/silent option.
get { return m_pos; }
}
#endregion #endregion
#region constructor #region Constructor
/// <summary>
/// Initialises the <see cref="SecondLife"/> class.
/// </summary>
public SecondLife() public SecondLife()
{ {
host = null; this.host = null;
m_random = new Random(); rdmRandom = new Random();
m_DateTimeScriptStarted = DateTime.Now.ToUniversalTime(); dtDateTimeScriptStarted = DateTime.Now.ToUniversalTime();
m_LandPassList = new Hashtable(); htLandPassList = new Hashtable();
m_LandBanList = new Hashtable(); htLandBanList = new Hashtable();
m_Volume = 0.0; fVolume = 0.0;
m_ObjectName = null; sObjectName = null;
m_pos = new vector(127, 128, 20); vPosition = new vector(127, 128, 20);
m_rot = rotation.ZERO_ROTATION; rRotation = rotation.ZERO_ROTATION;
m_rotlocal = rotation.ZERO_ROTATION; rRotationlocal = rotation.ZERO_ROTATION;
m_scale = vector.ZERO_VECTOR; vScale = vector.ZERO_VECTOR;
m_SitText = "sittext"; sSitText = "sittext";
m_SoundRadius = 1.0; fSoundRadius = 1.0;
m_start_parameter = 0; iStartParameter = 0;
m_RegionCorner = vector.ZERO_VECTOR; vRegionCorner = vector.ZERO_VECTOR;
} }
#endregion #endregion
#region internal routines #region Properties
private void Verbose(string strLine, params object[] parameters) public vector GetLocalPos
{ {
if (parameters.Length == 0) // TODO change this to use a call to llGetLocalPos specifying NOT to be Verbose. After all functions have been changed to allow verbose/silent option.
host.VerboseMessage(strLine); get { return vPosition; }
else }
host.VerboseMessage(string.Format(strLine, parameters));
} public SecondLifeHost host
{
get { return this.slhHost; }
set { this.slhHost = value; }
}
#endregion
#region internal routines
private void Verbose(string strLine, params object[] parameters)
{
if (parameters.Length == 0) {
host.VerboseMessage(strLine);
} else {
this.host.VerboseMessage(string.Format(strLine, parameters));
}
}
private void Chat(integer channel, string message, CommunicationType how) private void Chat(integer iChannel, string sText, CommunicationType ctHow)
{ {
host.Chat(host, channel, host.GetObjectName(), host.GetKey(), message, how); this.host.Chat(this.host, iChannel, this.host.GetObjectName(), this.host.GetKey(), sText, ctHow);
} }
public void state(string strStateName) public void state(string strStateName)
{ {
Verbose("state->" + strStateName); Verbose("state->" + strStateName);
host.State(strStateName, false); host.State(strStateName, false);
System.Threading.Thread.Sleep(1000); System.Threading.Thread.Sleep(1000);
System.Windows.Forms.MessageBox.Show("If you see this, something is wrong", "Oops..."); System.Windows.Forms.MessageBox.Show("If you see this, something is wrong", "Oops...");
} }
#endregion #endregion
#region Helper Functions #region Helper Functions
#region List Functions #region List Functions
private bool CorrectIt(int intLength, ref int intStart, ref int intEnd)
{
bool bResult = true;
if (intStart < 0) {
intStart = intLength + intStart;
}
private bool CorrectIt(int length, ref int start, ref int end) if (intEnd < 0) {
{ intEnd = intLength + intEnd;
if (start < 0) }
start = length + start;
if (end < 0) if (intStart <= intEnd) {
end = length + end; if (intStart >= intLength) {
bResult = false;
}
if (intEnd < 0) {
bResult = false;
}
}
if (start <= end) intStart = Math.Max(0, intStart);
{ intEnd = Math.Min(intLength - 1, intEnd);
if (start >= length)
return false;
if (end < 0)
return false;
}
start = Math.Max(0, start); return bResult;
end = Math.Min(length - 1, end); }
return true; public ArrayList RandomShuffle(ArrayList alCollection)
} {
/* We have to copy all items anyway, and there isn't a way to produce the items
on the fly that is linear. So copying to an array and shuffling it is as efficient as we can get.
*/
public ArrayList RandomShuffle(ArrayList collection) if (alCollection == null) {
{ throw new ArgumentNullException("collection");
// We have to copy all items anyway, and there isn't a way to produce the items }
// on the fly that is linear. So copying to an array and shuffling it is as efficient as we can get.
if (collection == null) int intCount = alCollection.Count;
throw new ArgumentNullException("collection"); for (int i = intCount - 1; i >= 1; --i) {
// Pick an random number 0 through i inclusive.
int j = rdmRandom.Next(i + 1);
int count = collection.Count; // Swap array[i] and array[j]
for (int i = count - 1; i >= 1; --i) object temp = alCollection[i];
{ alCollection[i] = alCollection[j];
// Pick an random number 0 through i inclusive. alCollection[j] = temp;
int j = m_random.Next(i + 1); }
return alCollection;
}
// Swap array[i] and array[j] private ArrayList List2Buckets(list lSource, int intStride)
object temp = collection[i]; {
collection[i] = collection[j]; ArrayList alBuckets = null;
collection[j] = temp; if ((lSource.Count % intStride) == 0 && intStride <= lSource.Count) {
} alBuckets = new ArrayList();
return collection; for (int intI = 0; intI < lSource.Count; intI += intStride) {
} object[] bucket = new object[intStride];
for (int intJ = 0; intJ < intStride; intJ++) {
bucket[intJ] = lSource[intI + intJ];
}
alBuckets.Add(bucket);
}
}
return alBuckets;
}
private ArrayList List2Buckets(list src, int stride) private list Buckets2List(ArrayList alBuckets, int intStride)
{ {
ArrayList buckets = null; object[] items = new object[alBuckets.Count * intStride];
if ((src.Count % stride) == 0 && stride <= src.Count) for (int intI = 0; intI < alBuckets.Count; intI++) {
{ for (int intJ = 0; intJ < intStride; intJ++) {
buckets = new ArrayList(); items[intI * intStride + intJ] = ((object[])alBuckets[intI])[intJ];
for (int intI = 0; intI < src.Count; intI += stride) }
{ }
object[] bucket = new object[stride]; return new list(items);
for (int intJ = 0; intJ < stride; intJ++) }
bucket[intJ] = src[intI + intJ];
buckets.Add(bucket);
}
}
return buckets;
}
private list Buckets2List(ArrayList buckets, int stride) /// <summary>
{ /// Implements the Comparer Interface for our custom types (Float, Integer, and String).
object[] items = new object[buckets.Count * stride]; /// </summary>
for (int intI = 0; intI < buckets.Count; intI++) private class BucketComparer : IComparer
{ {
for (int intJ = 0; intJ < stride; intJ++) private integer iAscending;
items[intI * stride + intJ] = ((object[])buckets[intI])[intJ];
}
return new list(items);
}
private class BucketComparer : IComparer /// <summary>
{ /// Initialises the <see cref="BucketComparer"/> class.
private integer ascending; /// </summary>
public BucketComparer(integer ascending) /// <param name="ascending"></param>
{ public BucketComparer(integer ascending)
this.ascending = ascending; {
} this.iAscending = ascending;
public int Compare(object x, object y) }
{
object[] xx = x as object[];
object[] yy = y as object[];
object A, B; public int Compare(object x, object y)
{
int iResult = 0;
object objA, objB;
if (ascending == TRUE) object[] xx = x as object[];
{ object[] yy = y as object[];
A = xx[0];
B = yy[0];
}
else
{
B = xx[0];
A = yy[0];
}
string strType = A.GetType().ToString(); if (iAscending == TRUE) {
objA = xx[0];
objB = yy[0];
} else {
objB = xx[0];
objA = yy[0];
}
if (((A is string) && (B is string)) || string strType = objA.GetType().ToString();
((A is SecondLife.String) && (B is SecondLife.String)))
return string.Compare(A.ToString(), B.ToString());
if ((A is SecondLife.integer) && (B is SecondLife.integer)) if (((objA is string) && (objB is string)) || ((objA is SecondLife.String) && (objB is SecondLife.String))) {
return SecondLife.integer.Compare((SecondLife.integer)A, (SecondLife.integer)B); iResult = string.Compare(objA.ToString(), objB.ToString());
} else if ((objA is SecondLife.integer) && (objB is SecondLife.integer)) {
iResult = SecondLife.integer.Compare((SecondLife.integer)objA, (SecondLife.integer)objB);
} else if ((objA is SecondLife.Float) && (objB is SecondLife.Float)) {
iResult = SecondLife.Float.Compare((SecondLife.Float)objA, (SecondLife.Float)objB);
}
if ((A is SecondLife.Float) && (B is SecondLife.Float)) return iResult;
return SecondLife.Float.Compare((SecondLife.Float)A, (SecondLife.Float)B); }
}
#endregion
return 0; #region String Functions
} private list ParseString(String sSource, list lSeparators, list lSpacers, bool blnKeepNulls)
} {
#endregion list lResult = new list();
int intFrom = 0;
string s = sSource;
for (int intI = 0; intI < s.Length; intI++) {
string strTmp = s.Substring(intI);
bool blnFound = false;
for (int intJ = 0; intJ < lSeparators.Count; intJ++) {
string strSeparator = lSeparators[intJ].ToString();
if (strSeparator.Length == 0) {
continue; // check this
}
if (strTmp.IndexOf(strSeparator) == 0) {
string strBefore = s.Substring(intFrom, intI - intFrom);
if (strBefore != "" || blnKeepNulls) {
lResult.Add(strBefore);
}
intI += strSeparator.Length - 1;
intFrom = intI + 1;
blnFound = true;
break;
}
}
#region String Functions if (blnFound) {
private list ParseString(String src, list separators, list spacers, bool blnKeepNulls) continue;
{ }
list result = new list();
int intFrom = 0;
string s = src;
for (int intI = 0; intI < s.Length; intI++)
{
string strTmp = s.Substring(intI);
bool blnFound = false;
for (int intJ = 0; intJ < separators.Count; intJ++)
{
string strSeparator = separators[intJ].ToString();
if (strSeparator.Length == 0)
continue; // check this
if (strTmp.IndexOf(strSeparator) == 0)
{
string strBefore = s.Substring(intFrom, intI - intFrom);
if (strBefore != "" || blnKeepNulls)
result.Add(strBefore);
intI += strSeparator.Length - 1;
intFrom = intI + 1;
blnFound = true;
break;
}
}
if (blnFound) for (int intJ = 0; intJ < lSpacers.Count; intJ++) {
continue; string strSpacer = lSpacers[intJ].ToString();
if (strSpacer.Length == 0) {
continue; // check this
}
if (strTmp.IndexOf(strSpacer) == 0) {
string strBefore = s.Substring(intFrom, intI - intFrom);
if (strBefore != "" || blnKeepNulls) {
lResult.Add(strBefore);
}
lResult.Add(strSpacer);
intI += strSpacer.Length - 1;
intFrom = intI + 1;
break;
}
}
}
string strLast = s.Substring(intFrom);
if (strLast != "" || blnKeepNulls) {
lResult.Add(strLast);
}
return lResult;
}
for (int intJ = 0; intJ < spacers.Count; intJ++) private string StringToBase64(string strText)
{ {
string strSpacer = spacers[intJ].ToString(); byte[] data = Encoding.UTF8.GetBytes(strText);
if (strSpacer.Length == 0) return Convert.ToBase64String(data);
continue; // check this }
if (strTmp.IndexOf(strSpacer) == 0)
{
string strBefore = s.Substring(intFrom, intI - intFrom);
if (strBefore != "" || blnKeepNulls)
result.Add(strBefore);
result.Add(strSpacer);
intI += strSpacer.Length - 1;
intFrom = intI + 1;
break;
}
}
}
string strLast = s.Substring(intFrom);
if (strLast != "" || blnKeepNulls)
result.Add(strLast);
return result;
}
private string StringToBase64(string str) private string Base64ToString(string strText)
{ {
byte[] data = Encoding.UTF8.GetBytes(str); byte[] data = Convert.FromBase64String(strText);
return Convert.ToBase64String(data); int intLen = Array.IndexOf(data, (byte)0x00);
} if (intLen < 0) {
intLen = data.Length;
}
return Encoding.UTF8.GetString(data, 0, intLen);
}
private string Base64ToString(string str) private int LookupBase64(string s, int intIndex)
{ {
byte[] data = Convert.FromBase64String(str); int intReturn = 0;
int intLen = Array.IndexOf(data, (byte)0x00); if (intIndex < s.Length) {
if (intLen < 0) intReturn = FastLookupBase64[s[intIndex]];
intLen = data.Length; if (intReturn == 0) {
return Encoding.UTF8.GetString(data, 0, intLen); if (s[intIndex] != 'A') {
} throw new Exception();
}
}
} else {
intReturn = 0;
}
return intReturn;
}
private int LookupBase64(string s, int intIndex) ////[SuppressMessage("StyleCop.CSharp.OrderingRules", "SA1204:StaticElementsMustAppearBeforeInstanceElements", Justification = "Stays with other string functions.")]
{ private static readonly int[] FastLookupBase64 =
if (intIndex < s.Length) { // 0 1 2 3 4 5 6 7 8 9 A B C D E F
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 00
int intReturn = FastLookupBase64[s[intIndex]]; 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 10
if (intReturn == 0) 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 0, 0, 0, 63, // 20
if (s[intIndex] != 'A') 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 0, 0, 0, 0, 0, 0, // 30
throw new Exception(); 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, // 40
return intReturn; 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 0, 0, 0, 0, 0, // 50
} 0, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, // 60
else 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 0, 0, 0, 0, 0, // 70
return 0; 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 80
} 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 90
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // A0
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // B0
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // C0
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // D0
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // E0
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; // F0
#endregion
static readonly int[] FastLookupBase64 = #region Math Functions
{// 0 1 2 3 4 5 6 7 8 9 A B C D E F private integer ModPow1(integer iA, integer iB, integer iC)
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 00 {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 10 return (int)Math.Pow((int)iA, (int)iB & (int)0xffff) % (int)iC;
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,62, 0, 0, 0,63, // 20 }
52,53,54,55,56,57,58,59,60,61, 0, 0, 0, 0, 0, 0, // 30
0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14, // 40
15,16,17,18,19,20,21,22,23,24,25, 0, 0, 0, 0, 0, // 50
0,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40, // 60
41,42,43,44,45,46,47,48,49,50,51, 0, 0, 0, 0, 0, // 70
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 80
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 90
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // A0
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // B0
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // C0
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // D0
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // E0
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // F0
#endregion
#region Math Functions private integer ModPow2(integer iValueX, integer iValueY, integer iModulus)
{
integer iResult = 0;
if (iValueX != 0) {
integer k = 1 + (int)Math.Ceiling(Math.Log(Math.Abs(iValueX)) / 0.69314718055994530941723212145818); // ceil(log2(x))
integer w = 32;
integer p = w / k;
integer r = iValueY / p;
integer f = iValueY % p;
integer z = 1;
if (r) {
z = ModPow2(ModPow1(iValueX, p, iModulus), r, iModulus);
}
if (f) {
z = (z * ModPow1(iValueX, f, iModulus)) % iModulus;
}
iResult = z;
}
return iResult;
}
#endregion Math Functions
private List<double> GetListOfNumbers(list lInput)
{
List<double> lResult = new List<double>();
for (int intI = 0; intI < lInput.Count; intI++) {
object objI = lInput[intI];
string strType = objI.GetType().ToString().Replace("LSLEditor.SecondLife+", "");
switch (strType) {
case "Float":
lResult.Add(Convert.ToDouble((Float)objI));
break;
case "System.Int32":
lResult.Add(Convert.ToDouble((int)objI));
break;
case "System.Double":
lResult.Add(Convert.ToDouble((double)objI));
break;
case "integer":
lResult.Add(Convert.ToDouble((integer)objI));
break;
default:
break;
}
}
return lResult;
}
private integer ModPow1(integer a, integer b, integer c) private double GetAverage(double[] data)
{ {
return (int)Math.Pow((int)a, (int)b & (int)0xffff) % (int)c; try {
} double dblDataTotal = 0;
for (int i = 0; i < data.Length; i++) {
dblDataTotal += data[i];
}
return SafeDivide(dblDataTotal, data.Length);
} catch (Exception) {
throw;
}
}
private integer ModPow2(integer x, integer y, integer m) public double GetStandardDeviation(double[] dblNumbers)
{ {
if (!x) return 0; double dblSum = 0.0, dblSumOfSqrs = 0.0;
integer k = 1 + (int)Math.Ceiling(Math.Log(Math.Abs(x)) / 0.69314718055994530941723212145818);//ceil(log2(x)) for (int i = 0; i < dblNumbers.Length; i++) {
integer w = 32; dblSum += dblNumbers[i];
integer p = w / k; dblSumOfSqrs += Math.Pow(dblNumbers[i], 2);
integer r = y / p; }
integer f = y % p; double dblTopSum = (dblNumbers.Length * dblSumOfSqrs) - Math.Pow(dblSum, 2);
integer z = 1; double dblN = (double)dblNumbers.Length;
if (r) z = ModPow2(ModPow1(x, p, m), r, m); return Math.Sqrt(dblTopSum / (dblN * (dblN - 1)));
if (f) z = (z * ModPow1(x, f, m)) % m; }
return z;
}
#endregion Math Functions private double SafeDivide(double dblValue1, double dblValue2)
{
double dblResult = 0;
try {
if ((dblValue1 != 0) && (dblValue2 != 0)) {
dblResult = dblValue1 / dblValue2;
}
} catch {
}
return dblResult;
}
private List<double> GetListOfNumbers(list input) private byte HexToInt(byte b)
{ {
List<double> result = new List<double>(); byte bResult;
for (int intI = 0; intI < input.Count; intI++) if (b >= '0' && b <= '9') {
{ bResult = (byte)(b - '0');
object objI = input[intI]; } else if ((b >= 'a' && b <= 'f') || (b >= 'A' && b <= 'F')) {
string strType = objI.GetType().ToString().Replace("LSLEditor.SecondLife+", ""); bResult = (byte)((b & 0x5f) - 0x37);
switch (strType) } else {
{ bResult = 0; // error
case "Float": }
result.Add(Convert.ToDouble((Float)objI)); return bResult;
break; }
case "System.Int32": #endregion
result.Add(Convert.ToDouble((int)objI)); }
break;
case "System.Double":
result.Add(Convert.ToDouble((double)objI));
break;
case "integer":
result.Add(Convert.ToDouble((integer)objI));
break;
default:
break;
}
}
return result;
}
private double GetAverage(double[] data)
{
try
{
double DataTotal = 0;
for (int i = 0; i < data.Length; i++)
{
DataTotal += data[i];
}
return SafeDivide(DataTotal, data.Length);
}
catch (Exception) { throw; }
}
public double GetStandardDeviation(double[] num)
{
double Sum = 0.0, SumOfSqrs = 0.0;
for (int i = 0; i < num.Length; i++)
{
Sum += num[i];
SumOfSqrs += Math.Pow(num[i], 2);
}
double topSum = (num.Length * SumOfSqrs) - (Math.Pow(Sum, 2));
double n = (double)num.Length;
return Math.Sqrt(topSum / (n * (n - 1)));
}
private double SafeDivide(double value1, double value2)
{
double ret = 0;
try
{
if ((value1 == 0) || (value2 == 0)) { return ret; }
ret = value1 / value2;
}
catch { }
return ret;
}
private byte HexToInt(byte b)
{
if (b >= '0' && b <= '9')
return (byte)(b - '0');
else if ((b >= 'a' && b <= 'f') || (b >= 'A' && b <= 'F'))
return (byte)((b & 0x5f) - 0x37);
else
return 0; // error
}
#endregion
}
} }

View file

@ -80,7 +80,7 @@ namespace LSLEditor
public static explicit operator String(float i) public static explicit operator String(float i)
{ {
return new String(string.Format("{0:0.000000}",i)); return new String(string.Format("{0:0.000000}", i));
} }
public static implicit operator string(String s) public static implicit operator string(String s)
@ -100,19 +100,16 @@ namespace LSLEditor
public static bool operator !=(String x, String y) public static bool operator !=(String x, String y)
{ {
return !(x==y); return !(x == y);
} }
// Public overrides // Public overrides
public override bool Equals(object o) public override bool Equals(object o)
{ {
try try {
{
return (bool)(this.value == o.ToString()); return (bool)(this.value == o.ToString());
} } catch {
catch
{
return false; return false;
} }
} }
@ -124,8 +121,9 @@ namespace LSLEditor
public override string ToString() public override string ToString()
{ {
if (this.value == null) if (this.value == null) {
this.value = ""; this.value = "";
}
return this.value; return this.value;
} }

View file

@ -57,8 +57,7 @@ namespace LSLEditor
{ {
get get
{ {
if (m_value == null) if (m_value == null) m_value = (Int32)0;
m_value = (Int32)0;
return (Int32)m_value; return (Int32)m_value;
} }
set set
@ -137,10 +136,7 @@ namespace LSLEditor
// Logical negation (NOT) operator // Logical negation (NOT) operator
public static integer operator !(integer x) public static integer operator !(integer x)
{ {
if (x.value == 0) return x.value == 0 ? TRUE : FALSE;
return TRUE;
else
return FALSE;
} }
// Bitwise AND operator // Bitwise AND operator
@ -257,22 +253,21 @@ namespace LSLEditor
public static int Compare(integer a, integer b) public static int Compare(integer a, integer b)
{ {
if (a.value < b.value) int intResult = 0;
return -1; if (a.value < b.value) {
if (a.value > b.value) intResult = -1;
return 1; } else if (a.value > b.value) {
return 0; intResult = 1;
}
return intResult;
} }
// Override the Object.Equals(object o) method: // Override the Object.Equals(object o) method:
public override bool Equals(object o) public override bool Equals(object o)
{ {
try try {
{
return (bool)(this == (integer)o); return (bool)(this == (integer)o);
} } catch {
catch
{
return false; return false;
} }
} }

View file

@ -84,25 +84,18 @@ namespace LSLEditor
// This is the one-and-only implicit typecasting in SecondLife // This is the one-and-only implicit typecasting in SecondLife
public static implicit operator key(string strGuid) public static implicit operator key(string strGuid)
{ {
if (strGuid == null) return strGuid == null ? new key("") : new key(strGuid);
return new key("");
else
return new key(strGuid);
} }
public static implicit operator key(String _strGuid) public static implicit operator key(String _strGuid)
{ {
string strGuid = _strGuid; string strGuid = _strGuid;
if (strGuid == null) return strGuid == null ? new key("") : new key(strGuid);
return new key("");
else
return new key(strGuid);
} }
public override string ToString() public override string ToString()
{ {
if (this.guid == null) if (this.guid == null) this.guid = "";
this.guid = "";
return this.guid.ToString(); return this.guid.ToString();
} }
@ -129,34 +122,27 @@ namespace LSLEditor
public static bool operator true(key k) public static bool operator true(key k)
{ {
if ((object)k == null) bool bResult = true;
return false; if ((object)k == null || k.guid == NULL_KEY || k.guid == "") {
if (k.guid == NULL_KEY) bResult = false;
return false; }
if (k.guid == "") return bResult;
return false;
return true;
} }
public static bool operator false(key k) public static bool operator false(key k)
{ {
if ((object)k == null) bool bResult = false;
return true; if ((object)k == null || k.guid == NULL_KEY || k.guid == "") {
if (k.guid == NULL_KEY) bResult = true;
return true; }
if (k.guid == "") return bResult;
return true;
return false;
} }
public override bool Equals(object obj) public override bool Equals(object obj)
{ {
try try {
{
return (this == (key)obj); return (this == (key)obj);
} } catch {
catch
{
return false; return false;
} }
} }

View file

@ -70,94 +70,85 @@ namespace LSLEditor
{ {
get get
{ {
if (this.value == null) if (this.value == null) this.value = new ArrayList();
this.value = new ArrayList();
return this.value.Count; return this.value.Count;
} }
} }
public void AddRange(list c) public void AddRange(list c)
{ {
if(this.value == null) if (this.value == null) this.value = new ArrayList();
this.value = new ArrayList();
this.value.AddRange(c.ToArray()); this.value.AddRange(c.ToArray());
} }
public void Add(object value) public void Add(object value)
{ {
if (this.value == null) if (this.value == null) this.value = new ArrayList();
this.value = new ArrayList();
string strType = value.GetType().ToString(); string strType = value.GetType().ToString();
if (value is string) if (value is string) {
this.value.Add((String)value.ToString()); this.value.Add((String)value.ToString());
else if (value is int) } else if (value is int) {
this.value.Add(new integer((int)value)); this.value.Add(new integer((int)value));
else if (value is uint) } else if (value is uint) {
this.value.Add(new integer((int)(uint)value)); this.value.Add(new integer((int)(uint)value));
else if (value is double) } else if (value is double) {
this.value.Add(new Float((double)value)); this.value.Add(new Float((double)value));
else } else {
this.value.Add(value); this.value.Add(value);
}
} }
public object this[int index] public object this[int index]
{ {
get get
{ {
if (this.value == null) if (this.value == null) this.value = new ArrayList();
this.value = new ArrayList();
return this.value[index]; return this.value[index];
} }
set set
{ {
if (this.value == null) if (this.value == null) this.value = new ArrayList();
this.value = new ArrayList();
this.value[index] = value; this.value[index] = value;
} }
} }
public void Insert(int index, object value) public void Insert(int index, object value)
{ {
if (this.value == null) if (this.value == null) this.value = new ArrayList();
this.value = new ArrayList();
if (this.value == null) if (this.value == null) this.value = new ArrayList();
this.value = new ArrayList();
string strType = value.GetType().ToString(); string strType = value.GetType().ToString();
if (value is string) if (value is string) {
this.value.Insert(index, (String)value.ToString()); this.value.Insert(index, (String)value.ToString());
else if (value is int) } else if (value is int) {
this.value.Insert(index, new integer((int)value)); this.value.Insert(index, new integer((int)value));
else if (value is uint) } else if (value is uint) {
this.value.Insert(index, new integer((int)(uint)value)); this.value.Insert(index, new integer((int)(uint)value));
else if (value is double) } else if (value is double) {
this.value.Insert(index, new Float((double)value)); this.value.Insert(index, new Float((double)value));
else } else {
this.value.Insert(index, value); this.value.Insert(index, value);
}
} }
public object[] ToArray() public object[] ToArray()
{ {
if (this.value == null) if (this.value == null) this.value = new ArrayList();
this.value = new ArrayList();
return this.value.ToArray(); return this.value.ToArray();
} }
public static list operator +(list a, list b) public static list operator +(list a, list b)
{ {
list l = new list(); list l = new list();
if((object)a != null) if ((object)a != null) l.AddRange(a);
l.AddRange(a); if ((object)b != null) l.AddRange(b);
if ((object)b != null)
l.AddRange(b);
return l; return l;
} }
public static list operator +(object b, list a) public static list operator +(object b, list a)
{ {
list l = new list(); list l = new list();
if ((object)a != null) if ((object)a != null) l.AddRange(a);
l.AddRange(a);
l.Insert(0, b); l.Insert(0, b);
return l; return l;
} }
@ -165,8 +156,7 @@ namespace LSLEditor
public static list operator +(list a, object b) public static list operator +(list a, object b)
{ {
list l = new list(); list l = new list();
if ((object)a != null) if ((object)a != null) l.AddRange(a);
l.AddRange(a);
l.Add(b); l.Add(b);
return l; return l;
} }
@ -235,50 +225,50 @@ namespace LSLEditor
public static integer operator ==(list l, list m) public static integer operator ==(list l, list m)
{ {
if (l.Count != m.Count) int iResult = TRUE;
return FALSE; if (l.Count != m.Count) {
for (int intI = 0; intI < l.Count; intI++) iResult = FALSE;
if (!l[intI].Equals(m[intI])) } else {
return FALSE; for (int intI = 0; intI < l.Count; intI++) {
return TRUE; if (!l[intI].Equals(m[intI])) {
iResult = FALSE;
break;
}
}
}
return iResult;
} }
public static integer operator !=(list l, list m) public static integer operator !=(list l, list m)
{ {
int intDifferent=0; int intDifferent = 0;
if (m.Count == 0) // shortcut if (m.Count == 0) {// shortcut
return l.Count; intDifferent = l.Count;
for (int intI = 0; intI < l.Count; intI++) } else {
{ for (int intI = 0; intI < l.Count; intI++) {
bool blnFound = false; bool blnFound = false;
for (int intJ = 0; intJ < m.Count; intJ++) for (int intJ = 0; intJ < m.Count; intJ++) {
{ if (l[intI].Equals(m[intJ])) {
if (l[intI].Equals(m[intJ])) blnFound = true;
{ break;
blnFound = true; }
break;
} }
if (!blnFound) intDifferent++;
} }
if(!blnFound)
intDifferent++;
} }
return intDifferent; return intDifferent;
} }
public static bool operator true(list x) public static bool operator true(list x)
{ {
if ((object)x == null) return (object)x == null ? false : (x.value.Count != 0);
return false;
return (x.value.Count != 0);
} }
// Definitely false operator. Returns true if the operand is // Definitely false operator. Returns true if the operand is
// ==0, false otherwise: // ==0, false otherwise:
public static bool operator false(list x) public static bool operator false(list x)
{ {
if ((object)x == null) return (object)x == null ? true : (x.value.Count == 0);
return true;
return (x.value.Count == 0);
} }
@ -295,19 +285,19 @@ namespace LSLEditor
public string ToVerboseString() public string ToVerboseString()
{ {
if (this.value == null) if (this.value == null) {
this.value = new ArrayList(); this.value = new ArrayList();
}
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.Append('['); sb.Append('[');
for (int intI = 0; intI < this.value.Count; intI++) for (int intI = 0; intI < this.value.Count; intI++) {
{ if (intI > 0) sb.Append(',');
if(intI>0) if ((this.value[intI] is string) && Properties.Settings.Default.QuotesListVerbose) {
sb.Append(','); sb.Append("\"" + this.value[intI].ToString() + "\"");
if((this.value[intI] is string) && Properties.Settings.Default.QuotesListVerbose) } else {
sb.Append("\""+this.value[intI].ToString()+"\"");
else
sb.Append(this.value[intI].ToString()); sb.Append(this.value[intI].ToString());
}
} }
sb.Append(']'); sb.Append(']');
return sb.ToString(); return sb.ToString();
@ -315,33 +305,25 @@ namespace LSLEditor
public override string ToString() public override string ToString()
{ {
if (this.value == null) if (this.value == null) this.value = new ArrayList();
this.value = new ArrayList();
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
for (int intI = 0; intI < this.value.Count; intI++) for (int intI = 0; intI < this.value.Count; intI++) {
{ if (this.value[intI] is vector) {
if (this.value[intI] is vector)
{
vector v = (vector)this.value[intI]; vector v = (vector)this.value[intI];
sb.AppendFormat(new System.Globalization.CultureInfo("en-us"), "<{0:0.000000}, {1:0.000000}, {2:0.000000}>", (double)v.x, (double)v.y, (double)v.z); sb.AppendFormat(new System.Globalization.CultureInfo("en-us"), "<{0:0.000000}, {1:0.000000}, {2:0.000000}>", (double)v.x, (double)v.y, (double)v.z);
} } else if (this.value[intI] is rotation) {
else if (this.value[intI] is rotation)
{
rotation r = (rotation)this.value[intI]; rotation r = (rotation)this.value[intI];
sb.AppendFormat(new System.Globalization.CultureInfo("en-us"), "<{0:0.000000}, {1:0.000000}, {2:0.000000}, {3:0.000000}>", (double)r.x, (double)r.y, (double)r.z, (double)r.s); sb.AppendFormat(new System.Globalization.CultureInfo("en-us"), "<{0:0.000000}, {1:0.000000}, {2:0.000000}, {3:0.000000}>", (double)r.x, (double)r.y, (double)r.z, (double)r.s);
} } else {
else
sb.Append(this.value[intI].ToString()); sb.Append(this.value[intI].ToString());
}
} }
return sb.ToString(); return sb.ToString();
} }
public static explicit operator String(list l) public static explicit operator String(list l)
{ {
if ((object)l == null) return (object)l == null ? "" : l.ToString();
return "";
else
return l.ToString();
} }
} }

View file

@ -56,8 +56,7 @@ namespace LSLEditor
{ {
get get
{ {
if (m_x == null) if (m_x == null) m_x = (Float)0;
m_x = (Float)0;
return (Float)m_x; return (Float)m_x;
} }
set set
@ -70,8 +69,7 @@ namespace LSLEditor
{ {
get get
{ {
if (m_y == null) if (m_y == null) m_y = (Float)0;
m_y = (Float)0;
return (Float)m_y; return (Float)m_y;
} }
set set
@ -84,8 +82,7 @@ namespace LSLEditor
{ {
get get
{ {
if (m_z == null) if (m_z == null) m_z = (Float)0;
m_z = (Float)0;
return (Float)m_z; return (Float)m_z;
} }
set set
@ -98,8 +95,7 @@ namespace LSLEditor
{ {
get get
{ {
if (m_s == null) if (m_s == null) m_s = (Float)0;
m_s = (Float)0;
return (Float)m_s; return (Float)m_s;
} }
set set
@ -137,8 +133,7 @@ namespace LSLEditor
RegexOptions.IgnorePatternWhitespace | RegexOptions.IgnorePatternWhitespace |
RegexOptions.Compiled); RegexOptions.Compiled);
Match m = regex.Match(a); Match m = regex.Match(a);
if (m.Success) if (m.Success) {
{
this.m_x = new Float(m.Groups["x"].Value); this.m_x = new Float(m.Groups["x"].Value);
this.m_y = new Float(m.Groups["y"].Value); this.m_y = new Float(m.Groups["y"].Value);
this.m_z = new Float(m.Groups["z"].Value); this.m_z = new Float(m.Groups["z"].Value);
@ -158,10 +153,11 @@ namespace LSLEditor
public static explicit operator String(rotation rot) public static explicit operator String(rotation rot)
{ {
if ((object)rot == null) if ((object)rot == null) {
return ZERO_ROTATION.ToString(); return ZERO_ROTATION.ToString();
else } else {
return rot.ToString(); return rot.ToString();
}
} }
// 23 feb 2008 // 23 feb 2008
@ -220,19 +216,19 @@ namespace LSLEditor
public static bool operator ==(rotation r1, rotation r2) public static bool operator ==(rotation r1, rotation r2)
{ {
if ((object)r1 == null) bool bReturn = true;
r1 = ZERO_ROTATION; if ((object)r1 == null) r1 = ZERO_ROTATION;
if ((object)r2 == null) if ((object)r2 == null) r2 = ZERO_ROTATION;
r2 = ZERO_ROTATION; if (Math.Abs(r1.x - r2.x) > EqualityTolerence) {
if (Math.Abs(r1.x - r2.x) > EqualityTolerence) bReturn = false;
return false; } else if (Math.Abs(r1.y - r2.y) > EqualityTolerence) {
if (Math.Abs(r1.y - r2.y) > EqualityTolerence) bReturn = false;
return false; } else if (Math.Abs(r1.z - r2.z) > EqualityTolerence) {
if (Math.Abs(r1.z - r2.z) > EqualityTolerence) bReturn = false;
return false; } else if (Math.Abs(r1.s - r2.s) > EqualityTolerence) {
if (Math.Abs(r1.s - r2.s) > EqualityTolerence) bReturn = false;
return false; }
return true; return bReturn;
} }
public static bool operator !=(rotation r, rotation s) public static bool operator !=(rotation r, rotation s)
@ -242,19 +238,23 @@ namespace LSLEditor
public static bool operator true(rotation r) public static bool operator true(rotation r)
{ {
if ((object)r == null) if ((object)r == null) {
return false; return false;
if (r.x == 0 && r.y == 0 && r.z == 0 && r.s == 1) }
if (r.x == 0 && r.y == 0 && r.z == 0 && r.s == 1) {
return false; return false;
}
return true; return true;
} }
public static bool operator false(rotation r) public static bool operator false(rotation r)
{ {
if ((object)r == null) if ((object)r == null) {
return true; return true;
if (r.x == 0 && r.y == 0 && r.z == 0 && r.s == 1) }
if (r.x == 0 && r.y == 0 && r.z == 0 && r.s == 1) {
return true; return true;
}
return false; return false;
} }
@ -266,12 +266,9 @@ namespace LSLEditor
public override bool Equals(object obj) public override bool Equals(object obj)
{ {
try try {
{
return (this == (rotation)obj); return (this == (rotation)obj);
} } catch {
catch
{
return false; return false;
} }
} }

View file

@ -221,18 +221,18 @@ namespace LSLEditor
public static bool operator ==(vector v1, vector v2) public static bool operator ==(vector v1, vector v2)
{ {
if ((object)v1 == null) if ((object)v1 == null) v1 = ZERO_VECTOR;
v1 = ZERO_VECTOR; if ((object)v2 == null) v2 = ZERO_VECTOR;
if ((object)v2 == null)
v2 = ZERO_VECTOR;
if (Math.Abs(v1.x - v2.x) > EqualityTolerence) bool bResult = true;
return false; if (Math.Abs(v1.x - v2.x) > EqualityTolerence) {
if (Math.Abs(v1.y - v2.y) > EqualityTolerence) bResult = false;
return false; } else if (Math.Abs(v1.y - v2.y) > EqualityTolerence) {
if (Math.Abs(v1.z - v2.z) > EqualityTolerence) bResult = false;
return false; } else if (Math.Abs(v1.z - v2.z) > EqualityTolerence) {
return true; bResult = false;
}
return bResult;
} }
public static bool operator !=(vector v1, vector v2) public static bool operator !=(vector v1, vector v2)
@ -242,19 +242,17 @@ namespace LSLEditor
public static bool operator true(vector v) public static bool operator true(vector v)
{ {
if ((object)v == null) if ((object)v == null || (v.x == 0 && v.y == 0 && v.z == 0)) {
return false;
if (v.x == 0 && v.y == 0 && v.z == 0)
return false; return false;
}
return true; return true;
} }
public static bool operator false(vector v) public static bool operator false(vector v)
{ {
if ((object)v == null) if ((object)v == null || (v.x == 0 && v.y == 0 && v.z == 0)) {
return true;
if (v.x == 0 && v.y == 0 && v.z == 0)
return true; return true;
}
return false; return false;
} }
@ -265,10 +263,11 @@ namespace LSLEditor
public static explicit operator String(vector v) public static explicit operator String(vector v)
{ {
if ((object)v == null) if ((object)v == null) {
return ZERO_VECTOR.ToString(); return ZERO_VECTOR.ToString();
else } else {
return v.ToString(); return v.ToString();
}
} }
public override int GetHashCode() public override int GetHashCode()
@ -278,12 +277,9 @@ namespace LSLEditor
public override bool Equals(object obj) public override bool Equals(object obj)
{ {
try try {
{
return (this == (vector)obj); return (this == (vector)obj);
} } catch {
catch
{
return false; return false;
} }
} }

163
trunk/Settings.StyleCop Normal file
View file

@ -0,0 +1,163 @@
<StyleCopSettings Version="105">
<GlobalSettings>
<StringProperty Name="Culture">en-GB</StringProperty>
<StringProperty Name="MergeSettingsFiles">NoMerge</StringProperty>
</GlobalSettings>
<Analyzers>
<Analyzer AnalyzerId="StyleCop.CSharp.DocumentationRules">
<Rules>
<Rule Name="FileMustHaveHeader">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FileHeaderMustShowCopyright">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FileHeaderMustContainFileName">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FileHeaderFileNameDocumentationMustMatchFileName">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FileHeaderMustHaveValidCompanyText">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="DocumentationHeadersMustNotContainBlankLines">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="PropertyDocumentationMustHaveValue">
<RuleSettings>
<BooleanProperty Name="Enabled">True</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="PropertyDocumentationMustHaveValueText">
<RuleSettings>
<BooleanProperty Name="Enabled">True</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementParameterDocumentationMustHaveText">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="DocumentationTextMustBeginWithACapitalLetter">
<RuleSettings>
<BooleanProperty Name="Enabled">True</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="DocumentationTextMustEndWithAPeriod">
<RuleSettings>
<BooleanProperty Name="Enabled">True</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="DocumentationTextMustMeetMinimumCharacterLength">
<RuleSettings>
<BooleanProperty Name="Enabled">True</BooleanProperty>
</RuleSettings>
</Rule>
</Rules>
<AnalyzerSettings />
</Analyzer>
<Analyzer AnalyzerId="StyleCop.CSharp.OrderingRules">
<Rules>
<Rule Name="UsingDirectivesMustBePlacedWithinNamespace">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementsMustAppearInTheCorrectOrder">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementsMustBeOrderedByAccess">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="StaticElementsMustAppearBeforeInstanceElements">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
</Rules>
<AnalyzerSettings />
</Analyzer>
<Analyzer AnalyzerId="StyleCop.CSharp.NamingRules">
<Rules>
<Rule Name="ElementMustBeginWithUpperCaseLetter">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FieldNamesMustNotUseHungarianNotation">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
</Rules>
<AnalyzerSettings />
</Analyzer>
<Analyzer AnalyzerId="StyleCop.CSharp.LayoutRules">
<Rules>
<Rule Name="CurlyBracketsForMultiLineStatementsMustNotShareLine">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ClosingCurlyBracketMustBeFollowedByBlankLine">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
</Rules>
<AnalyzerSettings />
</Analyzer>
<Analyzer AnalyzerId="StyleCop.CSharp.SpacingRules">
<Rules>
<Rule Name="TabsMustNotBeUsed">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
</Rules>
<AnalyzerSettings />
</Analyzer>
<Analyzer AnalyzerId="StyleCop.CSharp.ReadabilityRules">
<Rules>
<Rule Name="PrefixLocalCallsWithThis">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="CodeMustNotContainMultipleStatementsOnOneLine">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="UseStringEmptyForEmptyStrings">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="UseBuiltInTypeAlias">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
</Rules>
<AnalyzerSettings />
</Analyzer>
</Analyzers>
</StyleCopSettings>

View file

@ -71,10 +71,12 @@ namespace LSLEditor
this.History = new List<string>(); this.History = new List<string>();
this.intHistory = 0; this.intHistory = 0;
if (Properties.Settings.Default.SimulatorLocation != Point.Empty) if (Properties.Settings.Default.SimulatorLocation != Point.Empty) {
this.Location = Properties.Settings.Default.SimulatorLocation; this.Location = Properties.Settings.Default.SimulatorLocation;
if (Properties.Settings.Default.SimulatorSize != Size.Empty) }
if (Properties.Settings.Default.SimulatorSize != Size.Empty) {
this.Size = Properties.Settings.Default.SimulatorSize; this.Size = Properties.Settings.Default.SimulatorSize;
}
this.Clear(); this.Clear();
@ -86,11 +88,11 @@ namespace LSLEditor
this.LocationChanged += new EventHandler(SimulatorConsole_LocationChanged); this.LocationChanged += new EventHandler(SimulatorConsole_LocationChanged);
foreach (Form form in this.Children) foreach (Form form in this.Children) {
{
EditForm editForm = form as EditForm; EditForm editForm = form as EditForm;
if (editForm == null || editForm.IsDisposed) if (editForm == null || editForm.IsDisposed) {
continue; continue;
}
editForm.ChatHandler = chathandler; editForm.ChatHandler = chathandler;
editForm.MessageLinkedHandler = messagelinkedhandler; editForm.MessageLinkedHandler = messagelinkedhandler;
editForm.StartCompiler(); editForm.StartCompiler();
@ -99,11 +101,11 @@ namespace LSLEditor
public void Stop() public void Stop()
{ {
foreach (Form form in this.Children) foreach (Form form in this.Children) {
{
EditForm editForm = form as EditForm; EditForm editForm = form as EditForm;
if (editForm == null || editForm.IsDisposed) if (editForm == null || editForm.IsDisposed) {
continue; continue;
}
editForm.StopCompiler(); editForm.StopCompiler();
} }
} }
@ -118,24 +120,26 @@ namespace LSLEditor
this.Listen(e); this.Listen(e);
// talk only to the owner // talk only to the owner
if (e.how == CommunicationType.OwnerSay) if (e.how != CommunicationType.OwnerSay) {
return; foreach (Form form in this.Children) {
EditForm editForm = form as EditForm;
if (editForm == null || editForm.IsDisposed) {
continue;
}
foreach (Form form in this.Children) if (editForm.runtime == null) {
{ continue;
EditForm editForm = form as EditForm; }
if (editForm == null || editForm.IsDisposed)
continue;
if (editForm.runtime == null) if (editForm.runtime.SecondLifeHost == null) {
continue; continue;
}
if (editForm.runtime.SecondLifeHost == null) // prevent loops loops loops loops, dont talk to myself
continue; if (sender != editForm.runtime.SecondLifeHost) {
editForm.runtime.SecondLifeHost.Listen(e);
// prevent loops loops loops loops, dont talk to myself }
if (sender != editForm.runtime.SecondLifeHost) }
editForm.runtime.SecondLifeHost.Listen(e);
} }
} }
@ -148,9 +152,8 @@ namespace LSLEditor
List<Guid> list; List<Guid> list;
int intLinkNum = e.linknum; int intLinkNum = e.iLinkIndex;
switch (intLinkNum) switch (intLinkNum) {
{
case 1: // LINK_ROOT , root prim in linked set (but not in a single prim, which is 0) case 1: // LINK_ROOT , root prim in linked set (but not in a single prim, which is 0)
list = this.solutionExplorer.GetScripts(RootObjectGuid, false); list = this.solutionExplorer.GetScripts(RootObjectGuid, false);
break; break;
@ -160,8 +163,7 @@ namespace LSLEditor
case -2: // LINK_ALL_OTHERS , all other prims in object besides prim function is in case -2: // LINK_ALL_OTHERS , all other prims in object besides prim function is in
list = this.solutionExplorer.GetScripts(RootObjectGuid, true); list = this.solutionExplorer.GetScripts(RootObjectGuid, true);
// remove scripts in prim itself, and below // remove scripts in prim itself, and below
foreach (Guid guid in this.solutionExplorer.GetScripts(ObjectGuid, true)) foreach (Guid guid in this.solutionExplorer.GetScripts(ObjectGuid, true)) {
{
if (list.Contains(guid)) if (list.Contains(guid))
list.Remove(guid); list.Remove(guid);
} }
@ -169,19 +171,18 @@ namespace LSLEditor
case -3: // LINK_ALL_CHILDREN , all child prims in object case -3: // LINK_ALL_CHILDREN , all child prims in object
list = this.solutionExplorer.GetScripts(RootObjectGuid, true); list = this.solutionExplorer.GetScripts(RootObjectGuid, true);
// remove root itself // remove root itself
foreach (Guid guid in this.solutionExplorer.GetScripts(RootObjectGuid, false)) foreach (Guid guid in this.solutionExplorer.GetScripts(RootObjectGuid, false)) {
{
if (list.Contains(guid)) if (list.Contains(guid))
list.Remove(guid); list.Remove(guid);
} }
break; break;
case -4: // LINK_THIS case -4: // LINK_THIS
/* /*
* From SL Wiki: "Causes the script to act only upon the prim the prim the script is in." * From SL Wiki: "Causes the script to act only upon the prim the prim the script is in."
* This means LINK_THIS, links to every script in the prim, not just the caller. * This means LINK_THIS, links to every script in the prim, not just the caller.
* @author = MrSoundless * @author = MrSoundless
* @date = 28 April 2011 * @date = 28 April 2011
*/ */
list = new List<Guid>(); list = new List<Guid>();
//list.Add(secondLifeHostSender.guid); // 4 feb 2008 //list.Add(secondLifeHostSender.guid); // 4 feb 2008
list = this.solutionExplorer.GetScripts(ObjectGuid, true); // 28 april 2011 list = this.solutionExplorer.GetScripts(ObjectGuid, true); // 28 april 2011
@ -193,36 +194,41 @@ namespace LSLEditor
} }
// only send message to running scripts in list // only send message to running scripts in list
foreach (Form form in this.Children) foreach (Form form in this.Children) {
{
EditForm editForm = form as EditForm; EditForm editForm = form as EditForm;
if (editForm == null || editForm.IsDisposed) if (editForm == null || editForm.IsDisposed) {
continue; continue;
}
if (editForm.runtime == null) if (editForm.runtime == null) {
continue; continue;
}
if (editForm.runtime.SecondLifeHost == null) if (editForm.runtime.SecondLifeHost == null) {
continue; continue;
}
if(list.Contains(editForm.guid)) if (list.Contains(editForm.guid)) {
editForm.runtime.SecondLifeHost.LinkMessage(e); editForm.runtime.SecondLifeHost.LinkMessage(e);
}
} }
} }
private void SimulatorConsole_OnControl(object sender, EventArgs e) private void SimulatorConsole_OnControl(object sender, EventArgs e)
{ {
foreach (Form form in this.Children) foreach (Form form in this.Children) {
{
EditForm editForm = form as EditForm; EditForm editForm = form as EditForm;
if (editForm == null || editForm.IsDisposed) if (editForm == null || editForm.IsDisposed) {
continue; continue;
}
if (editForm.runtime == null) if (editForm.runtime == null) {
continue; continue;
}
if (editForm.runtime.SecondLifeHost == null) if (editForm.runtime.SecondLifeHost == null) {
continue; continue;
}
editForm.runtime.SecondLifeHost.SendControl((Keys)sender); editForm.runtime.SecondLifeHost.SendControl((Keys)sender);
} }
@ -231,47 +237,48 @@ namespace LSLEditor
private delegate void AppendTextDelegate(string strLine); private delegate void AppendTextDelegate(string strLine);
public void TalkToSimulatorConsole(string strLine) public void TalkToSimulatorConsole(string strLine)
{ {
if (this.textBox2.InvokeRequired) if (this.textBox2.InvokeRequired) {
{
this.textBox2.Invoke(new AppendTextDelegate(TalkToSimulatorConsole), new object[] { strLine }); this.textBox2.Invoke(new AppendTextDelegate(TalkToSimulatorConsole), new object[] { strLine });
} } else {
else
{
this.textBox2.AppendText(strLine.Replace("\n", "\r\n") + "\r\n"); this.textBox2.AppendText(strLine.Replace("\n", "\r\n") + "\r\n");
} }
} }
private void Chat(int channel, string name, SecondLife.key id, string message, CommunicationType how) private void Chat(int channel, string name, SecondLife.key id, string message, CommunicationType how)
{ {
if (OnChat != null) if (OnChat != null) {
OnChat(this, new SecondLifeHostChatEventArgs(channel, name, id, message, how)); OnChat(this, new SecondLifeHostChatEventArgs(channel, name, id, message, how));
}
} }
public void Listen(SecondLifeHostChatEventArgs e) public void Listen(SecondLifeHostChatEventArgs e)
{ {
// Translate the incomming messages a bit so it looks like SL. // Translate the incomming messages a bit so it looks like SL.
string strHow = ": "; string strHow = ": ";
if (e.how == CommunicationType.Shout) if (e.how == CommunicationType.Shout) {
strHow = " shout: "; strHow = " shout: ";
}
if (e.how == CommunicationType.Whisper) if (e.how == CommunicationType.Whisper) {
strHow = " whispers: "; strHow = " whispers: ";
}
string strWho = e.name; string strWho = e.name;
string strMessage = e.message; string strMessage = e.message;
if (e.name == Properties.Settings.Default.AvatarName) if (e.name == Properties.Settings.Default.AvatarName) {
strWho = "You"; strWho = "You";
}
if (e.message.ToString().StartsWith("/me")) if (e.message.ToString().StartsWith("/me")) {
{
strWho = e.name; strWho = e.name;
strHow = " "; strHow = " ";
strMessage = e.message.ToString().Substring(3).Trim(); strMessage = e.message.ToString().Substring(3).Trim();
} }
if (e.channel == 0) if (e.channel == 0) {
TalkToSimulatorConsole(strWho + strHow + strMessage); TalkToSimulatorConsole(strWho + strHow + strMessage);
}
} }
private void Speak(CommunicationType how) private void Speak(CommunicationType how)
@ -283,35 +290,26 @@ namespace LSLEditor
intHistory = History.Count; intHistory = History.Count;
if (strMessage == "") if (strMessage != ""){
return; if (strMessage[0] == '/') {
if (strMessage.StartsWith("/me")) {
if (strMessage[0] == '/') // do nothing
{ } else {
if (strMessage.StartsWith("/me")) string strChannel = "";
{ for (int intI = 1; intI < strMessage.Length; intI++) {
// do nothing if (strMessage[intI] >= '0' && strMessage[intI] <= '9') {
} strChannel += strMessage[intI];
else if (intI < 10) {
{ continue;
string strChannel = ""; }
for (int intI = 1; intI < strMessage.Length; intI++) }
{ try {
if (strMessage[intI] >= '0' && strMessage[intI] <= '9') intChannel = Convert.ToInt32(strChannel);
{ strMessage = strMessage.Substring(intI).Trim();
strChannel += strMessage[intI]; } catch {
if (intI < 10) }
continue; break;
} }
try
{
intChannel = Convert.ToInt32(strChannel);
strMessage = strMessage.Substring(intI).Trim();
}
catch
{
}
break;
} }
} }
} }
@ -336,13 +334,16 @@ namespace LSLEditor
private void ScrollChat(KeyEventArgs e) private void ScrollChat(KeyEventArgs e)
{ {
e.SuppressKeyPress = true; e.SuppressKeyPress = true;
if (e.KeyCode == Keys.Up) if (e.KeyCode == Keys.Up) {
intHistory = Math.Max(0, intHistory - 1); intHistory = Math.Max(0, intHistory - 1);
if (e.KeyCode == Keys.Down) }
if (e.KeyCode == Keys.Down) {
intHistory = Math.Min(History.Count, intHistory + 1); intHistory = Math.Min(History.Count, intHistory + 1);
}
this.textBox1.Clear(); this.textBox1.Clear();
if (intHistory != History.Count) if (intHistory != History.Count) {
this.textBox1.AppendText(History[intHistory]); this.textBox1.AppendText(History[intHistory]);
}
} }
private void textBox1_KeyDown(object sender, KeyEventArgs e) private void textBox1_KeyDown(object sender, KeyEventArgs e)
@ -350,23 +351,16 @@ namespace LSLEditor
this.buttonSay.Enabled = true; this.buttonSay.Enabled = true;
this.buttonShout.Enabled = true; this.buttonShout.Enabled = true;
if (e.KeyCode == Keys.Return) if (e.KeyCode == Keys.Return) {
{
Speak(CommunicationType.Say); Speak(CommunicationType.Say);
e.SuppressKeyPress = true; e.SuppressKeyPress = true;
} }
if (e.Control && (e.KeyCode == Keys.Up || e.KeyCode == Keys.Down)) if (e.Control && (e.KeyCode == Keys.Up || e.KeyCode == Keys.Down)) {
{
ScrollChat(e); ScrollChat(e);
} } else if (e.KeyCode == Keys.Down || e.KeyCode == Keys.Left || e.KeyCode == Keys.Right || e.KeyCode == Keys.Up ) {
else if (e.KeyCode == Keys.Down || if (OnControl != null) {
e.KeyCode == Keys.Left ||
e.KeyCode == Keys.Right ||
e.KeyCode == Keys.Up
)
{
if (OnControl != null)
OnControl(e.KeyCode, new EventArgs()); OnControl(e.KeyCode, new EventArgs());
}
e.SuppressKeyPress = true; e.SuppressKeyPress = true;
} }
} }
@ -391,8 +385,9 @@ namespace LSLEditor
private void textBox2_KeyDown(object sender, KeyEventArgs e) private void textBox2_KeyDown(object sender, KeyEventArgs e)
{ {
if (e.Control && e.KeyCode == Keys.A) if (e.Control && e.KeyCode == Keys.A) {
this.textBox2.SelectAll(); this.textBox2.SelectAll();
}
} }
private void copyToolStripMenuItem_Click(object sender, EventArgs e) private void copyToolStripMenuItem_Click(object sender, EventArgs e)

View file

@ -1992,28 +1992,28 @@ namespace LSLEditor.Solution
return typeSL; return typeSL;
} }
private delegate void DelegateRemoveInventory(Guid guid, SecondLife.String name); private delegate void DelegateRemoveInventory(Guid guid, SecondLife.String name);
public void RemoveInventory(Guid guid, SecondLife.String name) public void RemoveInventory(Guid guid, SecondLife.String name)
{ {
if (this.treeView1.InvokeRequired) if (this.treeView1.InvokeRequired)
{ {
this.treeView1.Invoke(new DelegateRemoveInventory(RemoveInventory), new object[] { guid, name }); this.treeView1.Invoke(new DelegateRemoveInventory(RemoveInventory), new object[] { guid, name });
return; return;
} }
TreeNode treeNode = FindGuid(this.treeView1.TopNode, guid); TreeNode treeNode = FindGuid(this.treeView1.TopNode, guid);
if (treeNode == null) if (treeNode == null)
return; return;
TreeNode parent = treeNode.Parent; TreeNode parent = treeNode.Parent;
for (int i = 0; i < parent.Nodes.Count; ++i) for (int i = 0; i < parent.Nodes.Count; ++i)
{ {
if (parent.Nodes[i].Text == name) if (parent.Nodes[i].Text == name)
{ {
parent.Nodes.RemoveAt(i); parent.Nodes.RemoveAt(i);
return; return;
} }
} }
} }
private delegate string DelegateGetInventoryName(Guid guid, int type, int number); private delegate string DelegateGetInventoryName(Guid guid, int type, int number);
public string GetInventoryName(Guid guid, int type, int number) public string GetInventoryName(Guid guid, int type, int number)
{ {
@ -2441,7 +2441,7 @@ namespace LSLEditor.Solution
break; break;
} }
} }
} }
public class NodeSorter : System.Collections.IComparer public class NodeSorter : System.Collections.IComparer
{ {
public int Compare(object x, object y) public int Compare(object x, object y)

View file

@ -112,10 +112,11 @@ namespace LSLEditor
{ {
Uri url; Uri url;
string strVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString(); string strVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString();
if (Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().Location).Contains("beta")) if (Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().Location).Contains("beta")) {
url = new Uri(Properties.Settings.Default.UpdateManifest + "?beta-" + strVersion); url = new Uri(Properties.Settings.Default.UpdateManifest + "?beta-" + strVersion);
else } else {
url = new Uri(Properties.Settings.Default.UpdateManifest + "?" + strVersion); url = new Uri(Properties.Settings.Default.UpdateManifest + "?" + strVersion);
}
manifest = new WebClient(); manifest = new WebClient();
manifest.DownloadStringCompleted += new DownloadStringCompletedEventHandler(manifest_DownloadCompleted); manifest.DownloadStringCompleted += new DownloadStringCompletedEventHandler(manifest_DownloadCompleted);
@ -130,28 +131,26 @@ namespace LSLEditor
public void CheckForUpdate(bool blnForce) public void CheckForUpdate(bool blnForce)
{ {
if (!blnForce) if (!blnForce) {
{ if (Properties.Settings.Default.DeleteOldFiles) {
if (Properties.Settings.Default.DeleteOldFiles)
DeleteOldFile(); DeleteOldFile();
}
DateTime dateTime = Properties.Settings.Default.CheckDate; DateTime dateTime = Properties.Settings.Default.CheckDate;
if (Properties.Settings.Default.CheckEveryDay) if (Properties.Settings.Default.CheckEveryDay) {
{
TimeSpan lastUpdate = DateTime.Now - dateTime; TimeSpan lastUpdate = DateTime.Now - dateTime;
if (lastUpdate.TotalDays >= 1.0) if (lastUpdate.TotalDays >= 1.0) {
blnForce = true; blnForce = true;
} }
else if (Properties.Settings.Default.CheckEveryWeek) } else if (Properties.Settings.Default.CheckEveryWeek) {
{
TimeSpan lastUpdate = DateTime.Now - dateTime; TimeSpan lastUpdate = DateTime.Now - dateTime;
if(lastUpdate.TotalDays >= 7.0) if (lastUpdate.TotalDays >= 7.0) {
blnForce = true; blnForce = true;
}
} }
} }
if (blnForce) if (blnForce) {
{
Properties.Settings.Default.CheckDate = DateTime.Now; Properties.Settings.Default.CheckDate = DateTime.Now;
Properties.Settings.Default.Save(); // save also all settings Properties.Settings.Default.Save(); // save also all settings
@ -164,7 +163,7 @@ namespace LSLEditor
if (e.Error != null) if (e.Error != null)
return; return;
versionInfo bzip = new versionInfo(); versionInfo bzip = new versionInfo();
versionInfo gzip = new versionInfo(); versionInfo gzip = new versionInfo();
versionInfo wzip = new versionInfo(); versionInfo wzip = new versionInfo();
@ -176,19 +175,13 @@ namespace LSLEditor
string strHelpHashMe = ""; string strHelpHashMe = "";
string strHelpFile = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), Properties.Settings.Default.HelpOfflineFile); string strHelpFile = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), Properties.Settings.Default.HelpOfflineFile);
if (File.Exists(strHelpFile)) if (File.Exists(strHelpFile)) {
{
strHelpHashMe = Decompressor.MD5Verify.ComputeHash(strHelpFile); strHelpHashMe = Decompressor.MD5Verify.ComputeHash(strHelpFile);
} } else {
else
{
// help file does not exist // help file does not exist
if (Properties.Settings.Default.HelpOffline || blnOnlyHelpFile) if (Properties.Settings.Default.HelpOffline || blnOnlyHelpFile) {
{
strHelpHashMe = "*"; // force new update strHelpHashMe = "*"; // force new update
} } else {
else
{
strHelpHashMe = ""; // no update strHelpHashMe = ""; // no update
this.labelHelpFile.Visible = false; this.labelHelpFile.Visible = false;
this.labelHelpversionString.Visible = false; this.labelHelpversionString.Visible = false;
@ -196,22 +189,22 @@ namespace LSLEditor
} }
StringReader sr = new StringReader(e.Result); StringReader sr = new StringReader(e.Result);
for (int intI = 0; intI < 255; intI++) for (int intI = 0; intI < 255; intI++) {
{
string strLine = sr.ReadLine(); string strLine = sr.ReadLine();
if (strLine == null) if (strLine == null) {
break; break;
}
int intSplit = strLine.IndexOf("=");
if (intSplit < 0) int intSplit = strLine.IndexOf("=");
if (intSplit < 0) {
continue; continue;
}
string strName = strLine.Substring(0, intSplit);
string strName = strLine.Substring(0, intSplit);
string strValue = strLine.Substring(intSplit + 1); string strValue = strLine.Substring(intSplit + 1);
//All hashes are of the uncompressed file. However, different archives may contain different versions. //All hashes are of the uncompressed file. However, different archives may contain different versions.
switch (strName) switch (strName) {
{
case "Version": case "Version":
case "BZipVersion": case "BZipVersion":
bzip = new versionInfo(strValue); bzip = new versionInfo(strValue);
@ -224,7 +217,7 @@ namespace LSLEditor
case "BZipUrl": case "BZipUrl":
bzip.uri = strValue; bzip.uri = strValue;
break; break;
case "GZipVersion": case "GZipVersion":
gzip = new versionInfo(strValue); gzip = new versionInfo(strValue);
break; break;
case "GZipHash": case "GZipHash":
@ -242,7 +235,7 @@ namespace LSLEditor
case "ZipUrl": case "ZipUrl":
wzip.uri = strValue; wzip.uri = strValue;
break; break;
case "HelpHash": case "HelpHash":
strHelpHashWeb = strValue; strHelpHashWeb = strValue;
break; break;
case "HelpUrl2": case "HelpUrl2":
@ -274,46 +267,39 @@ namespace LSLEditor
this.labelOurVersionString.Text = current.version.ToString(); this.labelOurVersionString.Text = current.version.ToString();
this.labelLatestVersionString.Text = web.version.ToString(); this.labelLatestVersionString.Text = web.version.ToString();
if (String.IsNullOrEmpty(web.uri) || (web.version.CompareTo(current.version) != 1)) if (String.IsNullOrEmpty(web.uri) || (web.version.CompareTo(current.version) != 1)) {
{
return; return;
} }
if (strHelpHashMe == "") if (strHelpHashMe == "") {
strHelpHashMe = strHelpHashWeb; strHelpHashMe = strHelpHashWeb;
}
if (strHelpHashMe == strHelpHashWeb) if (strHelpHashMe == strHelpHashWeb) {
{
this.labelHelpversionString.Text = "Up to date"; this.labelHelpversionString.Text = "Up to date";
this.strHelpUrl = null; this.strHelpUrl = null;
} } else {
else
{
this.labelHelpversionString.Text = "Out of date"; this.labelHelpversionString.Text = "Out of date";
} }
if (current.hash == web.hash) if (current.hash == web.hash) {
{
this.strDownloadUrl = null; this.strDownloadUrl = null;
} } else {
else
{
this.strDownloadUrl = web.uri; this.strDownloadUrl = web.uri;
} }
if (this.blnOnlyHelpFile) if (this.blnOnlyHelpFile) {
{
this.strDownloadUrl = null; this.strDownloadUrl = null;
this.labelLatestVersion.Visible = false; this.labelLatestVersion.Visible = false;
this.labelLatestVersionString.Visible = false; this.labelLatestVersionString.Visible = false;
} }
if (this.strHelpUrl != null || this.strDownloadUrl != null) if (this.strHelpUrl != null || this.strDownloadUrl != null) {
{
this.buttonUpdate.Enabled = true; this.buttonUpdate.Enabled = true;
if (OnUpdateAvailable != null) if (OnUpdateAvailable != null) {
OnUpdateAvailable(this, null); OnUpdateAvailable(this, null);
}
} }
} }
@ -330,85 +316,85 @@ namespace LSLEditor
private void Download() private void Download()
{ {
if (strHelpUrl != null) if (strHelpUrl != null) {
DownloadHelpFile(); // starts also DownloadProgram when finished DownloadHelpFile(); // starts also DownloadProgram when finished
else } else {
DownloadProgram(); DownloadProgram();
}
} }
private void DownloadHelpFile() private void DownloadHelpFile()
{ {
if (strHelpUrl == null) if (strHelpUrl != null) {
return; Uri url = new Uri(strHelpUrl);
Uri url = new Uri(strHelpUrl); client = new WebClient();
client = new WebClient(); if (this.strHelpReferer != null) {
client.Headers.Add("Referer", strHelpReferer);
}
if(this.strHelpReferer != null) client.DownloadFileCompleted += new AsyncCompletedEventHandler(client_DownloadHelpFileCompleted);
client.Headers.Add("Referer", strHelpReferer); client.DownloadProgressChanged += new DownloadProgressChangedEventHandler(client_DownloadProgressChanged);
client.DownloadFileCompleted += new AsyncCompletedEventHandler(client_DownloadHelpFileCompleted); string strCurrentFile = Assembly.GetExecutingAssembly().Location;
client.DownloadProgressChanged += new DownloadProgressChangedEventHandler(client_DownloadProgressChanged); string strDirectory = Path.GetDirectoryName(strCurrentFile);
string strNewFile = Path.Combine(strDirectory, Properties.Settings.Default.HelpOfflineFile);
string strCurrentFile = Assembly.GetExecutingAssembly().Location; if (File.Exists(strNewFile)) {
string strDirectory = Path.GetDirectoryName(strCurrentFile); File.Delete(strNewFile);
string strNewFile = Path.Combine(strDirectory, Properties.Settings.Default.HelpOfflineFile); }
if (File.Exists(strNewFile)) client.DownloadFileAsync(url, strNewFile);
File.Delete(strNewFile); }
client.DownloadFileAsync(url, strNewFile);
} }
void client_DownloadHelpFileCompleted(object sender, AsyncCompletedEventArgs e) void client_DownloadHelpFileCompleted(object sender, AsyncCompletedEventArgs e)
{ {
try try {
{ if (e.Error != null) {
if (e.Error != null)
throw e.Error; throw e.Error;
}
string strCurrentFile = Assembly.GetExecutingAssembly().Location; string strCurrentFile = Assembly.GetExecutingAssembly().Location;
string strDirectory = Path.GetDirectoryName(strCurrentFile); string strDirectory = Path.GetDirectoryName(strCurrentFile);
string strNewFile = Path.Combine(strDirectory, Properties.Settings.Default.HelpOfflineFile); string strNewFile = Path.Combine(strDirectory, Properties.Settings.Default.HelpOfflineFile);
string strComputedHash = Decompressor.MD5Verify.ComputeHash(strNewFile); string strComputedHash = Decompressor.MD5Verify.ComputeHash(strNewFile);
if (strComputedHash != strHelpHashWeb) if (strComputedHash != strHelpHashWeb) {
{
this.buttonUpdate.Enabled = true; this.buttonUpdate.Enabled = true;
throw new Exception("MD5 Hash of HelpFile not correct, try downloading again!"); throw new Exception("MD5 Hash of HelpFile not correct, try downloading again!");
} }
if (this.strDownloadUrl != null) if (this.strDownloadUrl != null) {
DownloadProgram(); DownloadProgram();
else } else {
this.Close(); this.Close();
} }
catch (Exception exception) } catch (Exception exception) {
{
MessageBox.Show(exception.Message, "Oops...", MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show(exception.Message, "Oops...", MessageBoxButtons.OK, MessageBoxIcon.Error);
} }
} }
private void DownloadProgram() private void DownloadProgram()
{ {
if (strDownloadUrl == null) if (strDownloadUrl != null) {
return; Uri url = new Uri(strDownloadUrl);
Uri url = new Uri(strDownloadUrl); client = new WebClient();
client.DownloadFileCompleted += new AsyncCompletedEventHandler(client_DownloadFileCompleted);
client.DownloadProgressChanged += new DownloadProgressChangedEventHandler(client_DownloadProgressChanged);
client = new WebClient(); string strCurrentFile = Assembly.GetExecutingAssembly().Location;
client.DownloadFileCompleted += new AsyncCompletedEventHandler(client_DownloadFileCompleted); string strDirectory = Path.GetDirectoryName(strCurrentFile);
client.DownloadProgressChanged += new DownloadProgressChangedEventHandler(client_DownloadProgressChanged); string strNewFileName = Path.GetFileName(strDownloadUrl);
string strNewFile = Path.Combine(strDirectory, strNewFileName);
string strCurrentFile = Assembly.GetExecutingAssembly().Location; if (File.Exists(strNewFile)) {
string strDirectory = Path.GetDirectoryName(strCurrentFile); File.Delete(strNewFile);
string strNewFileName = Path.GetFileName(strDownloadUrl); }
string strNewFile = Path.Combine(strDirectory, strNewFileName);
if (File.Exists(strNewFile)) client.DownloadFileAsync(url, strNewFile, strNewFileName);
File.Delete(strNewFile); }
client.DownloadFileAsync(url, strNewFile, strNewFileName);
} }
void client_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e) void client_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
@ -418,10 +404,10 @@ namespace LSLEditor
void client_DownloadFileCompleted(object sender, AsyncCompletedEventArgs e) void client_DownloadFileCompleted(object sender, AsyncCompletedEventArgs e)
{ {
try try {
{ if (e.Error != null) {
if (e.Error != null)
throw e.Error; throw e.Error;
}
string strNewFileName = e.UserState.ToString(); string strNewFileName = e.UserState.ToString();
@ -433,8 +419,7 @@ namespace LSLEditor
string strOldFile = Path.Combine(strDirectory, "_LSLEditor.exe"); string strOldFile = Path.Combine(strDirectory, "_LSLEditor.exe");
string strExtension = Path.GetExtension(strNewFileName); string strExtension = Path.GetExtension(strNewFileName);
switch (strExtension) switch (strExtension) {
{
case ".bz2": case ".bz2":
Decompressor.BZip2.Decompress(File.OpenRead(strZipFile), File.Create(strNewFile)); Decompressor.BZip2.Decompress(File.OpenRead(strZipFile), File.Create(strNewFile));
break; break;
@ -449,16 +434,16 @@ namespace LSLEditor
break; break;
} }
string strComputedHash = Decompressor.MD5Verify.ComputeHash(strNewFile); string strComputedHash = Decompressor.MD5Verify.ComputeHash(strNewFile);
if (strComputedHash == strHashWeb) if (strComputedHash == strHashWeb) {
{
if (File.Exists(strOldFile)) if (File.Exists(strOldFile))
File.Delete(strOldFile); File.Delete(strOldFile);
File.Move(strCurrentFile, strOldFile); File.Move(strCurrentFile, strOldFile);
File.Move(strNewFile, strCurrentFile); File.Move(strNewFile, strCurrentFile);
if (File.Exists(strZipFile)) if (File.Exists(strZipFile)) {
File.Delete(strZipFile); File.Delete(strZipFile);
}
// save all there is pending (if any) // save all there is pending (if any)
Properties.Settings.Default.Save(); Properties.Settings.Default.Save();
@ -466,32 +451,28 @@ namespace LSLEditor
System.Diagnostics.Process.Start(strCurrentFile); System.Diagnostics.Process.Start(strCurrentFile);
Environment.Exit(0); Environment.Exit(0);
} } else {
else
{
this.buttonUpdate.Enabled = true; this.buttonUpdate.Enabled = true;
throw new Exception("MD5 Hash not correct, try downloading again!"); throw new Exception("MD5 Hash not correct, try downloading again!");
} }
} } catch (Exception exception) {
catch (Exception exception)
{
MessageBox.Show(exception.Message, "Oops...", MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show(exception.Message, "Oops...", MessageBoxButtons.OK, MessageBoxIcon.Error);
} }
} }
private void UpdateApplicationForm_FormClosing(object sender, FormClosingEventArgs e) private void UpdateApplicationForm_FormClosing(object sender, FormClosingEventArgs e)
{ {
if (client != null) if (client != null) {
{ if (client.IsBusy) {
if (client.IsBusy)
client.CancelAsync(); client.CancelAsync();
}
client.Dispose(); client.Dispose();
} }
client = null; client = null;
if (manifest != null) if (manifest != null) {
{ if (manifest.IsBusy) {
if (manifest.IsBusy)
manifest.CancelAsync(); manifest.CancelAsync();
}
manifest.Dispose(); manifest.Dispose();
} }
manifest = null; manifest = null;
@ -502,9 +483,10 @@ namespace LSLEditor
string strCurrentFile = Assembly.GetExecutingAssembly().Location; string strCurrentFile = Assembly.GetExecutingAssembly().Location;
string strDirectory = Path.GetDirectoryName(strCurrentFile); string strDirectory = Path.GetDirectoryName(strCurrentFile);
string strOldFile = Path.Combine(strDirectory, "_LSLEditor.exe"); string strOldFile = Path.Combine(strDirectory, "_LSLEditor.exe");
if (File.Exists(strOldFile)) if (File.Exists(strOldFile)) {
File.Delete(strOldFile); File.Delete(strOldFile);
}
} }
} }
} }

View file

@ -58,7 +58,7 @@ namespace LSLEditor
private string OwnerName; private string OwnerName;
private SecondLife.key id; private SecondLife.key id;
public llDialogForm(SecondLifeHost host, SecondLife.String strObjectName, SecondLife.key id, SecondLife.String strOwner, SecondLife.String strMessage, SecondLife.list buttons, SecondLife.integer intChannel) public llDialogForm(SecondLifeHost host, SecondLife.String strObjectName, SecondLife.key id, SecondLife.String strOwner, SecondLife.String strMessage, SecondLife.list buttons, SecondLife.integer intChannel)
{ {
InitializeComponent(); InitializeComponent();
@ -68,21 +68,19 @@ namespace LSLEditor
this.ObjectName = strObjectName; this.ObjectName = strObjectName;
this.id = id; this.id = id;
for (int intI = 1; intI <= 12; intI++) for (int intI = 1; intI <= 12; intI++) {
{
Button button = this.Controls["Button" + intI] as Button; Button button = this.Controls["Button" + intI] as Button;
button.Visible = false; button.Visible = false;
} }
this.label1.Text = strOwner + "'s '" + strObjectName +"'"; this.label1.Text = strOwner + "'s '" + strObjectName + "'";
this.label2.Text = strMessage.ToString().Replace("&","&&"); this.label2.Text = strMessage.ToString().Replace("&", "&&");
for (int intI = 1; intI <= buttons.Count; intI++) for (int intI = 1; intI <= buttons.Count; intI++) {
{
Button button = this.Controls["Button" + intI] as Button; Button button = this.Controls["Button" + intI] as Button;
if (button == null) if (button == null)
continue; continue;
button.Text = buttons[intI - 1].ToString().Replace("&","&&"); button.Text = buttons[intI - 1].ToString().Replace("&", "&&");
button.Visible = true; button.Visible = true;
button.Click += new EventHandler(button_Click); button.Click += new EventHandler(button_Click);
} }
@ -91,10 +89,10 @@ namespace LSLEditor
void button_Click(object sender, EventArgs e) void button_Click(object sender, EventArgs e)
{ {
Button button = sender as Button; Button button = sender as Button;
if (button == null) if (button != null) {
return; host.Chat(this, this.Channel, this.OwnerName, this.id, button.Text.Replace("&&", "&"), CommunicationType.Say);
host.Chat(this,this.Channel, this.OwnerName, this.id, button.Text.Replace("&&","&"), CommunicationType.Say); this.Close();
this.Close(); }
} }
private void button13_Click(object sender, EventArgs e) private void button13_Click(object sender, EventArgs e)
@ -102,4 +100,4 @@ namespace LSLEditor
this.Close(); this.Close();
} }
} }
} }

View file

@ -12,40 +12,39 @@ using System.Windows.Forms;
namespace LSLEditor namespace LSLEditor
{ {
public partial class llTextBoxForm : Form public partial class llTextBoxForm : Form
{ {
private SecondLifeHost host; private SecondLifeHost host;
private int Channel; private int Channel;
private string ObjectName; private string ObjectName;
private string OwnerName; private string OwnerName;
private SecondLife.key id; private SecondLife.key id;
public llTextBoxForm(SecondLifeHost host, SecondLife.String strObjectName, SecondLife.key id, SecondLife.String strOwner, SecondLife.String strMessage, SecondLife.integer intChannel) public llTextBoxForm(SecondLifeHost host, SecondLife.String strObjectName, SecondLife.key id, SecondLife.String strOwner, SecondLife.String strMessage, SecondLife.integer intChannel)
{ {
InitializeComponent(); InitializeComponent();
this.host = host; this.host = host;
this.Channel = intChannel; this.Channel = intChannel;
this.OwnerName = strOwner; this.OwnerName = strOwner;
this.ObjectName = strObjectName; this.ObjectName = strObjectName;
this.id = id; this.id = id;
this.label1.Text = strMessage.ToString().Replace("&", "&&"); this.label1.Text = strMessage.ToString().Replace("&", "&&");
} }
private void buttonIgnore_Click(object sender, EventArgs e) private void buttonIgnore_Click(object sender, EventArgs e)
{ {
this.Close();
}
private void buttonOK_Click(object sender, EventArgs e)
{
Button button = sender as Button;
if (button == null)
return;
host.Chat(this,this.Channel, this.OwnerName, this.id, textBox.Text.Replace("&&","&"), CommunicationType.Say);
this.Close(); this.Close();
} }
}
} private void buttonOK_Click(object sender, EventArgs e)
{
Button button = sender as Button;
if (button != null) {
host.Chat(this, this.Channel, this.OwnerName, this.id, textBox.Text.Replace("&&", "&"), CommunicationType.Say);
this.Close();
}
}
}
}

View file

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup> <PropertyGroup>
<ProjectType>Local</ProjectType> <ProjectType>Local</ProjectType>
@ -125,274 +125,471 @@
</Compile> </Compile>
<Compile Include="About.Designer.cs"> <Compile Include="About.Designer.cs">
<DependentUpon>About.cs</DependentUpon> <DependentUpon>About.cs</DependentUpon>
<ExcludeFromStyleCop>false</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="BugReport\BugReportForm.cs"> <Compile Include="BugReport\BugReportForm.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="BugReport\BugReportForm.Designer.cs"> <Compile Include="BugReport\BugReportForm.Designer.cs">
<DependentUpon>BugReportForm.cs</DependentUpon> <DependentUpon>BugReportForm.cs</DependentUpon>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="BugReport\UploadBugReport.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="BZip2Decompress\BZip2.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="BZip2Decompress\BZip2Constants.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="BZip2Decompress\BZip2InputStream.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="Decompressor\ZipEntry.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="BugReport\UploadBugReport.cs" />
<Compile Include="BZip2Decompress\BZip2.cs" />
<Compile Include="BZip2Decompress\BZip2Constants.cs" />
<Compile Include="BZip2Decompress\BZip2InputStream.cs" />
<Compile Include="Decompressor\ZipEntry.cs" />
<Compile Include="Docking\AutoHideStripBase.cs"> <Compile Include="Docking\AutoHideStripBase.cs">
<SubType>Component</SubType> <SubType>Component</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="Docking\DockAreasEditor.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Docking\DockAreasEditor.cs" />
<Compile Include="Docking\DockContent.cs"> <Compile Include="Docking\DockContent.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="Docking\DockContentCollection.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="Docking\DockContentEventArgs.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="Docking\DockContentHandler.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="Docking\DockOutlineBase.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Docking\DockContentCollection.cs" />
<Compile Include="Docking\DockContentEventArgs.cs" />
<Compile Include="Docking\DockContentHandler.cs" />
<Compile Include="Docking\DockOutlineBase.cs" />
<Compile Include="Docking\DockPane.cs"> <Compile Include="Docking\DockPane.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Docking\DockPane.SplitterControl.cs"> <Compile Include="Docking\DockPane.SplitterControl.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Docking\DockPaneCaptionBase.cs"> <Compile Include="Docking\DockPaneCaptionBase.cs">
<SubType>Component</SubType> <SubType>Component</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="Docking\DockPaneCollection.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Docking\DockPaneCollection.cs" />
<Compile Include="Docking\DockPanel.AutoHideWindow.cs"> <Compile Include="Docking\DockPanel.AutoHideWindow.cs">
<SubType>Component</SubType> <SubType>Component</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Docking\DockPanel.cs"> <Compile Include="Docking\DockPanel.cs">
<SubType>Component</SubType> <SubType>Component</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Docking\DockPanel.DockDragHandler.cs"> <Compile Include="Docking\DockPanel.DockDragHandler.cs">
<SubType>Component</SubType> <SubType>Component</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Docking\DockPanel.DragHandler.cs"> <Compile Include="Docking\DockPanel.DragHandler.cs">
<SubType>Component</SubType> <SubType>Component</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Docking\DockPanel.FocusManager.cs"> <Compile Include="Docking\DockPanel.FocusManager.cs">
<SubType>Component</SubType> <SubType>Component</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Docking\DockPanel.MdiClientController.cs"> <Compile Include="Docking\DockPanel.MdiClientController.cs">
<SubType>Component</SubType> <SubType>Component</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Docking\DockPanel.Persistor.cs"> <Compile Include="Docking\DockPanel.Persistor.cs">
<SubType>Component</SubType> <SubType>Component</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Docking\DockPanel.SplitterDragHandler.cs"> <Compile Include="Docking\DockPanel.SplitterDragHandler.cs">
<SubType>Component</SubType> <SubType>Component</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="Docking\DockPanelExtender.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="Docking\DockPanelSkin.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Docking\DockPanelExtender.cs" />
<Compile Include="Docking\DockPanelSkin.cs" />
<Compile Include="Docking\DockPaneStripBase.cs"> <Compile Include="Docking\DockPaneStripBase.cs">
<SubType>Component</SubType> <SubType>Component</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Docking\DockWindow.cs"> <Compile Include="Docking\DockWindow.cs">
<SubType>Component</SubType> <SubType>Component</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Docking\DockWindow.SplitterControl.cs"> <Compile Include="Docking\DockWindow.SplitterControl.cs">
<SubType>Component</SubType> <SubType>Component</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="Docking\DockWindowCollection.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Docking\DockWindowCollection.cs" />
<Compile Include="Docking\DragForm.cs"> <Compile Include="Docking\DragForm.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Docking\DummyControl.cs"> <Compile Include="Docking\DummyControl.cs">
<SubType>Component</SubType> <SubType>Component</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="Docking\Enums.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Docking\Enums.cs" />
<Compile Include="Docking\FloatWindow.cs"> <Compile Include="Docking\FloatWindow.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="Docking\FloatWindowCollection.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="Docking\Helpers\DockHelper.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="Docking\Helpers\DrawHelper.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="Docking\Helpers\ResourceHelper.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="Docking\Helpers\Win32Helper.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Docking\FloatWindowCollection.cs" />
<Compile Include="Docking\Helpers\DockHelper.cs" />
<Compile Include="Docking\Helpers\DrawHelper.cs" />
<Compile Include="Docking\Helpers\ResourceHelper.cs" />
<Compile Include="Docking\Helpers\Win32Helper.cs" />
<Compile Include="Docking\InertButtonBase.cs"> <Compile Include="Docking\InertButtonBase.cs">
<SubType>Component</SubType> <SubType>Component</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="Docking\Interfaces.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="Docking\Localization.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="Docking\Measures.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="Docking\NestedDockingStatus.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="Docking\NestedPaneCollection.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="Docking\Resources.Designer.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Docking\Interfaces.cs" />
<Compile Include="Docking\Localization.cs" />
<Compile Include="Docking\Measures.cs" />
<Compile Include="Docking\NestedDockingStatus.cs" />
<Compile Include="Docking\NestedPaneCollection.cs" />
<Compile Include="Docking\Resources.Designer.cs" />
<Compile Include="Docking\SplitterBase.cs"> <Compile Include="Docking\SplitterBase.cs">
<SubType>Component</SubType> <SubType>Component</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="Docking\Strings.Designer.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="Docking\VisibleNestedPaneCollection.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Docking\Strings.Designer.cs" />
<Compile Include="Docking\VisibleNestedPaneCollection.cs" />
<Compile Include="Docking\VS2005AutoHideStrip.cs"> <Compile Include="Docking\VS2005AutoHideStrip.cs">
<SubType>Component</SubType> <SubType>Component</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Docking\VS2005DockPaneCaption.cs"> <Compile Include="Docking\VS2005DockPaneCaption.cs">
<SubType>Component</SubType> <SubType>Component</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Docking\VS2005DockPaneStrip.cs"> <Compile Include="Docking\VS2005DockPaneStrip.cs">
<SubType>Component</SubType> <SubType>Component</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="Docking\Win32\Enums.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="Docking\Win32\NativeMethods.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="Editor\KeyWords.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Docking\Win32\Enums.cs" />
<Compile Include="Docking\Win32\NativeMethods.cs" />
<Compile Include="Editor\KeyWords.cs" />
<None Include="Editor\RoundCorners.cs" /> <None Include="Editor\RoundCorners.cs" />
<Compile Include="Decompressor\Decompress.cs" /> <Compile Include="Decompressor\Decompress.cs">
<Compile Include="Editor\MsXsltContext.cs" /> <ExcludeFromStyleCop>true</ExcludeFromStyleCop>
<Compile Include="Helpers\HTTPRequest.cs" /> </Compile>
<Compile Include="Helpers\OutlineHelper.cs" /> <Compile Include="Editor\MsXsltContext.cs">
<Compile Include="Helpers\SendMyKeys.cs" /> <ExcludeFromStyleCop>true</ExcludeFromStyleCop>
<Compile Include="Helpers\TextFileEncodingDetector.cs" /> </Compile>
<Compile Include="BZip2Decompress\IChecksum.cs" /> <Compile Include="Helpers\HTTPRequest.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="Helpers\OutlineHelper.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="Helpers\SendMyKeys.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="Helpers\TextFileEncodingDetector.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="BZip2Decompress\IChecksum.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="llTextBoxForm.cs"> <Compile Include="llTextBoxForm.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="llTextBoxForm.Designer.cs"> <Compile Include="llTextBoxForm.Designer.cs">
<DependentUpon>llTextBoxForm.cs</DependentUpon> <DependentUpon>llTextBoxForm.cs</DependentUpon>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="Plugins\Generic.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="SecondLife\SecondLifeConstants.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="SecondLife\SecondLifeEvents.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="SecondLife\SecondLifeFunctions.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Plugins\Generic.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SecondLife\SecondLifeConstants.cs" />
<Compile Include="SecondLife\SecondLifeEvents.cs" />
<Compile Include="SecondLife\SecondLifeFunctions.cs" />
<Compile Include="Solution\GuidProperty.cs"> <Compile Include="Solution\GuidProperty.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Solution\GuidProperty.Designer.cs"> <Compile Include="Solution\GuidProperty.Designer.cs">
<DependentUpon>GuidProperty.cs</DependentUpon> <DependentUpon>GuidProperty.cs</DependentUpon>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="Helpers\CodeCompletion.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="Helpers\CompilerHelper.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="Helpers\FileAssociator.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="Helpers\GetTemplate.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="Helpers\Measure.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="Helpers\PrinterHelper.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="Helpers\TaskQueue.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="Helpers\XMLRPC.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="Helpers\OopsFormatter.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Helpers\CodeCompletion.cs" />
<Compile Include="Helpers\CompilerHelper.cs" />
<Compile Include="Helpers\FileAssociator.cs" />
<Compile Include="Helpers\GetTemplate.cs" />
<Compile Include="Helpers\Measure.cs" />
<Compile Include="Helpers\PrinterHelper.cs" />
<Compile Include="Helpers\TaskQueue.cs" />
<Compile Include="Helpers\XMLRPC.cs" />
<Compile Include="Helpers\OopsFormatter.cs" />
<Compile Include="Solution\NewProject.cs"> <Compile Include="Solution\NewProject.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Solution\NewProject.Designer.cs"> <Compile Include="Solution\NewProject.Designer.cs">
<DependentUpon>NewProject.cs</DependentUpon> <DependentUpon>NewProject.cs</DependentUpon>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="PermissionsForm.cs"> <Compile Include="PermissionsForm.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="PermissionsForm.Designer.cs"> <Compile Include="PermissionsForm.Designer.cs">
<DependentUpon>PermissionsForm.cs</DependentUpon> <DependentUpon>PermissionsForm.cs</DependentUpon>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="GotoWindow.cs"> <Compile Include="GotoWindow.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="GotoWindow.Designer.cs"> <Compile Include="GotoWindow.Designer.cs">
<DependentUpon>GotoWindow.cs</DependentUpon> <DependentUpon>GotoWindow.cs</DependentUpon>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Editor\Numbered.cs"> <Compile Include="Editor\Numbered.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Editor\Numbered.Designer.cs"> <Compile Include="Editor\Numbered.Designer.cs">
<DependentUpon>Numbered.cs</DependentUpon> <DependentUpon>Numbered.cs</DependentUpon>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Editor\TooltipWindow.cs"> <Compile Include="Editor\TooltipWindow.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Editor\TooltipWindow.designer.cs"> <Compile Include="Editor\TooltipWindow.designer.cs">
<DependentUpon>TooltipWindow.cs</DependentUpon> <DependentUpon>TooltipWindow.cs</DependentUpon>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Editor\GListBox.cs"> <Compile Include="Editor\GListBox.cs">
<SubType>Component</SubType> <SubType>Component</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Editor\GListBox.designer.cs"> <Compile Include="Editor\GListBox.designer.cs">
<DependentUpon>GListBox.cs</DependentUpon> <DependentUpon>GListBox.cs</DependentUpon>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Editor\GListBoxWindow.cs"> <Compile Include="Editor\GListBoxWindow.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Editor\GListBoxWindow.designer.cs"> <Compile Include="Editor\GListBoxWindow.designer.cs">
<DependentUpon>GListBoxWindow.cs</DependentUpon> <DependentUpon>GListBoxWindow.cs</DependentUpon>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Editor\RichLabel.cs"> <Compile Include="Editor\RichLabel.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Editor\RichLabel.Designer.cs"> <Compile Include="Editor\RichLabel.Designer.cs">
<DependentUpon>RichLabel.cs</DependentUpon> <DependentUpon>RichLabel.cs</DependentUpon>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="llDialogForm.cs"> <Compile Include="llDialogForm.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="llDialogForm.Designer.cs"> <Compile Include="llDialogForm.Designer.cs">
<DependentUpon>llDialogForm.cs</DependentUpon> <DependentUpon>llDialogForm.cs</DependentUpon>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="Plugins\LSLint.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="Plugins\Particles.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Plugins\LSLint.cs" />
<Compile Include="Plugins\Particles.cs" />
<Compile Include="Browser.cs"> <Compile Include="Browser.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Browser.Designer.cs"> <Compile Include="Browser.Designer.cs">
<DependentUpon>Browser.cs</DependentUpon> <DependentUpon>Browser.cs</DependentUpon>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="Helpers\AutoFormatter.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Helpers\AutoFormatter.cs" />
<Compile Include="EditForm.cs"> <Compile Include="EditForm.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="EditForm.Designer.cs"> <Compile Include="EditForm.Designer.cs">
<DependentUpon>EditForm.cs</DependentUpon> <DependentUpon>EditForm.cs</DependentUpon>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="FindWindow.cs"> <Compile Include="FindWindow.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="FindWindow.Designer.cs"> <Compile Include="FindWindow.Designer.cs">
<DependentUpon>FindWindow.cs</DependentUpon> <DependentUpon>FindWindow.cs</DependentUpon>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="LSLEditorForm.cs"> <Compile Include="LSLEditorForm.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="LSLEditorForm.Designer.cs"> <Compile Include="LSLEditorForm.Designer.cs">
<DependentUpon>LSLEditorForm.cs</DependentUpon> <DependentUpon>LSLEditorForm.cs</DependentUpon>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Properties\Resources.Designer.cs"> <Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen> <AutoGen>True</AutoGen>
<DesignTime>True</DesignTime> <DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon> <DependentUpon>Resources.resx</DependentUpon>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Properties\Settings.Designer.cs"> <Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen> <AutoGen>True</AutoGen>
<DesignTimeSharedInput>True</DesignTimeSharedInput> <DesignTimeSharedInput>True</DesignTimeSharedInput>
<DependentUpon>Settings.settings</DependentUpon> <DependentUpon>Settings.settings</DependentUpon>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="Helpers\Settings.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Helpers\Settings.cs" />
<Compile Include="Helpers\GroupboxEvent.cs"> <Compile Include="Helpers\GroupboxEvent.cs">
<SubType>Component</SubType> <SubType>Component</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="Helpers\LSL2CSharp.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Helpers\LSL2CSharp.cs" />
<Compile Include="Editor\NumberedTextBoxUC.cs"> <Compile Include="Editor\NumberedTextBoxUC.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Editor\NumberedTextBoxUC.designer.cs"> <Compile Include="Editor\NumberedTextBoxUC.designer.cs">
<DependentUpon>NumberedTextBoxUC.cs</DependentUpon> <DependentUpon>NumberedTextBoxUC.cs</DependentUpon>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="RuntimeConsole.cs"> <Compile Include="RuntimeConsole.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="RuntimeConsole.Designer.cs"> <Compile Include="RuntimeConsole.Designer.cs">
<DependentUpon>RuntimeConsole.cs</DependentUpon> <DependentUpon>RuntimeConsole.cs</DependentUpon>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="SecondLife\SecondLifeHst.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="SecondLife\SecondLifeHst.cs" />
<Compile Include="Helpers\SmtpClient.cs"> <Compile Include="Helpers\SmtpClient.cs">
<SubType>Code</SubType> <SubType>Code</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="SecondLife\Float.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="SecondLife\String.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="SecondLife\list.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="SecondLife\rotation.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="SecondLife\key.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="SecondLife\integer.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="SecondLife\vector.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="SecondLife\Float.cs" />
<Compile Include="SecondLife\String.cs" />
<Compile Include="SecondLife\list.cs" />
<Compile Include="SecondLife\rotation.cs" />
<Compile Include="SecondLife\key.cs" />
<Compile Include="SecondLife\integer.cs" />
<Compile Include="SecondLife\vector.cs" />
<Compile Include="Editor\SyntaxRichTextBox.cs"> <Compile Include="Editor\SyntaxRichTextBox.cs">
<SubType>Component</SubType> <SubType>Component</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Helpers\WebRequestClass.cs"> <Compile Include="Helpers\WebRequestClass.cs">
<SubType>Code</SubType> <SubType>Code</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<EmbeddedResource Include="About.resx"> <EmbeddedResource Include="About.resx">
<SubType>Designer</SubType> <SubType>Designer</SubType>
@ -400,139 +597,187 @@
</EmbeddedResource> </EmbeddedResource>
<Compile Include="SecondLife\SecondLifeMain.cs"> <Compile Include="SecondLife\SecondLifeMain.cs">
<SubType>Code</SubType> <SubType>Code</SubType>
<ExcludeFromStyleCop>false</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Helpers\TabControlExtended.cs"> <Compile Include="Helpers\TabControlExtended.cs">
<SubType>Component</SubType> <SubType>Component</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Helpers\TabControlExtended.Designer.cs"> <Compile Include="Helpers\TabControlExtended.Designer.cs">
<DependentUpon>TabControlExtended.cs</DependentUpon> <DependentUpon>TabControlExtended.cs</DependentUpon>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="SimulatorConsole.cs"> <Compile Include="SimulatorConsole.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="SimulatorConsole.Designer.cs"> <Compile Include="SimulatorConsole.Designer.cs">
<DependentUpon>SimulatorConsole.cs</DependentUpon> <DependentUpon>SimulatorConsole.cs</DependentUpon>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Solution\SolutionExplorer.cs"> <Compile Include="Solution\SolutionExplorer.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Solution\SolutionExplorer.designer.cs"> <Compile Include="Solution\SolutionExplorer.designer.cs">
<DependentUpon>SolutionExplorer.cs</DependentUpon> <DependentUpon>SolutionExplorer.cs</DependentUpon>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Solution\SvnAguments.cs"> <Compile Include="Solution\SvnAguments.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Solution\SvnAguments.Designer.cs"> <Compile Include="Solution\SvnAguments.Designer.cs">
<DependentUpon>SvnAguments.cs</DependentUpon> <DependentUpon>SvnAguments.cs</DependentUpon>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="Plugins\Svn.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="BZip2Decompress\StrangeCrc.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Plugins\Svn.cs" />
<Compile Include="BZip2Decompress\StrangeCrc.cs" />
<Compile Include="SyntaxError.cs"> <Compile Include="SyntaxError.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="SyntaxError.Designer.cs"> <Compile Include="SyntaxError.Designer.cs">
<DependentUpon>SyntaxError.cs</DependentUpon> <DependentUpon>SyntaxError.cs</DependentUpon>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Tools\EnvironmentPlugins.cs"> <Compile Include="Tools\EnvironmentPlugins.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Tools\EnvironmentPlugins.Designer.cs"> <Compile Include="Tools\EnvironmentPlugins.Designer.cs">
<DependentUpon>EnvironmentPlugins.cs</DependentUpon> <DependentUpon>EnvironmentPlugins.cs</DependentUpon>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Tools\RuntimeGeneral.cs"> <Compile Include="Tools\RuntimeGeneral.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Tools\RuntimeGeneral.Designer.cs"> <Compile Include="Tools\RuntimeGeneral.Designer.cs">
<DependentUpon>RuntimeGeneral.cs</DependentUpon> <DependentUpon>RuntimeGeneral.cs</DependentUpon>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Tools\TextEditorCodeCompletion.cs"> <Compile Include="Tools\TextEditorCodeCompletion.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Tools\TextEditorCodeCompletion.Designer.cs"> <Compile Include="Tools\TextEditorCodeCompletion.Designer.cs">
<DependentUpon>TextEditorCodeCompletion.cs</DependentUpon> <DependentUpon>TextEditorCodeCompletion.cs</DependentUpon>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Tools\EnvironmentBrowser.cs"> <Compile Include="Tools\EnvironmentBrowser.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Tools\EnvironmentBrowser.Designer.cs"> <Compile Include="Tools\EnvironmentBrowser.Designer.cs">
<DependentUpon>EnvironmentBrowser.cs</DependentUpon> <DependentUpon>EnvironmentBrowser.cs</DependentUpon>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Tools\ProjectSettings.cs"> <Compile Include="Tools\ProjectSettings.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Tools\ProjectSettings.Designer.cs"> <Compile Include="Tools\ProjectSettings.Designer.cs">
<DependentUpon>ProjectSettings.cs</DependentUpon> <DependentUpon>ProjectSettings.cs</DependentUpon>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Tools\RuntimeInternal.cs"> <Compile Include="Tools\RuntimeInternal.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Tools\RuntimeInternal.Designer.cs"> <Compile Include="Tools\RuntimeInternal.Designer.cs">
<DependentUpon>RuntimeInternal.cs</DependentUpon> <DependentUpon>RuntimeInternal.cs</DependentUpon>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Tools\RuntimeSmtp.cs"> <Compile Include="Tools\RuntimeSmtp.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Tools\RuntimeSmtp.Designer.cs"> <Compile Include="Tools\RuntimeSmtp.Designer.cs">
<DependentUpon>RuntimeSmtp.cs</DependentUpon> <DependentUpon>RuntimeSmtp.cs</DependentUpon>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Tools\RuntimeExternal.cs"> <Compile Include="Tools\RuntimeExternal.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Tools\RuntimeExternal.Designer.cs"> <Compile Include="Tools\RuntimeExternal.Designer.cs">
<DependentUpon>RuntimeExternal.cs</DependentUpon> <DependentUpon>RuntimeExternal.cs</DependentUpon>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Tools\EnvironmentGeneral.cs"> <Compile Include="Tools\EnvironmentGeneral.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Tools\EnvironmentGeneral.Designer.cs"> <Compile Include="Tools\EnvironmentGeneral.Designer.cs">
<DependentUpon>EnvironmentGeneral.cs</DependentUpon> <DependentUpon>EnvironmentGeneral.cs</DependentUpon>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Tools\TextEditorFontColors.cs"> <Compile Include="Tools\TextEditorFontColors.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Tools\TextEditorFontColors.Designer.cs"> <Compile Include="Tools\TextEditorFontColors.Designer.cs">
<DependentUpon>TextEditorFontColors.cs</DependentUpon> <DependentUpon>TextEditorFontColors.cs</DependentUpon>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Tools\EnvironmentHelp.cs"> <Compile Include="Tools\EnvironmentHelp.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Tools\EnvironmentHelp.Designer.cs"> <Compile Include="Tools\EnvironmentHelp.Designer.cs">
<DependentUpon>EnvironmentHelp.cs</DependentUpon> <DependentUpon>EnvironmentHelp.cs</DependentUpon>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Tools\TextEditorGeneral.cs"> <Compile Include="Tools\TextEditorGeneral.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Tools\TextEditorGeneral.Designer.cs"> <Compile Include="Tools\TextEditorGeneral.Designer.cs">
<DependentUpon>TextEditorGeneral.cs</DependentUpon> <DependentUpon>TextEditorGeneral.cs</DependentUpon>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Tools\ToolsOptions.cs"> <Compile Include="Tools\ToolsOptions.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Tools\ToolsOptions.Designer.cs"> <Compile Include="Tools\ToolsOptions.Designer.cs">
<DependentUpon>ToolsOptions.cs</DependentUpon> <DependentUpon>ToolsOptions.cs</DependentUpon>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Tools\VersionControlGeneral.cs"> <Compile Include="Tools\VersionControlGeneral.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Tools\VersionControlGeneral.Designer.cs"> <Compile Include="Tools\VersionControlGeneral.Designer.cs">
<DependentUpon>VersionControlGeneral.cs</DependentUpon> <DependentUpon>VersionControlGeneral.cs</DependentUpon>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="ToolWindow.cs"> <Compile Include="ToolWindow.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="ToolWindow.Designer.cs"> <Compile Include="ToolWindow.Designer.cs">
<DependentUpon>ToolWindow.cs</DependentUpon> <DependentUpon>ToolWindow.cs</DependentUpon>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="UpdateApplicationForm.cs"> <Compile Include="UpdateApplicationForm.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="UpdateApplicationForm.Designer.cs"> <Compile Include="UpdateApplicationForm.Designer.cs">
<DependentUpon>UpdateApplicationForm.cs</DependentUpon> <DependentUpon>UpdateApplicationForm.cs</DependentUpon>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<Compile Include="Web References\org.lsleditor.www\Reference.cs"> <Compile Include="Web References\org.lsleditor.www\Reference.cs">
<AutoGen>True</AutoGen> <AutoGen>True</AutoGen>
<DesignTime>True</DesignTime> <DesignTime>True</DesignTime>
<DependentUpon>Reference.map</DependentUpon> <DependentUpon>Reference.map</DependentUpon>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile> </Compile>
<EmbeddedResource Include="Browser.resx"> <EmbeddedResource Include="Browser.resx">
<SubType>Designer</SubType> <SubType>Designer</SubType>
@ -871,6 +1116,7 @@
</BootstrapperPackage> </BootstrapperPackage>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(ProgramFiles)\MSBuild\StyleCop\v4.7\StyleCop.targets" />
<PropertyGroup> <PropertyGroup>
<PreBuildEvent>"$(FrameworkSDKDir)Bin\rc.exe" /r "$(ProjectDir)$(TargetName).rc"</PreBuildEvent> <PreBuildEvent>"$(FrameworkSDKDir)Bin\rc.exe" /r "$(ProjectDir)$(TargetName).rc"</PreBuildEvent>
<PostBuildEvent>$(SolutionDir)\..\build\AssemblyRevisionIncrementer.exe /t="$(SolutionDir)\Properties\AssemblyInfo.cs"</PostBuildEvent> <PostBuildEvent>$(SolutionDir)\..\build\AssemblyRevisionIncrementer.exe /t="$(SolutionDir)\Properties\AssemblyInfo.cs"</PostBuildEvent>