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


C# IDictionaryEnumerator.Reset方法代码示例

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


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

示例1: createTransTable

        private string createTransTable(IDictionaryEnumerator translist)
        {
            translist.Reset();
            string res = "";
            while (translist.MoveNext())
            {
                Translation trans = (Translation) translist.Value;
                res += "<tr>\n\t\t\t<td></td><td colspan=\"3\" bgcolor=\"dddddd\">" + trans.ToString() + "</td></tr>\n\t\t";
                res += "<tr>\n\t\t\t<td colspan=\"4\" style=\"padding:10px;\" bgcolor=\"#f4f4f4\">" +
                    this.cleanText(trans.Text, this.checkBox1.Checked) + "</td></tr>\n\t\t";

            }
            return res;
        }
开发者ID:BackupTheBerlios,项目名称:lyra2-svn,代码行数:14,代码来源:HTML.cs

示例2: Reset

		public void Reset ()
		{
			hashEnum = hash.GetEnumerator ();
			hashEnum.Reset ();
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:5,代码来源:Set.cs

示例3: CompareDictionaryIgnoreOrder

        private void CompareDictionaryIgnoreOrder(string breadCrumb, IDictionaryEnumerator enumerator1,
            IDictionaryEnumerator enumerator2)
        {
            var loopedBack = false;
            var needLoopBack = false;
            var enumerator1Index = -1;
            var enumerator2Index = 0;
            int? limit = null;

            //if object2 holds more items than object1 we need to track, and then show diffs of the remaining
            //items
            var needTrackingOfObject2 = IsBigger(enumerator1, enumerator2);
            var foundObject2Items = new List<int>();

            while (enumerator1.MoveNext())
            {
                enumerator1Index++;

                //currentCrumb = AddBreadCrumb(breadCrumb, info.Name, string.Empty, i);
                var found = false;

                // expect order, but don't assume it.  this improves performance
                // where the collections are ordered in sync (wittingly, or un-), but
                // the logic is a bit different than the above index compare,

                var movedNext = enumerator2.MoveNext();

                if (!movedNext)
                {
                    enumerator2.Reset();
                    movedNext = enumerator2.MoveNext();
                    enumerator2Index = 0;
                }

                string currentBreadCrumb = breadCrumb;

                while (movedNext)
                {
                    var clone = Clone();
                    clone.Differences = new List<Difference>();

                    currentBreadCrumb = AddBreadCrumb(breadCrumb, "Current", string.Empty, enumerator1Index);

                    if (HasMatchingSpecEntry(enumerator1.Key))
                    {
                        if (clone.MatchObjects(enumerator1.Key, enumerator2.Key, ref breadCrumb))
                        {
                            found = true;
                            Compare(enumerator1.Key, enumerator2.Key, breadCrumb);
                            foundObject2Items.Add(enumerator2Index);
                            break;
                        }
                    }
                    else
                    {
                        clone.Compare(enumerator1.Key, enumerator2.Key, currentBreadCrumb);
                    }

                    if (clone.Differences.Count == 0)
                    {
                        clone.Compare(enumerator1.Value, enumerator2.Value, currentBreadCrumb);

                        if (clone.Differences.Count == 0)
                        {
                            found = true;

                            foundObject2Items.Add(enumerator2Index);

                            break;
                        }
                    }

                    movedNext = enumerator2.MoveNext();
                    enumerator2Index++;

                    if (enumerator2Index == limit)
                        break;

                    if (!movedNext && needLoopBack && !loopedBack)
                    {
                        enumerator2.Reset();
                        limit = enumerator2Index;
                        enumerator2Index = 0;
                        movedNext = enumerator2.MoveNext();
                        loopedBack = true;
                    }
                }

                if (!found)
                {
                    Difference difference = new Difference
                    {
                        ExpectedName = ExpectedName,
                        ActualName = ActualName,
                        PropertyName = currentBreadCrumb,
                        Object1Value = NiceString(enumerator1.Key),
                        Object2Value = "(null)",
                        ChildPropertyName = "Item",
                        Object1 = new WeakReference(enumerator1),
                        Object2 = null
//.........这里部分代码省略.........
开发者ID:rv192,项目名称:Fussen,代码行数:101,代码来源:CompareComponent.cs

示例4: defaultBootstrap_InitialComponentContext

        public static unoidl.com.sun.star.uno.XComponentContext defaultBootstrap_InitialComponentContext(
            string iniFile,
            IDictionaryEnumerator bootstrapParameters)
        {
            if (bootstrapParameters != null)
            {
            bootstrapParameters.Reset();
            while (bootstrapParameters.MoveNext())
            {
                string key = (string)bootstrapParameters.Key;
                string value = (string)bootstrapParameters.Value;

                native_bootstrap_set(key, key.Length, value, value.Length);
            }
            }

            System.Console.WriteLine("Bootstrap with ini " + iniFile);
            // bootstrap native uno
            IntPtr context;
            if (iniFile == null)
            {
            context = native_defaultBootstrap_InitialComponentContext();
            }
            else
            {
            context = native_defaultBootstrap_InitialComponentContext(iniFile, iniFile.Length);
            }

            return (unoidl.com.sun.star.uno.XComponentContext)ExtractObject(context);
        }
开发者ID:jcorrius,项目名称:go-oo-mingw32-soc,代码行数:30,代码来源:managed_bootstrap.cs


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