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


C# Entity.GetAttributeValue方法代码示例

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


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

示例1: SynchronousWorkflow

        public SynchronousWorkflow(Entity workflow)
        {
            this.workflow = workflow;
            initialRank = Rank;

            // Stage
            if (workflow.GetAttributeValue<bool>("triggeroncreate"))
            {
                var stageCode = workflow.GetAttributeValue<OptionSetValue>("createstage");
                Stage = stageCode != null ? stageCode.Value : 40;
                Message = "Create";
            }
            else if (workflow.GetAttributeValue<bool>("triggeronupdate") ||
                !string.IsNullOrEmpty(workflow.GetAttributeValue<string>("triggeronupdateattributelist")))
            {
                var stageCode = workflow.GetAttributeValue<OptionSetValue>("updatestage");
                Stage = stageCode != null ? stageCode.Value : 40;
                Message = "Update";
            }
            else if (workflow.GetAttributeValue<bool>("triggerondelete"))
            {
                var stageCode = workflow.GetAttributeValue<OptionSetValue>("deletestage");
                Stage = stageCode != null ? stageCode.Value : 20;
                Message = "Delete";
            }
        }
开发者ID:RazDynamics,项目名称:XrmToolBox,代码行数:26,代码来源:SynchronousWorkflow.cs

示例2: SynchronousWorkflow

        public SynchronousWorkflow(Entity workflow)
        {
            this.workflow = workflow;
            initialRank = Rank;

            // Stage
            if (workflow.GetAttributeValue<bool>("triggeroncreate"))
            {
                var stageCode = workflow.GetAttributeValue<OptionSetValue>("createstage");
                Stage = stageCode != null ? stageCode.Value : 40;
                Message = "Create";
            }
            else if (workflow.GetAttributeValue<bool>("triggeronupdate"))
            {
                var stageCode = workflow.GetAttributeValue<OptionSetValue>("updatestage");
                Stage = stageCode != null ? stageCode.Value : 40;
                Message = "Update";
            }
            else if (workflow.GetAttributeValue<bool>("triggerondelete"))
            {
                var stageCode = workflow.GetAttributeValue<OptionSetValue>("deletestage");
                Stage = stageCode != null ? stageCode.Value : 20;
                Message = "Delete";
            }
            else
            {
                // throw new Exception("Unexpected stage data");
            }
        }
开发者ID:NORENBUCH,项目名称:XrmToolBox,代码行数:29,代码来源:SynchronousWorkflow.cs

示例3: PluginStep

        public PluginStep(Entity pluginStep, IEnumerable<Entity> sdkMessageFilers, IEnumerable<Entity> sdkMessages)
        {
            this.pluginStep = pluginStep;
            initialRank = Rank;

            // EntityLogicalName
            var messageFilter = sdkMessageFilers.FirstOrDefault(
                    s => pluginStep.GetAttributeValue<EntityReference>("sdkmessagefilterid") != null &&
            s.Id == pluginStep.GetAttributeValue<EntityReference>("sdkmessagefilterid").Id);
            if (messageFilter != null)
            {
                EntityLogicalName = messageFilter.GetAttributeValue<string>("primaryobjecttypecode");

                if (EntityLogicalName.Length == 0)
                {
                    EntityLogicalName = "None";
                }

                var message = sdkMessages.FirstOrDefault(
                    m => m.Id == messageFilter.GetAttributeValue<EntityReference>("sdkmessageid").Id);
                if (message != null)
                {
                    Message = message.GetAttributeValue<string>("name");
                }
            }
            else
            {
                EntityLogicalName = "(none)";

                var message = sdkMessages.FirstOrDefault(
                  m => m.Id == pluginStep.GetAttributeValue<EntityReference>("sdkmessageid").Id);
                if (message != null)
                {
                    Message = message.GetAttributeValue<string>("name");
                }
            }
        }
开发者ID:RazDynamics,项目名称:XrmToolBox,代码行数:37,代码来源:PluginStep.cs

示例4: WebResource

 public WebResource(Entity webResource, string filePath)
 {
     FilePath = filePath;
     WebResourceEntity = webResource;
     InitialBase64 = webResource.GetAttributeValue<string>("content");
 }
开发者ID:rehanhsyed,项目名称:XrmToolBox,代码行数:6,代码来源:WebResource.cs


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