Exemplo n.º 1
0
        public Generic(LSLEditorForm parent, string strPluginName)
        {
            EditForm editForm = parent.ActiveMdiForm as EditForm;

            if (editForm == null)
            {
                return;
            }

            string      strFilePath = editForm.FullPathName;
            RichTextBox tb          = editForm.TextBox as RichTextBox;

            string strDirectory        = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
            string strPluginsDirectory = Path.Combine(strDirectory, "Plugins");
            string strProgram          = Path.Combine(strPluginsDirectory, strPluginName + ".exe");

            Assembly assembly = null;

            try
            {
                assembly = Assembly.LoadFrom(strProgram);
            }
            catch
            {
                MessageBox.Show("Not a valid plugin, see http://www.lsleditor.org/help/Plugins.aspx", "Plugins", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            if (assembly == null)
            {
                return;
            }

            object[] args = new object[] { strFilePath, tb };

            foreach (Type t in assembly.GetTypes())
            {
                if (t.BaseType.Name == "DockContent")
                {
                    DockContent form = assembly.CreateInstance(t.FullName, false,
                                                               BindingFlags.Public | BindingFlags.Instance | BindingFlags.CreateInstance,
                                                               null, args, null, null) as DockContent;
                    if (form != null)
                    {
                        parent.AddForm(form);
                        return;
                    }
                }
                MethodInfo info = t.GetMethod("Run",
                                              BindingFlags.Public |
                                              BindingFlags.NonPublic |
                                              BindingFlags.Static);

                if (info == null)
                {
                    continue;
                }

                info.Invoke(null, args);
            }
        }
Exemplo n.º 2
0
 public FindWindow(LSLEditorForm lslEditForm)
 {
     InitializeComponent();
     this.lslEditForm = lslEditForm;
     this.intStart    = 0;
     this.intEnd      = 0;
 }
Exemplo n.º 3
0
        public NewProject(LSLEditorForm parent)
        {
            InitializeComponent();

            this.checkBox2.Visible = Svn.IsInstalled;

            this.parent = parent;

            this.textBox2.Text = Properties.Settings.Default.ProjectLocation;
        }
Exemplo n.º 4
0
        public About(LSLEditorForm parent)
        {
            this.InitializeComponent();

            this.Icon = parent.Icon;

            string strVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString();

            this.label2.Text = strVersion;
        }
Exemplo n.º 5
0
        public GotoWindow(LSLEditorForm lslEditForm)
        {
            InitializeComponent();
            this.Icon        = lslEditForm.Icon;
            this.lslEditForm = lslEditForm;

            EditForm editForm = this.lslEditForm.ActiveMdiForm as EditForm;

            this.label1.Text = "Line number (1-" + editForm.TextBox.Lines.Length + ")";
        }
Exemplo n.º 6
0
        public Browser(LSLEditorForm lslEditorForm)
        {
            InitializeComponent();

            this.Icon          = lslEditorForm.Icon;
            this.lslEditorForm = lslEditorForm;

            // enables close buttons on tabs
            this.tabControl1.SetDrawMode();
        }
Exemplo n.º 7
0
 public bool SyntaxCheck(LSLEditorForm parent)
 {
     foreach (Form form in parent.Children)
     {
         EditForm editForm = form as EditForm;
         if (editForm == null || editForm.IsDisposed)
         {
             continue;
         }
         RunOnce(parent.SyntaxErrors.ListView, editForm);
     }
     this.HasErrors = (parent.SyntaxErrors.ListView.Items.Count != 0);
     return(ExceptionMessage == "");
 }
Exemplo n.º 8
0
        public Particles(LSLEditorForm parent)
        {
            string strPluginName = "Particles";

            string strDirectory        = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
            string strPluginsDirectory = Path.Combine(strDirectory, "Plugins");
            string strProgram          = Path.Combine(strPluginsDirectory, strPluginName + ".exe");

            Assembly assembly = Assembly.LoadFrom(strProgram);
            Form     frmMain  = assembly.CreateInstance("Particles.frmMain") as Form;

            /*	if (parent.IsMdiContainer)
             *      {
             *              parent.AddForm(frmMain);
             *      }
             *      else
             *      {*/
            //MessageBox.Show("This plugin does not run in tabbed mode", "Particles plugin", MessageBoxButtons.OK, MessageBoxIcon.Error);
            frmMain.Show();
            //}
        }
Exemplo n.º 9
0
 public BugReportForm(LSLEditorForm parent)
 {
     InitializeComponent();
     this.parent        = parent;
     this.Icon          = parent.Icon;
     this.textBox1.Text = Properties.Settings.Default.AvatarName;
     this.textBox2.Text = Properties.Settings.Default.EmailAddress;
     this.listView1.Columns.Add("ScriptName", this.listView1.Width - 30);
     foreach (Form form in parent.Children)
     {
         EditForm editForm = form as EditForm;
         if (editForm == null || editForm.IsDisposed)
         {
             continue;
         }
         ListViewItem lvi = new ListViewItem(editForm.ScriptName);
         lvi.Checked = false;
         this.listView1.Items.Add(lvi);
     }
     ShowBugReportsList();
 }
Exemplo n.º 10
0
        public EditForm(LSLEditorForm lslEditorForm)
        {
            InitializeComponent();

            this.guid = new Guid();

            this.components = new System.ComponentModel.Container();

            this.Icon   = lslEditorForm.Icon;
            this.parent = lslEditorForm;
            this.numberedTextBoxUC1.TextBox.setEditform(this);
            this.numberedTextBoxUC1.TextBox.Init(this.parent, this.parent.ConfLSL);
            this.numberedTextBoxUC1.TextBox.OnDirtyChanged += new IsDirtyHandler(TextBox_OnDirtyChanged);

            this.Move   += new EventHandler(EditForm_Position);
            this.Resize += new EventHandler(EditForm_Position);

            this.Layout += new LayoutEventHandler(EditForm_Layout);
            ImageList imageList = new ImageList();

            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.Events.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.Vars.gif"));
            imageList.Images.Add(new Bitmap(this.GetType(), "Images.Properties.gif"));
            imageList.Images.Add(new Bitmap(this.GetType(), "Images.States.gif"));

            this.tvOutline.ImageList = imageList;
            if (lslEditorForm.outlineToolStripMenuItem.Checked)
            {
                splitContainer1.Panel2Collapsed = false;
            }
            else
            {
                splitContainer1.Panel2Collapsed = true;
            }
            SetFont();
        }
Exemplo n.º 11
0
 public RuntimeConsole(LSLEditorForm mainForm)
 {
     InitializeComponent();
     this.mainForm = mainForm;
     this.Dock     = DockStyle.Fill;
 }