/// <summary> /// Constructor /// </summary> /// <param name="document">The script document</param> /// <param name="className">The class name</param> public ScriptNetworkLayerFactory(ScriptDocument document, string className) { Script = document; ClassName = className; Description = Properties.Resources.ScriptNetworkLayerFactory_Name; _config = new Dictionary<string, object>(); _desc = new ScriptDynamicTypeDescriptor(this); }
/// <summary> /// Constructor /// </summary> /// <param name="document">The script document</param> /// <param name="className">The class name</param> public ScriptDataEndpointFactory(ScriptDocument document, string className) : base(className, new ServerConfig()) { ServerConfig config = Config as ServerConfig; config.SetFactory(this); Script = document; ClassName = className; }
public ScriptOptionsForm(ScriptDocument document) { InitializeComponent(); _document = document; checkBoxEnableDebug.Checked = _document.Container.EnableDebug; dynamicConfigEditorControl.Properties = _document.Configuration.ToArray(); LoadReferenceList(_document.Container.ReferencedNames); }
/// <summary> /// Constructor /// </summary> /// <param name="document">The script document to test</param> public ScriptTestDocument(ScriptDocument document) { #pragma warning disable 612 _document = null; _path = null; #pragma warning restore 612 _config = new DynamicNodeConfig(); _config.Label = "node"; _config.Script = document; _config.DirtyChanged += new EventHandler(_config_DirtyChanged); }
// TODO: Fix this :) public ScriptDocumentControl(IDocumentObject document, bool forParserDocument) { _document = (ScriptDocument)document; _currText = _document.Script; InitializeComponent(); Text = _document.Name; ScriptDocumentControlConfig config = _document.GetProperty<ScriptDocumentControlConfig>(DOCUMENT_CONFIG_NAME, false); UpdateConfig(config ?? DocumentControl.GetConfigItem<ScriptDocumentControlConfig>(GetConfigForEngine(_document.Container.Engine), true)); LoadFile(_document.Script); _forParserDocument = forParserDocument; if (!forParserDocument) { if (this.ParentForm != null) { this.ParentForm.FormClosing += new FormClosingEventHandler(ParentForm_FormClosing); } } textEditorControl.ActiveTextAreaControl.Document.UndoStack.OperationPushed += new OperationEventHandler(UndoStack_OperationPushed); textEditorControl.ActiveTextAreaControl.Document.UndoStack.ActionUndone += new EventHandler(UndoStack_ActionUndone); textEditorControl.ActiveTextAreaControl.Document.UndoStack.ActionRedone += new EventHandler(UndoStack_ActionUndone); if (GlobalControlConfig.ScriptEditorFont != null) { textEditorControl.Font = GlobalControlConfig.ScriptEditorFont; } if (forParserDocument) { toolStripButtonSave.Visible = false; toolStripButtonOptions.Visible = false; toolStripButtonOpenTest.Visible = false; } }
private void btnOK_Click(object sender, EventArgs e) { if (scriptSelectionControl.Document == null) { MessageBox.Show(this, CANAPE.Properties.Resources.ScriptSelectForm_NoDocument, CANAPE.Properties.Resources.ScriptSelectForm_Caption, MessageBoxButtons.OK, MessageBoxIcon.Error); } else if (String.IsNullOrWhiteSpace(scriptSelectionControl.ClassName)) { MessageBox.Show(this, CANAPE.Properties.Resources.ScriptSelectForm_NoClass, CANAPE.Properties.Resources.ScriptSelectForm_Caption, MessageBoxButtons.OK, MessageBoxIcon.Error); } else { Document = scriptSelectionControl.Document; ClassName = scriptSelectionControl.ClassName; DialogResult = DialogResult.OK; Close(); } }
private static ScriptDocument FindScriptDocument(string name) { ScriptDocument doc = CANAPEProject.CurrentProject.GetDocumentByName(name) as ScriptDocument; if (doc == null) { Guid g; if (Guid.TryParse(name, out g)) { doc = CANAPEProject.CurrentProject.GetDocumentByUuid(g) as ScriptDocument; } if (doc == null) { throw new ArgumentException(String.Format(CANAPE.Documents.Properties.Resources.ScriptDocument_CannotFindDocument, name)); } } return(doc); }
public ScriptStringConverter(ScriptDocument document) { _document = document; }
private void ApplyScript_Click(ScriptDocument script) { try { ApplyStringConverter(ScriptUtils.GetInstance<IStringConverter>(script.Container) ?? new ScriptStringConverter(script)); } catch (Exception ex) { MessageBox.Show(this, ex.Message, CANAPE.Properties.Resources.MessageBox_ErrorString, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
protected override bool SelectScript(ScriptDocument document, string className) { Server = new ScriptDataEndpointFactory(document, className); return true; }
protected override bool SelectScript(ScriptDocument document, string className) { Factory = new ScriptNetworkLayerFactory(document, className); return true; }
protected virtual bool SelectScript(ScriptDocument document, string className) { // Do nothing return true; }
private void ReloadScript() { if ((_script == null) && (_uuid != Guid.Empty)) { _script = (ScriptDocument)CANAPEProject.CurrentProject.GetDocumentByUuid(_uuid); if (_script == null) { _uuid = Guid.Empty; ClassName = String.Empty; } } }
public ScriptPacketLogExtension(ScriptDocument document) { _document = document; }
void RunScript_Click(ScriptDocument script) { try { RunPacketLogExtension(ScriptUtils.GetInstance<IPacketLogExtension>(script.Container) ?? new ScriptPacketLogExtension(script)); } catch (Exception ex) { MessageBox.Show(this, ex.Message, CANAPE.Properties.Resources.MessageBox_ErrorString, MessageBoxButtons.OK, MessageBoxIcon.Error); } }