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

C# Serialization类代码示例

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

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



Serialization类属于命名空间,在下文中一共展示了Serialization类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: WrappedSerializer

		internal WrappedSerializer(Serialization.DataFormat dataFormat, string streamName, TextWriter output) : base(dataFormat, streamName)
		{
			this.firstCall = true;
			this.textWriter = output;
			Serialization.DataFormat dataFormat1 = this.format;
			switch (dataFormat1)
			{
				case Serialization.DataFormat.Text:
				{
					return;
				}
				case Serialization.DataFormat.XML:
				{
					XmlWriterSettings xmlWriterSetting = new XmlWriterSettings();
					xmlWriterSetting.CheckCharacters = false;
					xmlWriterSetting.OmitXmlDeclaration = true;
					this.xmlWriter = XmlWriter.Create(this.textWriter, xmlWriterSetting);
					this.xmlSerializer = new Serializer(this.xmlWriter);
					return;
				}
				default:
				{
					return;
				}
			}
		}
开发者ID:nickchal,项目名称:pash,代码行数:26,代码来源:WrappedSerializer.cs


示例2: WriteInstance

		public override void WriteInstance( Serialization.MaterialSerializer ser, SubRenderState subRenderState,
		                                    Graphics.Pass srcPass, Graphics.Pass dstPass )
		{
			//TODO
			//ser.WriteAttribute(4, "transform_stage");
			//ser.WriteValue("ffp");
		}
开发者ID:ryan-bunker,项目名称:axiom3d,代码行数:7,代码来源:FFPTransformFactory.cs


示例3: ObjectReferencePropertyTemplate

        public ObjectReferencePropertyTemplate(Arebis.CodeGeneration.IGenerationHost _host, IZetboxContext ctx, Serialization.SerializationMembersList serializationList, string moduleNamespace, string ownInterface, string name, string implName, string eventName, string fkBackingName, string fkGuidBackingName, string referencedInterface, string referencedImplementation, string associationName, string targetRoleName, string positionPropertyName, string inverseNavigatorName, bool inverseNavigatorIsList, bool eagerLoading, bool relDataTypeExportable, bool callGetterSetterEvents, bool isCalculated, bool disableExport)
            : base(_host)
        {
			this.ctx = ctx;
			this.serializationList = serializationList;
			this.moduleNamespace = moduleNamespace;
			this.ownInterface = ownInterface;
			this.name = name;
			this.implName = implName;
			this.eventName = eventName;
			this.fkBackingName = fkBackingName;
			this.fkGuidBackingName = fkGuidBackingName;
			this.referencedInterface = referencedInterface;
			this.referencedImplementation = referencedImplementation;
			this.associationName = associationName;
			this.targetRoleName = targetRoleName;
			this.positionPropertyName = positionPropertyName;
			this.inverseNavigatorName = inverseNavigatorName;
			this.inverseNavigatorIsList = inverseNavigatorIsList;
			this.eagerLoading = eagerLoading;
			this.relDataTypeExportable = relDataTypeExportable;
			this.callGetterSetterEvents = callGetterSetterEvents;
			this.isCalculated = isCalculated;
			this.disableExport = disableExport;

        }
开发者ID:jrgcubano,项目名称:zetbox,代码行数:26,代码来源:ObjectReferencePropertyTemplate.Designer.cs


示例4: Override

 /// <summary>
 /// Overrides the existing values
 /// </summary>
 /// <param name="declaration"></param>
 public void Override(Serialization.StyleDeclaration declaration)
 {
     foreach (StyleProperty property in _styleSheetDeclaration.Properties)
     {
         _cached[property.Name] = property.Value;
     }
 }
开发者ID:groov0v,项目名称:edriven-gui,代码行数:11,代码来源:StyleSheetValuesFactory.cs


示例5: Call

        private static void Call(Arebis.CodeGeneration.IGenerationHost host,
            IZetboxContext ctx,
            Serialization.SerializationMembersList serializationList,
            Property prop, bool hasPersistentOrder, bool isList,
            string collectionWrapperClass,
            string listWrapperClass)
        {
            if (prop == null) { throw new ArgumentNullException("prop"); }
            if (!isList) { throw new ArgumentOutOfRangeException("prop", "prop must be a List-valued property"); }

            string name = prop.Name;
            string backingName = "_" + name;
            string backingCollectionType = (hasPersistentOrder ? listWrapperClass : collectionWrapperClass);

            string exposedCollectionInterface = hasPersistentOrder ? "IList" : "ICollection";

            string thisInterface = prop.ObjectClass.Name;
            string referencedType = prop.GetElementTypeString();
            string referencedCollectionEntry = prop.GetCollectionEntryFullName();
            string referencedCollectionEntryImpl = referencedCollectionEntry + host.Settings["extrasuffix"] + Zetbox.API.Helper.ImplementationSuffix;

            string providerCollectionType = "ObservableCollection<" + referencedCollectionEntryImpl + ">";
            string underlyingCollectionName = "_" + name + "Collection";

            string moduleNamespace = prop.Module.Namespace;

            Call(
                host, ctx, serializationList,
                name, backingName, backingCollectionType, exposedCollectionInterface,
                thisInterface, referencedType,
                referencedCollectionEntry, referencedCollectionEntryImpl,
                providerCollectionType, underlyingCollectionName, !hasPersistentOrder,
                moduleNamespace,
                prop.DisableExport == true);
        }
开发者ID:daszat,项目名称:zetbox,代码行数:35,代码来源:ValueCollectionProperty.cs


示例6: InternalNetSerialize

        private void InternalNetSerialize(Serialization.CrySerialize serialize, int aspect, byte profile, int flags)
        {
            // var serialize = new Serialization.CrySerialize();
            //serialize.Handle = handle;

            NetSerialize(serialize, aspect, profile, flags);
        }
开发者ID:jbjhjm,项目名称:legendsofdrakan,代码行数:7,代码来源:Actor.cs


示例7: Main

        public static void Main(string[] args)
        {
            var twitterops = new TwitterOperations();
            var gui = new MainWindow();
            var ironmq = new IronMQOperations("AppZwitschern", TokenRepository.LoadFrom("ironmq.credentials.txt"));
            var serialisieren = new Serialization<Versandauftrag>();
            var urlShortener = new TinyUrlOperations();
            var compressor = new TextCompressor();

            FlowRuntimeConfiguration.SynchronizationFactory = () => new SyncWithWPFDispatcher();

            var config = new FlowRuntimeConfiguration()
                .AddStreamsFrom("az.application.flows.flow", Assembly.GetExecutingAssembly())
                .AddFunc<Versandauftrag, Versandauftrag>("versandauftrag_schnueren", twitterops.Versandauftrag_um_access_token_erweitern)
                .AddFunc<Versandauftrag, string>("serialisieren", serialisieren.Serialize)
                .AddAction<string>("enqueue", ironmq.Enqueue, true)
                .AddFunc<string, string[]>("extract_urls", compressor.Extract_Urls)
                .AddFunc<Tuple<string, Tuple<string,string>[]>,string>("replace_urls", compressor.Replace_Urls)
                .AddFunc<IEnumerable<string>, Tuple<String,string>[]>("shorten_urls", urlShortener.ShortenMany)
                .AddOperation(new AutoResetJoin<string, Tuple<string,string>[]>("join"))
                .AddOperation(new Throttle("throttle", 1000))
                .AddAction<string>("display_shortened_text", gui.ShortenedText).MakeSync()
                .AddAction("versandstatus_anzeigen", () => gui.Versandstatus("Versendet!")).MakeSync();

            using (var fr = new FlowRuntime(config)) {
                fr.UnhandledException += ex => MessageBox.Show(ex.InnerException.Message);
                fr.Message += Console.WriteLine;

                gui.Versenden += fr.CreateEventProcessor<Versandauftrag>(".versenden");
                gui.ShortenText += fr.CreateEventProcessor<string>(".shortenText");

                var app = new Application { MainWindow = gui };
                app.Run(gui);
            }
        }
开发者ID:ralfw,项目名称:appzwitschern,代码行数:35,代码来源:Program.cs


示例8: InternalFullSerialize

        private void InternalFullSerialize(Serialization.CrySerialize serialize)
        {
            //var serialize = new Serialization.CrySerialize();
            //serialize.Handle = handle;

            FullSerialize(serialize);
        }
开发者ID:jbjhjm,项目名称:legendsofdrakan,代码行数:7,代码来源:Actor.cs


示例9: WrappedDeserializer

		internal WrappedDeserializer(Serialization.DataFormat dataFormat, string streamName, TextReader input) : base(dataFormat, streamName)
		{
			if (dataFormat != Serialization.DataFormat.None)
			{
				this.textReader = input;
				this.firstLine = this.textReader.ReadLine();
				if (string.Compare(this.firstLine, Serialization.XmlCliTag, StringComparison.OrdinalIgnoreCase) == 0)
				{
					dataFormat = Serialization.DataFormat.XML;
				}
				Serialization.DataFormat dataFormat1 = this.format;
				switch (dataFormat1)
				{
					case Serialization.DataFormat.Text:
					{
						return;
					}
					case Serialization.DataFormat.XML:
					{
						this.xmlReader = XmlReader.Create(this.textReader);
						this.xmlDeserializer = new Deserializer(this.xmlReader);
						return;
					}
					default:
					{
						return;
					}
				}
			}
			else
			{
				return;
			}
		}
开发者ID:nickchal,项目名称:pash,代码行数:34,代码来源:WrappedDeserializer.cs


示例10: AddSerialization

 protected override void AddSerialization(Serialization.SerializationMembersList list, string name)
 {
     if (list != null)
     {
         if (HasDefaultValue)
         {
             list.Add("Serialization.SimplePropertyWithDefaultSerialization",
                 disableExport ? Templates.Serialization.SerializerType.Binary : Serialization.SerializerType.All,
                 _prop.Module.Namespace,
                 name,
                 type,
                 backingName,
                 IsSetFlagName);
         }
         else
         {
             list.Add("Serialization.SimplePropertySerialization",
                 disableExport ? Serialization.SerializerType.Binary : Serialization.SerializerType.All,
                 _prop.Module.Namespace,
                 name,
                 type,
                 backingName);
         }
     }
 }
开发者ID:jrgcubano,项目名称:zetbox,代码行数:25,代码来源:NotifyingDataProperty.cs


示例11: Read

        public override string Read(Serialization.ISerializer serializer)
        {
            if (serializer.GetType() == typeof(Arch.CFramework.AppInternals.Serialization.XMLSerializer))
            {
                XmlDocument xml = new XmlDocument();
                xml.AppendChild(xml.CreateXmlDeclaration("1.0", Encoding.UTF8.BodyName, null));
                var node = xml.CreateElement("HealthCheck");
                xml.AppendChild(node);
                var node1 = xml.CreateElement("Healthies");
                node.AppendChild(node1);
                foreach (var hcb in list.ToList())
                {
                    var n = xml.CreateElement(hcb.GetType().Name);
                    node1.AppendChild(n);
                    var n1 = xml.CreateElement("IsHealthy");
                    n1.InnerText = hcb.Healthy.IsHealthy.ToString();
                    n.AppendChild(n1);
                    n1 = xml.CreateElement("Message");
                    n1.InnerText = hcb.Healthy.Message;
                    n.AppendChild(n1);
                    n1 = xml.CreateElement("Error");
                    if (hcb.Healthy.Error != null)
                        n1.InnerText = hcb.Healthy.Error.ToString();
                    else
                        n1.InnerText = string.Empty;
                    n.AppendChild(n1);
                }

                return xml.OuterXml;
            }
            return base.Read(serializer);
        }
开发者ID:felix-tien,项目名称:TechLab,代码行数:32,代码来源:HealthCheck.cs


示例12: OnSetState

 protected override void OnSetState(Serialization.Mobile.SerializationInfo info, Core.StateMode mode)
 {
   base.OnSetState(info, mode);
   Name = info.GetValue<string>("SilverlightPrincipal.Criteria.Name");
   Password = info.GetValue<string>("SilverlightPrincipal.Criteria.Password");
   ProviderType = info.GetValue<string>("SilverlightPrincipal.Criteria.ProviderType");
 }
开发者ID:nschonni,项目名称:csla-svn,代码行数:7,代码来源:SilverlightPrincipal.cs


示例13: OnGetState

 protected override void OnGetState(Serialization.Mobile.SerializationInfo info, Core.StateMode mode)
 {
   info.AddValue("SilverlightPrincipal.Criteria.Name", Name);
   info.AddValue("SilverlightPrincipal.Criteria.Password", Password);
   info.AddValue("SilverlightPrincipal.Criteria.ProviderType", ProviderType);
   base.OnGetState(info, mode);
 }
开发者ID:nschonni,项目名称:csla-svn,代码行数:7,代码来源:SilverlightPrincipal.cs


示例14: AddSerialization

 protected virtual void AddSerialization(Serialization.SerializationMembersList list, string underlyingCollectionName)
 {
     if (list != null)
     {
         Serialization.CollectionSerialization.Add(list, ctx, moduleNamespace, name, underlyingCollectionName, orderByValue, disableExport);
     }
 }
开发者ID:daszat,项目名称:zetbox,代码行数:7,代码来源:ValueCollectionProperty.cs


示例15: Call

        public static void Call(Arebis.CodeGeneration.IGenerationHost host,
            IZetboxContext ctx, Serialization.SerializationMembersList serializationList, Property prop)
        {
            if (host == null) { throw new ArgumentNullException("host"); }

            host.CallTemplate("Properties.NotifyingDataProperty",
                ctx, serializationList, prop);
        }
开发者ID:jrgcubano,项目名称:zetbox,代码行数:8,代码来源:NotifyingDataProperty.cs


示例16: ReadIndexHierarchyXml

 public static AHPIndexHierarchy ReadIndexHierarchyXml()
 {
     AHPIndexHierarchy TunnelHealIndex = new AHPIndexHierarchy();
     Serialization<AHPIndexHierarchy> Xml2AHPIndex = new Serialization<AHPIndexHierarchy>();
     TunnelHealIndex = Xml2AHPIndex.XMLDeserialization(_hierarchyFilePath);
     SetAhpParent(TunnelHealIndex);
     return TunnelHealIndex;
 }
开发者ID:zeuscn,项目名称:ShieldTunnelHealthEvaluation,代码行数:8,代码来源:XMLIO.cs


示例17: PersistenceManager_CurrentTreeChanged

 private void PersistenceManager_CurrentTreeChanged(Serialization.PersistenceManager manager, Serialization.PersistentTree oldTree, Serialization.PersistentTree newTree)
 {
     if (newTree != null)
     {
         Tab tab = mainForm.EditorTabs.FindTab(newTree);
         mainForm.EditorTabs.SelectedTab = tab;
     }
 }
开发者ID:umaranis,项目名称:MindMate,代码行数:8,代码来源:TabController.cs


示例18: Call

        public static void Call(Arebis.CodeGeneration.IGenerationHost host,
          IZetboxContext ctx, Serialization.SerializationMembersList serializationList, string backingName)
        {
            if (host == null) { throw new ArgumentNullException("host"); }

            host.CallTemplate("Properties.ExportGuidProperty",
                ctx, serializationList, backingName);
        }
开发者ID:daszat,项目名称:zetbox,代码行数:8,代码来源:ExportGuidProperty.cs


示例19: SerializeInfo

 public void SerializeInfo()
 {
     using (var conn = new NpgsqlConnection("Server=127.0.0.1;Port=5432;Database=sakila;User Id=test;Password=test;"))
     {
         conn.Open();
         var s = new Serialization();
         s.Serialize(conn);
     }
 }
开发者ID:wallymathieu,项目名称:mejram,代码行数:9,代码来源:DataObjects.cs


示例20: ObjectListProperty

 public ObjectListProperty(Arebis.CodeGeneration.IGenerationHost host,
     IZetboxContext ctx,
     Serialization.SerializationMembersList serializationList,
     Relation rel,
     RelationEndRole endRole)
     : this(host, ctx, serializationList, "name", "wrapperName", "wrapperClass", "exposedListType",
         rel, endRole, "positionPropertyName", "otherName", "referencedInterface")
 {
 }
开发者ID:daszat,项目名称:zetbox,代码行数:9,代码来源:ObjectListProperty.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# SerializationContext类代码示例发布时间:2022-05-24
下一篇:
C# SerializableFile类代码示例发布时间: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