本文整理汇总了C#中ListType类的典型用法代码示例。如果您正苦于以下问题:C# ListType类的具体用法?C# ListType怎么用?C# ListType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ListType类属于命名空间,在下文中一共展示了ListType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: NamespaceList
public NamespaceList(string namespaces, string targetNamespace) {
Debug.Assert(targetNamespace != null);
this.targetNamespace = targetNamespace;
namespaces = namespaces.Trim();
if (namespaces == "##any" || namespaces.Length == 0) {
type = ListType.Any;
}
else if (namespaces == "##other") {
type = ListType.Other;
}
else {
type = ListType.Set;
set = new Hashtable();
string[] splitString = XmlConvert.SplitString(namespaces);
for (int i = 0; i < splitString.Length; ++i) {
if (splitString[i] == "##local") {
set[string.Empty] = string.Empty;
}
else if (splitString[i] == "##targetNamespace") {
set[targetNamespace] = targetNamespace;
}
else {
XmlConvert.ToUri (splitString[i]); // can throw
set[splitString[i]] = splitString[i];
}
}
}
}
示例2: NamespaceList
public NamespaceList(string namespaces, string targetNamespace)
{
this.targetNamespace = targetNamespace;
namespaces = namespaces.Trim();
if ((namespaces == "##any") || (namespaces.Length == 0))
{
this.type = ListType.Any;
}
else if (namespaces == "##other")
{
this.type = ListType.Other;
}
else
{
this.type = ListType.Set;
this.set = new Hashtable();
string[] strArray = XmlConvert.SplitString(namespaces);
for (int i = 0; i < strArray.Length; i++)
{
if (strArray[i] == "##local")
{
this.set[string.Empty] = string.Empty;
}
else if (strArray[i] == "##targetNamespace")
{
this.set[targetNamespace] = targetNamespace;
}
else
{
XmlConvert.ToUri(strArray[i]);
this.set[strArray[i]] = strArray[i];
}
}
}
}
示例3: KCT_BuildListVessel
public KCT_BuildListVessel(ShipConstruct s, String ls, double bP, String flagURL)
{
ship = s;
shipNode = s.SaveShip();
shipName = s.shipName;
//Get total ship cost
float dry, fuel;
s.GetShipCosts(out dry, out fuel);
cost = dry + fuel;
TotalMass = 0;
foreach (Part p in s.Parts)
{
TotalMass += p.mass;
TotalMass += p.GetResourceMass();
}
launchSite = ls;
buildPoints = bP;
progress = 0;
flag = flagURL;
if (launchSite == "LaunchPad")
type = ListType.VAB;
else
type = ListType.SPH;
InventoryParts = new Dictionary<string, int>();
id = Guid.NewGuid();
cannotEarnScience = false;
}
示例4: ImportListFile
public static List<string> ImportListFile(string fileName, ListType type)
{
using (var sr = File.OpenText(fileName))
{
switch (type)
{
case ListType.M3U8:
{
var line = sr.ReadLine().ToUpper();
if (!line.Contains("#EXTM3U"))
return null;
line = sr.ReadLine();
var temp = new List<string>();
while (!string.IsNullOrWhiteSpace(line))
{
if (line[0] == '#')
{
line = sr.ReadLine();
continue;
}
temp.Add(line);
line = sr.ReadLine();
}
return temp;
}
default: return null;
}
}
}
示例5: ConvertListTypeToString
private static string ConvertListTypeToString(ListType type)
{
string s;
switch (type)
{
case ListType.RECOMMENDED:
s = "recommended";
break;
case ListType.LIKED:
s = "liked";
break;
case ListType.LISTEN_LATER:
s = "listen_later";
break;
case ListType.FEED:
s = "feed";
break;
case ListType.PUBLISHED:
s = "dj";
break;
case ListType.HISTORY:
s = "listened";
break;
default:
throw new System.ArgumentException("Invalid ListType argument passed");
}
return s;
}
示例6: MainForm
public MainForm(string path, bool loadNames, bool loadBrstms, bool groupSongs)
{
InitializeComponent();
loadNamesFromInfopacToolStripMenuItem.Checked = songPanel1.LoadNames = loadNames;
loadBRSTMPlayerToolStripMenuItem.Checked = songPanel1.LoadBrstms = loadBrstms;
groupSongsByStageToolStripMenuItem.Checked = groupSongs;
listType = groupSongs ? ListType.GroupByStage : ListType.FilesInDir;
// Later commands to change the titlebar assume there is a hypen in the title somewhere
this.Text += " -";
loadNames = loadNamesFromInfopacToolStripMenuItem.Checked;
loadBrstms = loadBRSTMPlayerToolStripMenuItem.Checked;
RightControl = chooseLabel;
// Drag and drop for the left and right sides of the window. The dragEnter and dragDrop methods will check which panel the file is dropped onto.
listBox1.AllowDrop = true;
listBox1.DragEnter += dragEnter;
listBox1.DragDrop += dragDrop;
this.FormClosing += closing;
this.FormClosed += closed;
changeDirectory(path);
}
示例7: NamespaceList
public NamespaceList(string namespaces, string targetNamespace) {
Debug.Assert(targetNamespace != null);
this.targetNamespace = targetNamespace;
namespaces = namespaces.Trim();
if (namespaces == "##any" || namespaces.Length == 0) {
type = ListType.Any;
}
else if (namespaces == "##other") {
type = ListType.Other;
}
else {
type = ListType.Set;
set = new Hashtable();
foreach(string ns in XmlConvert.SplitString(namespaces)) {
if (ns == "##local") {
set[string.Empty] = string.Empty;
}
else if (ns == "##targetNamespace") {
set[targetNamespace] = targetNamespace;
}
else {
XmlConvert.ToUri (ns); // can throw
set[ns] = ns;
}
}
}
}
示例8: ListMenu
public ListMenu(string DataPath, AppsModules Modul, ListType Type, string ModLabel)
{
InitializeComponent();
//Set Label Format
Lbl_List.Foreground = new SolidColorBrush(FontColor);
Lbl_List.FontFamily = TitleFont;
//Set Title
Lbl_List.Content = ModLabel;
//Search for the Files or Directories
if (Type == ListType.Folder)
{
//Search all Directories
DirectoryPaths = Directory.GetDirectories(DataPath).ToList();
}
else if (Type == ListType.None)
{
//Dummy
}
else
{
DirectoryPaths = new List<string>();
//Search all Files in diferents formats
for(int x=0; x < FileMgr.GetFileFormats(Type).Length; x++)
DirectoryPaths.AddRange(Directory.GetFiles(DataPath, FileMgr.GetFileFormats(Type)[x]).ToList());
}
//Copy the Option Information
CurrentModul = Modul;
SelModul = 0;
myType = Type;
}
示例9: GetFileFormats
/// <summary>
/// Get file formats for each kind of App
/// </summary>
public static string[] GetFileFormats(ListType type)
{
string[] Formats;
switch (type)
{
case ListType.PDF:
Formats = new string[] { "*.pdf" };
break;
case ListType.Video:
Formats = new string[] { "*.avi", "*.wmv", "*.flv", "*.mp4", "*.mpg"};
break;
case ListType.Maps:
Formats = new string[] { "*.png", "*.jpg" };
break;
case ListType.Web:
Formats = new string[] { "*.txt" };
break;
case ListType.Voting:
Formats = new string[] { "*.xml" };
break;
default:
Formats = new string[] { "*.*" };
break;
}
return Formats;
}
示例10:
/// <summary>
/// Constructor for the GroupEnumeratorHelper. At construction
/// time, you specify the GroupingCollection to use, and the type
/// of enumerator you wish to get.
/// </summary>
/// <remarks>
/// </remarks>
/// <owner>DavidLe</owner>
/// <param name="groupingCollection"></param>
/// <param name="type"></param>
/// <returns>IEnumerator</returns>
internal GroupEnumeratorHelper
(
GroupingCollection groupingCollection,
ListType type
)
{
error.VerifyThrow(groupingCollection != null, "GroupingCollection is null");
this.groupingCollection = groupingCollection;
this.type = type;
}
示例11: GetListId
public virtual int GetListId(ListType listType, SchoolCategory schoolCategory)
{
switch(schoolCategory)
{
case SchoolCategory.None:
case SchoolCategory.Ungraded:
schoolCategory = SchoolCategory.HighSchool;
break;
}
return GetListId(listType.ToString(), schoolCategory);
}
示例12: CloseList
public static string CloseList(ListType type)
{
switch (type)
{
case ListType.Bulletted:
return CloseBulletedList();
case ListType.Numbered:
return CloseNumberedList();
default:
return CloseNumberedList();
}
}
示例13: GetLayoutForType
public static int GetLayoutForType(ListType type)
{
switch (type)
{
case ListType.Regular:
return Resource.Layout.sino_droid_md_listitem;
case ListType.Single:
return Resource.Layout.sino_droid_md_listitem_singlechoice;
case ListType.Multi:
return Resource.Layout.sino_droid_md_listitem_multichoice;
default:
throw new InvalidOperationException("Not a valid list type");
}
}
示例14: GetTagName
private static string GetTagName(ListType listType)
{
switch (listType)
{
case ListType.BulletedList:
return "ul";
case ListType.NumberedList:
return "ol";
default:
throw new ArgumentOutOfRangeException("listType");
}
}
示例15: KCT_BuildListVessel
public KCT_BuildListVessel(String name, String ls, double bP, String flagURL, float spentFunds)
{
ship = new ShipConstruct();
launchSite = ls;
shipName = name;
buildPoints = bP;
progress = 0;
flag = flagURL;
if (launchSite == "LaunchPad")
type = ListType.VAB;
else
type = ListType.SPH;
InventoryParts = new List<string>();
cannotEarnScience = false;
cost = spentFunds;
}