本文整理汇总了C#中FlatRedBall.Glue.SaveClasses.NamedObjectSave.GetReferencedElement方法的典型用法代码示例。如果您正苦于以下问题:C# NamedObjectSave.GetReferencedElement方法的具体用法?C# NamedObjectSave.GetReferencedElement怎么用?C# NamedObjectSave.GetReferencedElement使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FlatRedBall.Glue.SaveClasses.NamedObjectSave
的用法示例。
在下文中一共展示了NamedObjectSave.GetReferencedElement方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DetermineIfShouldShowStates
private bool DetermineIfShouldShowStates(NamedObjectSave instance)
{
IElement referencedEntitySave = instance.GetReferencedElement();
bool shouldRemove = referencedEntitySave == null;
if (referencedEntitySave != null)
{
shouldRemove = true;
IElement element = referencedEntitySave;
while (element != null)
{
if (element.States.Count != 0)
{
shouldRemove = false;
break;
}
else
{
element = ObjectFinder.Self.GetIElement(element.BaseElement);
}
}
}
return !shouldRemove;
}
示例2: WriteSetStateOnNamedObject
public static void WriteSetStateOnNamedObject(NamedObjectSave namedObject, ICodeBlock codeBlock)
{
if (!string.IsNullOrEmpty(namedObject.CurrentState))
{
IElement referencedElement = namedObject.GetReferencedElement();
if (referencedElement != null && referencedElement.GetUncategorizedStatesRecursively().Count != 0)
{
string qualifiedName = NamedObjectSaveCodeGenerator.GetQualifiedTypeName(namedObject);
string lineToAdd = namedObject.FieldName + ".CurrentState = " + qualifiedName + ".VariableState." + namedObject.CurrentState + ";";
codeBlock.Line(lineToAdd);
}
}
}
示例3: FillPossibleStatesFor
public static void FillPossibleStatesFor(List<string> listToFill, string selectedItemName, NamedObjectSave currentNamedObject)
{
IElement element = currentNamedObject.GetReferencedElement();
while (element != null)
{
IEnumerable<StateSave> stateList = element.States;
// Let's see if this element has a variable by this name
CustomVariable foundVariable = element.GetCustomVariableRecursively(selectedItemName);
if (foundVariable != null)
{
FillPossibleStatesFor(listToFill, element, foundVariable);
break;
}
else
{
listToFill.Add("<NONE>");
bool useDefaultStateList = selectedItemName == "CurrentVariableState" ||
(foundVariable == null && selectedItemName == "CurrentState");
if (useDefaultStateList)
{
foreach (StateSave state in element.States)
{
listToFill.Add(state.Name);
}
foreach (StateSaveCategory ssc in element.StateCategoryList)
{
if (ssc.SharesVariablesWithOtherCategories)
{
foreach (StateSave state in ssc.States)
{
listToFill.Add(state.Name);
}
}
}
}
else
{
if (!useDefaultStateList)
{
string stateCategory = "";
if (foundVariable != null)
{
stateCategory = foundVariable.Type;
}
else
{
stateCategory = StateSaveExtensionMethods.GetStateTypeFromCurrentVariableName(selectedItemName);
}
StateSaveCategory category = element.GetStateCategory(stateCategory);
if (category != null)
{
stateList = category.States;
}
}
foreach (StateSave state in stateList)
{
listToFill.Add(state.Name);
}
}
element = ObjectFinder.Self.GetIElement(element.BaseElement);
}
}
}