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


C# IData.GetLabel方法代码示例

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


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

示例1: PCDataItem

        public PCDataItem(IData data)
        {
            if (data is IPackageServerSource)
            {
                Label = (data as IPackageServerSource).Url;
            }
            else
            {
                Label = data.GetLabel();
            }

            var dataId = data.DataSourceId.DataId;
            Name = new XElement(itemName,
                dataId.GetType().GetProperties()
                .Select(p => new XAttribute(p.Name, dataId.GetProperty(p.Name)))
                ).ToString();
            DataType = data.DataSourceId.InterfaceType.ToString();
        }
开发者ID:Orckestra,项目名称:C1-Packages,代码行数:18,代码来源:PCDataItem.cs

示例2: BuildElement


//.........这里部分代码省略.........
                    if (!hasChildren)
                    {
                        foreach (var childNode in this.ChildNodes.OfType<DataElementsTreeNode>()
                            .Where(n => n.FilterNodes.OfType<FunctionFilterNode>().Any()))
                        {
                            var newDynamicContext = new TreeNodeDynamicContext(TreeNodeDynamicContextDirection.Down)
                            {
                                ElementProviderName = dynamicContext.ElementProviderName,
                                Piggybag = dynamicContext.Piggybag.PreparePiggybag(this.ParentNode, parentEntityToken),
                                CurrentEntityToken = currentEntityToken
                            };

                            if (childNode.GetDataset(newDynamicContext, false).DataItems.Any())
                            {
                                hasChildren = true;
                                break;
                            }
                        }
                    }
                }

                if (this.Icon != null)
                {
                    icon = this.Icon;
                    openedIcon = this.OpenedIcon;
                }
                else
                {
                    openedIcon = icon = data.GetIcon();
                }
            }

            string label = this.Label.IsNullOrEmpty()
                            ? data.GetLabel()
                            : this.LabelDynamicValuesHelper.ReplaceValues(replaceContext);

            string toolTip = this.ToolTip.IsNullOrEmpty()
                            ? label
                            : this.ToolTipDynamicValuesHelper.ReplaceValues(replaceContext);

            if (itemLocalizationEnabledAndForeign)
            {
                label = string.Format("{0} ({1})", label, DataLocalizationFacade.GetCultureTitle(UserSettings.ForeignLocaleCultureInfo));

                if (!data.IsTranslatable())
                {
                    toolTip = StringResourceSystemFacade.GetString("Composite.C1Console.Trees", "LocalizeDataWorkflow.DisabledData");
                }
                else
                {
                    toolTip = string.Format("{0} ({1})", toolTip, DataLocalizationFacade.GetCultureTitle(UserSettings.ForeignLocaleCultureInfo));
                }
            }

            element.VisualData = new ElementVisualizedData
            {
                Label = label,
                ToolTip = toolTip,
                HasChildren = hasChildren,
                Icon = icon,
                OpenedIcon = openedIcon,
                IsDisabled = isDisabled
            };


            if (InternalUrls.DataTypeSupported(data.DataSourceId.InterfaceType))
开发者ID:DBailey635,项目名称:C1-CMS,代码行数:67,代码来源:DataElementsTreeNode.cs

示例3: CheckForPotentialBrokenReferences

        private void CheckForPotentialBrokenReferences(IData data, List<PackageFragmentValidationResult> validationResult, 
            Type type, DataScopeIdentifier dataScopeIdentifier, CultureInfo locale, DataKeyPropertyCollection dataKeyPropertyCollection)
        {
            var pagesReferencingPageTypes = new HashSet<string>();
            var dataReferencingDataToBeUninstalled = new HashSet<string>();

            List<IData> referees = data.GetReferees();

            bool addToDelete = true;
            foreach (IData referee in referees)
            {
                if (this.UninstallerContext.IsPendingForDeletionData(referee))
                {
                    continue;
                }

                addToDelete = false;

                if (referee is IPage && data is IPageType)
                {
                    string pathToPage;

                    using (new DataScope(referee.DataSourceId.PublicationScope, referee.DataSourceId.LocaleScope))
                    {
                        pathToPage = GetPathToPage(referee as IPage);
                    }

                    if (!pagesReferencingPageTypes.Contains(pathToPage))
                    {
                        validationResult.AddFatal(Texts.DataPackageFragmentUninstaller_PageTypeIsReferenced(
                            data.GetLabel(), pathToPage));
                        pagesReferencingPageTypes.Add(pathToPage);
                    }
                }
                else
                {
                    var refereeType = referee.DataSourceId.InterfaceType;

                    string label = referee.GetLabel();
                    string key = label + refereeType.FullName;

                    if (!dataReferencingDataToBeUninstalled.Contains(key))
                    {
                        validationResult.AddFatal(Texts.DataPackageFragmentUninstaller_DataIsReferenced(
                            data.GetLabel(),
                            type.FullName,
                            label,
                            refereeType.FullName));

                        dataReferencingDataToBeUninstalled.Add(key);
                    }
                }
            }

            if (addToDelete)
            {
                AddDataToDelete(type, dataScopeIdentifier, locale, dataKeyPropertyCollection);
            }
        }
开发者ID:DBailey635,项目名称:C1-CMS,代码行数:59,代码来源:DataPackageFragmentUninstaller.cs


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