/// <summary> /// A superclass that represents the Model for an individual HIT. /// </summary> /// <param name="range">The Range object selected for this task</param> /// <param name="job">The unique job number for this task</param> public HITData(Word.Range range, int job) { this.range = range; this.job = job; int unixTime = (int)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; string bookmarkName = "Soylent" + job; this.stages = new List <StageData>(); numParagraphs = range.Paragraphs.Count; //stages = new Dictionary<ResultType, StageData>(); //TODO: Use Word XML binding to text instead of bookmarks. /* * Improved Data Mapping Provides Separation Between a Document's Data and Its Formatting * XML mapping allows you to attach XML data to Word documents and link XML elements to placeholders in the document. * Combined with content controls, XML mapping becomes a powerful tool for developers. * These features provide you with the capability to position content controls in the document and then link them to XML elements. * This type of data and view separation allows you to access Word document data to repurpose and integrate with other systems and applications. */ object bkmkRange = (object)range; Globals.Soylent.jobToDoc[this.job].Bookmarks.Add(bookmarkName, ref bkmkRange); tk = new TurKit(this); }
/// <summary> /// A superclass that represents the Model for an individual HIT. /// </summary> /// <param name="range">The Range object selected for this task</param> /// <param name="job">The unique job number for this task</param> public HITData(Word.Range range, int job) { this.range = range; this.job = job; int unixTime = (int)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; string bookmarkName = "Soylent" + job; this.stages = new List<StageData>(); numParagraphs = range.Paragraphs.Count; //stages = new Dictionary<ResultType, StageData>(); //TODO: Use Word XML binding to text instead of bookmarks. /* * Improved Data Mapping Provides Separation Between a Document's Data and Its Formatting * XML mapping allows you to attach XML data to Word documents and link XML elements to placeholders in the document. * Combined with content controls, XML mapping becomes a powerful tool for developers. * These features provide you with the capability to position content controls in the document and then link them to XML elements. * This type of data and view separation allows you to access Word document data to repurpose and integrate with other systems and applications. */ object bkmkRange = (object)range; Globals.Soylent.jobToDoc[this.job].Bookmarks.Add(bookmarkName, ref bkmkRange); tk = new TurKit(this); }
public HITData() { this.range = null; this.job = -1; numParagraphs = 0; this.stages = new List <StageData>(); tk = new TurKit(this); }
/// <summary> /// Reads in the AMT secret and key from the amazon.xml file so that HITs can be submitted. /// </summary> public static void AskForAmazonKeys(TurKit.startTaskDelegate success, TurKit.noKeysDelegate cancel) { AmazonKeys keys = LoadAmazonKeys(); if (keys == null) { Globals.Ribbons.Ribbon.AskForKeys(success, cancel); } else { success(keys); } }
public HITData() { this.range = null; this.job = -1; numParagraphs = 0; this.stages = new List<StageData>(); tk = new TurKit(this); }