Login to reply

3 posts


by aktionline 4 months ago
I tried these, but not worked, I have VS2017 installed
http://www.korduene.com/oldcontent/docs/Extensions/customnodes.html
thanks

by aktionline 4 months ago
I tried this
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Korduene;
using Korduene.KGraph;
using System.Windows.Forms;
using System.ComponentModel;
namespace MyNode
{
public class MyExtension : IExtension
{
//Extension Author
public string Author { get { return ""; } }
//Extension Menu
public ToolStripMenuItem ExtensionMenu { get { return extensionMenu; } }
//Name of extension
public string Name { get { return ""; } }
//Extension version
public Version Version { get { return new Version(1, 0); } }
// Available version
public Version AvailableVersion { get { return new Version(1, 0); } }
//Extension website
public string Website { get { return ""; } }
//Korduene version that this extension is compatible with.
public Version KordueneVersion { get { return new Version(0, 1); } }
//Extension author email
public string Email { get { return ""; } }
//Extension description
public string Description { get { return ""; } }
//Extension nodes namespace.
public bool IncludeNodes { get { return true; } }
//Extension license
public string License { get { return ""; } }
//Support link
public string SupportLink { get { return ""; } }
//Extension image 16x16
public System.Drawing.Image Image { get { return null; } }
ToolStripMenuItem extensionMenu = null;
//public MyExtension()
//{
// extensionMenu = new System.Windows.Forms.ToolStripMenuItem("EmptyExtension2");
// extensionMenu.Click += extensionMenu_Click;
//}
//void extensionMenu_Click(object sender, EventArgs e)
//{
// MessageBox.Show("This is an empty extension and only used for demonstration.2", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information);
//}
}

[IsNode("Message Box")]
public class MessageBox : Node
{
Port run = new Port(PortType.IN, typeof(RUN), AcceptsLinks.MULTIPLE, "Show");
Port title = new Port(PortType.IN, typeof(string), AcceptsLinks.ONE, "Title");
Port msg = new Port(PortType.IN, typeof(string), AcceptsLinks.ONE, "Message");
Port buttons = new Port(PortType.IN, typeof(System.Windows.Forms.MessageBoxButtons), AcceptsLinks.ONE, "Buttons");
Port icon = new Port(PortType.IN, typeof(System.Windows.Forms.MessageBoxIcon), AcceptsLinks.ONE, "Icon");
Port defaultbutton = new Port(PortType.IN, typeof(System.Windows.Forms.MessageBoxDefaultButton), AcceptsLinks.ONE, "DefaultButton");
Port runYes = new Port(PortType.OUT, typeof(RUN), AcceptsLinks.MULTIPLE, "Yes");
Port runNo = new Port(PortType.OUT, typeof(RUN), AcceptsLinks.MULTIPLE, "No");
Port runOK = new Port(PortType.OUT, typeof(RUN), AcceptsLinks.MULTIPLE, "Ok");
Port runAbort = new Port(PortType.OUT, typeof(RUN), AcceptsLinks.MULTIPLE, "Abort");
Port runCancel = new Port(PortType.OUT, typeof(RUN), AcceptsLinks.MULTIPLE, "Cancel");
Port runIgnore = new Port(PortType.OUT, typeof(RUN), AcceptsLinks.MULTIPLE, "Ignore");
Port runRetry = new Port(PortType.OUT, typeof(RUN), AcceptsLinks.MULTIPLE, "Retry");
Port runNone = new Port(PortType.OUT, typeof(RUN), AcceptsLinks.MULTIPLE, "None");
public MessageBox()
{
NodeType = NodeType.Method;
this.Name = "Message Box";
this.AddPort(run);
this.AddPort(title);
this.AddPort(msg);
AddPort(buttons);
AddPort(icon);
AddPort(defaultbutton);
this.AddPort(runYes);
this.AddPort(runNo);
this.AddPort(runOK);
this.AddPort(runAbort);
this.AddPort(runCancel);
this.AddPort(runIgnore);
this.AddPort(runRetry);
this.AddPort(runNone);
Information = "Displays a message box. " +
"You can set the message box Icon, Title, Message, and Buttons, all that is done in " +
"the properties window " +
"If none of the buttons is clicked 'None' will fire, " +
"If OK is clicked 'OK' will fire, " +
"if Cancel is clicked, 'Cancel' will fire, " +
"If Yes is clicked 'Yes' will fire, " +
"if No is clicked, 'No' will fire." +
"If Abort is clicked 'Abort' will fire, " +
"if Ignore is clicked, 'Ignore' will fire." +
"If Retry is clicked 'Retry' will fire, " +
"if Retry is clicked, 'Retry' will fire.";
}
public override string Code()
{
string code = "DialogResult result = System.Windows.Forms.MessageBox.Show(" + GetValue(msg) + ", "
+ GetValue(title) + ", " + GetValue(buttons) + ", "
+ GetValue(icon) + ", "
+ GetValue(defaultbutton) + ");\r
";
if (runAbort.IsConnected)
{
code += "if (result == System.Windows.Forms.DialogResult.Abort)\r
{\r
" + GetValue(runAbort) + "}\r
";
}
if (runCancel.IsConnected)
{
code += "if (result == System.Windows.Forms.DialogResult.Cancel)\r
{\r
" + GetValue(runCancel) + "}\r
";
}
if (runIgnore.IsConnected)
{
code += "if (result == System.Windows.Forms.DialogResult.Ignore)\r
{\r
" + GetValue(runIgnore) + "}\r
";
}
if (runNo.IsConnected)
{
code += "if (result == System.Windows.Forms.DialogResult.No)\r
{\r
" + GetValue(runNo) + "}\r
";
}
if (runNone.IsConnected)
{
code += "if (result == System.Windows.Forms.DialogResult.None)\r
{\r
" + GetValue(runNone) + "}\r
";
}
if (runOK.IsConnected)
{
code += "if (result == System.Windows.Forms.DialogResult.OK)\r
{\r
" + GetValue(runOK) + "}\r
";
}
if (runRetry.IsConnected)
{
code += "if (result == System.Windows.Forms.DialogResult.Retry)\r
{\r
" + GetValue(runRetry) + "}\r
";
}
if (runYes.IsConnected)
{
code += "if (result == System.Windows.Forms.DialogResult.Yes)\r
{\r
" + GetValue(runYes) + "}\r
";
}
return code;
}
}
}

got it using the code in:
http://www.korduene.com/oldcontent/docs/Nodes/Application/Dialogs/MessageBox.html

This method of making nides is really hurt. Please make it using graphical method.

by Rebin 4 months ago
At the moment, that's probably the best way to make nodes, I think it's a great idea creating nodes in Korduene, this could be another project type.
For now, let me know what you're having problems with creating nodes this way, and I will help as much as I can.

Korduene Developer
Login to reply
;