Ejemplo n.º 1
0
        private void ConfigForm_Load(object sender, EventArgs e)
        {
            FCurrentPath  = Directory.GetCurrentDirectory();

            FPropTable = new BotStudio.PropertyPack.PropertyTable();

            BotStudio.PropertyPack.PropertySpec prop = new BotStudio.PropertyPack.PropertySpec("BotRoot", typeof(string));
            FPropTable.Properties.Add(prop);
            FPropTable["BotRoot"] = ConfigurationManager.AppSettings["BotRoot"];

            prop = new BotStudio.PropertyPack.PropertySpec("BotEditor", typeof(string));
            prop.Attributes = new Attribute[] { new EditorAttribute(typeof(PropertyGridFilePicker), typeof(System.Drawing.Design.UITypeEditor)) };
            FPropTable.Properties.Add(prop);
            FPropTable["BotEditor"] = ConfigurationManager.AppSettings["BotEditor"];

            prop = new BotStudio.PropertyPack.PropertySpec("DefaultHostAddress", typeof(IPAddress));
            prop.Attributes = new Attribute[] { new EditorAttribute(typeof(PropertyGridIPAddressInput), typeof(System.Drawing.Design.UITypeEditor)) };
            FPropTable.Properties.Add(prop);
            FPropTable["DefaultHostAddress"] = IPAddress.Parse(ConfigurationManager.AppSettings["DefaultHostAddress"]);

            prop = new BotStudio.PropertyPack.PropertySpec("DefaultHostPort", typeof(int));
            FPropTable.Properties.Add(prop);
            FPropTable["DefaultHostPort"] = ConfigurationManager.AppSettings["DefaultHostPort"];

            prop = new BotStudio.PropertyPack.PropertySpec("DefaultBotName", typeof(string));
            FPropTable.Properties.Add(prop);
            FPropTable["DefaultBotName"] = ConfigurationManager.AppSettings["DefaultBotName"];

            configPropGrid.SelectedObject = FPropTable;
        }
Ejemplo n.º 2
0
        private void NewBotDlg_Load(object sender, EventArgs e)
        {
            Text = BotDesc.Script;

            FPropTable = new BotStudio.PropertyPack.PropertyTable();

            BotStudio.PropertyPack.PropertySpec prop = new BotStudio.PropertyPack.PropertySpec("Name", typeof(string));
            FPropTable.Properties.Add(prop);
            FPropTable["Name"] = BotDesc.Name;

            prop = new BotStudio.PropertyPack.PropertySpec("Count", typeof(int));
            FPropTable.Properties.Add(prop);
            FPropTable["Count"] = BotDesc.Count;

            prop = new BotStudio.PropertyPack.PropertySpec("Silence Mode", typeof(bool));
            FPropTable.Properties.Add(prop);
            FPropTable["Silence Mode"] = BotDesc.Silenced;

            prop = new BotStudio.PropertyPack.PropertySpec("HostAddress", typeof(IPAddress));

            prop.Attributes = new Attribute[] { new EditorAttribute(typeof(PropertyGridIPAddressInput), typeof(System.Drawing.Design.UITypeEditor)) };
            FPropTable.Properties.Add(prop);
            FPropTable["HostAddress"] = BotDesc.Host.Address;

            prop = new BotStudio.PropertyPack.PropertySpec("HostPort", typeof(int));
            FPropTable.Properties.Add(prop);
            FPropTable["HostPort"] = BotDesc.Host.Port;

            prop = new BotStudio.PropertyPack.PropertySpec("Script", typeof(string));
            prop.Attributes = new Attribute[]{new ReadOnlyAttribute(true)};
            FPropTable.Properties.Add(prop);
            FPropTable["Script"] = BotDesc.Script;

            propGrid.SelectedObject = FPropTable;
        }
Ejemplo n.º 3
0
        public BotCommandForm(BotEngine.BotCommand cmd)
        {
            InitializeComponent();
            FCommand = cmd;

            FPropertyTable = new BotStudio.PropertyPack.PropertyTable();

            foreach(BotEngine.BotCommand.Parameter param in cmd.Parameters)
            {
                FPropertyTable.Properties.Add(new BotStudio.PropertyPack.PropertySpec(param.Name, typeof(string)));
            }

            commandPropList.SelectedObject = FPropertyTable;
        }