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


C# DataSet.Exists方法代码示例

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


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

示例1: Evaluate

 //
 // - Methods -
 //
 public override bool Evaluate(DataSet dataSet)
 {
     return (dataSet.Exists(this.tagSequence));
 }
开发者ID:ewcasas,项目名称:DVTK,代码行数:7,代码来源:BooleanExpressionDataSetContainsAttribute.cs

示例2: Execute

        protected override void Execute()
        {
            try
            {
                WriteHtmlInformation("<br />");
                WriteInformation(string.Format("Reading reference media file from {0}",DCMCompareForm.firstDCMFile));
                WriteHtmlInformation("<br />");

                // Read the DCM File
                DicomFile dcmFile = new DicomFile();

                DataSet refDataset = new DataSet();

                if ((DCMCompareForm.firstDCMFile.ToLower().IndexOf("dicomdir")) != -1)
                {
                    // Read the DICOMDIR dataset
                    refDataset.DvtkDataDataSet = Dvtk.DvtkDataHelper.ReadDataSetFromFile(DCMCompareForm.firstDCMFile);
                }
                else
                {
                    dcmFile.Read(DCMCompareForm.firstDCMFile, this);
                    refDataset = dcmFile.DataSet;
                }

                refDataset.UnVrDefinitionLookUpWhenReading = false;

                FileMetaInformation refFMI = dcmFile.FileMetaInformation;

                WriteInformation(string.Format("Reading source media file from {0}",DCMCompareForm.secondDCMFile));
                WriteHtmlInformation("<br />");

                DataSet srcDataset = new DataSet();

                if ((DCMCompareForm.secondDCMFile.ToLower().IndexOf("dicomdir")) != -1)
                {
                    // Read the DICOMDIR dataset
                    srcDataset.DvtkDataDataSet = Dvtk.DvtkDataHelper.ReadDataSetFromFile(DCMCompareForm.secondDCMFile);
                }
                else
                {
                    dcmFile.Read(DCMCompareForm.secondDCMFile, this);
                    srcDataset = dcmFile.DataSet;
                }

                srcDataset.UnVrDefinitionLookUpWhenReading = false;

                FileMetaInformation srcFMI = dcmFile.FileMetaInformation;

                // Now get the list of filtered attribute
                if(DCMCompareForm.attributesTagList.Count != 0)
                {
                    foreach(string filterAttr in DCMCompareForm.attributesTagList)
                    {
                        try
                        {
                            if(srcDataset.Exists(filterAttr))
                            {
                                srcDataset.Delete(filterAttr);
                            }
                            if(refDataset.Exists(filterAttr))
                            {
                                refDataset.Delete(filterAttr);
                            }
                        }
                        catch(Exception exception)
                        {
                            MessageBox.Show(exception.Message, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        }
                    }
                    DCMCompareForm.attributesTagList.Clear();
                }

                WriteInformation(string.Format("Comparing the Media files - {0} and {1}",DCMCompareForm.firstDCMFile,DCMCompareForm.secondDCMFile));
                WriteHtmlInformation("<br />");

                StaticDicomCompare staticDicomCompare = new StaticDicomCompare();

                //Determine the VR display based on Transfer syntax
                string srcTransferSyntax = "";
                string refTransferSyntax = "";

                if((srcFMI != null) && srcFMI.Exists("0x00020010"))
                {
                    // Get the Transfer syntax
                    DvtkHighLevelInterface.Dicom.Other.Attribute tranferSyntaxAttr = srcFMI["0x00020010"];
                    srcTransferSyntax = tranferSyntaxAttr.Values[0];
                }
                else
                {
                    WriteHtmlInformation(string.Format("Couldn't retrieve the Transfer syntax from DCM File {0}",DCMCompareForm.secondDCMFile));
                    WriteHtmlInformation("<br />");
                }

                if((refFMI != null) && refFMI.Exists("0x00020010"))
                {
                    // Get the Transfer syntax
                    DvtkHighLevelInterface.Dicom.Other.Attribute tranferSyntaxAttr = refFMI["0x00020010"];
                    refTransferSyntax = tranferSyntaxAttr.Values[0];
                }
                else
//.........这里部分代码省略.........
开发者ID:ewcasas,项目名称:DVTK,代码行数:101,代码来源:ScriptSession.cs


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