本文整理汇总了C#中System.Windows.Documents.List.Join方法的典型用法代码示例。如果您正苦于以下问题:C# List.Join方法的具体用法?C# List.Join怎么用?C# List.Join使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Documents.List
的用法示例。
在下文中一共展示了List.Join方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetGestures
public static List<Gesture> GetGestures(List<UIElement> uiElements)
{
var list = uiElements.Join(eventRequests, u => u, e => e.UIElement, (u, e) => e.Gesture).ToList<Gesture>();
return list;
}
示例2: EditBiotaPermissions
internal void EditBiotaPermissions(TaxonViewModel taxon)
{
if (!taxon.TaxaID.HasValue || taxon.TaxaID.Value < 0) {
ErrorMessage.Show("You must save apply changes before you can proceed.");
return;
}
bool readOnly = !User.HasBiotaPermission(taxon.TaxaID.Value, PERMISSION_MASK.OWNER);
if (!readOnly) {
PluginManager.Instance.AddNonDockableContent(Owner, new BiotaPermissions(User, taxon, readOnly), "Taxon Permissions for '" + taxon.TaxaFullName + (readOnly ? "' (Read Only)" : "'"), SizeToContent.Manual);
} else {
// Display a readonly version of the permissions...
var permStr = "";
string strOwners = "";
using (new OverrideCursor(Cursors.Wait)) {
var service = new SupportService(User);
var perms = service.GetBiotaPermissions(User.Username, taxon.TaxaID.Value);
var owners = service.getBiotaOwners(taxon.TaxaID.Value);
if ((perms.PermMask1 & (int) PERMISSION_MASK.OWNER) != 0) {
permStr= "Owner";
} else if ((perms.PermMask1 & (int) PERMISSION_MASK.WRITE) != 0) {
var rights = new List<String>();
if ((perms.PermMask1 & (int) PERMISSION_MASK.INSERT) != 0) {
rights.Add("Insert");
}
if ((perms.PermMask1 & (int) PERMISSION_MASK.UPDATE) != 0) {
rights.Add("Update");
}
if ((perms.PermMask1 & (int) PERMISSION_MASK.DELETE) != 0) {
rights.Add("Delete");
}
permStr = rights.Join(", ");
} else {
permStr = "Read Only";
}
var ownerNames = new List<string>();
foreach (BiotaOwner owner in owners) {
if (!string.IsNullOrWhiteSpace(owner.Name)) {
ownerNames.Add(string.Format("{0} ({1})", owner.Name, owner.FullName));
}
}
strOwners = ownerNames.Join(", ");
if (string.IsNullOrWhiteSpace(strOwners)) {
strOwners = "sa (System Administrator)";
}
}
InfoBox.Show(string.Format("Permissions: {0}\n\nOwners: {1}", permStr, strOwners), "Permissions for " + taxon.TaxaFullName, this);
}
}
示例3: DoImport
private void DoImport()
{
if (String.IsNullOrEmpty(txtFilename.Text)) {
ErrorMessage.Show("You must select a file before proceeding!");
return;
}
int rowCount = 0;
var service = new SupportService(User);
using (var parser = new GenericParserAdapter(txtFilename.Text)) {
parser.ColumnDelimiter = ',';
parser.FirstRowHasHeader = chkFirstRowHeaders.IsChecked.GetValueOrDefault(false);
parser.TextQualifier = '\"';
parser.FirstRowSetsExpectedColumnCount = true;
var columnNames = new List<String>();
var values = new List<string>();
while (parser.Read()) {
if (rowCount == 0) {
for (int i = 0; i < parser.ColumnCount; ++i) {
if (parser.FirstRowHasHeader) {
columnNames.Add(parser.GetColumnName(i));
} else {
columnNames.Add("Column" + i);
}
}
}
values.Clear();
for (int i = 0; i < parser.ColumnCount; ++i) {
values.Add(parser[i]);
}
String strFullPath = null;
if (values.Count == 0) {
strFullPath = values[0];
} else {
strFullPath = values.Join("\\");
}
if (!String.IsNullOrWhiteSpace(strFullPath)) {
service.GetDistributionIdFromPath(strFullPath);
lblProgress.InvokeIfRequired(() => {
lblProgress.Content = strFullPath;
lblProgress.UpdateLayout();
});
rowCount++;
}
}
}
lblProgress.InvokeIfRequired(() => {
lblProgress.Content = String.Format("{0} rows processed.", rowCount);
});
btnCancel.Content = "_Close";
}