Skip to content

Instantly share code, notes, and snippets.

public class ReportRunner
{
private TswaClientHyperlinkService _linkService;
private TfsTeamProjectCollection _teamProjectCollection;
private Project _tfsProject;
private QueryFolder _tfsQueryFolder;
private QueryItem _tfsQueryItem;
private WorkItemStore _workItemStore;
public ReportRunner()
@cjlotz
cjlotz / CommandLineOptions.cs
Last active December 15, 2015 16:38
CommandLineOptions class used in Report Generator solution
public enum AppAction
{
View = 0,
Export = 1
}
public class CommandLineOptions
{
public CommandLineOptions()
{
...
public List<Bookmark> Bookmarks { get; private set; }
public ReleaseNotesWriterSettings Settings { get; private set; }
public IReadOnlyList<ReleaseNoteWorkItem> WorkItems { get; private set; }
public void Publish(string outputFile)
{
var stream = new MemoryStream();
try
internal class ReleaseNotesPdfPageEvents : IPdfPageEvent
{
private const float FooterYPos = 30;
private const float HorizontalSpacer = 60;
private const float FooterFontSize = 9;
private const float HeadingFontSize = 18;
private BaseFont _baseFont = null;
private BaseFont _frontPageFont = null;
private IList<Bookmark> Merge(string mergeFile, int pageShift)
{
PdfContentByte content = _writer.DirectContent;
// Create pdf reader
PdfReader reader = new PdfReader(File.ReadAllBytes(mergeFile));
// Export the bookmarks
var bookmarks = ExportBookmarks(reader, pageShift);
int numberOfPages = reader.NumberOfPages;
private void WriteWorkItems(string chapterText, ref int chapterNumber, IEnumerable<ReleaseNoteWorkItem> workItems)
{
if (!workItems.Any())
return;
_document.NewPage();
string chapterTitle = string.Format(CultureInfo.InvariantCulture, "{0}. {1}", chapterNumber++, chapterText);
var chapter = new Chunk(chapterTitle, _chapterFont);
private void CreateBookmarks()
{
PdfContentByte content = _writer.DirectContent;
PdfOutline outline = content.RootOutline;
foreach (var bookmark in Bookmarks)
{
if (bookmark.IsReleaseHeader)
outline = CreatePdfOutline(content.RootOutline, bookmark);
else
@cjlotz
cjlotz / PivotViewerResourceManager
Last active December 20, 2015 01:49
PivotViewerResourceManager
public class PivotViewerResourceManager : ResourceManager
{
public const string PivotViewerResourcePrefix = "MSPivot";
private PivotViewerResourceManager(IResourceProvider provider) : base("System.Windows.Controls.Pivot.Properties.Resources", typeof(PivotViewer).Assembly)
{
ResourceProvider = provider;
}
private IResourceProvider ResourceProvider { get; set; }
[Register("intouch.controls.ITTextInputLayout")]
public class ITTextInputLayout : TextInputLayout, IITComposite
{
public ITTextInputLayout(Context context) : this(context, null)
{
}
public ITTextInputLayout(Context context, IAttributeSet attrs) : base(context, attrs)
{
LayoutInflater inflator = (LayoutInflater)context.GetSystemService(Context.LayoutInflaterService);
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="ITTextInputLayout" >
<attr name="android:inputType"/>
<attr name="android:maxLines"/>
<attr name="android:text"/>
<attr name="android:imeOptions"/>
<attr name="ItcHeader" format="string"/>
<attr name="ItcError" format="string"/>
</declare-styleable>