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


C# Utils.RedimPreserveString方法代码示例

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


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

示例1: FindRepeatPlans

        bool FindRepeatPlans(ITable PlansTable, out string[] RepeatPlans, out string[] SummaryNames, out int RepeatCnt)
        {
            IFIDSet pNonEmptyPlansFIDSet = new FIDSetClass();
              ICursor pPlansCur = null;
              SummaryNames = null;
              RepeatPlans = null;
              RepeatCnt = 0;

              try
              {
            pPlansCur = PlansTable.Search(null, false);
            Int32 iPlanNameIDX = pPlansCur.Fields.FindField("NAME");
            IRow pPlanRow = pPlansCur.NextRow();
            //Create a collection of plan names

            if (m_pStepProgressor.Position < m_pStepProgressor.MaxRange)
              m_pStepProgressor.Step();

            string[] sPlanNames = new string[0]; //define as dynamic array
            int iCount = 0;
            bool bCont = true;

            Utils FabricUTILS = new Utils();

            while (pPlanRow != null)
            {
              //Check if the cancel button was pressed. If so, stop process
              bCont = m_pTrackCancel.Continue();
              if (!bCont)
              {
            RepeatCnt++;
            return false;
              }

              string sPlanNm = (string)pPlanRow.get_Value(iPlanNameIDX);
              if (sPlanNm.Trim() == "")
            sPlanNm = "<No Name>";
              FabricUTILS.RedimPreserveString(ref sPlanNames, 1);
              sPlanNames[iCount++] = sPlanNm.Trim() + ", OID:" + pPlanRow.OID;

              Marshal.ReleaseComObject(pPlanRow);
              pPlanRow = pPlansCur.NextRow();
              if (m_pStepProgressor.Position < m_pStepProgressor.MaxRange)
            m_pStepProgressor.Step();
            }

            if (pPlanRow!=null)
              Marshal.ReleaseComObject(pPlanRow);
            if (pPlansCur != null)
              Marshal.ReleaseComObject(pPlansCur);

            System.Array.Sort<string>(sPlanNames);
            int m = -1;
            string sName_m;
            int k = -1;
            string sName_k;
            string sThisRepeat = "";
            bool bIsNewGroup = false;
            Dictionary<int, string> dictNameFromID = new Dictionary<int,string>();
            int iCnt = sPlanNames.GetLength(0) - 1;
            //Create a collection of repeat plan names
            string[] sRepeatPlans = new string[0]; //define as dynamic array
            FabricUTILS.RedimPreserveString(ref sRepeatPlans, 1);
            sRepeatPlans[0] = "";
            int idx = 0; // used with sRepeatPlans string array
            int iOID =-1;
            RepeatCnt = 0;
            for (int j = iCnt; j >= 0; j--)
            {
              //Check if the cancel button was pressed. If so, stop process
              bCont = m_pTrackCancel.Continue();
              if (!bCont)
            return false;

              sName_m = "";
              sName_k = "";

              int l = sPlanNames[j].LastIndexOf(", OID:");
              string sName_l = sPlanNames[j].Trim().Substring(0, l);

              if (sName_l.ToUpper().Trim() == sThisRepeat.ToUpper().Trim())
            bIsNewGroup = false;
              else if (j < iCnt - 1)
            bIsNewGroup = true;

              if (j > 0)
              {
            k = sPlanNames[j - 1].LastIndexOf(", OID:");
            sName_k = sPlanNames[j - 1].Trim().Substring(0, k);
              }
              if (j < sPlanNames.GetLength(0)-1)
              {
            m = sPlanNames[j + 1].LastIndexOf(", OID:");
            sName_m = sPlanNames[j + 1].Trim().Substring(0, m);
              }

              sThisRepeat = sName_l;

              if (sName_l.ToUpper() == sName_k.ToUpper() ||
            sName_l.ToUpper() == sName_m.ToUpper())
//.........这里部分代码省略.........
开发者ID:Esri,项目名称:parcel-fabric-desktop-addins,代码行数:101,代码来源:MergeSameNameFabricPlans.cs


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