vault backup: 2025-06-23 00:01:29
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||
</startup>
|
||||
</configuration>
|
||||
@@ -0,0 +1,62 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{8DDB2F59-34EA-4008-A736-612FCF6F5EDD}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>DIP_Solution04</RootNamespace>
|
||||
<AssemblyName>DIP_Solution04</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ExternalService\Service01.cs" />
|
||||
<Compile Include="ExternalService\Service02.cs" />
|
||||
<Compile Include="ExternalService\Service03.cs" />
|
||||
<Compile Include="Framework\Base\BaseService.cs" />
|
||||
<Compile Include="Framework\Interface\IService.cs" />
|
||||
<Compile Include="LifeCycle\A.cs" />
|
||||
<Compile Include="LifeCycle\B.cs" />
|
||||
<Compile Include="LifeCycle\C.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DIP_Solution04.ExternalService
|
||||
{
|
||||
public class Service01
|
||||
{
|
||||
#region [ - Ctor - ]
|
||||
public Service01()
|
||||
{
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region [ - Method - ]
|
||||
|
||||
#region [ - M1() - ]
|
||||
public void M1()
|
||||
{
|
||||
Console.WriteLine("M1 is running ...");
|
||||
}
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DIP_Solution04.ExternalService
|
||||
{
|
||||
public class Service02
|
||||
{
|
||||
#region [ - Ctor - ]
|
||||
public Service02()
|
||||
{
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region [ - Method - ]
|
||||
|
||||
#region [ - M2() - ]
|
||||
public void M2()
|
||||
{
|
||||
Console.WriteLine("M2 is running ...");
|
||||
}
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DIP_Solution04.ExternalService
|
||||
{
|
||||
public class Service03
|
||||
{
|
||||
#region [ - Ctor - ]
|
||||
public Service03()
|
||||
{
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region [ - Method - ]
|
||||
|
||||
#region [ - M3() - ]
|
||||
public void M3()
|
||||
{
|
||||
Console.WriteLine("M3 is running ...");
|
||||
}
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
using DIP_Solution04.ExternalService;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DIP_Solution04.Framework.Base
|
||||
{
|
||||
public class BaseService : Interface.IService
|
||||
{
|
||||
#region [ - Ctor - ]
|
||||
|
||||
#region [ - BaseService(ExternalService.Service01 ref_Service01, ExternalService.Service02 ref_Service02, ExternalService.Service03 ref_Service03) - ]
|
||||
//Eager Aggregation
|
||||
public BaseService(Service01 ref_Service01,
|
||||
Service02 ref_Service02,
|
||||
Service03 ref_Service03)
|
||||
{
|
||||
Ref_Service01 = ref_Service01;
|
||||
Ref_Service02 = ref_Service02;
|
||||
Ref_Service03 = ref_Service03;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region [ - BaseService() - ]
|
||||
public BaseService()
|
||||
{
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#region [ - Props - ]
|
||||
public Service01 Ref_Service01 { get; set; }
|
||||
public Service02 Ref_Service02 { get; set; }
|
||||
public Service03 Ref_Service03 { get; set; }
|
||||
#endregion
|
||||
|
||||
#region [ - Methods - ]
|
||||
|
||||
// Implement Lazy Aggregation
|
||||
|
||||
#region [ - GenerateService01(Service01 ref_Service01) - ]
|
||||
public void GenerateService01(Service01 ref_Service01)
|
||||
{
|
||||
Ref_Service01 = ref_Service01;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region [ - GenerateService02(Service02 ref_Service02) - ]
|
||||
public void GenerateService02(Service02 ref_Service02)
|
||||
{
|
||||
Ref_Service02 = ref_Service02;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region [ - GenerateService03(Service03 ref_Service03) - ]
|
||||
public void GenerateService03(Service03 ref_Service03)
|
||||
{
|
||||
Ref_Service03 = ref_Service03;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DIP_Solution04.Framework.Interface
|
||||
{
|
||||
interface IService
|
||||
{
|
||||
#region [ - Props - ]
|
||||
ExternalService.Service01 Ref_Service01{ get; set; }
|
||||
ExternalService.Service02 Ref_Service02{ get; set; }
|
||||
ExternalService.Service03 Ref_Service03{ get; set; }
|
||||
#endregion
|
||||
|
||||
#region [ - Methods - ]
|
||||
|
||||
#region [ - GenerateService01(ExternalService.Service01 ref_Service01) - ]
|
||||
void GenerateService01(ExternalService.Service01 ref_Service01);
|
||||
#endregion
|
||||
|
||||
#region [ - GenerateService02(ExternalService.Service02 ref_Service02) - ]
|
||||
void GenerateService02(ExternalService.Service02 ref_Service02);
|
||||
#endregion
|
||||
|
||||
#region [ - GenerateService03(ExternalService.Service03 ref_Service03) - ]
|
||||
void GenerateService03(ExternalService.Service03 ref_Service03);
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DIP_Solution04.LifeCycle
|
||||
{
|
||||
public class A: Framework.Base.BaseService
|
||||
{
|
||||
#region [ - Ctor - ]
|
||||
public A(): base(new ExternalService.Service01(), new ExternalService.Service02(), new ExternalService.Service03())
|
||||
{
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DIP_Solution04.LifeCycle
|
||||
{
|
||||
public class B: Framework.Base.BaseService
|
||||
{
|
||||
#region [ - Ctor - ]
|
||||
public B() : base(new ExternalService.Service01(), new ExternalService.Service02(), new ExternalService.Service03())
|
||||
{
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DIP_Solution04.LifeCycle
|
||||
{
|
||||
public class C: Framework.Base.BaseService
|
||||
{
|
||||
#region [ - Ctor - ]
|
||||
public C() : base(new ExternalService.Service01(), new ExternalService.Service02(), new ExternalService.Service03())
|
||||
{
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DIP_Solution04
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
LifeCycle.A Ref_A = new LifeCycle.A();
|
||||
|
||||
LifeCycle.B Ref_B = new LifeCycle.B();
|
||||
|
||||
LifeCycle.C Ref_C = new LifeCycle.C();
|
||||
|
||||
// Disable
|
||||
|
||||
#region [ - Eager Aggregation - ]
|
||||
|
||||
//Console.WriteLine("A:");
|
||||
//Ref_A.Ref_Service01.M1();
|
||||
//Ref_A.Ref_Service02.M2();
|
||||
//Ref_A.Ref_Service03.M3();
|
||||
|
||||
//Console.WriteLine("--------------");
|
||||
|
||||
//Console.WriteLine("B:");
|
||||
//Ref_B.Ref_Service01.M1();
|
||||
//Ref_B.Ref_Service02.M2();
|
||||
//Ref_B.Ref_Service03.M3();
|
||||
|
||||
//Console.WriteLine("--------------");
|
||||
|
||||
//Console.WriteLine("C:");
|
||||
//Ref_C.Ref_Service01.M1();
|
||||
//Ref_C.Ref_Service02.M2();
|
||||
//Ref_C.Ref_Service03.M3();
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
// Active
|
||||
|
||||
#region [ - Lazy Aggregation - ]
|
||||
|
||||
#region [ - A - ]
|
||||
|
||||
Console.WriteLine("A:");
|
||||
|
||||
Ref_A.GenerateService01(new ExternalService.Service01());
|
||||
Ref_A.Ref_Service01.M1();
|
||||
|
||||
Ref_A.GenerateService02(new ExternalService.Service02());
|
||||
Ref_A.Ref_Service02.M2();
|
||||
|
||||
Ref_A.GenerateService03(new ExternalService.Service03());
|
||||
Ref_A.Ref_Service03.M3();
|
||||
|
||||
#endregion
|
||||
|
||||
Console.WriteLine("--------------");
|
||||
|
||||
#region [ - B - ]
|
||||
|
||||
Console.WriteLine("B:");
|
||||
|
||||
Ref_B.GenerateService01(new ExternalService.Service01());
|
||||
Ref_B.Ref_Service01.M1();
|
||||
|
||||
Ref_B.GenerateService02(new ExternalService.Service02());
|
||||
Ref_B.Ref_Service02.M2();
|
||||
|
||||
Ref_B.GenerateService03(new ExternalService.Service03());
|
||||
Ref_B.Ref_Service03.M3();
|
||||
|
||||
#endregion
|
||||
|
||||
Console.WriteLine("--------------");
|
||||
|
||||
#region [ - C - ]
|
||||
|
||||
Console.WriteLine("C:");
|
||||
|
||||
Ref_C.GenerateService01(new ExternalService.Service01());
|
||||
Ref_C.Ref_Service01.M1();
|
||||
|
||||
Ref_C.GenerateService02(new ExternalService.Service02());
|
||||
Ref_C.Ref_Service02.M2();
|
||||
|
||||
Ref_C.GenerateService03(new ExternalService.Service03());
|
||||
Ref_C.Ref_Service03.M3();
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
System.Console.ReadLine();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("DIP_Solution04")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("DIP_Solution04")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2021")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("8ddb2f59-34ea-4008-a736-612fcf6f5edd")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
Binary file not shown.
+6
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||
</startup>
|
||||
</configuration>
|
||||
Binary file not shown.
+4
@@ -0,0 +1,4 @@
|
||||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
|
||||
BIN
Binary file not shown.
+1
@@ -0,0 +1 @@
|
||||
d68365b161194bf2db16706aba6cc2d2f704eecc92f60bbead37d172ee57baa7
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
E:\Ali\Programming\ASP.net\Projects\H\Session07\Session07\Session07\DIP_Solution04\bin\Debug\DIP_Solution04.exe.config
|
||||
E:\Ali\Programming\ASP.net\Projects\H\Session07\Session07\Session07\DIP_Solution04\bin\Debug\DIP_Solution04.exe
|
||||
E:\Ali\Programming\ASP.net\Projects\H\Session07\Session07\Session07\DIP_Solution04\bin\Debug\DIP_Solution04.pdb
|
||||
E:\Ali\Programming\ASP.net\Projects\H\Session07\Session07\Session07\DIP_Solution04\obj\Debug\DIP_Solution04.csproj.AssemblyReference.cache
|
||||
E:\Ali\Programming\ASP.net\Projects\H\Session07\Session07\Session07\DIP_Solution04\obj\Debug\DIP_Solution04.csproj.CoreCompileInputs.cache
|
||||
E:\Ali\Programming\ASP.net\Projects\H\Session07\Session07\Session07\DIP_Solution04\obj\Debug\DIP_Solution04.exe
|
||||
E:\Ali\Programming\ASP.net\Projects\H\Session07\Session07\Session07\DIP_Solution04\obj\Debug\DIP_Solution04.pdb
|
||||
E:\Ali\Programming\ASP.net\MFT\Projects\H\Session07\Session07\Session07\DIP_Solution04\obj\Debug\DIP_Solution04.csproj.AssemblyReference.cache
|
||||
E:\Ali\Programming\ASP.net\MFT\Projects\H\Session07\Session07\Session07\DIP_Solution04\obj\Debug\DIP_Solution04.csproj.CoreCompileInputs.cache
|
||||
E:\Ali\Programming\ASP.net\MFT\Projects\H\Session07\Session07\Session07\DIP_Solution04\obj\Debug\DIP_Solution04.exe
|
||||
E:\Ali\Programming\ASP.net\MFT\Projects\H\Session07\Session07\Session07\DIP_Solution04\obj\Debug\DIP_Solution04.pdb
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user