IsFileSupported() public static method

public static IsFileSupported ( string file ) : bool
file string
return bool
Exemplo n.º 1
0
        private void BeforeQueryStatus(object sender, EventArgs e)
        {
            OleMenuCommand button = (OleMenuCommand)sender;

            button.Enabled = button.Visible = false;

            var item = ProjectHelpers.GetSelectedItems().FirstOrDefault();

            if (item == null || item.FileCount == 0)
            {
                return;
            }

            string file = item.FileNames[1];

            button.Enabled = button.Visible = CommandHelpers.IsFileSupported(file);
        }
Exemplo n.º 2
0
        public bool IsDropEnabled(DragDropInfo dragDropInfo)
        {
            _fileName = GetImageFilename(dragDropInfo);

            if (string.IsNullOrEmpty(_fileName) || !CommandHelpers.IsFileSupported(_fileName) || VSPackage._dte.ActiveDocument == null)
            {
                return(false);
            }

            string activeFile = Path.GetFileName(VSPackage._dte.ActiveDocument.FullName);

            if (Constants.FILENAME.Equals(activeFile, StringComparison.OrdinalIgnoreCase))
            {
                return(true);
            }

            return(false);
        }