Changeset 98193e382721…
Parent 8557f332516f…
by
Changes to 6 files · Browse files at 98193e382721 Showing diff from parent 8557f332516f Diff from another changeset...
|
@@ -0,0 +1,20 @@ +
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual Studio 2008
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TimeIntervalExample", "TimeIntervalExample\TimeIntervalExample.csproj", "{BAADAECF-22A2-438F-9098-E1E977B1BAF8}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {BAADAECF-22A2-438F-9098-E1E977B1BAF8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {BAADAECF-22A2-438F-9098-E1E977B1BAF8}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {BAADAECF-22A2-438F-9098-E1E977B1BAF8}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {BAADAECF-22A2-438F-9098-E1E977B1BAF8}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
|
|
|
|
|
|
@@ -0,0 +1,43 @@ + using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+using FogCreek.Plugins;
+
+// 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: AssemblyFogCreekPluginId("Adam+TimeIntervalExample@fogcreek.com")]
+[assembly: AssemblyFogCreekMajorVersion(3)]
+[assembly: AssemblyFogCreekMinorVersionMin(6)]
+[assembly: AssemblyFogCreekEmailAddress("customer-service@fogcreek.com")]
+[assembly: AssemblyFogCreekWebsite("http://www.fogcreek.com/FogBugz/support.html")]
+[assembly: AssemblyTitle("TimeIntervalExample")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Fog Creek Software")]
+[assembly: AssemblyProduct("TimeIntervalExample")]
+[assembly: AssemblyCopyright("Copyright © Fog Creek Software 2011")]
+[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("37dd7a8b-0034-48c8-9922-243ff0a76880")]
+
+// 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("0.1.0.0")]
+[assembly: AssemblyFileVersion("0.1.0.0")] // adam - Added this cool new FogBugz plugin!
|
|
|
@@ -0,0 +1,146 @@ + using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Web;
+
+using FogCreek.FogBugz;
+using FogCreek.FogBugz.Plugins;
+using FogCreek.FogBugz.Plugins.Api;
+using FogCreek.FogBugz.Plugins.Entity;
+using FogCreek.FogBugz.Plugins.Interfaces;
+using FogCreek.FogBugz.UI.Dialog;
+
+namespace TimeIntervalExample
+{
+ public class TimeIntervalExample : Plugin, IPluginTimeIntervalCommit, IPluginTimeIntervalJoin,
+ IPluginJS, IPluginDatabase, IPluginRawPageDisplay
+ {
+ public TimeIntervalExample(CPluginApi api) : base(api) { }
+
+ protected const string SPluginId = "Adam+TimeIntervalExample@fogcreek.com";
+ string _preCommitComment = "";
+ private const string CommentsTable = "TimeIntervalComment";
+ private const string IntervalColumn = "ixInterval";
+ private const string CommentColumn = "sComment";
+ public const int CommentColumnMaxLength = 255;
+ private const int PluginSchemaVer = 1;
+
+ #region IPluginTimeIntervalCommit Members
+
+ public void TimeIntervalCommitAfter(CTimeInterval timeinterval)
+ {
+ throw new NotImplementedException();
+ }
+
+ public bool TimeIntervalCommitBefore(CTimeInterval timeinterval)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void TimeIntervalCommitRollback(CTimeInterval timeinterval)
+ {
+ throw new NotImplementedException();
+ }
+
+ #endregion
+
+ #region IPluginTimeIntervalJoin Members
+
+ public string[] TimeIntervalJoinTables()
+ {
+ return new string[] { "TimeIntervalComment" };
+ }
+
+ #endregion
+
+ #region IPluginJS Members
+
+ public CJSInfo JSInfo()
+ {
+ throw new NotImplementedException();
+ }
+
+ #endregion
+
+ #region IPluginDatabase Members
+
+ public CTable[] DatabaseSchema()
+ {
+ var timeIntervalComments = api.Database.NewTable(api.Database.PluginTableName(CommentsTable));
+ timeIntervalComments.sDesc = "Assigns Comments to TimeIntervals";
+ timeIntervalComments.AddAutoIncrementPrimaryKey("ixTimeIntervalComment");
+ timeIntervalComments.AddIntColumn(IntervalColumn, true, 0);
+ timeIntervalComments.AddVarcharColumn(CommentColumn, CommentColumnMaxLength, false);
+
+ return new[] { timeIntervalComments };
+ }
+
+ public int DatabaseSchemaVersion()
+ {
+ return PluginSchemaVer;
+ }
+
+ public void DatabaseUpgradeAfter(int ixVersionFrom, int ixVersionTo, CDatabaseUpgradeApi apiUpgrade)
+ {
+ if (ixVersionTo == 1)
+ {
+ // No action required. Don't create any data in the tables
+ }
+ }
+
+ public void DatabaseUpgradeBefore(int ixVersionFrom, int ixVersionTo, CDatabaseUpgradeApi apiUpgrade)
+ {
+ if (ixVersionTo == 1)
+ {
+ // No action required. Don't create any data in the tables
+ }
+ }
+
+ #endregion
+
+ #region IPluginRawPageDisplay Members
+
+ public string RawPageDisplay()
+ {
+ if (api.Request[api.AddPluginPrefix("action")] != null &&
+ Convert.ToString(api.Request[api.AddPluginPrefix("action")]) == "postComment")
+ {
+ // make sure the request includes a valid action token
+ if ((api.Request[api.AddPluginPrefix("actionToken")] == null) ||
+ !api.Security.ValidateActionToken(api.Request[api.AddPluginPrefix("actionToken")],
+ "postComment"))
+ {
+ return "action token invalid";
+ }
+ else
+ {
+ PostComment();
+ }
+
+ }
+
+ if (api.Request[api.AddPluginPrefix("data")] == "getComment")
+ {
+ return GetComment();
+ }
+ else return "command not recognized";
+ }
+
+ public PermissionLevel RawPageVisibility()
+ {
+ return PermissionLevel.Normal;
+ }
+
+ #endregion
+
+ private void PostComment()
+ {
+
+ }
+
+ private void GetComment()
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
|
|
@@ -0,0 +1,65 @@ + <?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>9.0.30729</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{BAADAECF-22A2-438F-9098-E1E977B1BAF8}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>TimeIntervalExample</RootNamespace>
+ <AssemblyName>TimeIntervalExample</AssemblyName>
+ <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ <TargetFrameworkSubset>
+ </TargetFrameworkSubset>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <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' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="FogBugz, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a9eb54ba6d925add, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>.\FogBugz.dll</HintPath>
+ </Reference>
+ <Reference Include="FogCreek.Plugins, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d8367ba9769b01ac, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>.\FogCreek.Plugins.dll</HintPath>
+ </Reference>
+ <Reference Include="System" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Web" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="TimeIntervalExample.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+ <PropertyGroup>
+ <PostBuildEvent>xcopy /Y /I /S /E "$(ProjectDir)static" "$(TargetDir)static"
+"$(SolutionDir)..\_postbuildSln.bat" $(TargetName)</PostBuildEvent>
+ </PropertyGroup>
+</Project>
\ No newline at end of file |
Loading...