예제 #1
0
파일: test-15.cs 프로젝트: kdoman21/mono
	public static int Main ()
	{
		Iface iface;
		Implementor i = new Implementor ();

		iface = i;
		if (iface.A () != 1)
			return 1;

		StructImplementor s = new StructImplementor ();
		Iface xiface = (Iface) s;
		if (xiface.A () != 2)
			return 2;
		
		return 0;
	}
예제 #2
0
	public static int Main ()
	{
		Iface iface;
		Implementor i = new Implementor ();

		iface = i;
		if (iface.A () != 1)
			return 1;

		StructImplementor s = new StructImplementor ();
		Iface xiface = (Iface) s;
		if (xiface.A () != 2)
			return 2;
		
		Console.WriteLine("passed");
		return 0;
	}
예제 #3
0
 public Abstraction()
 {
     this.implementor = Implementation.GetImplementation();
 }
 public abstract void SetImplementor(Implementor implementor);
예제 #5
0
 /// <summary>
 /// Deserialize an object from an XmlReader and return it strongly-typed
 /// </summary>
 /// <typeparam name="T">The type to deserialize into</typeparam>
 /// <param name="reader">An XmlReader that will read the XML from which to deserialize</param>
 /// <returns>The deserialized object</returns>
 public static T DeserializeFromXmlReader <T>(XmlReader reader)
 {
     return(Implementor <T> .Deserialize(reader));
 }
예제 #6
0
 /// <summary>
 /// Deserialize an object from a string and return it
 /// </summary>
 /// <param name="resultType">The type to deserialize into</typeparam>
 /// <param name="xmlString">A string containing the XML from which to deserialize</param>
 /// <returns>The deserialized object</returns>
 public static object DeserializeFromString(string xmlString, Type resultType)
 {
     using (var sr = new StringReader(xmlString))
         using (var reader = XmlReader.Create(sr))
             return(Implementor.Deserialize(reader, resultType));
 }
예제 #7
0
 /// <summary>
 /// Serialize an object to an XmlWriter
 /// </summary>
 /// <typeparam name="T">Object type (usually inferred)</typeparam>
 /// <param name="obj">The object to serialize</param>
 /// <param name="writer">The XmlWriter to serialize to</param>
 public static void SerializeToXmlWriter <T>(T obj, XmlWriter writer)
 {
     Implementor <T> .Serialize(obj, writer);
 }
 public virtual void SetImplementor(Implementor implementor)
 {
     _implementor = implementor;
 }
예제 #9
0
 public ExtendedAbstraction(Implementor imp) : base(imp)
 {
 }
예제 #10
0
        protected Implementor impl; //定义实现类接口对象

        public void SetImpl(Implementor impl)
        {
            this.impl = impl;
        }
예제 #11
0
 public override void Operator()
 {
     Implementor.Operation();
 }
예제 #12
0
 public Abstraction(Implementor imp)
 {
     implementor = imp;
 }
예제 #13
0
파일: Bridge.cs 프로젝트: s344951241/design
 public void SetImp(Implementor imp)
 {
     this.Imp = imp;
 }
예제 #14
0
 public void SetImp(Implementor implementor)
 {
     mImplementor = implementor;
 }
예제 #15
0
 public void SetImplementor(Implementor implementor)
 {
     Implementor = implementor;
 }
예제 #16
0
 public RefinedAbstraction(Implementor impl)
 {
     this.impl = impl;
 }
예제 #17
0
 public override void Operation()
 {
     Implementor.Operation();
     Console.WriteLine("Invoke in RefinedAbstraction");
 }
예제 #18
0
 protected Abstraction(Implementor implementor)
 {
     Implementor = implementor;
 }
예제 #19
0
 /// <summary>
 /// Deserialize an object from an XmlReader and return it
 /// </summary>
 /// <typeparam name="resultType">The type to deserialize into</typeparam>
 /// <param name="reader">An XmlReader that will read the XML from which to deserialize</param>
 /// <returns>The deserialized object</returns>
 public static object DeserializeFromXmlReader(XmlReader reader, Type resultType)
 {
     return(Implementor.Deserialize(reader, resultType));
 }
예제 #20
0
 public Abstraction(Implementor implementor)
 {
     this.implementor = implementor;
 }
예제 #21
0
 /// <summary>
 /// Serialize an object to an XmlWriter
 /// </summary>
 /// <param name="obj">The object to serialize</param>
 /// <param name="writer">The XmlWriter to serialize to</param>
 public static void SerializeToXmlWriter(object obj, XmlWriter writer)
 {
     Implementor.Serialize(obj, writer);
 }
예제 #22
0
 public static T FromRow <T>(DataRow row) where T : new()
 {
     return(Implementor <T> .Create(row));
 }
예제 #23
0
 public override void Show()
 {
     Implementor.Show(this);
 }
예제 #24
0
 public static T FromRow <T>(ExcelDocument.Row row) where T : new()
 {
     return(Implementor <T> .Create(row));
 }
예제 #25
0
 public RefinedAbstraction(Implementor imp)
     : base(imp)
 {
 }
예제 #26
0
 public void SetImplementor(Implementor implementor)
 {
     this.implementor = implementor;
 }
 public override void SetImplementor(Implementor implementor)
 {
     _implementor = implementor;
 }
예제 #28
0
 public ConcreteCommandB(Implementor implementor)
 {
     this.implementor = implementor;
 }