Exemple #1
0
 public PlayThrough(GameWrapperClass currentGame, PlayerWrapperClass currentPlayer, IWordTemplate wordTemplate)
 {
     this.CurrentTries = 0;
     this.WordTemplate = wordTemplate;
     this.p            = currentPlayer;
     this.g            = currentGame;
 }
        // TODO: Not happy passing a word app or doc to this constructor

        /// <summary>
        /// Initializes a new instance of the <see cref="TeamProjectTemplate"/> class.
        /// </summary>
        /// <param name="logger">The logger used for logging.</param>
        /// <param name="wordTemplate">The Word template that underlies the team project template.</param>
        /// <param name="application">The Word application.</param>
        public TeamProjectTemplate(ILogger logger, IWordTemplate wordTemplate, IWordApplication application)
        {
            if (logger == null)
            {
                throw new ArgumentNullException("logger");
            }

            this.logger       = logger;
            this.wordTemplate = wordTemplate;
            this.application  = application;
            this.logger.Log(TraceEventType.Verbose, "Constructing template");
        }
Exemple #3
0
        public void Write <TSection>(string filepath, IWordTemplate <TSection> template) where TSection : class
        {
            var document = new Document();

            var section = document.AddSection();

            template.Execute(section as TSection);

            document.SaveToFile(filepath, FileFormat.Auto);

            document.Close();
            document.Dispose();
        }