string cat and singeltonpattern
This commit is contained in:
@ -1,14 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ClassLibrary01
|
||||
{
|
||||
public class Class1
|
||||
public class Class1 :IDisposable
|
||||
{
|
||||
|
||||
|
||||
public void DoIt()
|
||||
{
|
||||
var foo = SingeltonPattern.GetInstance();
|
||||
}
|
||||
|
||||
public int Add(int i1, int i2 = 10)
|
||||
{
|
||||
return i1 + i2;
|
||||
@ -19,5 +26,20 @@ namespace ClassLibrary01
|
||||
return Add(i1, 10);
|
||||
}
|
||||
|
||||
private Pen _pen;
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_pen.Dispose();
|
||||
}
|
||||
|
||||
|
||||
public Pen getPen()
|
||||
{
|
||||
|
||||
_pen = new Pen(Color.Black, 2);
|
||||
|
||||
return _pen;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?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>4859a826-18e2-4c0c-a441-f77975e70e93</ProjectGuid>
|
||||
<ProjectGuid>{4859A826-18E2-4C0C-A441-F77975E70E93}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>ClassLibrary01</RootNamespace>
|
||||
@ -31,24 +31,20 @@
|
||||
<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"/>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<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="Class1.cs" />
|
||||
<Compile Include="CodeFile1.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
</Project>
|
33
WindowsFormsApp01/ClassLibrary01/CodeFile1.cs
Normal file
33
WindowsFormsApp01/ClassLibrary01/CodeFile1.cs
Normal file
@ -0,0 +1,33 @@
|
||||
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
public class SingeltonPattern
|
||||
{
|
||||
|
||||
|
||||
|
||||
private static SingeltonPattern _singelton;
|
||||
|
||||
|
||||
private SingeltonPattern()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static SingeltonPattern GetInstance()
|
||||
{
|
||||
if (_singelton == null)
|
||||
{
|
||||
_singelton = new SingeltonPattern();
|
||||
}
|
||||
|
||||
return _singelton;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
@ -1 +1 @@
|
||||
69d79abfd67c28b98a7f19e87fceac8121786190
|
||||
165664fdbdaecd0156134d10b5983b1832f42627
|
||||
|
@ -4,3 +4,9 @@ C:\Users\root\source\repos\WindowsFormsApp01\ClassLibrary01\obj\Debug\ClassLibra
|
||||
C:\Users\root\source\repos\WindowsFormsApp01\ClassLibrary01\obj\Debug\ClassLibrary01.csproj.CoreCompileInputs.cache
|
||||
C:\Users\root\source\repos\WindowsFormsApp01\ClassLibrary01\obj\Debug\ClassLibrary01.dll
|
||||
C:\Users\root\source\repos\WindowsFormsApp01\ClassLibrary01\obj\Debug\ClassLibrary01.pdb
|
||||
C:\Users\root\source\SoftwareEngineering2\WindowsFormsApp01\ClassLibrary01\bin\Debug\ClassLibrary01.dll
|
||||
C:\Users\root\source\SoftwareEngineering2\WindowsFormsApp01\ClassLibrary01\bin\Debug\ClassLibrary01.pdb
|
||||
C:\Users\root\source\SoftwareEngineering2\WindowsFormsApp01\ClassLibrary01\obj\Debug\ClassLibrary01.csprojAssemblyReference.cache
|
||||
C:\Users\root\source\SoftwareEngineering2\WindowsFormsApp01\ClassLibrary01\obj\Debug\ClassLibrary01.csproj.CoreCompileInputs.cache
|
||||
C:\Users\root\source\SoftwareEngineering2\WindowsFormsApp01\ClassLibrary01\obj\Debug\ClassLibrary01.dll
|
||||
C:\Users\root\source\SoftwareEngineering2\WindowsFormsApp01\ClassLibrary01\obj\Debug\ClassLibrary01.pdb
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user