本文整理汇总了C#中MetaData类的典型用法代码示例。如果您正苦于以下问题:C# MetaData类的具体用法?C# MetaData怎么用?C# MetaData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MetaData类属于命名空间,在下文中一共展示了MetaData类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ToPrettyString_Works
public void ToPrettyString_Works()
{
var metadata = new MetaData();
metadata.BuildType = BuildType.Debug;
metadata.ClrVersion = "3.0";
metadata.FullName = "Assembly.dll";
metadata.Platform = Platform.x64;
metadata.References = new[] { "mscorlib.dll" };
metadata.Type = AssemblyType.ConsoleApp;
metadata.Version = "1.0";
string expected =
@"General:
FullName = Assembly.dll
Version = 1.0
Platform = x64
BuildType = Debug
CLR Version = 3.0
Type = ConsoleApp
References:
mscorlib.dll
Attributes:
";
Assert.AreEqual(expected, metadata.ToPrettyString());
}
示例2: Flv
public Flv(FileInfo file, bool generateMetadata)
{
_file = file;
_generateMetadata = generateMetadata;
int count = 0;
if (!_generateMetadata)
{
try
{
FlvReader reader = new FlvReader(_file);
ITag tag = null;
while (reader.HasMoreTags() && (++count < 5))
{
tag = reader.ReadTag();
if (tag.DataType == IOConstants.TYPE_METADATA)
{
if (_metaService == null) _metaService = new MetaService(_file);
_metaData = _metaService.ReadMetaData(tag.Body);
}
}
reader.Close();
}
catch (Exception ex)
{
#if !SILVERLIGHT
log.Error("An error occured looking for metadata:", ex);
#endif
}
}
}
示例3: RenderHTML
public Stream RenderHTML(ICollection<Result> results, MetaData metaData)
{
RenderMetaData(metaData);
var body = BaseTemplate.DocumentNode.SelectSingleNode("//body");
body.ChildNodes.Add(MetaDataTemplate.DocumentNode);
int i = 0;
foreach (var r in results)
{
var div = HtmlNode.CreateNode("<div></div>");
div.CopyFrom(TableTemplate.DocumentNode.SelectSingleNode("//div"), false);
div.InnerHtml = div.InnerHtml.Replace("{{CLASS_NAME}}", r.ClassName);
foreach (var ri in r.Items)
{
var beforeCol = ri.Before.Split(' ');
string before = beforeCol.Length > 1 ? String.Format("<span class=\"datatype\"> {0} </span>{1}", beforeCol[0], beforeCol[1]) : ri.Before;
var afterCol = ri.After.Split(' ');
string after = afterCol.Length > 1 ? String.Format("<span class=\"datatype\"> {0} </span>{1}", afterCol[0], afterCol[1]) : ri.After;
string type = String.Format("<span class=\"{0}\">{0}</span", ri.Type);
var node = HtmlNode.CreateNode(String.Format("<tr class=\"{0} child\"><td>{1}</td><td>{2}</td><td>{3}</td></tr>", i % 2 == 0 ? "even" : "odd", type, before, after));
div.SelectSingleNode("//table").ChildNodes.Add(node);
i++;
}
i = 0;
body.ChildNodes.Add(div);
}
var stream = new MemoryStream();
BaseTemplate.Save(stream);
return stream;
}
示例4: Command
public Command(string identifier, string value, StatementType statementType, MetaData<IMeta> metaData, bool rcon)
: base(statementType, metaData)
{
Identifier = identifier;
Value = value;
RCON = rcon;
}
示例5: GetMetaData
public static MetaData GetMetaData(string text)
{
Hashtable table = text.hashtableFromJson();
MetaData meta = new MetaData((Hashtable)table["meta"]);
return meta;
}
示例6: FillCommonData
internal static void FillCommonData(ShellFolder shell, MetaData data)
{
if (shell.IsFileSystemObject)
{
data.Add(new MetaEntry { Name = FileMetaData.ModifiedDate.Name, Value = shell.Properties.GetProperty(SystemProperties.System.DateModified).ValueAsObject });
data.Add(new MetaEntry { Name = FileMetaData.Type.Name, Value = shell.Properties.GetProperty(SystemProperties.System.ItemTypeText).ValueAsObject });
}
}
示例7: MapObject
protected MapObject(long id)
{
ID = id;
Visgroups = new List<int>();
AutoVisgroups = new List<int>();
Children = new Dictionary<long, MapObject>();
MetaData = new MetaData();
}
示例8: ItemVM
public ItemVM(IItemProvider provider, ContainerVM parent, string name, bool canRename)
{
Provider = provider;
Parent = parent;
_name = name;
CanRename = canRename;
MetaData = new MetaData();
}
示例9: TcpClient_onMessage
private void TcpClient_onMessage(MetaData md, string msg)
{
switch(md.Action)
{
case MetaData.Actions.register:
priority = Int32.Parse(msg);
Console.WriteLine("Получен порядковый номер " + msg);
break;
}
}
示例10: ReadBlock
public override void ReadBlock(FlvContext context)
{
base.ReadBlock(context);
//var br = context.Reader;
//var dat = br.ReadBytes((int)this.Header.DataLength);
//data = new MetaData(dat);
data = new MetaData(context, this.Header.DataLength);
this.Size += this.Header.DataLength;
context.CurrentPostion += this.Size;
}
示例11: Construct_MetaData_with_Field_array
public void Construct_MetaData_with_Field_array()
{
var fields = new []
{
new Field("Test_Field_1", DataType.adInteger),
new Field("Test_Field_2", DataType.adVarChar)
};
var metaData = new MetaData(fields);
Assert.That(metaData.Fields, Is.EqualTo(fields));
}
示例12: AddMetaData
public void AddMetaData(MetaData metaData)
{
IEnumerable<Attribute> attributes = CreateTextFramesFromMetaData(metaData);
foreach (var attribute in attributes)
{
//TODO: needs testing
if (!String.IsNullOrEmpty(attribute.Value))
{
_container.Add(attribute);
}
}
}
示例13: PdbWriter
/// <summary>
/// Constructor
/// </summary>
/// <param name="writer">Symbol writer</param>
/// <param name="pdbState">PDB state</param>
/// <param name="metaData">Meta data</param>
public PdbWriter(ISymbolWriter2 writer, PdbState pdbState, MetaData metaData) {
if (writer == null)
throw new ArgumentNullException("writer");
if (pdbState == null)
throw new ArgumentNullException("pdbState");
if (metaData == null)
throw new ArgumentNullException("metaData");
this.writer = writer;
this.pdbState = pdbState;
this.metaData = metaData;
this.module = metaData.Module;
writer.Initialize(metaData);
}
示例14: SetUp
public void SetUp()
{
_metaData = new MetaData(new[]
{
new Field("First_Field", DataType.adInteger),
new Field("Second_Field", DataType.adVarChar, 2014)
});
_fakeData = new List<object[]>
{
new object[] { 1, "First" },
new object[] { 2, "Second" }
};
}
示例15: MetaData
/// <summary>Initializes a new instance of the <see cref="T:System.Object" /> class.</summary>
public MetaData(MetaData metadata)
{
if (metadata != null)
{
this.AlbumArtist = metadata.AlbumArtist;
this.Artist = metadata.Artist;
this.Comment = metadata.Comment;
this.Composer = metadata.Composer;
this.Description = metadata.Description;
this.Genre = metadata.Genre;
this.LongDescription = metadata.LongDescription;
this.Name = metadata.Name;
this.ReleaseDate = metadata.ReleaseDate;
}
}