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

C# CompositeType类代码示例

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

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



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

示例1: DoWork

 public List<CompositeType> DoWork()
 {
     comm_sqlDataContext mylinq = new comm_sqlDataContext();
         ISingleResult<adrbook> bb = mylinq.getdata();
         var peoples = new List<CompositeType> ();
         foreach (adrbook cast in bb)
         {
             CompositeType p = new CompositeType();
             p.Lid= cast.id;
             p.Ltype = cast.type;
             p.Lsubtype = cast.subtype;
             p.Llastname = cast.lastname;
             p.Lfirstname = cast.firstname;
             p.Lmiddlename = cast.middlename;
             p.Lpost = cast.post;
             p.Lemail1 = cast.email1;
             p.Lemail2 = cast.email2;
             p.Lroom = cast.room;
             p.Lphone1 = cast.phone1;
             p.Lphone2 = cast.phone2;
             p.Lphone3 = cast.phone3;
             peoples.Add(p);
         }
         return peoples;
 }
开发者ID:kreeeeg,项目名称:site,代码行数:25,代码来源:Service1.cs


示例2: CreateMock

		public override object CreateMock(MockFactory mockFactory, CompositeType typesToMock, string name, MockStyle mockStyle, object[] constructorArgs)
		{
			if (typesToMock == null)
				throw new ArgumentNullException("typesToMock");

			Type primaryType = typesToMock.PrimaryType;
			Type[] additionalInterfaces = BuildAdditionalTypeArrayForProxyType(typesToMock);
			IInterceptor mockInterceptor = new MockObjectInterceptor(mockFactory, typesToMock, name, mockStyle);
			object result;

			/* ^ */ var _typeInfo = primaryType.GetTypeInfo(); /* [email protected] ^ */

			if (/* ^ */ _typeInfo.IsInterface /* [email protected] ^ */)
			{
				result = generator.CreateInterfaceProxyWithoutTarget(primaryType, additionalInterfaces, new ProxyGenerationOptions {BaseTypeForInterfaceProxy = typeof (InterfaceMockBase)}, mockInterceptor);
				((InterfaceMockBase) result).Name = name;
			}
			else
			{
				result = generator.CreateClassProxy(primaryType, additionalInterfaces, ProxyGenerationOptions.Default, constructorArgs, mockInterceptor);
				//return generator.CreateClassProxy(primaryType, new []{typeof(IMockObject)}, mockInterceptor);
			}

			return result;
		}
开发者ID:textmetal,项目名称:main,代码行数:25,代码来源:DynamicProxyMockObjectFactory.cs


示例3: TestConstructorFailureNullItemNames

 public void TestConstructorFailureNullItemNames()
 {
     CompositeType type = new CompositeType("TypeName", "TypeDescription",
     new string[] {"ItemName1", null},
     new string[] {"ItemDescr1", "ItemDescr2"},
     new OpenType[] { SimpleType.Integer, SimpleType.Double});
 }
开发者ID:SzymonPobiega,项目名称:NetMX,代码行数:7,代码来源:CompositeTypeTests.cs


示例4: MockObject

 protected MockObject(CompositeType mockedType, string name, IExpectationCollector expectationCollector, IInvocationListener invocationListener)
 {
     this.name = name;
     this.invocationListener = invocationListener;
     this.expectationCollector = expectationCollector;
     mockedTypes = mockedType;
 }
开发者ID:isaiah-perumalla,项目名称:NMocha,代码行数:7,代码来源:MockObject.cs


示例5: MethodReference

 public MethodReference(CompositeType owner, string name, Prototype prototype)
     : this()
 {
     Owner = owner;
     Name = name;
     Prototype = prototype;
 }
开发者ID:Xtremrules,项目名称:dot42,代码行数:7,代码来源:MethodReference.cs


示例6: MockObject

		/// <summary>
		/// Initializes a new instance of the <see cref="MockObject"/> class.
		/// </summary>
		/// <param name="mockFactory">The mockFactory.</param>
		/// <param name="mockedType">Type of the mocked.</param>
		/// <param name="name">The name.</param>
		/// <param name="mockStyle">The mock style.</param>
		protected MockObject(MockFactory mockFactory, CompositeType mockedType, string name, MockStyle mockStyle)
		{
			MockFactory = mockFactory;
			MockStyle = mockStyle;
			MockName = name;
			eventHandlers = new Dictionary<string, List<Delegate>>();
			MockedTypes = mockedType;
		}
开发者ID:textmetal,项目名称:main,代码行数:15,代码来源:MockObject.cs


示例7: GetDataUsingDataContract

 public CompositeType GetDataUsingDataContract(CompositeType composite)
 {
   if (composite.BoolValue)
   {
     composite.StringValue += "Suffix";
   }
   return composite;
 }
开发者ID:RainsSoft,项目名称:UJad-AI-VFS,代码行数:8,代码来源:Service1.cs


示例8: DisplayMessage

 public void DisplayMessage(CompositeType composite)
 {
     string username = composite.Username ?? "";
     string message = composite.Message ?? "";
     // Dispatcher is here to take care of threads ownership over UI components
     Dispatcher.Invoke(() =>
     {
         ChatHistory.Text += (username + ": " + message + Environment.NewLine);
     });
 }
开发者ID:tortila,项目名称:quirc,代码行数:10,代码来源:ChatGrid.xaml.cs


示例9: GetDataUsingDataContract

    public CompositeType GetDataUsingDataContract(CompositeType composite)
    {
        Console.WriteLine(String.Format("GetDataUsingDataContract(Composite({0}, {1})", composite.BoolValue, composite.StringValue));

        if (composite.BoolValue)
        {
            composite.StringValue += "Suffix";
        }
        return composite;
    }
开发者ID:oletsaca,项目名称:outbound,代码行数:10,代码来源:Service.cs


示例10: GetDataUsingDataContract

 public CompositeType GetDataUsingDataContract(CompositeType composite)
 {
     if (composite == null) {
         throw new ArgumentNullException("composite");
     }
     if (composite.BoolValue) {
         composite.StringValue += "Suffix";
     }
     return composite;
 }
开发者ID:jdaigle,项目名称:WCFPlayground,代码行数:10,代码来源:Service1.cs


示例11: Ws2007HttpBindingTest

        public void Ws2007HttpBindingTest()
        {
            using (var client = new ServiceClient("Ws2007HttpEndpoint"))
            {
                var input = new CompositeType { BoolValue = true, StringValue = "Hello, world!" };
                var result = client.GetDataUsingDataContract(input);

                Assert.AreEqual<string>(input.StringValue + "Suffix", result.StringValue);
                Assert.AreEqual<bool>(input.BoolValue, result.BoolValue);
            }
        }
开发者ID:patkovskyi,项目名称:WcfPlayground,代码行数:11,代码来源:GetDataUsingDataContractTests.cs


示例12: LoadFile

        public void LoadFile(string filename)
        {
            XmlDocument document = new XmlDocument();
            document.Load(filename);

            XmlNode compositeNode = document.SelectSingleNode(CompositeXPath);
            string rootNamespace = GetNodeValue(compositeNode, "@rootNamespace");
            RootNamespace = rootNamespace;

            XmlNodeList types = document.SelectNodes(TypesXPath);
            foreach (XmlNode typeNode in types)
            {
                string typeName = GetNodeValue(typeNode, "@name");
                string className = GetNodeValue(typeNode, "@className");
                string theNamespace = GetNodeValue(typeNode, "@namespace");
                if (!Namespaces.Contains(theNamespace))
                {
                    Namespaces.Add(theNamespace);
                }
                CompositeType compositeType = new CompositeType(typeName, className, theNamespace);

                Type foundType = FindType(className, theNamespace);

                foreach (PropertyInfo pi in foundType.GetProperties())
                {
                    if (pi.CanRead && pi.CanWrite)
                    {
                        CompositeProperty property = new CompositeProperty(typeName, pi.Name, pi.PropertyType);
                        compositeType.Properties.Add(property);
                    }
                }

                XmlNodeList hiddenNodes = typeNode.SelectNodes(PropertiesXPath);
                foreach (XmlNode propertyNode in hiddenNodes)
                {
                    string propertyName = GetNodeValue(propertyNode, "@name");
                    string alias = GetNodeValue(propertyNode, "@alias");
                    bool isReadOnly = GetBooleanNodeValue(propertyNode, "@isReadOnly");
                    bool isHidden = GetBooleanNodeValue(propertyNode, "@isHidden");

                    CompositeProperty property = compositeType.Properties.FindCompositeProperty(typeName, propertyName);

                    if (property != null)
                    {
                        if (!String.IsNullOrEmpty(alias))
                        {
                            property.Alias = alias;
                        }
                        property.IsReadOnly = isReadOnly;
                        property.IsHidden = isHidden;
                    }
                }
            }
        }
开发者ID:Mickey-P,项目名称:SmallSharpToolsDotNet,代码行数:54,代码来源:CompositeClass.cs


示例13: JavaBytes_To_CompositeType_WithHints

        public void JavaBytes_To_CompositeType_WithHints()
        {
            // arrange

            // act
            var actual = new CompositeType();
            actual.ComponentTypeHints = _compositeType.Select(t => t.GetType()).ToList();
            actual.SetValueFromBigEndian(_javaByteOrder);

            // assert
            Assert.True(_compositeType.SequenceEqual((CassandraObject[])actual));
        }
开发者ID:bjuris,项目名称:fluentcassandra,代码行数:12,代码来源:CompositeTypeTest.cs


示例14: JavaBytes_To_CompositeType

        public void JavaBytes_To_CompositeType()
        {
            // arrange
            var expected = new CassandraObject[] { (BytesType)_compositeType[0].GetValue<string>(), (BytesType)_compositeType[1].GetValue<long>() };

            // act
            var actual = new CompositeType();
            actual.SetValueFromBigEndian(_javaByteOrder);

            // assert
            Assert.True(expected.SequenceEqual((CassandraObject[])actual));
        }
开发者ID:bjuris,项目名称:fluentcassandra,代码行数:12,代码来源:CompositeTypeTest.cs


示例15: GetCompositeType

 private async void GetCompositeType()
 {
     var serviceClient = new CompositeTypeServiceClient();
     
     var arg = new CompositeType
     {
         StringValue = StringRequest,
     };
     
     var res = await serviceClient.CompositeTypeAsync(arg);
     
     StringResponce = res.StringValue;
 }
开发者ID:Whylex,项目名称:ikit-mita-materials,代码行数:13,代码来源:MainWindowViewModel.cs


示例16: Save_CompositeType

        public void Save_CompositeType()
        {
            // arrange
            var family = _db.GetColumnFamily(FamilyName);
            var expected = new CompositeType<LongType, UTF8Type>(300L, "string1");

            // act
            family.InsertColumn(TestKey, expected, Math.PI);
            var value = family.Get(TestKey).Execute();
            var actual = value.FirstOrDefault().Columns.FirstOrDefault();

            // assert
            Assert.AreEqual((object)expected, (object)actual.ColumnName);
        }
开发者ID:bjuris,项目名称:fluentcassandra,代码行数:14,代码来源:CompositeTypeTest.cs


示例17: CreateGetDataUsingDataContractRequest

     private string CreateGetDataUsingDataContractRequest(CompositeType composite)
     {
         return String.Format(@"<?xml version=""1.0"" encoding=""utf-8""?>
 <s:Envelope xmlns:s=""http://schemas.xmlsoap.org/soap/envelope/"">
     <s:Body>
         <GetDataUsingDataContract xmlns=""http://tempuri.org/"">
             <composite xmlns:d4p1=""http://schemas.datacontract.org/2004/07/AppWithWCF"" xmlns:i=""http://www.w3.org/2001/XMLSchema-instance"">
                 <d4p1:BoolValue>{0}</d4p1:BoolValue>
                 <d4p1:StringValue>{1}</d4p1:StringValue>
              </composite>
         </GetDataUsingDataContract>
     </s:Body>
 </s:Envelope>", composite.BoolValue.ToString().ToLower(), composite.StringValue);
     }
开发者ID:ylemsoul,项目名称:XamarinWithWCF,代码行数:14,代码来源:Service1Client.cs


示例18: SaveCompositeType

        public void SaveCompositeType()
        {
            CompositeType value = new CompositeType();
            value.Foo = "foobar";
            value.Bar.A = 5;
            value.Bar.B = 10;
            value.Bar.C = "hello \"world\"!";

            Dom dom = Dom.Serialise(value);

            string output = dom.Save();
            string expected = "SaveTest+CompositeType {\n  Foo: String \"foobar\",\n  Bar: SaveTest+NonParsable {\n    A: Int32 \"5\",\n    B: Single \"10\",\n    C: String \"hello \\\"world\\\"!\",\n    D: null\n  }\n}";

            Assert.AreEqual(expected, output);
        }
开发者ID:Quantumplation,项目名称:Myre,代码行数:15,代码来源:SaveTest.cs


示例19: CreateMock

		public override object CreateMock(MockFactory mockFactory, CompositeType typesToMock, string name, MockStyle mockStyle, object[] constructorArgs)
		{
			_typesToMock = typesToMock;

			_typesToMock.Add(typeof(IMockObject));

			var reflectiveInterceptor = new ReflectiveInterceptor(mockFactory, typesToMock, name, mockStyle);

			var proxy = CreateMock(reflectiveInterceptor, constructorArgs);

			if (_typesToMock.PrimaryType.IsInterface)
				((InterfaceMockBase) proxy).Name = name;

			return proxy;
		}
开发者ID:textmetal,项目名称:main,代码行数:15,代码来源:ReflectiveMockObjectFactory.cs


示例20: GetDataUsingDataContract

 public async Task<CompositeType> GetDataUsingDataContract(CompositeType composite)
 {
     var soapString = this.CreateGetDataUsingDataContractRequest(composite);
     using (var client = new HttpClient())
     {
         client.DefaultRequestHeaders.Add("SOAPAction", "http://tempuri.org/IService1/GetDataUsingDataContract");
         var content = new StringContent(soapString, Encoding.UTF8, "text/xml");
         using (var response = await client.PostAsync(this.uri, content))
         {
             string soapResponse = await response.Content.ReadAsStringAsync();
             CompositeType result = this.ParseGetDataUsingDataContractResponse(soapResponse);
             return result;
         }
     }
 }
开发者ID:ylemsoul,项目名称:XamarinWithWCF,代码行数:15,代码来源:Service1Client.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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