Ejemplo n.º 1
0
        /// <summary>
        /// Read all the comment tokens from the application object
        /// </summary>
        public void GetCommentTokens()
        {
            // Variables to represent the properties collection and each property in the Options dialog box.
            properties = default(EnvDTE.Properties);

            // Represents the Task List Node under the Enviroment node.
            properties = ApplicationObject.get_Properties("Environment", "TaskList");

            // Represents the items in the comment Token list and their priorities (1-3/low-high).
            EnvDTE.Property commentProperties = properties.Item("CommentTokens");
            TokensFull = (Object[])commentProperties.Value;
        }
Ejemplo n.º 2
0
        private dynamic getProperties(string propName)
        {
            if (_dteInstance != null)
            {
                try
                {
                    var props = DTE.get_Properties(Consts.Pluginname, Consts.SettingspageServer);

                    //System.IO.File.WriteAllText(@"D:\1.txt", props.Item(propName).Value.ToString());

                    if (props.Item(propName).Value != null && props.Item(propName).Value.GetType().Name == "String")
                    {
                        return(props.Item(propName).Value == "" ? null : props.Item(propName).Value);
                    }

                    return(props.Item(propName).Value);
                }
                catch (System.Exception)
                {
                    return(string.Empty);
                }
            }
            return(string.Empty);
        }