コード例 #1
0
        private void FormatActiveDocument()
        {
            ItemsCollector itemsCollector = new ItemsCollector();

            itemsCollector.CollectActiveProjectItem();

            var document = (itemsCollector.items[0].GetObject() as ProjectItem).Document;

            mDocument = document;
            ExecuteFormatCommand();
        }
コード例 #2
0
        public static bool AreToolbarCommandsEnabled()
        {
            if (IsOpenFolderModeActive())
            {
                return(true);
            }

            ItemsCollector itemCollector = new ItemsCollector();

            itemCollector.CollectActiveProjectItem();

            if (itemCollector.IsEmpty)
            {
                return(false);
            }

            string activeItem    = itemCollector.Items[0].GetName().ToLower();
            var    fileExtension = Path.GetExtension(activeItem);

            return(ScriptConstants.kAcceptedFileExtensions.Contains(fileExtension));
        }
コード例 #3
0
        internal static bool AreToolbarCommandsEnabled()
        {
            if (IsOpenFolderModeActive())
            {
                return(true);
            }

            ItemsCollector itemCollector = new ItemsCollector();

            itemCollector.CollectActiveProjectItem();
            List <string> selectedItems = new List <string>();

            if (itemCollector.HaveItems == false)
            {
                return(false);
            }

            itemCollector.Items.ForEach(i => selectedItems.Add(i.GetName()));

            var fileExtension = Path.GetExtension(selectedItems.FirstOrDefault()).ToLower();

            return(ScriptConstants.kAcceptedFileExtensions.Contains(fileExtension));
        }