本文整理汇总了C#中DropNet.Models.MetaData类的典型用法代码示例。如果您正苦于以下问题:C# MetaData类的具体用法?C# MetaData怎么用?C# MetaData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MetaData类属于DropNet.Models命名空间,在下文中一共展示了MetaData类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateFolderViewModel
public CreateFolderViewModel()
{
if (IsInDesignMode)
{
_metadata = new MetaData { Path = "/photos" };
}
}
示例2: OnNavigatedTo
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
{
if (RemoveBackEntry)
{
NavigationService.RemoveBackEntry();
}
Messenger.Default.Register<MetaDataViewModel>(this, MessengerToken.GetLink, GetLinkPage);
var data = new MetaData
{
Path = GetPath(),
Icon = GetIcon()
};
PageTitle.Text = data.Name.ToLower();
_viewModel.RegisterMessengers.Execute(null);
_viewModel.LoadItems.Execute(data);
SetPinIcon(data);
if (RemoveBackEntry)
{
App.NeedDataRefresh = true;
}
base.OnNavigatedTo(e);
}
示例3: IsPinned
public static bool IsPinned(MetaData metaData)
{
string path = string.Format("/FolderPage.xaml?path={0}&icon={1}", metaData.Path, metaData.Icon);
var tile = LiveTileHelper.GetTile(new Uri(path, UriKind.Relative));
return tile != null;
}
示例4: FromMetaData
public static DropBoxItem FromMetaData(MetaData metaData)
{
if(metaData.Is_Dir)
{
return new DropBoxFolder(metaData.Path, metaData.Name);
}
return new DropBoxFile(metaData.Path, metaData.Name);
}
示例5: GetMetaData
private async void GetMetaData()
{
_metaData = _client.GetMetaData(path: "/Photos/Camera/2014/2014-05-11");
_position = 0;
LoadImageIntoControl(await GetImage(_position));
if (_position < _metaData.Contents.Count - 1)
await GetImage(_position + 1); // cache the next image
}
示例6: ParseImageMetadata
protected virtual void ParseImageMetadata(MetaData data)
{
Client.GetMediaAsync(data.Path, response =>
{
var media = MediaFactory.CreateFromUrl(Settings.Id, response.Url);
NewMedia(media);
((List<Media>)Media).Add(media);
}, exception => Debug.WriteLine(exception));
}
示例7: RemoveTile
public static void RemoveTile(MetaData metaData)
{
string path = string.Format("/FolderPage.xaml?path={0}&icon={1}", metaData.Path, metaData.Icon);
var tile = LiveTileHelper.GetTile(new Uri(path, UriKind.Relative));
if (tile != null)
{
tile.Delete();
}
}
示例8: GetMetadataRecursive
public static IEnumerable<MetaData> GetMetadataRecursive(MetaData metaData)
{
var result = new List<MetaData>() {metaData};
if (metaData.Contents != null) {
foreach (var data in metaData.Contents) {
result.AddRange(GetMetadataRecursive(data));
}
}
return result;
}
示例9: FileEntry
public FileEntry(MetaData md, ImageSource thumb)
{
Modified = md.ModifiedDate;
Title = md.Name;
Image = thumb;
IdString = md.Path;
IsFolder = md.Is_Dir;
IsGDrive = false;
IsViewable = !md.Is_Dir && IsExtViewable(md.Extension.Replace(".", ""));
}
示例10: Create
public static DropboxFileMeta Create(MetaData m)
{
return new DropboxFileMeta
{
IsDir = m.Is_Dir,
IsDeleted = m.Is_Deleted,
Extension = m.Extension,
Name = m.Name,
LastModifiedUtc = m.UTCDateModified,
Path = m.Path
};
}
示例11: ConvertToFileObject
/// <summary>
/// Converting DropBox Model to FileObject
/// </summary>
/// <param name="meta">DropBox Model</param>
/// <returns>POJO FileObject</returns>
public static FileObject ConvertToFileObject(MetaData meta)
{
string Name = meta.Name;
string UpdateAt = meta.ModifiedDate.ToString(); //14/02/2014 15:48:13
string Id = meta.Path; // Full path
string ParentId = meta.Path;
double Size = meta.Bytes * 1.0;
FileObject.FileObjectType Type = (meta.Is_Dir ? FileObject.FileObjectType.FOLDER : FileObject.FileObjectType.FILE);
string Extension = (meta.Extension == null || "".Equals(meta.Extension)) ? "" : meta.Extension.Substring(1, meta.Extension.Length -1); // .png
return new FileObject(Id,Name,Size,Type,Extension,UpdateAt);
}
示例12: GetRelativeTime
private static string GetRelativeTime(MetaData data)
{
DateTime date;
var parsed = DateTime.TryParseExact(
data.Modified,
"ddd, dd MMM yyyy HH:mm:ss +ffff",
CultureInfo.InvariantCulture,
DateTimeStyles.None, out date);
return parsed
? date.ToRelative()
: string.Empty;
}
示例13: MetaListItemInfo
public MetaListItemInfo(MetaData data)
{
if (data == null)
throw new ArgumentNullException("data");
Title = data.Name;
_path = data.Path;
_idDir = data.Is_Dir;
_modified = data.Modified;
Icon = ThemeData.GetImage(
data.Is_Dir ? "folder" : "entry");
}
示例14: UnpublishedMarkdownFiles
private static bool UnpublishedMarkdownFiles(MetaData arg)
{
if (arg.Name == null)
return false;
var withoutExtension = Path.GetFileNameWithoutExtension(arg.Name);
var extension = Path.GetExtension(arg.Name);
return
withoutExtension != null &&
extension != null &&
withoutExtension.IndexOf(PublishedMarker, StringComparison.Ordinal) == -1 &&
withoutExtension.IndexOf(WorkInProgressMarker, StringComparison.Ordinal) == -1 &&
extension == ".md";
}
示例15: CreateTile
public static void CreateTile(MetaData metaData)
{
ImageSource imageSource = new BitmapImage(new Uri(string.Format("/TileIcon/{0}.png", metaData.Icon), UriKind.Relative));
var visual = new LiveTileVisual();
visual.SetProperties(metaData.Name, imageSource);
var data = new RadExtendedTileData
{
VisualElement = visual
};
string path = string.Format("/FolderPage.xaml?path={0}&icon={1}", metaData.Path, metaData.Icon);
LiveTileHelper.CreateTile(data, new Uri(path, UriKind.Relative));
}