コード例 #1
0
        /// <summary>
        /// Constructor initializing add in AHP and DDSP.
        /// </summary>
        private AcronymsHighlightFacade()
        {
            this.plugin = AcronymsHighlightPlugin.newInstance();
            IDocumentDetails details = AddInManager.instance.getDocumentDetails();
            IDocumentProperty pathToDataSource = details.get(WordDocumentProperties.DataSourceLibPathPropertyName);

            if (pathToDataSource != null && !string.IsNullOrWhiteSpace(pathToDataSource.value.ToString()))
            {
                this.provider = DDSP.DynamicDataSourceProvider.newInstance(pathToDataSource.value.ToString(), details);
            }

            AddInManager.instance.DocumentDetailsUpdated += new EventHandler<UpdateDocumentDetailsEventArgs>(refreshDDSP);
        }
コード例 #2
0
        public bool refreshDDSP(IDocumentProperty property)
        {
            bool result = false;
            if (property.name.Equals(WordDocumentProperties.DataSourceLibPathPropertyName))
            {
                if (!string.IsNullOrWhiteSpace(property.value.ToString()))
                {
                    this.provider = DDSP.DynamicDataSourceProvider.newInstance(property.value.ToString(), AddInManager.instance.getDocumentDetails());
                    result = true;
                }
            }

            return result;
        }