コード例 #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
ファイル: test-15.cs プロジェクト: mortezabarzkar/SharpNative
	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
ファイル: bridge.cs プロジェクト: mohammad641/DesignPatterns
 public Abstraction()
 {
     this.implementor = Implementation.GetImplementation();
 }
コード例 #4
0
 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);
 }
コード例 #8
0
 public virtual void SetImplementor(Implementor implementor)
 {
     _implementor = implementor;
 }
コード例 #9
0
 public ExtendedAbstraction(Implementor imp) : base(imp)
 {
 }
コード例 #10
0
ファイル: Bridge.cs プロジェクト: devgis/CSharpDesignPattern
        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
ファイル: Prototype.cs プロジェクト: WeihanLi/DesignPatterns
 public void SetImplementor(Implementor implementor)
 {
     Implementor = implementor;
 }
コード例 #16
0
ファイル: BridgePattern.cs プロジェクト: omxian/DesignPattern
 public RefinedAbstraction(Implementor impl)
 {
     this.impl = impl;
 }
コード例 #17
0
ファイル: Prototype.cs プロジェクト: WeihanLi/DesignPatterns
 public override void Operation()
 {
     Implementor.Operation();
     Console.WriteLine("Invoke in RefinedAbstraction");
 }
コード例 #18
0
ファイル: Abstraction.cs プロジェクト: m1c1b/GOF-Patterns
 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;
 }
コード例 #27
0
 public override void SetImplementor(Implementor implementor)
 {
     _implementor = implementor;
 }
コード例 #28
0
 public ConcreteCommandB(Implementor implementor)
 {
     this.implementor = implementor;
 }