本文整理汇总了C#中System.Collections.Generic.List类的典型用法代码示例。如果您正苦于以下问题:C# System.Collections.Generic.List类的具体用法?C# System.Collections.Generic.List怎么用?C# System.Collections.Generic.List使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
System.Collections.Generic.List类属于命名空间,在下文中一共展示了System.Collections.Generic.List类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: LoadAssemblies
private static System.Collections.Generic.IList<System.Reflection.Assembly> LoadAssemblies()
{
System.Collections.Generic.IList<System.Reflection.Assembly> assemblyList = new System.Collections.Generic.List<System.Reflection.Assembly>();
assemblyList.Add(Load("HRApplicationServices.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken" +
"=null"));
assemblyList.Add(Load("HRApplicationServices.Data, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" +
""));
assemblyList.Add(Load("Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a" +
"3a"));
assemblyList.Add(Load("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
assemblyList.Add(Load("System.Activities, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364" +
"e35"));
assemblyList.Add(Load("System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
assemblyList.Add(Load("System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
assemblyList.Add(Load("System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934" +
"e089"));
assemblyList.Add(Load("System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
assemblyList.Add(Load("System.Runtime.Serialization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b7" +
"7a5c561934e089"));
assemblyList.Add(Load("System.Security, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3" +
"a"));
assemblyList.Add(Load("System.ServiceModel.Activities, Version=4.0.0.0, Culture=neutral, PublicKeyToken=" +
"31bf3856ad364e35"));
assemblyList.Add(Load("System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c56193" +
"4e089"));
assemblyList.Add(Load("System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"));
assemblyList.Add(Load("System.Xaml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
assemblyList.Add(Load("System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
assemblyList.Add(Load("System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e08" +
"9"));
assemblyList.Add(System.Reflection.Assembly.GetExecutingAssembly());
return assemblyList;
}
开发者ID:vvalotto,项目名称:PlataformaNET,代码行数:33,代码来源:_HRApplicationServices.Activities.g.cs
示例2: LoadAssemblies
private static System.Collections.Generic.IList<System.Reflection.Assembly> LoadAssemblies()
{
System.Collections.Generic.IList<System.Reflection.Assembly> assemblyList = new System.Collections.Generic.List<System.Reflection.Assembly>();
assemblyList.Add(Load("Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a" +
"3a"));
assemblyList.Add(Load("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
assemblyList.Add(Load("System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
assemblyList.Add(Load("System.Data.DataSetExtensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b" +
"77a5c561934e089"));
assemblyList.Add(Load("System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
assemblyList.Add(Load("System.Deployment, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50" +
"a3a"));
assemblyList.Add(Load("System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
assemblyList.Add(Load("System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" +
""));
assemblyList.Add(Load("System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3" +
"a"));
assemblyList.Add(Load("System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c5619" +
"34e089"));
assemblyList.Add(Load("System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
assemblyList.Add(Load("System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e08" +
"9"));
assemblyList.Add(System.Reflection.Assembly.GetExecutingAssembly());
return assemblyList;
}
开发者ID:OgarPlus,项目名称:Ogar-Plus-GUI,代码行数:25,代码来源:_Ogar-Plus+GUI.g.cs
示例3: run
private static int run(string[] args, Ice.Communicator communicator)
{
System.Collections.Generic.List<int> ports = new System.Collections.Generic.List<int>();
for(int i = 0; i < args.Length; i++)
{
int port = 0;
try
{
port = System.Int32.Parse(args[i]);
}
catch(System.FormatException ex)
{
System.Console.Error.WriteLine(ex);
return 1;
}
ports.Add(port);
}
if(ports.Count == 0)
{
System.Console.Error.WriteLine("Client: no ports specified");
usage();
return 1;
}
AllTests.allTests(communicator, ports);
return 0;
}
开发者ID:pedia,项目名称:zeroc-ice,代码行数:28,代码来源:Client.cs
示例4: BuildUri
internal override string BuildUri(string baseUri, string accesskey)
{
// assume no batch id nor events
string usingBatch = String.Empty;
string usingEvents = String.Empty;
// if the user has passed a batch id, build that portion of the query string request
if (!String.IsNullOrEmpty(BatchId))
{
usingBatch = String.Format("&batchid={0}", HttpUtility.UrlEncode(BatchId));
}
// if the user has passed event ids, build that portion of the query string request
if (EventIds != null)
{
if (EventIds.Count() != 0)
{
// URLEncode each event id
System.Collections.Generic.List<string> list = new System.Collections.Generic.List<string>();
foreach (var ev in EventIds)
{
list.Add(HttpUtility.UrlEncode(ev));
}
// Build the event ids string
string idString = String.Join("_", list.ToArray());
usingEvents = String.Format("&eventids={0}", idString);
}
}
// build the uri
return String.Concat(baseUri, String.Format(c_removeeventscommand, accesskey, usingBatch, usingEvents));
}
开发者ID:Sandeep136,项目名称:JetstreamSDK-.NET,代码行数:34,代码来源:RemoveEventsRequest.cs
示例5: LoadScene
//public GameObject loadingImage;
public void LoadScene(string level)
{
Data.noMissions = false;
System.Collections.Generic.List<Mission> tempList = new System.Collections.Generic.List<Mission>();
for (int i = 0; i < Data.diplomacyList.Count; i++)
{
if (Data.diplomacyList[i].difficulty == Data.currentDifficulty && !Data.diplomacyList[i].isDone)
{
tempList.Add(Data.diplomacyList[i]);
}
}
System.Random r = new System.Random();
int randomIndex = r.Next(0, tempList.Count);
if (tempList.Count == 0)
{
//hotdogs
}
else if (!Data.preserveDipMission || !Data.lastDipMission.isListed)
{
Debug.Log("Random mission: " + randomIndex + " out of: " + tempList.Count);
Data.pickedMission = tempList[randomIndex];
Data.lastDipMission = Data.pickedMission;
Data.lastDipMission.isListed = true;
}
else
{
Data.pickedMission = Data.lastDipMission;
}
tempList.Clear();
Data.hitBack = false;
//loadingImage.SetActive(true);
Application.LoadLevel(level);
}
开发者ID:CraigRWilliams,项目名称:MaroFortuna,代码行数:37,代码来源:DipSelect.cs
示例6: getPermutationV5
//Idea of Recursive
public static System.Collections.Generic.List<string> getPermutationV5(string str)
{
if (str == null)
{
return null;
}
System.Collections.Generic.List<string> solutions = new System.Collections.Generic.List<string>();
if (str.Length == 0)
{
solutions.Add("");
return solutions;
}
//solutions.Add(str[0].ToString());
string remaining = str.Substring(1);
System.Collections.Generic.List<string> current_solutions = getPermutationV5(remaining);
foreach (string item in current_solutions)
{
for (int i = 0; i <= item.Length; i++)
{
string new_item = insertStr(item, i, str[0].ToString());
solutions.Add(new_item);
}
}
return solutions;
}
开发者ID:Sanqiang,项目名称:Algorithm-Win,代码行数:26,代码来源:CC8_4.cs
示例7: Test1
public virtual void Test1()
{
int size = 100000;
int[] arrayOfInts = new int[size];
System.Collections.Generic.IList<int> listOfInts = new System.Collections.Generic.List
<int>(size);
long startArray = OdbTime.GetCurrentTimeInMs();
for (int i = 0; i < size; i++)
{
arrayOfInts[i] = i;
}
for (int i = 0; i < size; i++)
{
int ii = arrayOfInts[i];
}
long endArray = OdbTime.GetCurrentTimeInMs();
long startList = OdbTime.GetCurrentTimeInMs();
for (int i = 0; i < size; i++)
{
listOfInts.Add(i);
}
for (int i = 0; i < size; i++)
{
int ii = listOfInts[i];
}
long endList = OdbTime.GetCurrentTimeInMs();
Println("Time for array = " + (endArray - startArray));
Println("Time for list = " + (endList - startList));
}
开发者ID:ekicyou,项目名称:pasta,代码行数:29,代码来源:TestArrayList_vs_array.cs
示例8: OverlappingIdentifierFails
public void OverlappingIdentifierFails()
{
// Assert
var start = new DateTime(1999, 1, 1);
var finish = new DateTime(2020, 12, 31);
var validity = new DateRange(start, finish);
var system = new SourceSystem { Name = "Test" };
var expected = new SourceSystemMapping { System = system, MappingValue = "1", Validity = validity };
var list = new System.Collections.Generic.List<SourceSystemMapping> { expected };
var repository = new Mock<IRepository>();
repository.Setup(x => x.Queryable<SourceSystemMapping>()).Returns(list.AsQueryable());
var identifier = new EnergyTrading.Mdm.Contracts.MdmId
{
SystemName = "Test",
Identifier = "1",
StartDate = start.AddHours(5),
EndDate = start.AddHours(10)
};
var request = new AmendMappingRequest() { EntityId = 1, Mapping = identifier, MappingId = 1 };
var rule = new AmendMappingNoOverlappingRule<SourceSystemMapping>(repository.Object);
// Act
var result = rule.IsValid(request);
// Assert
repository.Verify(x => x.Queryable<SourceSystemMapping>());
Assert.IsFalse(result, "Rule failed");
}
开发者ID:RWE-Nexus,项目名称:EnergyTrading-MDM,代码行数:31,代码来源:AmendMappingNoOverlappingRuleFixture.cs
示例9: buildPhoneNumbers
private static System.String[] buildPhoneNumbers(System.String number1, System.String number2, System.String number3)
{
// System.Collections.ArrayList numbers = System.Collections.ArrayList.Synchronized(new System.Collections.ArrayList(3)); // commented by .net follower (http://dotnetfollower.com)
System.Collections.Generic.List<Object> numbers = new System.Collections.Generic.List<Object>(3); // added by .net follower (http://dotnetfollower.com)
if (number1 != null)
{
numbers.Add(number1);
}
if (number2 != null)
{
numbers.Add(number2);
}
if (number3 != null)
{
numbers.Add(number3);
}
int size = numbers.Count;
if (size == 0)
{
return null;
}
System.String[] result = new System.String[size];
for (int i = 0; i < size; i++)
{
result[i] = ((System.String) numbers[i]);
}
return result;
}
开发者ID:rondvorak,项目名称:jade_change,代码行数:28,代码来源:BizcardResultParser.cs
示例10: GetTLProject_broken_connection
public void GetTLProject_broken_connection()
{
System.Collections.Generic.List<TestProject> list =
new System.Collections.Generic.List<TestProject>();
list.Add(
FakeTestLinkFactory.GetTestProject(
"project1",
"prj1",
string.Empty));
list.Add(
FakeTestLinkFactory.GetTestProject(
"project2",
"prj2",
string.Empty));
list.Add(
FakeTestLinkFactory.GetTestProject(
"project3",
"prj3",
string.Empty));
//cmdlet.WriteTrace(cmdlet, "GetTLProject_broken_connection: 001");
System.Collections.Generic.List<TestProject> resultList =
getProjectCollection(list, true);
//cmdlet.WriteTrace(cmdlet, "GetTLProject_broken_connection: 002");
Assert.AreEqual<System.Collections.Generic.List<TestProject>>(
(new System.Collections.Generic.List<TestProject>()),
resultList);
}
开发者ID:apetrovskiy,项目名称:STUPS,代码行数:27,代码来源:GetProjectCollectionTestFixture.cs
示例11: ExtractRenderMesh
public static Rhino.Commands.Result ExtractRenderMesh(Rhino.RhinoDoc doc)
{
Rhino.DocObjects.ObjRef objRef = null;
Rhino.Commands.Result rc = Rhino.Input.RhinoGet.GetOneObject("Select surface or polysurface", false, Rhino.DocObjects.ObjectType.Brep, out objRef);
if (rc != Rhino.Commands.Result.Success)
return rc;
Rhino.DocObjects.RhinoObject obj = objRef.Object();
if (null == obj)
return Rhino.Commands.Result.Failure;
System.Collections.Generic.List<Rhino.DocObjects.RhinoObject> objList = new System.Collections.Generic.List<Rhino.DocObjects.RhinoObject>(1);
objList.Add(obj);
Rhino.DocObjects.ObjRef[] meshObjRefs = Rhino.DocObjects.RhinoObject.GetRenderMeshes(objList, true, false);
if (null != meshObjRefs)
{
for (int i = 0; i < meshObjRefs.Length; i++)
{
Rhino.DocObjects.ObjRef meshObjRef = meshObjRefs[i];
if (null != meshObjRef)
{
Rhino.Geometry.Mesh mesh = meshObjRef.Mesh();
if (null != mesh)
doc.Objects.AddMesh(mesh);
}
}
doc.Views.Redraw();
}
return Rhino.Commands.Result.Success;
}
开发者ID:jackieyin2015,项目名称:rhinocommon,代码行数:32,代码来源:ex_extractrendermesh.cs
示例12: getProjectCollection
private System.Collections.Generic.List<TestProject> getProjectCollection(
System.Collections.Generic.List<TestProject> listOfProjects,
bool makeFail)
{
TLProjectCmdletBase cmdlet = new TLProjectCmdletBase();
cmdlet.Name = null;
TLAddinData.CurrentTestLinkConnection =
FakeTestLinkFactory.GetTestLinkWithProjects(listOfProjects);
if (makeFail) {
TLAddinData.CurrentTestLinkConnection = null;
}
//cmdlet.WriteTrace(cmdlet, "getProjectCollection: 003");
TLSrvGetProjectCommand command =
new TLSrvGetProjectCommand(cmdlet);
command.Execute();
//cmdlet.WriteTrace(cmdlet, "getProjectCollection: 004");
System.Collections.Generic.List<TestProject> resultList =
new System.Collections.Generic.List<TestProject>();
//cmdlet.WriteTrace(cmdlet, "getProjectCollection: 005");
//cmdlet.WriteTrace(cmdlet, "IsInitialized: " + PSTestLib.UnitTestOutput.IsInitialized.ToString());
foreach (object tpr in PSTestLib.UnitTestOutput.LastOutput) {
//cmdlet.WriteTrace(cmdlet, "getProjectCollection: 006");
resultList.Add((TestProject)tpr);
//cmdlet.WriteTrace(cmdlet, "getProjectCollection: 007");
}
return resultList;
}
开发者ID:apetrovskiy,项目名称:STUPS,代码行数:30,代码来源:GetProjectCollectionTestFixture.cs
示例13: Run
public static void Run()
{
// ExStart:1
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
// ****** Program ******
// Initialize WorkbookDesigner object
WorkbookDesigner designer = new WorkbookDesigner();
// Load the template file
designer.Workbook = new Workbook(dataDir + "SM_NestedObjects.xlsx");
// Instantiate the List based on the class
System.Collections.Generic.ICollection<Individual> list = new System.Collections.Generic.List<Individual>();
// Create an object for the Individual class
Individual p1 = new Individual("Damian", 30);
// Create the relevant Wife class for the Individual
p1.Wife = new Wife("Dalya", 28);
// Create another object for the Individual class
Individual p2 = new Individual("Mack", 31);
// Create the relevant Wife class for the Individual
p2.Wife = new Wife("Maaria", 29);
// Add the objects to the list
list.Add(p1);
list.Add(p2);
// Specify the DataSource
designer.SetDataSource("Individual", list);
// Process the markers
designer.Process(false);
// Save the Excel file.
designer.Workbook.Save(dataDir+ "output.xlsx");
}
开发者ID:aspose-cells,项目名称:Aspose.Cells-for-.NET,代码行数:33,代码来源:UsingNestedObjects.cs
示例14: btnBus_Click
protected void btnBus_Click(object sender, EventArgs e)
{
int intAnio = 0;
int intMes = 0;
if (!int.TryParse(cmbAnio.SelectedValue, out intAnio) || !int.TryParse(cmbMes.SelectedValue, out intMes))
{
lblErr.Text = "El año y mes seleccionado es incorrecto";
return;
}
System.Collections.Generic.List<ReportParameter> _parameters = new System.Collections.Generic.List<ReportParameter>();
_parameters.Add(new ReportParameter("Tipo", this.cmbTip.SelectedIndex == 0 ? " " : this.cmbTip.Text));
_parameters.Add(new ReportParameter("Grupo", this.cmbGru.SelectedIndex == 0 ? " " : this.cmbGru.Text));
_parameters.Add(new ReportParameter("Area", this.cmbAre.SelectedIndex == 0 ? " " : this.cmbAre.Text));
_parameters.Add(new ReportParameter("fechaIni", UtilFechas.getFechaIni(intAnio,intMes).ToString("yyyyMMdd")));
_parameters.Add(new ReportParameter("fechaFin", UtilFechas.getFechaFin(intAnio, intMes).ToString("yyyyMMdd")));
try
{
this.rpvData.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote;
this.rpvData.ShowParameterPrompts = false;
this.rpvData.ServerReport.ReportServerUrl = new Uri(ConfigurationManager.AppSettings["ReportServerUrl"]);
this.rpvData.ServerReport.ReportPath = "/rptTablero/rptAnalisisSLA";
this.rpvData.ServerReport.SetParameters(_parameters);
this.rpvData.ServerReport.Refresh();
this.rpvData.Visible = true;
}
catch (Exception ex)
{
this.rpvData.Visible = false;
this.lblErr.Text = ex.Message + "<br/>" + ex.StackTrace;
}
}
开发者ID:moisesluza,项目名称:TableroControl,代码行数:35,代码来源:frmAnalisisSLA.aspx.cs
示例15: LoadAssemblies
private static System.Collections.Generic.IList<System.Reflection.Assembly> LoadAssemblies() {
System.Collections.Generic.IList<System.Reflection.Assembly> assemblyList = new System.Collections.Generic.List<System.Reflection.Assembly>();
assemblyList.Add(Load("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
assemblyList.Add(Load("PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856a" +
"d364e35"));
assemblyList.Add(Load("System.Activities, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364" +
"e35"));
assemblyList.Add(Load("System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
assemblyList.Add(Load("System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
assemblyList.Add(Load("System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
assemblyList.Add(Load("System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" +
""));
assemblyList.Add(Load("System.Runtime.Serialization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b7" +
"7a5c561934e089"));
assemblyList.Add(Load("System.ServiceModel.Activities, Version=4.0.0.0, Culture=neutral, PublicKeyToken=" +
"31bf3856ad364e35"));
assemblyList.Add(Load("System.Xaml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
assemblyList.Add(Load("System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
assemblyList.Add(Load("System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e08" +
"9"));
assemblyList.Add(Load("Microsoft.Activities, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad" +
"364e35"));
assemblyList.Add(Load("Microsoft.SharePoint.Client.ServerRuntime, Version=15.0.0.0, Culture=neutral, Pub" +
"licKeyToken=71e9bce111e9429c"));
assemblyList.Add(Load("Microsoft.SharePoint.DesignTime.Activities, Version=14.0.0.0, Culture=neutral, Pu" +
"blicKeyToken=b03f5f7f11d50a3a"));
assemblyList.Add(Load("Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce11" +
"1e9429c"));
assemblyList.Add(System.Reflection.Assembly.GetExecutingAssembly());
return assemblyList;
}
开发者ID:karayakar,项目名称:MCSD_SharePoint_Applications,代码行数:31,代码来源:_Farm_Solution2.g.cs
示例16: FirefoxProfile_add_five_extensions
public void FirefoxProfile_add_five_extensions()
{
string[] expected = { "SePSX.dll", "SePSX.dll", "SePSX.dll", "SePSX.dll", "SePSX.dll" };
AddSeFirefoxExtensionCommand cmdlet =
WebDriverFactory.Container.Resolve<AddSeFirefoxExtensionCommand>();
//AddSeFirefoxExtensionCommand.UnitTestMode = true;
cmdlet.InputObject =
//WebDriverFactory.GetFirefoxProfile();
// resolve FirefoxProfile
WebDriverFactory.Container.Resolve<FirefoxProfile>();
cmdlet.ExtensionList =
expected;
SeAddFirefoxExtensionCommand command =
new SeAddFirefoxExtensionCommand(cmdlet);
command.Execute();
System.Collections.Generic.List<string> listOfArguments =
new System.Collections.Generic.List<string>();
listOfArguments.Add(expected[0]);
listOfArguments.Add(expected[1]);
listOfArguments.Add(expected[2]);
listOfArguments.Add(expected[3]);
listOfArguments.Add(expected[4]);
ReadOnlyCollection<string> expectedList =
new ReadOnlyCollection<string>(listOfArguments);
//Assert.AreEqual(expectedList, (SePSX.CommonCmdletBase.UnitTestOutput[0] as FirefoxProfile)); // ??
}
开发者ID:apetrovskiy,项目名称:STUPS,代码行数:26,代码来源:AddSeFirefoxExtensionCommandTestFixture.cs
示例17: getPermutation
public static System.Collections.Generic.List<string> getPermutation(string str, int index = 0, System.Collections.Generic.List<string> sets = null)
{
if (index == str.Length)
{
return sets;
}
System.Collections.Generic.List<string> current_result = new System.Collections.Generic.List<string>();
string c = str.Substring(index, 1);
if (sets == null)
{
current_result.Add(c);
}else if (sets != null)
{
foreach (string item in sets)
{
for (int i = 0; i <= item.Length; i++)
{
current_result.Add(insertStr(item, i, c));
}
}
}
return getPermutation(str, index + 1, current_result);
}
开发者ID:Sanqiang,项目名称:Algorithm-Win,代码行数:25,代码来源:CC8_4.cs
示例18: Test2
/// <exception cref="System.Exception"></exception>
public virtual void Test2()
{
string baseName = GetBaseName();
NeoDatis.Odb.ODB odb = Open(baseName);
System.Collections.Generic.IList<NeoDatis.Odb.Test.VO.Login.Profile> profiles = new
System.Collections.Generic.List<NeoDatis.Odb.Test.VO.Login.Profile>();
profiles.Add(new NeoDatis.Odb.Test.VO.Login.Profile("p1", new NeoDatis.Odb.Test.VO.Login.Function
("f1")));
profiles.Add(new NeoDatis.Odb.Test.VO.Login.Profile("p2", new NeoDatis.Odb.Test.VO.Login.Function
("f2")));
NeoDatis.Odb.Test.Query.Criteria.ClassB cb = new NeoDatis.Odb.Test.Query.Criteria.ClassB
("name", profiles);
odb.Store(cb);
odb.Close();
odb = Open(baseName);
NeoDatis.Odb.Test.VO.Login.Profile p = (NeoDatis.Odb.Test.VO.Login.Profile)odb.GetObjects
(typeof(NeoDatis.Odb.Test.VO.Login.Profile)).GetFirst();
NeoDatis.Odb.Impl.Core.Query.Criteria.CriteriaQuery query = odb.CriteriaQuery(typeof(
NeoDatis.Odb.Test.Query.Criteria.ClassB), NeoDatis.Odb.Core.Query.Criteria.Where
.Contain("profiles", p));
NeoDatis.Odb.Objects<NeoDatis.Odb.Test.Query.Criteria.ClassB> l = odb.GetObjects(
query);
odb.Close();
AssertEquals(1, l.Count);
}
开发者ID:ekicyou,项目名称:pasta,代码行数:26,代码来源:TestCriteriaQuery6.cs
示例19: InnitCBCat
private void InnitCBCat()
{
int newsid = Request["newsid"] == null ? -1 : int.Parse(Request["newsid"]);
int catid = -1;
if (newsid != -1)
{
var news = (from n in Data.CV_News
where n.NewsID == newsid
select n).FirstOrDefault();
if (news != null)
{
catid = news.CatNewsID.Value;
}
}
System.Collections.Generic.List<ListItem> cats = new System.Collections.Generic.List<ListItem>();
var catnews = from cn in Data.CV_CatNews
where cn.PortalID==PortalId
select new ListItem { Value = cn.CatID.ToString(), Selected = cn.CatID == catid, Text = cn.CatName };
foreach (var c in catnews)
{
cats.Add(c);
}
this.ddlCatNews.Items.Clear();
this.ddlCatNews.Items.AddRange(cats.ToArray());
}
开发者ID:shahinhemati,项目名称:project-example-a,代码行数:30,代码来源:EditNews.ascx.cs
示例20: Test1
/// <exception cref="System.Exception"></exception>
public virtual void Test1()
{
string baseName = GetBaseName();
NeoDatis.Odb.ODB odb = Open(baseName);
System.Collections.Generic.IList<NeoDatis.Odb.Test.VO.Login.Profile> profiles = new
System.Collections.Generic.List<NeoDatis.Odb.Test.VO.Login.Profile>();
profiles.Add(new NeoDatis.Odb.Test.VO.Login.Profile("p1", new NeoDatis.Odb.Test.VO.Login.Function
("f1")));
profiles.Add(new NeoDatis.Odb.Test.VO.Login.Profile("p2", new NeoDatis.Odb.Test.VO.Login.Function
("f2")));
NeoDatis.Odb.Test.Query.Criteria.ClassB cb = new NeoDatis.Odb.Test.Query.Criteria.ClassB
("name", profiles);
odb.Store(cb);
odb.Close();
odb = Open(baseName);
// this object is not known y NeoDatis so the query will not return anything
NeoDatis.Odb.Test.VO.Login.Profile p = new NeoDatis.Odb.Test.VO.Login.Profile("p1"
, (System.Collections.IList)null);
NeoDatis.Odb.Impl.Core.Query.Criteria.CriteriaQuery query = odb.CriteriaQuery(typeof(
NeoDatis.Odb.Test.Query.Criteria.ClassB), NeoDatis.Odb.Core.Query.Criteria.Where
.Contain("profiles", p));
NeoDatis.Odb.Objects<NeoDatis.Odb.Test.Query.Criteria.ClassB> l = odb.GetObjects(
query);
odb.Close();
AssertEquals(0, l.Count);
}
开发者ID:ekicyou,项目名称:pasta,代码行数:27,代码来源:TestCriteriaQuery6.cs
注:本文中的System.Collections.Generic.List类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论