本文整理汇总了C#中System.Collections.Specialized.StringCollection.Clear方法的典型用法代码示例。如果您正苦于以下问题:C# StringCollection.Clear方法的具体用法?C# StringCollection.Clear怎么用?C# StringCollection.Clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Collections.Specialized.StringCollection
的用法示例。
在下文中一共展示了StringCollection.Clear方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadSection
public void ReadSection(String Section, StringCollection Idents)
{
Byte[] Buffer = new Byte[16384];
Idents.Clear();
int bufLen = getPrivateProfileString(Section, null, null,
Buffer, Buffer.GetUpperBound(0), filename);
//��Section�����
getStringsFromBuffer(Buffer, bufLen, Idents);
}
示例2: AllowToUpdate
//Read the config file and decide whether a task can be started or not
public static bool AllowToUpdate(DateTime curDateTime)
{
string[] list;
DateTime dt = common.Consts.constNullDate;
StringCollection aFields = new StringCollection();
bool saveEncryption = common.configuration.withEncryption;
common.configuration.withEncryption = false;
aFields.Clear();
aFields.Add("Holidays");
if (GetConfig("UPDATEDATA", "updateTime", aFields) && IsHolidays(curDateTime, aFields[0])) return false;
int idx = -1;
while (true)
{
idx++;
aFields.Clear();
aFields.Add("range" + idx.ToString());
if (!GetConfig("UPDATEDATA", "updateTime", aFields)) break;
//"Start time" "End Time" "Dow,,Dow"
list = common.system.String2List(aFields[0], ";");
if (list.Length != 3)
{
common.fileFuncs.WriteLog("Invalid config : " + aFields[0]);
return false;
}
//Start date
if (common.dateTimeLibs.StringToDateTime(list[0], out dt))
{
if (curDateTime < dt) continue;
}
//End date
if (common.dateTimeLibs.StringToDateTime(list[1], out dt))
{
if (curDateTime > dt) continue;
}
//dayOfWeek
string[] dow = common.system.String2List(list[2]);
if (dow.Length > 0 && !dow.Contains(curDateTime.DayOfWeek.ToString().Substring(0, 3))) continue;
return true;
}
return false;
}
示例3: FindListedCommands
/// <summary>
/// Identifies the commands exposed by a bundle represented by the "packageZipFilePath"
/// </summary>
/// <param name="packageZipFilePath">Path to the zip file of the bundle</param>
/// <param name="localCommands">Returns the local commands identified from packagecontents.xml</param>
/// <param name="globalCommands">Returns the global commands identified from packagecontents.xml</param>
public static void FindListedCommands(String packageZipFilePath, ref StringCollection localCommands, ref StringCollection globalCommands)
{
String tempPath = System.IO.Path.GetTempPath();
if (File.Exists(packageZipFilePath))
{
using (System.IO.Compression.ZipArchive za = System.IO.Compression.ZipFile.OpenRead(packageZipFilePath))
{
foreach (ZipArchiveEntry entry in za.Entries)
{
if (entry.FullName.EndsWith("PackageContents.xml", StringComparison.OrdinalIgnoreCase))
{
Directory.CreateDirectory(Path.GetDirectoryName(Path.Combine(tempPath, entry.FullName)));
String packageContentsXmlFilePath = Path.Combine(tempPath, entry.FullName);
if (File.Exists(packageContentsXmlFilePath))
File.Delete(packageContentsXmlFilePath);
entry.ExtractToFile(packageContentsXmlFilePath);
localCommands.Clear();
globalCommands.Clear();
System.IO.TextReader tr = new System.IO.StreamReader(packageContentsXmlFilePath);
using (System.Xml.XmlReader reader = System.Xml.XmlReader.Create(tr))
{
while (reader.ReadToFollowing("Command"))
{
reader.MoveToFirstAttribute();
if (reader.Name.Equals("Local"))
localCommands.Add(reader.Value);
else if (reader.Name.Equals("Global"))
globalCommands.Add(reader.Value);
while (reader.MoveToNextAttribute())
{
if (reader.Name.Equals("Local"))
localCommands.Add(reader.Value);
else if (reader.Name.Equals("Global"))
globalCommands.Add(reader.Value);
}
}
}
tr.Close();
break;
}
}
}
}
}
示例4: Test01
public void Test01()
{
StringCollection sc;
// simple string values
string[] values =
{
"",
" ",
"a",
"aa",
"text",
" spaces",
"1",
"$%^#",
"2222222222222222222222222",
System.DateTime.Today.ToString(),
Int32.MaxValue.ToString()
};
// [] StringCollection.IsReadOnly should return false
//-----------------------------------------------------------------
sc = new StringCollection();
// [] on empty collection
//
if (sc.IsReadOnly)
{
Assert.False(true, string.Format("Error, returned true for empty collection"));
}
// [] on filled collection
//
sc.Clear();
sc.AddRange(values);
if (sc.Count != values.Length)
{
Assert.False(true, string.Format("Error, count is {0} instead of {1}", sc.Count, values.Length));
}
if (sc.IsReadOnly)
{
Assert.False(true, string.Format("Error, returned true for filled collection"));
}
}
示例5: TerminateInstances
/// <summary>
/// Terminate instances.
/// </summary>
public void TerminateInstances()
{
string serviceName = this.name.Substring(this.name.LastIndexOf(".", StringComparison.OrdinalIgnoreCase) + 1);
string query = string.Format(CultureInfo.CurrentCulture, "SELECT * FROM MSBTS_ServiceInstance WHERE ServiceClass = {0} and ServiceStatus > 2 AND ServiceName = '{1}'", 1, serviceName);
using (ManagementObjectSearcher searcher = new ManagementObjectSearcher(new ManagementScope(@"root\MicrosoftBizTalkServer"), new WqlObjectQuery(query), null))
{
if (searcher.Get().Count > 0)
{
StringCollection instanceIds = new StringCollection();
StringCollection serviceClassIds = new StringCollection();
StringCollection serviceTypeIds = new StringCollection();
string hostName = string.Empty;
int instanceCount = 0;
foreach (ManagementObject obj2 in searcher.Get())
{
if (string.IsNullOrEmpty(hostName))
{
hostName = obj2["HostName"].ToString();
}
// This seems to be a magic number, carried over from original source (it is un-documented)
if (instanceCount > 1999)
{
TerminateServiceInstancesByID(hostName, instanceIds, serviceClassIds, serviceTypeIds);
instanceCount = 0;
serviceClassIds.Clear();
serviceTypeIds.Clear();
instanceIds.Clear();
}
serviceClassIds.Add(obj2["ServiceClassId"].ToString());
serviceTypeIds.Add(obj2["ServiceTypeId"].ToString());
instanceIds.Add(obj2["InstanceID"].ToString());
instanceCount++;
}
if (serviceClassIds.Count > 0)
{
TerminateServiceInstancesByID(hostName, instanceIds, serviceClassIds, serviceTypeIds);
}
}
}
}
示例6: LoadPortfolioStock
// Load stock list specified in the user's portfolio
protected void LoadPortfolioStock()
{
StringCollection stockList = new StringCollection();
TreeNode node;
data.baseDS.portfolioDataTable portfolioTbl = new data.baseDS.portfolioDataTable();
portfolioTbl.Clear();
myStockCodeTbl.Clear();
dataLibs.LoadPortfolioByInvestor(portfolioTbl, sysLibs.sysLoginCode, AppTypes.PortfolioTypes.Portfolio);
stockTV.Nodes.Clear();
DataView myStockView = new DataView(myStockCodeTbl);
data.baseDS.stockCodeRow stockRow;
myStockView.Sort = myStockCodeTbl.codeColumn.ColumnName;
StringCollection list = new StringCollection();
for (int idx1 = 0; idx1 < portfolioTbl.Count; idx1++)
{
node = stockTV.Nodes.Add(portfolioTbl[idx1].name);
list.Clear();
list.Add(portfolioTbl[idx1].code);
myStockCodeTbl.Clear();
if (portfolioTbl[idx1].type == (byte)AppTypes.PortfolioTypes.WatchList)
dataLibs.LoadStockCode_ByWatchList(myStockCodeTbl, list);
else
dataLibs.LoadStockCode_ByPortfolios(myStockCodeTbl, list);
stockList.Clear();
for (int idx2 = 0; idx2 < myStockView.Count; idx2++)
{
stockRow = (data.baseDS.stockCodeRow)myStockView[idx2].Row;
//Ignore duplicate stocks
if (stockList.Contains(stockRow.tickerCode)) continue;
stockList.Add(stockRow.tickerCode);
node.Nodes.Add(stockRow.tickerCode);
}
node.Text = node.Text + "(" + node.Nodes.Count.ToString() + ")";
node.ExpandAll();
}
}
示例7: ValidateExistence
private StringCollection ValidateExistence()
{
StringCollection validfiles = new StringCollection();
StringCollection invalidfiles = new StringCollection();
// remove all invalid log files
foreach (string filename in XmlLogs)
{
if (File.Exists(filename))
{
FileInfo fi = new FileInfo(filename);
validfiles.Add(fi.FullName.ToLower());
}
else
{
invalidfiles.Add(filename);
}
}
xmlLogs.Clear();
foreach (string filename in validfiles)
{
if (!xmlLogs.Contains(filename))
{
xmlLogs.Add(filename);
}
}
validfiles.Clear();
// remove all invalid req table files
foreach (string filename in RequirementTables)
{
if (File.Exists(filename))
{
FileInfo fi = new FileInfo(filename);
validfiles.Add(fi.FullName.ToLower());
}
else
{
invalidfiles.Add(filename);
}
}
requirementTables.Clear();
foreach (string filename in validfiles)
{
if (!requirementTables.Contains(filename))
{
requirementTables.Add(filename);
}
}
return invalidfiles;
}
示例8: Save_User_Envir
public static bool Save_User_Envir()
{
StringCollection aFields = new StringCollection();
StringCollection aValues = new StringCollection();
aFields.Clear(); aValues.Clear();
aFields.Add(common.system.GetName(new { commonClass.SysLibs.sysLoginAccount }));
aValues.Add(commonClass.SysLibs.sysLoginAccount);
return common.configuration.SaveConfiguration(Settings.sysFileUserConfig, "Environment", "", aFields, aValues, false);
}
示例9: GetDefaultFormState
public static bool GetDefaultFormState(string formName,bool nullAsTrue)
{
StringCollection aFields = new StringCollection();
aFields.Clear();
aFields.Add(formName);
if (!GetLocalUserConfig("DefaultForms", aFields)) return nullAsTrue;
return (aFields[0]!=Boolean.FalseString);
}
示例10: Load_Local_UserSettings_SYSTEM2
public static bool Load_Local_UserSettings_SYSTEM2()
{
StringCollection aFields = new StringCollection();
//Company
aFields.Clear();
aFields.Add(common.system.GetName(new { commonClass.SysLibs.sysCompanyName }));
aFields.Add(common.system.GetName(new { commonClass.SysLibs.sysCompanyAddr1 }));
aFields.Add(common.system.GetName(new { commonClass.SysLibs.sysCompanyAddr2 }));
aFields.Add(common.system.GetName(new { commonClass.SysLibs.sysCompanyAddr3 }));
aFields.Add(common.system.GetName(new { commonClass.SysLibs.sysCompanyPhone }));
aFields.Add(common.system.GetName(new { commonClass.SysLibs.sysCompanyFax }));
aFields.Add(common.system.GetName(new { commonClass.SysLibs.sysCompanyEmail }));
aFields.Add(common.system.GetName(new { commonClass.SysLibs.sysCompanyURL }));
if (GetLocalUserConfig("Investor", aFields))
{
commonClass.SysLibs.sysCompanyName = aFields[0].ToString();
commonClass.SysLibs.sysCompanyAddr1 = aFields[1].ToString();
commonClass.SysLibs.sysCompanyAddr2 = aFields[2].ToString();
commonClass.SysLibs.sysCompanyAddr3 = aFields[3].ToString();
commonClass.SysLibs.sysCompanyPhone = aFields[4].ToString();
commonClass.SysLibs.sysCompanyFax = aFields[5].ToString();
commonClass.SysLibs.sysCompanyEmail = aFields[6].ToString();
commonClass.SysLibs.sysCompanyURL = aFields[7].ToString();
}
//Image and Icon
aFields.Clear();
aFields.Add(common.system.GetName(new { Settings.sysImgFilePathBackGround }));
aFields.Add(common.system.GetName(new { Settings.sysImgFilePathIcon }));
aFields.Add(common.system.GetName(new { Settings.sysImgFilePathCompanyLogo1 }));
aFields.Add(common.system.GetName(new { Settings.sysImgFilePathCompanyLogo2 }));
if (GetLocalUserConfig("Others", aFields))
{
Settings.sysImgFilePathBackGround = common.fileFuncs.MakeRelativePath(aFields[0].ToString());
Settings.sysImgFilePathIcon = common.fileFuncs.MakeRelativePath(aFields[1].ToString());
Settings.sysImgFilePathCompanyLogo1 = common.fileFuncs.MakeRelativePath(aFields[2].ToString());
Settings.sysImgFilePathCompanyLogo2 = common.fileFuncs.MakeRelativePath(aFields[3].ToString());
}
return true;
}
示例11: Load_Global_Settings
//From database
public static bool Load_Global_Settings(ref GlobalSettings settings)
{
int num;
StringCollection aFields = new StringCollection();
// System
aFields.Clear();
aFields.Add(common.system.GetName(new { settings.WriteLogAccess }));
aFields.Add(common.system.GetName(new { settings.PasswordMinLen }));
aFields.Add(common.system.GetName(new { settings.UseStrongPassword }));
if (!GetConfig(ref aFields)) return false;
if (int.TryParse(aFields[0], out num)) settings.WriteLogAccess = (AppTypes.SyslogMedia)num;
if (int.TryParse(aFields[1], out num)) settings.PasswordMinLen = (byte)num;
if (aFields[2].Trim() != "") settings.UseStrongPassword = (aFields[2] == Boolean.TrueString);
// Data count
aFields.Clear();
aFields.Add(common.system.GetName(new { settings.DayScanForLastPrice }));
aFields.Add(common.system.GetName(new { settings.AlertDataCount }));
aFields.Add(common.system.GetName(new { settings.ChartMaxLoadCount_FIRST }));
aFields.Add(common.system.GetName(new { settings.ChartMaxLoadCount_MORE }));
if (!GetConfig(ref aFields)) return false;
if (aFields[0].Trim() != "" & int.TryParse(aFields[0], out num)) settings.DayScanForLastPrice = (short)num;
if (aFields[1].Trim() != "" & int.TryParse(aFields[1], out num)) settings.AlertDataCount = (short)num;
if (aFields[2].Trim() != "" & int.TryParse(aFields[2], out num)) settings.ChartMaxLoadCount_FIRST = (short)num;
if (aFields[3].Trim() != "" & int.TryParse(aFields[3], out num)) settings.ChartMaxLoadCount_MORE = (short)num;
//Auto key
aFields.Clear();
aFields.Add(common.system.GetName(new { settings.DataKeyPrefix }));
aFields.Add(common.system.GetName(new { settings.DataKeySize }));
aFields.Add(common.system.GetName(new { settings.AutoEditKeySize }));
aFields.Add(common.system.GetName(new { settings.TimeOut_AutoKey }));
if(!GetConfig(ref aFields)) return false;
if (aFields[0].Trim() != "") settings.DataKeyPrefix = aFields[0].Trim();
if (int.TryParse(aFields[1], out num)) settings.DataKeySize = num;
if (int.TryParse(aFields[2], out num)) settings.AutoEditKeySize = num;
if (int.TryParse(aFields[3], out num)) settings.TimeOut_AutoKey = num;
//Email
aFields.Clear();
aFields.Add(common.system.GetName(new { settings.smtpAddress }));
aFields.Add(common.system.GetName(new { settings.smtpPort }));
aFields.Add(common.system.GetName(new { settings.smtpAuthAccount }));
aFields.Add(common.system.GetName(new { settings.smtpAuthPassword }));
aFields.Add(common.system.GetName(new { settings.smtpSSL}));
if (!GetConfig(ref aFields)) return false;
if (aFields[0].Trim() != "") settings.smtpAddress = aFields[0];
if (aFields[1].Trim() != "" & int.TryParse(aFields[1], out num)) settings.smtpPort = num;
settings.smtpAuthAccount = aFields[2].Trim();
settings.smtpAuthPassword = aFields[3].Trim();
settings.smtpSSL = (aFields[4].Trim() == Boolean.TrueString);
//Default
aFields.Clear();
aFields.Add(common.system.GetName(new { settings.DefautLanguage }));
aFields.Add(common.system.GetName(new { settings.DefaultTimeRange }));
aFields.Add(common.system.GetName(new { settings.DefaultTimeScaleCode }));
aFields.Add(common.system.GetName(new { settings.ScreeningTimeScaleCode }));
aFields.Add(common.system.GetName(new { settings.AlertDataCount}));
aFields.Add(common.system.GetName(new { settings.ScreeningDataCount}));
if (!GetConfig(ref aFields)) return false;
if (aFields[0].Trim() != "") settings.DefautLanguage = AppTypes.Code2Language(aFields[0].Trim());
if (aFields[1].Trim() != "") settings.DefaultTimeRange = AppTypes.TimeRangeFromCode(aFields[1]);
if (aFields[2].Trim() != "") settings.DefaultTimeScaleCode = aFields[2];
if (aFields[3].Trim() != "") settings.ScreeningTimeScaleCode = aFields[3];
if (aFields[4].Trim() != "" & int.TryParse(aFields[4], out num)) settings.AlertDataCount = (short)num;
if (aFields[5].Trim() != "" & int.TryParse(aFields[5], out num)) settings.ScreeningDataCount = (short)num;
//Timming
aFields.Clear();
aFields.Add(common.system.GetName(new { settings.TimerIntervalInSecs }));
aFields.Add(common.system.GetName(new { settings.RefreshDataInSecs }));
aFields.Add(common.system.GetName(new { settings.CheckAlertInSeconds }));
aFields.Add(common.system.GetName(new { settings.AutoCheckInSeconds }));
if (!GetConfig(ref aFields)) return false;
if (aFields[0].Trim() != "" & int.TryParse(aFields[0], out num)) settings.TimerIntervalInSecs = (short)num;
if (aFields[1].Trim() != "" & int.TryParse(aFields[1], out num)) settings.RefreshDataInSecs = (short)num;
if (aFields[2].Trim() != "" & int.TryParse(aFields[2], out num)) settings.CheckAlertInSeconds = (short)num;
if (aFields[3].Trim() != "" & int.TryParse(aFields[3], out num)) settings.AutoCheckInSeconds = (short)num;
return true;
}
示例12: Save_Local_UserSettings_CHART
public static bool Save_Local_UserSettings_CHART()
{
//Systen tab
StringCollection aFields = new StringCollection();
StringCollection aValues = new StringCollection();
aFields.Clear();
aFields.Add(common.system.GetName(new { Settings.sysChartBgColor }));
aFields.Add(common.system.GetName(new { Settings.sysChartFgColor }));
aFields.Add(common.system.GetName(new { Settings.sysChartGridColor }));
aFields.Add(common.system.GetName(new { Settings.sysChartVolumesColor }));
aFields.Add(common.system.GetName(new { Settings.sysChartLineCandleColor }));
aFields.Add(common.system.GetName(new { Settings.sysChartBearCandleColor }));
aFields.Add(common.system.GetName(new { Settings.sysChartBearBorderColor }));
aFields.Add(common.system.GetName(new { Settings.sysChartBullCandleColor }));
aFields.Add(common.system.GetName(new { Settings.sysChartBullBorderColor }));
aFields.Add(common.system.GetName(new { Settings.sysChartBarDnColor }));
aFields.Add(common.system.GetName(new { Settings.sysChartBarUpColor }));
aValues.Clear();
aValues.Add(ColorTranslator.ToHtml(Settings.sysChartBgColor));
aValues.Add(ColorTranslator.ToHtml(Settings.sysChartFgColor));
aValues.Add(ColorTranslator.ToHtml(Settings.sysChartGridColor));
aValues.Add(ColorTranslator.ToHtml(Settings.sysChartVolumesColor));
aValues.Add(ColorTranslator.ToHtml(Settings.sysChartLineCandleColor));
aValues.Add(ColorTranslator.ToHtml(Settings.sysChartBearCandleColor));
aValues.Add(ColorTranslator.ToHtml(Settings.sysChartBearBorderColor));
aValues.Add(ColorTranslator.ToHtml(Settings.sysChartBullCandleColor));
aValues.Add(ColorTranslator.ToHtml(Settings.sysChartBullBorderColor));
aValues.Add(ColorTranslator.ToHtml(Settings.sysChartBarDnColor));
aValues.Add(ColorTranslator.ToHtml(Settings.sysChartBarUpColor));
if (!SaveLocalUserConfig("ChartColors", aFields, aValues)) return false;
//Chart page
aFields.Clear();
aFields.Add(common.system.GetName(new { Settings.sysChartShowDescription }));
aFields.Add(common.system.GetName(new { Settings.sysChartShowVolume }));
aFields.Add(common.system.GetName(new { Settings.sysChartShowGrid }));
aFields.Add(common.system.GetName(new { Settings.sysChartShowLegend }));
aFields.Add(common.system.GetName(new { Charts.Settings.sysZoom_Percent }));
aFields.Add(common.system.GetName(new { Charts.Settings.sysZoom_MinCount}));
aFields.Add(common.system.GetName(new { Charts.Settings.sysPAN_MovePercent }));
aFields.Add(common.system.GetName(new { Charts.Settings.sysPAN_MoveMinCount }));
aFields.Add(common.system.GetName(new { Charts.Settings.sysPAN_MouseRate }));
aFields.Add(common.system.GetName(new { Charts.Settings.sysNumberOfPoint_DEFA }));
aFields.Add(common.system.GetName(new { Charts.Settings.sysNumberOfPoint_MIN }));
aFields.Add(common.system.GetName(new { Charts.Settings.sysViewMinBarAtLEFT }));
aFields.Add(common.system.GetName(new { Charts.Settings.sysViewMinBarAtRIGHT }));
aFields.Add(common.system.GetName(new { Charts.Settings.sysChartMarginLEFT }));
aFields.Add(common.system.GetName(new { Charts.Settings.sysChartMarginRIGHT }));
aFields.Add(common.system.GetName(new { Charts.Settings.sysChartMarginTOP }));
aFields.Add(common.system.GetName(new { Charts.Settings.sysChartMarginBOT }));
aFields.Add(common.system.GetName(new { Charts.Settings.sysViewSpaceAtLEFT }));
aFields.Add(common.system.GetName(new { Charts.Settings.sysViewSpaceAtRIGHT }));
aFields.Add(common.system.GetName(new { Charts.Settings.sysViewSpaceAtTOP }));
aFields.Add(common.system.GetName(new { Charts.Settings.sysViewSpaceAtBOT }));
aValues.Clear();
aValues.Add(Settings.sysChartShowDescription.ToString());
aValues.Add(Settings.sysChartShowVolume.ToString());
aValues.Add(Settings.sysChartShowGrid.ToString());
aValues.Add(Settings.sysChartShowLegend.ToString());
aValues.Add(common.system.Number2String_Common(Charts.Settings.sysZoom_Percent));
aValues.Add(common.system.Number2String_Common(Charts.Settings.sysZoom_MinCount));
aValues.Add(common.system.Number2String_Common(Charts.Settings.sysPAN_MovePercent));
aValues.Add(common.system.Number2String_Common(Charts.Settings.sysPAN_MoveMinCount));
aValues.Add(common.system.Number2String_Common(Charts.Settings.sysPAN_MouseRate));
aValues.Add(common.system.Number2String_Common(Charts.Settings.sysNumberOfPoint_DEFA));
aValues.Add(common.system.Number2String_Common(Charts.Settings.sysNumberOfPoint_MIN));
aValues.Add(common.system.Number2String_Common(Charts.Settings.sysViewMinBarAtLEFT));
aValues.Add(common.system.Number2String_Common(Charts.Settings.sysViewMinBarAtRIGHT));
aValues.Add(common.system.Number2String_Common(Charts.Settings.sysChartMarginLEFT));
aValues.Add(common.system.Number2String_Common(Charts.Settings.sysChartMarginRIGHT));
aValues.Add(common.system.Number2String_Common(Charts.Settings.sysChartMarginTOP));
aValues.Add(common.system.Number2String_Common(Charts.Settings.sysChartMarginBOT));
aValues.Add(common.system.Number2String_Common(Charts.Settings.sysViewSpaceAtLEFT));
aValues.Add(common.system.Number2String_Common(Charts.Settings.sysViewSpaceAtRIGHT));
aValues.Add(common.system.Number2String_Common((decimal)Charts.Settings.sysViewSpaceAtTOP));
aValues.Add(common.system.Number2String_Common((decimal)Charts.Settings.sysViewSpaceAtBOT));
if (!SaveLocalUserConfig("ChartSettings", aFields, aValues)) return false;
//.........这里部分代码省略.........
示例13: GetStringsFromBuffer
private void GetStringsFromBuffer(Byte[] Buffer, int bufLen, StringCollection Strings)
{
Strings.Clear();
if (bufLen != 0)
{
int start = 0;
for (int i = 0; i < bufLen; i++)
{
if ((Buffer[i] == 0) && ((i - start) > 0))
{
String s = Encoding.GetEncoding(0).GetString(Buffer, start, i - start);
Strings.Add(s);
start = i + 1;
}
}
}
}
示例14: EnumAdaptorSelectors
/// <summary>
/// Enumerates IAdaptorSelector classes and creates one
/// instance into list of possible selectors
/// </summary>
public static void EnumAdaptorSelectors()
{
StringCollection cache = new StringCollection();
// Since basic GetType already searches in mscorlib we can safely put it as already done
cache.Add ("mscorlib");
GetSelectorsInReferencedAssemblies (Assembly.GetEntryAssembly(), cache);
cache.Clear();
cache = null;
}
示例15: RTLReplace
internal string RTLReplace (Regex regex, string input, MatchEvaluator evaluator, int count, int startat)
{
Match m = Scan (regex, input, startat, input.Length);
if (!m.Success)
return input;
int ptr = startat;
int counter = count;
#if NET_2_1
var pieces = new System.Collections.Generic.List<string> ();
#else
StringCollection pieces = new StringCollection ();
#endif
pieces.Add (input.Substring (ptr));
do {
if (count != -1)
if (counter-- <= 0)
break;
if (m.Index + m.Length > ptr)
throw new SystemException ("how");
pieces.Add (input.Substring (m.Index + m.Length, ptr - m.Index - m.Length));
pieces.Add (evaluator (m));
ptr = m.Index;
m = m.NextMatch ();
} while (m.Success);
StringBuilder result = new StringBuilder ();
result.Append (input, 0, ptr);
for (int i = pieces.Count; i > 0; )
result.Append (pieces [--i]);
pieces.Clear ();
return result.ToString ();
}