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


C# IObject.isSet方法代码示例

本文整理汇总了C#中IObject.isSet方法的典型用法代码示例。如果您正苦于以下问题:C# IObject.isSet方法的具体用法?C# IObject.isSet怎么用?C# IObject.isSet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IObject的用法示例。


在下文中一共展示了IObject.isSet方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetName

        public string GetName(IObject element)
        {
            // Returns the name by the uml logic.
            var dataLayer = _dataLayerLogic?.GetDataLayerOfObject(element);
            var metaLayer = _dataLayerLogic?.GetMetaLayerFor(dataLayer);
            var uml = _dataLayerLogic?.Get<_UML>(metaLayer);
            if (uml != null && element.isSet(_UML._CommonStructure._NamedElement.name))
            {
                var result = element.get(_UML._CommonStructure._NamedElement.name);
                if (result != null)
                {
                    return result.ToString();
                }
            }

            // If the element is not uml induced or the property is empty, check by
            // the default "name" property
            if (element.isSet("name"))
            {
                return element.get("name").ToString();
            }

            // Ok, finally, we don't know what to do, so request retrieve the name just via ToString
            return element.ToString();
        }
开发者ID:mbrenn,项目名称:datenmeister-new,代码行数:25,代码来源:UmlNameResolution.cs

示例2: IsProperty

        public bool IsProperty(IObject element)
        {
            var attributeXmi = "{" + Namespaces.Xmi + "}type";

            return element.isSet(attributeXmi) &&
                   element.get(attributeXmi).ToString() == "uml:Property";
        }
开发者ID:mbrenn,项目名称:datenmeister-new,代码行数:7,代码来源:XmiSourceParser.cs

示例3: GetName

        public static string GetName(IObject value)
        {
            if (value.isSet("name"))
            {
                return value.get("name").ToString();
            }

            return null;
        }
开发者ID:mbrenn,项目名称:datenmeister-new,代码行数:9,代码来源:UmlHelper.cs

示例4: ConvertToJson

        /// <summary>
        /// Converts a given element to a json string, dependent on the column definition as given by the 
        /// ColumnCreationResult
        /// </summary>
        /// <param name="element"></param>
        /// <param name="creatorResult"></param>
        /// <returns></returns>
        private Dictionary<string, object> ConvertToJson(IObject element, ColumnCreationResult creatorResult)
        {
            var result = new Dictionary<string, object>();

            foreach (var property in creatorResult.Properties
                .Where(property => element.isSet(property)))
            {
                var propertyAsString = ColumnCreator.ConvertPropertyToColumnName(property);

                var propertyValue = element.get(property);

                if (creatorResult.ColumnsOnProperty[property].isEnumeration)
                {
                    if (propertyValue is IEnumerable && !(propertyValue is string))
                    {
                        var list = new List<object>();
                        foreach (var listValue in (propertyValue as IEnumerable))
                        {
                            var asElement = listValue as IElement;
                            string url;
                            if (asElement != null)
                            {
                                url = asElement.GetUri();
                            }
                            else
                            {
                                url = null;
                            }

                            list.Add(new
                            {
                                u = url,
                                v = listValue == null ? "null" : _resolution.GetName(listValue)
                            });
                        }

                        result[propertyAsString] = list;
                    }
                    else
                    {
                        result[propertyAsString] = propertyValue == null ? "null" : _resolution.GetName(propertyValue);
                    }
                }
                else
                {
                    result[propertyAsString] = propertyValue == null ? "null" : _resolution.GetName(propertyValue);
                }
            }

            return result;
        }
开发者ID:mbrenn,项目名称:datenmeister-new,代码行数:58,代码来源:ExtentController.cs


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