示例#1
0
        private void RegisterPlugin(Assembly assembly, Plugin plugin, ImageList imageList, bool bAddNodes)
        {
            // register the plugin
            Plugin.AddLoadedPlugin(assembly);
            Plugin.RegisterTypeHandlers(assembly);
            Plugin.RegisterAgentTypes(assembly);

            // register all the groups we need in the node explorer
            if (bAddNodes && imageList != null)
            {
                Plugin.RegisterNodeDesc(assembly, imageList.Images.Count);
            }
            else
            {
                Plugin.RegisterNodeDesc(assembly);
            }

            // add all file managers, exporters and AI types
            _fileManagers.AddRange(plugin.FileManagers);
        }
示例#2
0
        private void RegisterPlugin(Assembly assembly, Plugin plugin, object nodeList, bool bAddNodes)
        {
            // register the plugin
            Plugin.AddLoadedPlugin(assembly);
            Plugin.RegisterTypeHandlers(assembly);
            Plugin.RegisterAgentTypes(assembly);

            // register all the groups we need in the node explorer
            if (bAddNodes && nodeList is NodeTreeList)
            {
                NodeTreeList nodeTreeList = nodeList as NodeTreeList;
                List<Image> images = Plugin.RegisterNodeDesc(assembly, nodeTreeList.ImageList.Images.Count);
                foreach (Image image in images)
                {
                    nodeTreeList.ImageList.Images.Add(image);
                }
            }
            else
            {
                Plugin.RegisterNodeDesc(assembly);
            }

            // add all file managers, exporters and AI types
            _fileManagers.AddRange(plugin.FileManagers);
        }
示例#3
0
文件: Agent.cs 项目: Just4F/behaviac
 public static bool Parse(object parent, string paramName, string parStr, Plugin.SetValue setter) {
     throw new Exception(string.Format(Resources.ExceptionDesignerAttributeIllegalIntegerValue, parStr));
 }
示例#4
0
文件: Agent.cs 项目: Just4F/behaviac
        public static bool Parse(object parent, string paramName, string parStr, Plugin.SetValue setter) {
            char result;

            if (char.TryParse(parStr, out result)) {
                setter(result);

                return true;

            } else {
                throw new Exception(string.Format(Resources.ExceptionDesignerAttributeIllegalIntegerValue, parStr));
            }
        }
示例#5
0
文件: Agent.cs 项目: Just4F/behaviac
        public static bool Parse(object parent, string paramName, string parStr, Plugin.SetValue setter)
        {
            ulong result;

            if (ulong.TryParse(parStr, NumberStyles.Any, CultureInfo.InvariantCulture.NumberFormat, out result))
            {
                setter(result);

                return true;
            }
            else
            {
                throw new Exception(string.Format(Resources.ExceptionDesignerAttributeIllegalIntegerValue, parStr));
            }
        }
示例#6
0
文件: Agent.cs 项目: Just4F/behaviac
        public static bool Parse(object parent, string paramName, string parStr, Plugin.SetValue setter) {
            if (!string.IsNullOrEmpty(parStr)) {
                bool bSet = false;

                if (parStr.Length >= 2) {
                    if (parStr[0] == '\'' || parStr[0] == '\"') {
                        string strTrimed = parStr.Substring(1, parStr.Length - 2);

                        setter(strTrimed);

                        bSet = true;
                    }
                }

                if (!bSet) {
                    setter(parStr);
                }

            } else {
                setter(parStr);
            }

            return true;
        }
示例#7
0
文件: Agent.cs 项目: Just4F/behaviac
        public static bool Parse(object parent, string paramName, string parStr, Plugin.SetValue setter) {
            parStr = parStr.ToLowerInvariant();

            if (parStr == "true") {
                setter(true);

                return true;

            } else if (parStr == "false") {
                setter(false);

                return true;

            } else {
                throw new Exception(string.Format(Resources.ExceptionDesignerAttributeIllegalBooleanValue, parStr));
            }
        }