Exemple #1
0
        private static ProjectType DetermineType(string path)
        {
            if (string.IsNullOrWhiteSpace(path))
            {
                return(ProjectType.Generic);
            }

            try
            {
                string      ext = Path.GetExtension(path);
                ProjectType type;

                if (!TypesByExtension.TryGetValue(ext, out type))
                {
                    type = ProjectType.Generic;
                }

                return(type);
            }
            catch (Exception ex)
            {
                Trace.WriteLine("Exception from determining project type: " + ex);
                return(ProjectType.Generic);
            }
        }
        private static ItemType DetermineType(string path)
        {
            if (string.IsNullOrWhiteSpace(path))
            {
                return(ItemType.Unknown);
            }

            try
            {
                string   ext = Path.GetExtension(path);
                ItemType type;

                if (!TypesByExtension.TryGetValue(ext, out type))
                {
                    type = ItemType.Unknown;
                }

                return(type);
            }
            catch (Exception ex)
            {
                Trace.WriteLine("Exception from determining item type: " + ex);
                return(ItemType.Unknown);
            }
        }