• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# MetaData类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中MetaData的典型用法代码示例。如果您正苦于以下问题:C# MetaData类的具体用法?C# MetaData怎么用?C# MetaData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



MetaData类属于命名空间,在下文中一共展示了MetaData类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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());
        }
开发者ID:jivkopetiov,项目名称:AssemblyXray,代码行数:28,代码来源:MetaDataTests.cs


示例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
                }
            }
        }
开发者ID:Nicholi,项目名称:fluorinefx-mod,代码行数:31,代码来源:Flv.cs


示例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;
        }
开发者ID:KLIM8D,项目名称:AsmDiff.NET,代码行数:34,代码来源:HtmlHelper.cs


示例4: Command

 public Command(string identifier, string value, StatementType statementType, MetaData<IMeta> metaData, bool rcon)
     : base(statementType, metaData)
 {
     Identifier = identifier;
     Value = value;
     RCON = rcon;
 }
开发者ID:keithharvey,项目名称:Script-Parser,代码行数:7,代码来源:Command.cs


示例5: GetMetaData

    public static MetaData GetMetaData(string text)
    {
        Hashtable table = text.hashtableFromJson();
        MetaData meta = new MetaData((Hashtable)table["meta"]);

        return meta;
    }
开发者ID:unigame,项目名称:TexturePackerImporter,代码行数:7,代码来源:TexturePacker.cs


示例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 });
     }
 }
开发者ID:soukoku,项目名称:MExplorer,代码行数:8,代码来源:Util.cs


示例7: MapObject

 protected MapObject(long id)
 {
     ID = id;
     Visgroups = new List<int>();
     AutoVisgroups = new List<int>();
     Children = new Dictionary<long, MapObject>();
     MetaData = new MetaData();
 }
开发者ID:KonstantinUb,项目名称:sledge,代码行数:8,代码来源:MapObject.cs


示例8: ItemVM

 public ItemVM(IItemProvider provider, ContainerVM parent, string name, bool canRename)
 {
     Provider = provider;
     Parent = parent;
     _name = name;
     CanRename = canRename;
     MetaData = new MetaData();
 }
开发者ID:soukoku,项目名称:MExplorer,代码行数:8,代码来源:ItemVM.cs


示例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;
     }
 }
开发者ID:PushkinTyt,项目名称:Chat,代码行数:10,代码来源:DispatcherClient.cs


示例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;
 }
开发者ID:haibocheng,项目名称:Sky,代码行数:10,代码来源:MetaTag.cs


示例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));
        }
开发者ID:wjeon,项目名称:TinyFakeDataRecord,代码行数:11,代码来源:MetaDataTests.cs


示例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);
                }
            }
        }
开发者ID:ahugh,项目名称:Zune-Social-Tagger,代码行数:13,代码来源:ZuneWMATagContainer.cs


示例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);
		}
开发者ID:EmilZhou,项目名称:dnlib,代码行数:19,代码来源:PdbWriter.cs


示例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" }
                };
        }
开发者ID:wjeon,项目名称:TinyFakeDataRecord,代码行数:14,代码来源:FakeDataRecordsTests.cs


示例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;
     }
 }
开发者ID:sr55,项目名称:HandBrake,代码行数:16,代码来源:MetaData.cs


示例16: ReconstructQuestion

        public Question ReconstructQuestion(QB qb, MetaData meta)
        {
            Question question = new Question();

            question.QuestionID = qb.QuestionID;
            question.Category = CategoryRepository.Find(qb.CategoryID);
            question.Source = qb.Source;
            question.CreatedUserName = qb.CrUserName;
            question.CreatedTime = qb.CrTime;
            if (meta != null)
            {
                question.Meta = meta;
            }

            return question;
        }
开发者ID:ningliaoyuan,项目名称:Antaeus,代码行数:16,代码来源:QuestionFactory.cs


示例17: ParseThread

        private static MetaData ParseThread(string path)
        {
            if (!Directory.Exists(path))
                throw new MetaParseException("Directory not found: {0}", path);

            MetaData meta = new MetaData();
            meta.Type = MetaType.Directory;
            meta.Path = path;
            //meta.Data = new Dictionary<MetaKey, object>();
            //meta.Data[MetaKey.FileName] = Path.GetFileName(path);
            //meta.Data[MetaKey.OriginalName] = meta.Data[MetaKey.FileName];
            //meta.Data[MetaKey.Size] = GetFileSize(path);
            //meta.Data[MetaKey.Date] = File.GetCreationTime(path);
            //meta.Data[MetaKey.Tags] = new string[0];
            return meta;
        }
开发者ID:RiJo,项目名称:ExifOrganizer,代码行数:16,代码来源:DirectoryParser.cs


示例18: CreateQuestion

        public Result CreateQuestion(string categoryIDString, string source , string userName,MetaData meta, out Question question)
        {
            var qd = QuestionRepository.QuestionFactory.CreateQuestion(categoryIDString, source, userName, meta);

            var res = QuestionRepository.Insert(qd);

            if (res.IsSuccess)
            {
                question = qd;
            }
            else
            {
                question = null;
            }

            return res;
        }
开发者ID:ningliaoyuan,项目名称:Antaeus,代码行数:17,代码来源:QuestionModel.cs


示例19: CreateQuestion

        public Question CreateQuestion(string categoryIDString, string source, string userName, MetaData meta)
        {
            long categoryID = Convert.ToInt64(categoryIDString);
            var category = CategoryRepository.Find(categoryID);

            Question question = new Question();
            question.QuestionID = IDProvider.GetNewId("QuestionID");
            question.CreatedTime = TimeProvider.Now;
            question.CreatedUserName = userName;
            question.Category = category;
            question.Source = source;

            meta.AlterWiki("Answer", userName, new KEYID("QuestionAnswer", question.QuestionID));

            question.Meta = meta;

            return question;
        }
开发者ID:ningliaoyuan,项目名称:Antaeus,代码行数:18,代码来源:QuestionFactory.cs


示例20: ParseThread

        private static MetaData ParseThread(string filename, MetaType type)
        {
            if (!File.Exists(filename))
                throw new MetaParseException("File not found: {0}", filename);

            MetaData meta = new MetaData();
            meta.Type = type;
            meta.Path = filename;
            meta.Data = new Dictionary<MetaKey, object>();
            meta.Data[MetaKey.FileName] = Path.GetFileName(filename);
            meta.Data[MetaKey.OriginalName] = meta.Data[MetaKey.FileName];
            meta.Data[MetaKey.Size] = GetFileSize(filename);
            meta.Data[MetaKey.DateCreated] = File.GetCreationTime(filename);
            meta.Data[MetaKey.DateModified] = File.GetLastWriteTime(filename);
            meta.Data[MetaKey.Timestamp] = meta.Data[MetaKey.DateModified];
            meta.Data[MetaKey.Tags] = new string[0];
            return meta;
        }
开发者ID:RiJo,项目名称:ExifOrganizer,代码行数:18,代码来源:GenericFileParser.cs



注:本文中的MetaData类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# MetaMetadataCompositeField类代码示例发布时间:2022-05-24
下一篇:
C# MetaBuilders类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap