Skip to content

Commit ffd8ffe

Browse files
committed
Cleaned up un-needed files
1 parent 616509c commit ffd8ffe

File tree

14 files changed

+243
-16
lines changed

14 files changed

+243
-16
lines changed

Common/Common.csproj

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<PropertyGroup>
55
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
66
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7-
<ProjectGuid>{8A4F066D-8669-42DF-B791-00C3C03FE0D9}</ProjectGuid>
7+
<ProjectGuid>{966CB1D4-42C9-4D90-876A-CE2466623D76}</ProjectGuid>
88
<OutputType>Library</OutputType>
99
<AppDesignerFolder>Properties</AppDesignerFolder>
1010
<RootNamespace>Common</RootNamespace>
@@ -16,7 +16,7 @@
1616
<DebugSymbols>true</DebugSymbols>
1717
<DebugType>full</DebugType>
1818
<Optimize>false</Optimize>
19-
<OutputPath>bin\Debug\</OutputPath>
19+
<OutputPath>..\bin\Debug\</OutputPath>
2020
<DefineConstants>DEBUG;TRACE</DefineConstants>
2121
<ErrorReport>prompt</ErrorReport>
2222
<WarningLevel>4</WarningLevel>
@@ -30,6 +30,10 @@
3030
<WarningLevel>4</WarningLevel>
3131
</PropertyGroup>
3232
<ItemGroup>
33+
<Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
34+
<HintPath>..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
35+
<Private>True</Private>
36+
</Reference>
3337
<Reference Include="System" />
3438
<Reference Include="System.Core" />
3539
<Reference Include="System.Xml.Linq" />
@@ -38,11 +42,29 @@
3842
<Reference Include="System.Data" />
3943
<Reference Include="System.Net.Http" />
4044
<Reference Include="System.Xml" />
45+
<Reference Include="ZendeskApi_v2, Version=3.2.14.0, Culture=neutral, processorArchitecture=MSIL">
46+
<HintPath>..\packages\ZendeskApi_v2.3.2.14\lib\net45\ZendeskApi_v2.dll</HintPath>
47+
<Private>True</Private>
48+
</Reference>
4149
</ItemGroup>
4250
<ItemGroup>
43-
<Compile Include="Class1.cs" />
44-
<Compile Include="Interface1.cs" />
51+
<Compile Include="Configuration.Designer.cs">
52+
<DependentUpon>Configuration.settings</DependentUpon>
53+
<AutoGen>True</AutoGen>
54+
<DesignTimeSharedInput>True</DesignTimeSharedInput>
55+
</Compile>
4556
<Compile Include="Properties\AssemblyInfo.cs" />
57+
<Compile Include="PrtgXmlOutput.cs" />
58+
<Compile Include="Tools.cs" />
59+
<Compile Include="ZenDeskApiManager.cs" />
60+
</ItemGroup>
61+
<ItemGroup>
62+
<None Include="app.config" />
63+
<None Include="Configuration.settings">
64+
<Generator>SettingsSingleFileGenerator</Generator>
65+
<LastGenOutput>Configuration.Designer.cs</LastGenOutput>
66+
</None>
67+
<None Include="packages.config" />
4668
</ItemGroup>
4769
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
4870
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.

Common/Configuration.Designer.cs

Lines changed: 53 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Common/Properties/AssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
// General Information about an assembly is controlled through the following
66
// set of attributes. Change these attribute values to modify the information
77
// associated with an assembly.
8-
[assembly: AssemblyTitle("Common")]
8+
[assembly: AssemblyTitle("ZendeskConnector")]
99
[assembly: AssemblyDescription("")]
1010
[assembly: AssemblyConfiguration("")]
1111
[assembly: AssemblyCompany("")]
12-
[assembly: AssemblyProduct("Common")]
12+
[assembly: AssemblyProduct("ZendeskConnector")]
1313
[assembly: AssemblyCopyright("Copyright © 2015")]
1414
[assembly: AssemblyTrademark("")]
1515
[assembly: AssemblyCulture("")]
@@ -20,7 +20,7 @@
2020
[assembly: ComVisible(false)]
2121

2222
// The following GUID is for the ID of the typelib if this project is exposed to COM
23-
[assembly: Guid("8a4f066d-8669-42df-b791-00c3c03fe0d9")]
23+
[assembly: Guid("966cb1d4-42c9-4d90-876a-ce2466623d76")]
2424

2525
// Version information for an assembly consists of the following four values:
2626
//

Common/PrtgXmlOutput.cs

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
using System.Xml;
7+
8+
namespace Common
9+
{
10+
public class PrtgXmlOutput
11+
{
12+
XmlWriter _xml;
13+
public PrtgXmlOutput()
14+
{
15+
_xml = XmlWriter.Create(Console.Out);
16+
CreateRoot();
17+
}
18+
private void CreateRoot()
19+
{
20+
// Root element - start tag
21+
_xml.WriteStartElement("prtg");
22+
}
23+
24+
public void AddChannel(string channelName, string value, bool writeEnd = true) {
25+
_xml.WriteStartElement("result");
26+
27+
_xml.WriteElementString("channel", channelName);
28+
_xml.WriteElementString("value", value);
29+
30+
if (writeEnd)
31+
{
32+
// end result
33+
_xml.WriteEndElement();
34+
}
35+
36+
}
37+
38+
public void AddChannel(string channelName, string value, Dictionary<string, string> data)
39+
{
40+
AddChannel(channelName, value, false);
41+
42+
foreach (var item in data)
43+
{
44+
_xml.WriteElementString(item.Key, item.Value);
45+
_xml.WriteEndElement();
46+
}
47+
48+
_xml.WriteEndElement();
49+
}
50+
51+
private void CloseXml() {
52+
// Root element - end tag
53+
_xml.WriteEndElement();
54+
55+
// End Documentd
56+
_xml.WriteEndDocument();
57+
}
58+
59+
public void PrintXml()
60+
{
61+
CloseXml();
62+
// Flush it
63+
_xml.Flush();
64+
}
65+
}
66+
}

Common/Tools.cs

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
using System;
2+
using ZendeskApi_v2;
3+
4+
namespace Common
5+
{
6+
public class Tools
7+
{
8+
/// <summary>
9+
/// Print error message
10+
/// </summary>
11+
public static void PrintError()
12+
{
13+
Console.WriteLine("Invalid argument");
14+
}
15+
16+
/// <summary>
17+
/// Print help message
18+
/// </summary>
19+
public static void PrintHelp(ZendeskApi api)
20+
{
21+
Console.WriteLine("You have to specify a group name or id as parameter");
22+
Console.WriteLine("List of groups:");
23+
PrintGroups(api);
24+
}
25+
26+
/// <summary>
27+
/// Print list of groups
28+
/// </summary>
29+
public static void PrintGroups(ZendeskApi api)
30+
{
31+
foreach (var group in api.Groups.GetGroups().Groups)
32+
{
33+
Console.WriteLine(group.Id + ": " + group.Name);
34+
}
35+
}
36+
}
37+
}

Common/ZenDeskApiManager.cs

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
using ZendeskApi_v2;
2+
3+
namespace Common
4+
{
5+
public class ZendeskApiManager
6+
{
7+
private static string apiUrl;
8+
private static ZendeskApi api;
9+
10+
public ZendeskApiManager()
11+
{
12+
initialize();
13+
}
14+
15+
public ZendeskApiManager(string url, string username, string password)
16+
{
17+
api = new ZendeskApi(url, username, password);
18+
}
19+
20+
public static ZendeskApi ZendeskApi
21+
{
22+
get
23+
{
24+
if (api == null)
25+
{
26+
initialize();
27+
}
28+
29+
return api;
30+
}
31+
32+
private set { api = value; }
33+
}
34+
35+
private static void initialize()
36+
{
37+
apiUrl = "https://" + Configuration.Default.Zendesk_subdomain + ".zendesk.com/api/v2";
38+
api = new ZendeskApi(apiUrl, Configuration.Default.Username, Configuration.Default.Password);
39+
}
40+
}
41+
}

Common/packages.config

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net452" />
4+
<package id="ZendeskApi_v2" version="3.2.14" targetFramework="net452" />
5+
</packages>

GetZendesAgentStatsInGroup/GetZendesAgentStatsInGroup.csproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@
5959
<None Include="packages.config" />
6060
</ItemGroup>
6161
<ItemGroup>
62-
<ProjectReference Include="..\..\ZendeskConnector\Common.csproj">
62+
<WCFMetadata Include="Service References\" />
63+
</ItemGroup>
64+
<ItemGroup>
65+
<ProjectReference Include="..\Common\Common.csproj">
6366
<Project>{966cb1d4-42c9-4d90-876a-ce2466623d76}</Project>
6467
<Name>Common</Name>
6568
</ProjectReference>

GetNumberOfOpenTickets/GetZendeskGroupStats.csproj renamed to GetZendeskGroupStats/GetZendeskGroupStats.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
<None Include="packages.config" />
6363
</ItemGroup>
6464
<ItemGroup>
65-
<ProjectReference Include="..\..\ZendeskConnector\Common.csproj">
65+
<ProjectReference Include="..\Common\Common.csproj">
6666
<Project>{966cb1d4-42c9-4d90-876a-ce2466623d76}</Project>
6767
<Name>Common</Name>
6868
</ProjectReference>

0 commit comments

Comments
 (0)