本文整理汇总了C#中Behaviac.Design.AgentType类的典型用法代码示例。如果您正苦于以下问题:C# AgentType类的具体用法?C# AgentType怎么用?C# AgentType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AgentType类属于Behaviac.Design命名空间,在下文中一共展示了AgentType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InspectObject
public void InspectObject(AgentType agentType, string agentFullname, Nodes.Node node)
{
_agentFullname = agentFullname;
preLayout();
deleteAllRowControls();
if (agentType != null)
{
IList<PropertyDef> properties = agentType.GetProperties();
foreach (PropertyDef p in properties)
{
addRowControl(p, null);
}
}
else if (node != null)
{
List<ParInfo> allPars = node.Pars;
foreach (ParInfo par in allPars)
{
addRowControl(null, par);
}
}
postLayout();
}
示例2: MetaMethodDialog
public MetaMethodDialog(AgentType agent, MethodDef method, MemberType memberType)
{
InitializeComponent();
this.Owner = MainWindow.Instance;
this.metaMethodPanel.Initialize(true, agent, method, memberType);
}
示例3: MetaPropertyDialog
public MetaPropertyDialog(bool canBeEdited, AgentType agent, CustomizedStruct customizedStruct, PropertyDef prop, bool canBePar)
{
InitializeComponent();
this.Owner = MainWindow.Instance;
this.metaPropertyPanel.Initialize(canBeEdited, agent, customizedStruct, prop, canBePar);
}
示例4: Inspect
internal static void Inspect(AgentType agentType, string agentName, string agentFullName, FrameStatePool.PlanningState nodeState) {
ParametersDock dock = findParametersDock(agentType, agentName);
if (dock == null) {
dock = new ParametersDock();
dock.Show(MainWindow.Instance.DockPanel, WeifenLuo.WinFormsUI.Docking.DockState.DockBottom);
}
dock.InspectObject(agentType, agentName, agentFullName, nodeState);
}
示例5: ResetMembers
public override bool ResetMembers(bool check, AgentType agentType, bool clear, MethodDef method = null, PropertyDef property = null)
{
bool bReset = false;
if (this._frames != null)
{
bReset |= this._frames.ResetMembers(check, agentType, clear, method, property);
}
bReset |= base.ResetMembers(check, agentType, clear, method, property);
return bReset;
}
示例6: Initialize
public void Initialize(bool canBeEdit, AgentType agent, CustomizedStruct customizedStruct, PropertyDef prop, bool canBePar)
{
Debug.Check(agent != null || customizedStruct != null);
_initialized = false;
_isModified = false;
_isNew = (prop == null);
_agent = agent;
_customizedStruct = customizedStruct;
_originalProperty = prop;
setTypes();
if (_isNew)
{
this.Text = canBeEdit ? Resources.AddProperty : Resources.ViewProperty;
if (customizedStruct == null)
_property = new PropertyDef(agent, null, agent.AgentTypeName, "", "", "");
else
_property = new PropertyDef(null, null, customizedStruct.Name, "", "", "");
}
else
{
this.Text = canBeEdit ? Resources.EditProperty : Resources.ViewProperty;
resetProperty(prop, prop.IsPar);
}
this.isStaticCheckBox.Visible = (agent != null);
this.isPublicCheckBox.Visible = !canBeEdit && (agent != null);
this.isConstcheckBox.Visible = (agent != null);
this.customizedCheckBox.Visible = !canBeEdit && !_property.IsInherited;
this.isLocalCheckBox.Checked = customizedStruct == null && _property.IsPar;
this.isLocalCheckBox.Visible = canBePar && customizedStruct == null && !_property.IsMember;
this.nameTextBox.Enabled = canBeEdit;
this.arrayCheckBox.Enabled = canBeEdit || _property.IsChangeableType;
this.typeComboBox.Enabled = canBeEdit || _property.IsChangeableType;
this.isStaticCheckBox.Enabled = canBeEdit;
this.isConstcheckBox.Enabled = canBeEdit;
this.dispTextBox.Enabled = canBeEdit;
this.descTextBox.Enabled = canBeEdit;
_initialized = true;
}
示例7: InspectObject
public void InspectObject(AgentType agentType, string agentFullname) {
_agentFullname = agentFullname;
preLayout();
deleteAllRowControls();
if (agentType != null) {
IList<PropertyDef> properties = agentType.GetProperties();
foreach(PropertyDef p in properties) {
if (!p.IsAddedAutomatically) {
addRowControl(p);
}
}
}
postLayout();
}
示例8: LoadCustomMembers
private static void LoadCustomMembers(List<Nodes.Node.ErrorCheck> result, XmlNode rootNode)
{
if (rootNode == null)
{ return; }
// Set the default base agent.
if (Plugin.AgentTypes.Count == 0) {
AgentType agent = new AgentType(typeof(Agent), "Agent", false, "Agent", "");
Plugin.AgentTypes.Add(agent);
}
foreach(XmlNode xmlNode in rootNode.ChildNodes) {
if (xmlNode.Name == "agent") {
string agentName = GetAttribute(xmlNode, "type");
string agentBase = GetAttribute(xmlNode, "base");
int baseIndex = -1;
for (int i = 0; i < Plugin.AgentTypes.Count; ++i) {
if (Plugin.AgentTypes[i].AgentTypeName == agentBase) {
baseIndex = i;
break;
}
}
string agentDisp = GetAttribute(xmlNode, "disp");
string agentDesc = GetAttribute(xmlNode, "desc");
if (string.IsNullOrEmpty(agentDisp))
{ agentDisp = agentName; }
AgentType agent = Plugin.GetAgentType(agentName);
if (agent == null) {
agent = new AgentType(agentName, (baseIndex > -1) ? Plugin.AgentTypes[baseIndex] : null, agentDisp, agentDesc);
Plugin.AgentTypes.Add(agent);
}
foreach(XmlNode bbNode in xmlNode) {
if (bbNode.Name == "properties") {
foreach(XmlNode propNode in bbNode) {
if (propNode.Name == "property") {
string propName = GetAttribute(propNode, "name");
string isStatic = GetAttribute(propNode, "static");
bool bStatic = false;
if (!string.IsNullOrEmpty(isStatic) && isStatic == "true")
{ bStatic = true; }
string isPublic = GetAttribute(propNode, "public");
bool bPublic = false;
if (string.IsNullOrEmpty(isPublic) || isPublic == "true")
{ bPublic = true; }
string isReadonly = GetAttribute(propNode, "readonly");
bool bReadonly = false;
if (!string.IsNullOrEmpty(isReadonly) && isReadonly == "true")
{ bReadonly = true; }
string propType = GetAttribute(propNode, "type");
Type type = Plugin.GetTypeFromName(propType);
string classname = GetAttribute(propNode, "classname");
if (string.IsNullOrEmpty(classname))
{ classname = agent.AgentTypeName; }
string propDisp = GetAttribute(propNode, "disp");
if (string.IsNullOrEmpty(propDisp))
{ propDisp = propName; }
string propDesc = GetAttribute(propNode, "desc");
PropertyDef prop = new PropertyDef(agent, type, classname, propName, propDisp, propDesc);
prop.IsStatic = bStatic;
prop.IsPublic = bPublic;
prop.IsReadonly = bReadonly;
string defaultValue = GetAttribute(propNode, "defaultvalue");
if (!string.IsNullOrEmpty(defaultValue)) {
prop.Variable = new VariableDef(null);
Plugin.InvokeTypeParser(result, type, defaultValue, (object value) => prop.Variable.Value = value, null);
}
agent.AddProperty(prop);
}
}
} else if (bbNode.Name == "methods") {
foreach(XmlNode methodNode in bbNode) {
if (methodNode.Name == "method") {
string methodName = GetAttribute(methodNode, "name");
Type returnType = Plugin.GetTypeFromName(GetAttribute(methodNode, "returntype"));
string isStatic = GetAttribute(methodNode, "static");
bool bStatic = false;
//.........这里部分代码省略.........
示例9: agentTypeChanged
private void agentTypeChanged(AgentType agentType) {
//CheckErrors(_rootNode.RootBehavior, true);
//PropertiesDock.UpdatePropertyGrids();
this.Redraw();
}
示例10: MethodDef
public MethodDef(AgentType agentType, MemberType memberType, bool isChangeableType, bool isPublic, bool isStatic, string classname, string owner, string name, string displayName, string description, string nativeReturnType, Type returnType, bool isActionMethodOnly, List<Param> pars)
{
_agentType = agentType;
_isChangeableType = isChangeableType;
_isPublic = isPublic;
_isStatic = isStatic;
_classname = classname;
_owner = owner;
_name = name;
_displayName = displayName;
_description = description;
_nativeReturnType = string.IsNullOrEmpty(nativeReturnType) ? Plugin.GetNativeTypeName(returnType) : nativeReturnType;
_returnType = returnType;
_isActionMethodOnly = isActionMethodOnly;
_params = pars;
_memberType = memberType;
_isCustomized = (memberType == Design.MemberType.Task);
}
示例11: ResetMembers
public bool ResetMembers(bool check, AgentType agentType, bool clear, MethodDef method, PropertyDef property)
{
if (this.IsMethod && this.Method != null)
{
if (method != null && method.OldName == this.Method.Name)
{
if (!check)
{
if (clear || this.Method.ShouldBeCleared(agentType))
{ this.m_method = null; }
else
{ this.Method.CopyFrom(method); }
}
return true;
}
return this.Method.ResetMembers(check, agentType, clear, method, property);
}
else if (this.Var != null)
{
return this.Var.ResetMembers(check, agentType, clear, property);
}
return false;
}
示例12: ShouldBeCleared
public bool ShouldBeCleared(AgentType agentType)
{
return (this.Owner == VariableDef.kSelf &&
!Plugin.IsAgentDerived(this.AgentType.AgentTypeName, agentType.AgentTypeName));
}
示例13: PropertyDef
// Meta Property
public PropertyDef(AgentType agentType, FieldInfo pi, bool isChangeableType, bool isStatic, bool isPublic, bool isProperty, bool isReadonly, string classname, string owner, string name, string nativeType, string displayName, string description)
{
_agentType = agentType;
_propertyInfo = pi;
_isChangeableType = isChangeableType;
_isStatic = isStatic;
_isPublic = isPublic;
_isProperty = isProperty;
_isReadonly = isReadonly;
_classname = classname;
_owner = owner;
_name = name;
_nativeType = nativeType;
_displayName = displayName;
_description = description;
}
示例14: ResetMembers
public override bool ResetMembers(bool check, AgentType agentType, bool clear, MethodDef method = null, PropertyDef property = null) {
bool bReset = false;
if (this._task != null && method != null && this._task.Name == method.OldName) {
if (method != null && this._task.Name == method.OldName &&
(clear || this._task.ShouldBeCleared(agentType))) {
bReset = true;
if (!check)
{ this._task = null; }
} else {
bReset |= this._task.ResetMembers(check, agentType, clear, method, property);
}
}
bReset |= base.ResetMembers(check, agentType, clear, method, property);
return bReset;
}
示例15: setText
private void setText(AgentType agentType, string agentName) {
// Par
if (agentType == null) {
Text = TabText = string.IsNullOrEmpty(agentName) ? Resources.Pars : string.Format(Resources.ParsOf, agentName);
}
// Global
else if (Plugin.IsGlobalInstanceAgentType(agentType)) {
Text = TabText = string.Format(Resources.PropertiesOf, agentType.ToString());
}
// Agent
else {
Text = TabText = string.Format(Resources.PropertiesOf + "::{1}", agentType.ToString(), agentName);
}
}