当前位置: 首页>>代码示例>>C#>>正文


C# CompositeType类代码示例

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


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


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