Skip to content

Commit dac1b5a

Browse files
committed
Adding Tfs-11.0.0.0 provider
1 parent d4cb23a commit dac1b5a

27 files changed

+3294
-0
lines changed
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{C9DC3080-122B-4F26-B2FB-B4A985983DC8}</ProjectGuid>
8+
<OutputType>Library</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>DataCommander.Providers.Tfs_11._0._0._0</RootNamespace>
11+
<AssemblyName>DataCommander.Providers.Tfs-11.0.0.0</AssemblyName>
12+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
</PropertyGroup>
15+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
16+
<DebugSymbols>true</DebugSymbols>
17+
<DebugType>full</DebugType>
18+
<Optimize>false</Optimize>
19+
<OutputPath>..\DataCommander\bin\Debug\</OutputPath>
20+
<DefineConstants>DEBUG;TRACE</DefineConstants>
21+
<ErrorReport>prompt</ErrorReport>
22+
<WarningLevel>4</WarningLevel>
23+
</PropertyGroup>
24+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
25+
<DebugType>pdbonly</DebugType>
26+
<Optimize>true</Optimize>
27+
<OutputPath>bin\Release\</OutputPath>
28+
<DefineConstants>TRACE</DefineConstants>
29+
<ErrorReport>prompt</ErrorReport>
30+
<WarningLevel>4</WarningLevel>
31+
</PropertyGroup>
32+
<ItemGroup>
33+
<Reference Include="Microsoft.TeamFoundation.Client, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
34+
<Reference Include="Microsoft.TeamFoundation.VersionControl.Client, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
35+
<Reference Include="Microsoft.TeamFoundation.VersionControl.Common, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
36+
<Reference Include="System" />
37+
<Reference Include="System.Core" />
38+
<Reference Include="System.Drawing" />
39+
<Reference Include="System.Windows.Forms" />
40+
<Reference Include="System.Xml.Linq" />
41+
<Reference Include="System.Data.DataSetExtensions" />
42+
<Reference Include="Microsoft.CSharp" />
43+
<Reference Include="System.Data" />
44+
<Reference Include="System.Xml" />
45+
</ItemGroup>
46+
<ItemGroup>
47+
<Compile Include="Properties\AssemblyInfo.cs" />
48+
<Compile Include="TfsCommand.cs" />
49+
<Compile Include="TfsConnection.cs" />
50+
<Compile Include="TfsDataParameter.cs" />
51+
<Compile Include="TfsDataReader.cs" />
52+
<Compile Include="TfsDataReaderFactory.cs" />
53+
<Compile Include="TfsDataReaderHelper.cs" />
54+
<Compile Include="TfsDataSourceEnumerator.cs" />
55+
<Compile Include="TfsDbConnection.cs" />
56+
<Compile Include="TfsDownloadDataReader.cs" />
57+
<Compile Include="TfsDownloadItemVersionsDataReader.cs" />
58+
<Compile Include="TfsFile.cs" />
59+
<Compile Include="TfsFolder.cs" />
60+
<Compile Include="TfsGetExtendedItemsDataReader.cs" />
61+
<Compile Include="TfsGetItemsDataReader.cs" />
62+
<Compile Include="TfsObjectExplorer.cs" />
63+
<Compile Include="TfsParameter.cs" />
64+
<Compile Include="TfsParameterCollection.cs" />
65+
<Compile Include="TfsProject.cs" />
66+
<Compile Include="TfsProvider.cs" />
67+
<Compile Include="TfsProviderFactory.cs" />
68+
<Compile Include="TfsQueryHistoryDataReader.cs" />
69+
<Compile Include="TfsQueryPendingSetsDataReader.cs" />
70+
<Compile Include="TfsQueryWorkspacesDataReader.cs" />
71+
</ItemGroup>
72+
<ItemGroup>
73+
<ProjectReference Include="..\DataCommander.Foundation\DataCommander.Foundation.csproj">
74+
<Project>{1bacf0aa-4122-4c10-a8d2-248542af054c}</Project>
75+
<Name>DataCommander.Foundation</Name>
76+
</ProjectReference>
77+
<ProjectReference Include="..\DataCommander.Providers\DataCommander.Providers.csproj">
78+
<Project>{31a30a80-d1b6-4867-a65e-188de9e912c8}</Project>
79+
<Name>DataCommander.Providers</Name>
80+
</ProjectReference>
81+
</ItemGroup>
82+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
83+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
84+
Other similar extension points exist, see Microsoft.Common.targets.
85+
<Target Name="BeforeBuild">
86+
</Target>
87+
<Target Name="AfterBuild">
88+
</Target>
89+
-->
90+
</Project>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using System;
2+
using System.Reflection;
3+
using System.Runtime.InteropServices;
4+
5+
[assembly: AssemblyTitle("DataCommander.Providers.Tfs-11.0.0.0")]
6+
[assembly: AssemblyVersion("1.0.0.0")]
7+
[assembly: AssemblyCopyright("Copyright © 2002-2015 Csaba Bernáth")]
8+
[assembly: AssemblyCompany("Csaba Bernáth")]
9+
[assembly: CLSCompliant(true)]
10+
[assembly: ComVisible(false)]
Lines changed: 209 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,209 @@
1+
namespace DataCommander.Providers.Tfs
2+
{
3+
using System;
4+
using System.Data;
5+
using System.Diagnostics.Contracts;
6+
7+
internal class TfsCommand : IDbCommand
8+
{
9+
private TfsConnection connection;
10+
private int commandTimeout;
11+
private string commandText;
12+
private CommandType commandType;
13+
private readonly TfsParameterCollection parameters = new TfsParameterCollection();
14+
private bool cancelled;
15+
16+
public TfsCommand(TfsConnection connection)
17+
{
18+
Contract.Requires(connection != null);
19+
this.connection = connection;
20+
}
21+
22+
public TfsConnection Connection
23+
{
24+
get
25+
{
26+
return this.connection;
27+
}
28+
}
29+
30+
#region IDbCommand Members
31+
32+
public void Cancel()
33+
{
34+
this.cancelled = true;
35+
}
36+
37+
internal bool Cancelled
38+
{
39+
get
40+
{
41+
return this.cancelled;
42+
}
43+
}
44+
45+
public string CommandText
46+
{
47+
get
48+
{
49+
return this.commandText;
50+
}
51+
52+
set
53+
{
54+
this.commandText = value;
55+
}
56+
}
57+
58+
public int CommandTimeout
59+
{
60+
get
61+
{
62+
return this.commandTimeout;
63+
}
64+
65+
set
66+
{
67+
this.commandTimeout = value;
68+
}
69+
}
70+
71+
public CommandType CommandType
72+
{
73+
get
74+
{
75+
return this.commandType;
76+
}
77+
78+
set
79+
{
80+
this.commandType = value;
81+
}
82+
}
83+
84+
IDbConnection IDbCommand.Connection
85+
{
86+
get
87+
{
88+
return this.connection.Connection;
89+
}
90+
91+
set
92+
{
93+
var tfsDbConnection = (TfsDbConnection)value;
94+
this.connection = tfsDbConnection.Connection;
95+
}
96+
}
97+
98+
IDbDataParameter IDbCommand.CreateParameter()
99+
{
100+
throw new NotSupportedException();
101+
}
102+
103+
int IDbCommand.ExecuteNonQuery()
104+
{
105+
throw new NotSupportedException();
106+
}
107+
108+
public IDataReader ExecuteReader(CommandBehavior behavior)
109+
{
110+
IDataReader dataReader;
111+
112+
switch (this.commandType)
113+
{
114+
case CommandType.StoredProcedure:
115+
dataReader = this.ExecuteStoredProcedure(behavior);
116+
break;
117+
118+
default:
119+
throw new NotImplementedException();
120+
}
121+
122+
return dataReader;
123+
}
124+
125+
public IDataReader ExecuteReader()
126+
{
127+
return this.ExecuteReader(CommandBehavior.Default);
128+
}
129+
130+
object IDbCommand.ExecuteScalar()
131+
{
132+
throw new NotSupportedException();
133+
}
134+
135+
IDataParameterCollection IDbCommand.Parameters
136+
{
137+
get
138+
{
139+
return this.parameters;
140+
}
141+
}
142+
143+
public TfsParameterCollection Parameters
144+
{
145+
get
146+
{
147+
return this.parameters;
148+
}
149+
}
150+
151+
void IDbCommand.Prepare()
152+
{
153+
throw new NotSupportedException();
154+
}
155+
156+
IDbTransaction IDbCommand.Transaction
157+
{
158+
get
159+
{
160+
return null;
161+
}
162+
163+
set
164+
{
165+
}
166+
}
167+
168+
public UpdateRowSource UpdatedRowSource
169+
{
170+
get
171+
{
172+
throw new NotImplementedException();
173+
}
174+
175+
set
176+
{
177+
throw new NotImplementedException();
178+
}
179+
}
180+
181+
#endregion
182+
183+
#region IDisposable Members
184+
185+
public void Dispose()
186+
{
187+
}
188+
189+
#endregion
190+
191+
private IDataReader ExecuteStoredProcedure(CommandBehavior behavior)
192+
{
193+
IDataReader dataReader;
194+
TfsDataReaderFactory.DataReaderInfo info;
195+
bool contains = TfsDataReaderFactory.Dictionary.TryGetValue(this.commandText, out info);
196+
197+
if (contains)
198+
{
199+
dataReader = info.CreateDataReader(this);
200+
}
201+
else
202+
{
203+
throw new NotSupportedException();
204+
}
205+
206+
return dataReader;
207+
}
208+
}
209+
}

0 commit comments

Comments
 (0)