本文整理汇总了C#中StringList.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# StringList.ToString方法的具体用法?C# StringList.ToString怎么用?C# StringList.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringList
的用法示例。
在下文中一共展示了StringList.ToString方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateTempUploadFile
public override int CreateTempUploadFile(int userID, string uploadAction, string searchInfo, StringList customParamList, string filename, string serverFileName, string md5, long fileSize, string fileID)
{
int tempUploadFileID;
using (SqlQuery query = new SqlQuery())
{
query.CommandType = CommandType.StoredProcedure;
query.CommandText = "bx_CreateTempUploadFile";
query.CreateParameter<int>("@UserID", userID, SqlDbType.Int);
query.CreateParameter<string>("@UploadAction", uploadAction, SqlDbType.VarChar, 100);
query.CreateParameter<string>("@SearchInfo", searchInfo, SqlDbType.NVarChar, 100);
query.CreateParameter<string>("@CustomParams", customParamList.ToString(), SqlDbType.NVarChar, 3000);
query.CreateParameter<string>("@FileName", filename, SqlDbType.NVarChar, 256);
query.CreateParameter<string>("@ServerFileName", serverFileName, SqlDbType.VarChar, 100);
query.CreateParameter<string>("@MD5", md5, SqlDbType.Char, 32);
query.CreateParameter<long>("@FileSize", fileSize, SqlDbType.Int);
query.CreateParameter<string>("@FileID", fileID, SqlDbType.VarChar, 50);
SqlParameter returnParam = query.CreateParameter<int>("@TempUploadFileID", SqlDbType.Int, ParameterDirection.Output);
query.ExecuteNonQuery();
tempUploadFileID = (int)returnParam.Value;
}
return tempUploadFileID;
}
示例2: GetValue
public string GetValue()
{
StringTable table = new StringTable();
//table.Add("LimitType", LimitType.ToString());
table.Add("LimitType", ((byte)LimitType).ToString());
foreach (KeyValuePair<Guid, List<Guid>> item in ExcludeRoles)
{
if (item.Value != null)
{
StringList roles = new StringList();
foreach (Guid roleID in item.Value)
{
roles.Add(roleID.ToString());
}
table.Add("ExcludeRoles-" + item.Key.ToString("N"), roles.ToString());
}
}
return table.ToString();
}
示例3: ToStringTest
public void ToStringTest()
{
StringList target = new StringList();
// empty list
string expected = string.Empty;
string actual = target.ToString();
Assert.AreEqual(expected, actual);
// 1 item in list
target.Add("test1");
expected = "test1";
actual = target.ToString();
Assert.AreEqual(expected, actual);
// 2 items in list
target.Add("test2");
expected = "test1,test2";
actual = target.ToString();
Assert.AreEqual(expected, actual);
}
示例4: GetCalendarItemsDetailed
//.........这里部分代码省略.........
dcOptAttendees.Caption = "OptAttendees";
dcOptAttendees.ColumnName = "OptAttendees";
dcOptAttendees.DefaultValue = "";
// Add the column to the table.
table.Columns.Add(dcOptAttendees);
DataColumn dcId = new DataColumn();
dcId.DataType = System.Type.GetType("System.String");
dcId.AllowDBNull = true;
dcId.Caption = "Id";
dcId.ColumnName = "Id";
dcId.DefaultValue = "";
// Add the column to the table.
table.Columns.Add(dcId);
#endregion
// Add rows and set values.
DataRow row;
//load properties
List<Item> items = new List<Item>();
if (myAppointments.Items.Count > 0)
{
foreach (Appointment a in myAppointments)
{
items.Add(a);
}
}
service.LoadPropertiesForItems(items, PropertySet.FirstClassProperties);
////Write out the subject of each appointment I have this week
foreach (Appointment appointment in myAppointments)
{
string openItemUrl = ItemUrlProtocol + service.Url.Host + ItemUrlFolder + appointment.WebClientReadFormQueryString;
row = table.NewRow();
row["Subject"] = cleanHighAsciiForXML(appointment.Subject);
row["Location"] = cleanHighAsciiForXML(appointment.Location);
row["Start"] = appointment.Start;
row["End"] = appointment.End;
row["Body"] = appointment.Body.Text;
row["Categories"] = appointment.Categories;
row["Id"] = appointment.Id;
//required attendees
AttendeeCollection req = appointment.RequiredAttendees;
StringList tmp = new StringList();
foreach (Attendee att in req)
{
tmp.Add(att.Address);
}
row["ReqAttendees"] = tmp.ToString();
//optional attendees
AttendeeCollection opt = appointment.OptionalAttendees;
tmp = new StringList();
foreach (Attendee att in opt)
{
tmp.Add(att.Address);
}
row["OptAttendees"] = tmp.ToString();
try
{
row["AllDay"] = appointment.IsAllDayEvent.ToString();
}
catch (Exception e)
{
row["AllDay"] = false; //default to false
}
row["Link"] = openItemUrl;
// Be sure to add the new row to the
// DataRowCollection.
table.Rows.Add(row);
}
rsp.TableData = table;
}
catch (Exception e)
{
if (!(int.TryParse(e.Message, out rsp.StatusCode)))
{
//if the parsing fails, then set a default value of 500
rsp.StatusCode = 500;
}
rsp.Msg = e.Message;
success = false;
miscData = "{ \"ErrMsg\":\"" + rsp.Msg + "\" }";
rsp.StackTrace = e.StackTrace;
if (e.InnerException != null) { rsp.InnerException = e.InnerException.ToString(); }
}
//audit
addAuditLog(apiKey, emlUserAddress, "GetCalendarItems", success, miscData);
return rsp;
}
示例5: DeleteSearch
private void DeleteSearch()
{
StringList param = new StringList();
param.Add(m_AdminForm.ToString());
param.Add(_Request.Get("updatePoint", Method.Post, "1"));
param.Add(_Request.Get("deleteArticle", Method.Post, "1"));
TaskManager.BeginTask(MyUserID, new DeleteBlogCategoryTask(), param.ToString());
}
示例6: DeleteBySearch
private void DeleteBySearch()
{
StringList param = new StringList();
param.Add(m_Filter.ToString());
param.Add(_Request.Get("updatePoint", Method.Post, "1"));
TaskManager.BeginTask(MyUserID, new DeleteCommentTask(), param.ToString());
}
示例7: ProcessStringList
static void ProcessStringList(ProjectState state, IO.XmlStream s, Dictionary<string, StringList> listDic,
string elementName, string listTypeName)
{
foreach (XmlNode n in s.Cursor.ChildNodes)
{
if (n.Name != elementName) continue;
s.SaveCursor(n);
var list = new StringList(state, s);
s.RestoreCursor();
string name_str = list.ToString();
try { listDic.Add(name_str, list); }
catch (ArgumentException) { Debug.LogFile.WriteLine(kDuplicateErrorStr, listTypeName, name_str); }
}
}
示例8: op_ToString_whenSingleItem
public void op_ToString_whenSingleItem()
{
var expected = "example" + Environment.NewLine;
var obj = new StringList
{
"example"
};
var actual = obj.ToString();
Assert.Equal(expected, actual);
}
示例9: op_ToString_whenMultipleItems
public void op_ToString_whenMultipleItems()
{
var expected = "123{0}456{0}".FormatWith(Environment.NewLine);
var obj = new StringList
{
"123",
"456"
};
var actual = obj.ToString();
Assert.Equal(expected, actual);
}
示例10: ApproveSearchResult
private void ApproveSearchResult()
{
TopicFilter filter = TopicForm;//TopicFilter.GetFromFilter("filter");
StringList param = new StringList();
param.Add(filter.ToString());
if (TaskManager.BeginTask(MyUserID, new ApproveTopicTask(), param.ToString()))
{
}
}
示例11: DeletedSearchResult
private void DeletedSearchResult()
{
TopicFilter filter = TopicForm;//TopicFilter.GetFromFilter("filter");
StringList param = new StringList();
param.Add(filter.ToString());
param.Add(_Request.Get("updatePoint", Method.Post, "1"));
if (TaskManager.BeginTask(MyUserID, new DeleteTopicTask(), param.ToString()))
{
}
}
示例12: ProcessFile
/// <summary>
/// Process a XML file containing CheApe definitions
/// </summary>
/// <param name="state"></param>
/// <param name="s"></param>
private void ProcessFile(ProjectState state, BlamLib.IO.XmlStream s)
{
int complexity = 1 +
PreprocessXmlNodeComplexity();
BlamVersion def_engine = BlamVersion.Unknown;
s.ReadAttribute("game", ref def_engine);
if (def_engine != state.Definition.Engine)
{
Debug.Assert.If(false, "CheApe definition '{0}' is for {1}. Expected a {2} definition.", s.FileName, def_engine, state.Definition.Engine);
}
else
{
string name_str;
foreach (XmlNode n in s.Cursor.ChildNodes)
{
switch (n.Name)
{
#region Enums
case "enums":
s.SaveCursor(n);
foreach (XmlNode n2 in s.Cursor.ChildNodes)
{
if (n2.Name != "Enum") continue;
s.SaveCursor(n2);
StringList list = new StringList(state, s);
s.RestoreCursor();
name_str = list.ToString();
try { Enums.Add(name_str, list); }
catch (ArgumentException) { Debug.LogFile.WriteLine(kDuplicateErrorStr, "enum definition", name_str); }
}
s.RestoreCursor();
break;
#endregion
#region Flags
case "flags":
s.SaveCursor(n);
foreach (XmlNode n2 in s.Cursor.ChildNodes)
{
if (n2.Name != "Flag") continue;
s.SaveCursor(n2);
StringList list = new StringList(state, s);
s.RestoreCursor();
name_str = list.ToString();
try { Flags.Add(name_str, list); }
catch (ArgumentException) { Debug.LogFile.WriteLine(kDuplicateErrorStr, "flag definition", name_str); }
}
s.RestoreCursor();
break;
#endregion
#region Tag References
case "references":
s.SaveCursor(n);
foreach (XmlNode n2 in s.Cursor.ChildNodes)
{
if (n2.Name != "Reference") continue;
s.SaveCursor(n2);
TagReference tagref = new TagReference(state, s);
s.RestoreCursor();
name_str = tagref.ToString();
try { References.Add(name_str, tagref); }
catch (ArgumentException) { Debug.LogFile.WriteLine(kDuplicateErrorStr, "tag reference definition", name_str); }
}
s.RestoreCursor();
break;
#endregion
#region Tag Data
case "data":
s.SaveCursor(n);
foreach (XmlNode n2 in s.Cursor.ChildNodes)
{
if (n2.Name != "TagData") continue;
s.SaveCursor(n2);
TagData tagdata = new TagData(state, s);
s.RestoreCursor();
name_str = tagdata.ToString();
try { Data.Add(name_str, tagdata); }
catch (ArgumentException) { Debug.LogFile.WriteLine(kDuplicateErrorStr, "tag data definition", name_str); }
}
s.RestoreCursor();
break;
#endregion
#region Script Functions
//.........这里部分代码省略.........