本文整理汇总了C#中System.Windows.Documents.List.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# List.Equals方法的具体用法?C# List.Equals怎么用?C# List.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Documents.List
的用法示例。
在下文中一共展示了List.Equals方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddAlbumSets
private void AddAlbumSets(List<AlbumUserControl> albumSets,WrapPanel wrapPanel)
{
//Getting fileNames in the directory which storage the paths of pictures
string[] fileNames = GetFileNames(albumSets);
//There is no files in the directory
if(fileNames.Count()==0)
{
return;
}
//Creating AlbumSet
foreach(string s in fileNames)
{
AlbumUserControl albumSet = CreateAlbumSet(wrapPanel, s);
#region
if (albumSets.Equals(familyAlbumSets))
{
albumSet.BelongsTo = "familyAlbumSets";
}
else if (albumSets.Equals(travelAlbumSets))
{
albumSet.BelongsTo = "travelAlbumSets";
}
else if (albumSets.Equals(sceneAlbumSets))
{
albumSet.BelongsTo = "sceneAlbumSets";
}
else if (albumSets.Equals(campusAlbumSets))
{
albumSet.BelongsTo = "campusAlbumSets";
}
else if (albumSets.Equals(personalAlbumSets))
{
albumSet.BelongsTo = "personalAlbumSets";
}
ReadPicturePaths(albumSet);
#endregion
AlbumSet aSet = new AlbumSet();
aSet.ImagePath = albumSet.PicturePathList[0];
aSet.AlbumSetName = albumSet.Name;
//Creating a new AlbumSet,
//for the purpose to add the first picture as the AlbumSet's background
AlbumUserControl userControl = new AlbumUserControl();
userControl.Name = aSet.AlbumSetName;
userControl.Content = aSet;
userControl.ContentTemplate = (DataTemplate)FindResource("AlbumSetDataTemplate");
userControl.IsSelected = true;
userControl.PicturePathList = albumSet.PicturePathList;
userControl.BelongsTo = albumSet.BelongsTo;
userControl.MouseDown += albumUserControl_MouseDown;
userControl.MouseDoubleClick += albumUserControl_MouseDoubleClick;
albumSet = userControl;//Referencing to the new AlbumSet
List<Image> pictureList=new List<Image>();
foreach(string ss in albumSet.PicturePathList)
{
Image i=new Image();
i.Source=new BitmapImage(new Uri(ss,UriKind.Absolute));
i.Stretch = Stretch.UniformToFill;
pictureList.Add(i);
}
albumSet.PictureList = pictureList;
albumSets.Add(albumSet);
UpdateAlbumSets(albumSets, wrapPanel);
}
}
示例2: GetFileNames
private string[] GetFileNames(List<AlbumUserControl> albumsets)
{
string[] fileNames;
List<string> files = new List<string>();
if(albumsets.Equals(familyAlbumSets))
{
fileNames = Directory.GetFiles(@"familyAlbumSets");
foreach(string s in fileNames)
{
files.Add(System.IO.Path.GetFileNameWithoutExtension(s));
}
}
else if(albumsets.Equals(travelAlbumSets))
{
fileNames = Directory.GetFiles(@"travelAlbumSets");
foreach (string s in fileNames)
{
files.Add(System.IO.Path.GetFileNameWithoutExtension(s));
}
}
else if(albumsets.Equals(sceneAlbumSets))
{
fileNames = Directory.GetFiles(@"sceneAlbumSets");
foreach (string s in fileNames)
{
files.Add(System.IO.Path.GetFileNameWithoutExtension(s));
}
}
else if(albumsets.Equals(campusAlbumSets))
{
fileNames = Directory.GetFiles(@"campusAlbumSets");
foreach (string s in fileNames)
{
files.Add(System.IO.Path.GetFileNameWithoutExtension(s));
}
}
else if(albumsets.Equals(personalAlbumSets))
{
fileNames = Directory.GetFiles(@"personalAlbumSets");
foreach (string s in fileNames)
{
files.Add(System.IO.Path.GetFileNameWithoutExtension(s));
}
}
return files.ToArray();
}