本文整理汇总了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;
}
示例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;
}
示例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});
}
示例4: MockObject
protected MockObject(CompositeType mockedType, string name, IExpectationCollector expectationCollector, IInvocationListener invocationListener)
{
this.name = name;
this.invocationListener = invocationListener;
this.expectationCollector = expectationCollector;
mockedTypes = mockedType;
}
示例5: MethodReference
public MethodReference(CompositeType owner, string name, Prototype prototype)
: this()
{
Owner = owner;
Name = name;
Prototype = prototype;
}
示例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;
}
示例7: GetDataUsingDataContract
public CompositeType GetDataUsingDataContract(CompositeType composite)
{
if (composite.BoolValue)
{
composite.StringValue += "Suffix";
}
return composite;
}
示例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);
});
}
示例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;
}
示例10: GetDataUsingDataContract
public CompositeType GetDataUsingDataContract(CompositeType composite)
{
if (composite == null) {
throw new ArgumentNullException("composite");
}
if (composite.BoolValue) {
composite.StringValue += "Suffix";
}
return composite;
}
示例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);
}
}
示例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;
}
}
}
}
示例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));
}
示例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));
}
示例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;
}