当前位置: 首页>>代码示例>>C#>>正文


C# NamedObjectSave.GetReferencedElement方法代码示例

本文整理汇总了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;

        }
开发者ID:gitter-badger,项目名称:FlatRedBall,代码行数:29,代码来源:NamedObjectPropertyGridDisplayer.cs

示例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);
                }

            }


        }
开发者ID:vchelaru,项目名称:FlatRedBall,代码行数:17,代码来源:StateCodeGenerator.cs

示例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);
                }
            }
        }
开发者ID:vchelaru,项目名称:FlatRedBall,代码行数:73,代码来源:AvailableStates.cs


注:本文中的FlatRedBall.Glue.SaveClasses.NamedObjectSave.GetReferencedElement方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。