本文整理汇总了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())
//.........这里部分代码省略.........