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


C# Row.Clone方法代码示例

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


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

示例1: MergeRows

        protected override Row MergeRows(Row newRow, Row oldRow)
        {
            Row row;

            // if the old row doesn't exist, then the new row is new, and it should be created
            if (oldRow["id"] == null) {
                row = newRow.Clone();
                row["action"] = "Create";
                return row;
            }

            // if the new row doesn't exist, then the old row has been dropped, and it should be marked as dropped and updated
            if (newRow["id"] == null) {
                row = oldRow.Clone();
                row["dropped"] = true;
                row["action"] = oldRow["dropped"].Equals(true) ? "None" : "Update";
                return row;
            }

            // if new and old rows are the same, then we have nothing to do.
            if (Equal(newRow, oldRow)) {
                row = oldRow.Clone();
                row["action"] = "None";
                return row;
            }

            // if we end up here, the sql is the same but other properties have been updated, so we should update it.
            row = newRow.Clone();
            row["action"] = "Update";
            row["modified"] = _today;
            return row;
        }
开发者ID:modulexcite,项目名称:SQLoogle,代码行数:32,代码来源:SqloogleCompare.cs

示例2: MergeRows

 protected override Row MergeRows(Row leftRow, Row rightRow)
 {
     var row = leftRow.Clone();
     row["AWord"] = leftRow["Id"] + "," + leftRow["AWord"] + "," +
                    rightRow["AWord"];
     return row;
 }
开发者ID:Thejraj,项目名称:RhinoETL,代码行数:7,代码来源:JoinWordsList.cs

示例3: MergeRows

 protected override Row MergeRows(Row leftRow, Row rightRow)
 {
     Row row = leftRow.Clone();
     row["AWord"] = leftRow["AWord"].ToString() + " " +
                                rightRow["AWord"].ToString();
     return row;
 }
开发者ID:JackWangCUMT,项目名称:HelloWorld-Rhino-ETL,代码行数:7,代码来源:Program.cs

示例4: MergeRows

 protected override Row MergeRows(Row leftRow, Row rightRow) {
     var row = leftRow.Clone();
     foreach (var field in _fields) {
         row[field] = rightRow[field];
     }
     return row;
 }
开发者ID:modulexcite,项目名称:Transformalize,代码行数:7,代码来源:EntityJoinOperation.cs

示例5: MergeRows

 protected override Row MergeRows(Row leftRow, Row rightRow)
 {
     var row = leftRow.Clone();
     if (rightRow["use"] != null) {
         row["use"] = rightRow["use"];
         row["lastused"] = DateTime.Now;
     }
     return row;
 }
开发者ID:modulexcite,项目名称:SQLoogle,代码行数:9,代码来源:CachedObjectStatsJoin.cs

示例6: MergeRows

        protected override Row MergeRows(Row leftRow, Row rightRow)
        {
            var row = leftRow.Clone();

            if (!leftRow["type"].Equals("Index"))
                return row;

            if(rightRow["use"] != null)
                row["use"] = rightRow["use"];

            if(rightRow["lastused"] != null)
                row["lastused"] = rightRow["lastused"];

            return row;
        }
开发者ID:modulexcite,项目名称:SQLoogle,代码行数:15,代码来源:IndexStatsJoin.cs

示例7: Should_respect_stringcomparer_specification

        public void Should_respect_stringcomparer_specification()
        {
            Row first = new Row(StringComparer.Ordinal);
            first["A"] = 1;

            Row second = new Row(StringComparer.Ordinal);
            second["a"] = 1;

            Row third = second.Clone();

            Row fourth = new Row();
            fourth.Copy(second);

            Assert.False(first.Equals(second));
            Assert.False(first.Equals(third));
            Assert.False(first.Equals(fourth));
        }
开发者ID:f4i2u1,项目名称:rhino-etl,代码行数:17,代码来源:RowTest.cs

示例8: Should_not_take_casing_into_account_in_column_names

        public void Should_not_take_casing_into_account_in_column_names()
        {
            Row first = new Row();
            first["A"] = 1;

            Row second = new Row();
            second["a"] = 1;

            Row third = second.Clone();
            
            Row fourth = new Row();
            fourth.Copy(third);

            Assert.True(first.Equals(second));
            Assert.True(first.Equals(third));
            Assert.True(first.Equals(fourth));
        }
开发者ID:f4i2u1,项目名称:rhino-etl,代码行数:17,代码来源:RowTest.cs

示例9: MergeRows

        protected override Row MergeRows(Row leftRow, Row rightRow) {
            var row = rightRow.Clone();

            if (ThereIsAKeyMatch(leftRow, _firstKey)) {
                row["TflAction"] = EntityAction.None;
                row["TflDeleted"] = false;
            } else {
                var isAlreadyDeleted = rightRow["TflDeleted"] != null && (bool)rightRow["TflDeleted"];
                if (isAlreadyDeleted) {
                    row["TflAction"] = EntityAction.None;
                    row["TflDeleted"] = true;
                } else {
                    row["TflAction"] = EntityAction.Delete;
                    row["TflDeleted"] = true;
                }
            }
            return row;
        }
开发者ID:modulexcite,项目名称:Transformalize,代码行数:18,代码来源:EntityDetectDeletes.cs

示例10: MergeRows

 protected override Row MergeRows(Row leftRow, Row rightRow)
 {
     Row row = leftRow.Clone();
     row["user_id"] = rightRow["new_id"];
     return row;
 }
开发者ID:f4i2u1,项目名称:rhino-etl,代码行数:6,代码来源:JoinUsersAndIds.cs

示例11: PrintSubjectOnly

        private void PrintSubjectOnly(DocumentBuilder builder, ReportStudent student, Row template, Table table)
        {
            #region 列印科目
            UniqueSet<RowHeader> RowIndexs = new UniqueSet<RowHeader>();

            #region 列印 RowHeader
            Dictionary<string, string> subjToDomain = new Dictionary<string, string>();
            foreach (SemesterData semester in student.SHistory.GetGradeYearSemester())
            {
                SemesterData sysems = new SemesterData(0, semester.SchoolYear, semester.Semester);
                if (!student.SemestersScore.Contains(sysems)) continue;

                SemesterScore semsscore = student.SemestersScore[sysems];

                foreach (string strSubject in semsscore.Subject)
                {
                    SemesterSubjectScore subject = semsscore.Subject[strSubject];

                    if (!subjToDomain.ContainsKey(strSubject))
                        subjToDomain.Add(strSubject, subject.Domain);

                    RowHeader header = new RowHeader(subjToDomain[strSubject], strSubject);
                    header.IsDomain = false;

                    if (!RowIndexs.Contains(header))
                        RowIndexs.Add(header);
                }
            }

            List<RowHeader> sortedHeaders = RowIndexs.ToList();
            sortedHeaders.Sort(delegate(RowHeader x, RowHeader y)
            {
                Subj xx = new JHSchool.Evaluation.Subject(x.Subject, x.Domain);
                Subj yy = new JHSchool.Evaluation.Subject(y.Subject, y.Domain);

                return xx.CompareTo(yy);
            });

            //產生 Row。
            List<RowHeader> indexHeaders = new List<RowHeader>();
            Row current = template;
            int rowIndex = 0;
            foreach (RowHeader header in sortedHeaders)
            {
                RowHeader indexH = header;
                indexH.Index = rowIndex++;
                indexHeaders.Add(indexH);

                Row datarow = table.InsertBefore(template.Clone(true), current) as Row;

                string gn = "";
                //Additional Classes

                string subjCName = header.Subject;
                string subjEName = Subj.GetSubjectEnglish(header.Subject);
                string subjString = header.Subject + (string.IsNullOrEmpty(subjEName) ? "" : " " + subjEName);

                datarow.Cells[0].Write(builder, subjString);

                //if (IsFlexible(header.Domain))
                //{
                //    gn = "彈性課程\nAdditional Classes";
                //    //把空白的領域當成「彈性課程」。
                //    datarow.Cells[0].Write(builder, gn);
                //    datarow.Cells[1].Write(builder, subjString);
                //}
                //else
                //{
                //}
            }
            #endregion

            #region 填資料
            //填資料
            foreach (RowHeader header in indexHeaders)
            {
                SemesterDataCollection semesters = new SemesterDataCollection();
                Row row = table.Rows[header.Index + DataRowOffset];
                foreach (SemesterData semester in student.SHistory.GetGradeYearSemester())
                {
                    SemesterData sysems = new SemesterData(0, semester.SchoolYear, semester.Semester);
                    semesters.Add(sysems);

                    if (!student.SemestersScore.Contains(sysems)) continue;
                    if (!student.HeaderList.ContainsKey(sysems)) continue;

                    int columnIndex = student.HeaderList[sysems];
                    SemesterScore semsscore = student.SemestersScore[sysems];

                    decimal? score = null;
                    decimal? weight = null;

                    //if (header.IsDomain)
                    //{
                    //    if (semsscore.Domain.Contains(header.Domain))
                    //    {
                    //        score = semsscore.Domain[header.Domain].Value;
                    //        weight = semsscore.Domain[header.Domain].Weight;
                    //    }
                    //}
//.........这里部分代码省略.........
开发者ID:ChunTaiChen,项目名称:JointAdmissionModule,代码行数:101,代码来源:ReportEnglish.cs

示例12: PrintDomainOnly

        private void PrintDomainOnly(DocumentBuilder builder, ReportStudent student, Row template, Table table)
        {
            #region 列印領域
            UniqueSet<RowHeader> RowIndexs = new UniqueSet<RowHeader>();

            #region 列印 RowHeader
            foreach (SemesterData semester in student.SHistory.GetGradeYearSemester())
            {
                SemesterData sysems = new SemesterData(0, semester.SchoolYear, semester.Semester);

                //如果不包含該學期成績資料,就跳過。
                if (!student.SemestersScore.Contains(sysems)) continue;

                SemesterScore semsscore = student.SemestersScore[sysems];

                //準備彈性課程的科目(要詳列出來)。
                foreach (string strSubject in semsscore.Subject)
                {
                    SemesterSubjectScore subject = semsscore.Subject[strSubject];

                    if (DetailDomain.Contains(subject.Domain))
                    {
                        RowHeader header = new RowHeader(subject.Domain, strSubject);
                        header.IsDomain = false;

                        if (!RowIndexs.Contains(header))
                            RowIndexs.Add(header);
                    }
                }

                //準備領域資料。
                foreach (string strDomain in semsscore.Domain)
                {
                    if (!Subj.Domains.Contains(strDomain)) continue;

                    SemesterDomainScore domain = semsscore.Domain[strDomain];

                    if (!DetailDomain.Contains(strDomain))
                    {
                        RowHeader header = new RowHeader(strDomain, string.Empty);
                        header.IsDomain = true;

                        if (!RowIndexs.Contains(header))
                            RowIndexs.Add(header);
                    }
                }
            }

            List<RowHeader> sortedHeaders = SortHeader(RowIndexs.ToList());

            //產生 Row。
            List<RowHeader> indexHeaders = new List<RowHeader>();
            Row current = template;
            int rowIndex = 0;
            foreach (RowHeader header in sortedHeaders)
            {
                RowHeader indexH = header;
                indexH.Index = rowIndex++;
                indexHeaders.Add(indexH);
                bool hasGroup = !string.IsNullOrEmpty(Subj.GetDomainGroup(header.Domain));
                string groupName = Subj.GetDomainGroup(header.Domain);

                Row datarow = table.InsertBefore(template.Clone(true), current) as Row;

                if (header.IsDomain)
                {
                    string domainCName = header.Domain;
                    string domainEName = Subj.GetDomainEnglish(header.Domain);
                    string domainString = domainCName + (string.IsNullOrEmpty(domainEName) ? "" : domainEName);

                    if (hasGroup)
                    {
                        string gn = groupName;

                        if (groupName == "語文")
                            gn = "語文\nLanguage";

                        datarow.Cells[0].Write(builder, gn);
                        datarow.Cells[1].Write(builder, domainString);
                    }
                    else
                        datarow.Cells[0].Write(builder, domainString);
                }
                else
                {
                    string gn = "";
                    //Additional Classes

                    if (IsFlexible(header.Domain))
                        gn = "彈性課程\nAdditional Classes";
                    else
                        gn = header.Domain;

                    string subjCName = header.Subject;
                    string subjEName = Subj.GetSubjectEnglish(header.Subject);
                    string subjString = header.Subject + (string.IsNullOrEmpty(subjEName) ? "" : "\n" + subjEName);

                    //把空白的領域當成「彈性課程」。
                    string domain = gn;
                    datarow.Cells[0].Write(builder, domain);
//.........这里部分代码省略.........
开发者ID:ChunTaiChen,项目名称:JointAdmissionModule,代码行数:101,代码来源:ReportEnglish.cs

示例13: AddInnerRow

        private static void AddInnerRow(ref Row innerRow, ref Row outerRow, ref List<Row> innerRows) {
            var r = innerRow.Clone();

            foreach (var column in outerRow.Columns.Where(column => !r.ContainsKey(column))) {
                r[column] = outerRow[column];
            }

            innerRows.Add(r);
            innerRow = new Row();
        }
开发者ID:modulexcite,项目名称:Transformalize,代码行数:10,代码来源:FromXmlOperation.cs


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