protected static string CreateFilterEntry(ImageEditor e)
 {
     string fileDialogDescription = e.GetFileDialogDescription();
     string str2 = CreateExtensionsString(e.GetExtensions(), ",");
     string str3 = CreateExtensionsString(e.GetExtensions(), ";");
     return (fileDialogDescription + "(" + str2 + ")|" + str3);
 }
Esempio n. 2
0
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")] // previously shipped this way. Would be a breaking change.
        protected static string CreateFilterEntry(ImageEditor e)
        {
            string desc      = e.GetFileDialogDescription();
            string exts      = CreateExtensionsString(e.GetExtensions(), ",");
            string extsSemis = CreateExtensionsString(e.GetExtensions(), ";");

            return(desc + "(" + exts + ")|" + extsSemis);
        }
Esempio n. 3
0
        protected static string CreateFilterEntry(ImageEditor e)
        {
            string fileDialogDescription = e.GetFileDialogDescription();
            string str2 = CreateExtensionsString(e.GetExtensions(), ",");
            string str3 = CreateExtensionsString(e.GetExtensions(), ";");

            return(fileDialogDescription + "(" + str2 + ")|" + str3);
        }
Esempio n. 4
0
        protected virtual string[] GetExtensions()
        {
            ArrayList list = new ArrayList();

            foreach (Type extender in GetImageExtenders())
            {
                // Skip invalid extenders.
                if (extender == null || !typeof(ImageEditor).IsAssignableFrom(extender))
                {
                    continue;
                }

                ImageEditor e = (ImageEditor)Activator.CreateInstance(extender, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.CreateInstance, null, null, null);
                if (e.GetType() != typeof(ImageEditor))
                {
                    string[] extensions = e.GetExtensions();
                    if (extensions != null)
                    {
                        list.AddRange(extensions);
                    }
                }
            }

            return((string[])list.ToArray(typeof(string)));
        }
Esempio n. 5
0
        protected static string CreateFilterEntry(ImageEditor e)
        {
            StringBuilder sb     = new StringBuilder();
            string        ExtStr = CreateExtensionsString(e.GetExtensions(), ";");

            sb.Append(e.GetFileDialogDescription());
            sb.Append(" (" + ExtStr + ")" + "|");
            sb.Append(ExtStr);
            return(sb.ToString());
        }
Esempio n. 6
0
        protected static string CreateFilterEntry(ImageEditor e)
        {
            ArgumentNullException.ThrowIfNull(e);

            string[] extenders   = e.GetExtensions();
            string   description = e.GetFileDialogDescription();
            string   extensions  = CreateExtensionsString(extenders, ",");
            string   extensionsWithSemicolons = CreateExtensionsString(extenders, ";");

            return($"{description}({extensions})|{extensionsWithSemicolons}");
        }
Esempio n. 7
0
        protected static string CreateFilterEntry(ImageEditor e)
        {
            if (e == null)
            {
                throw new ArgumentNullException(nameof(e));
            }

            string[] extenders = e.GetExtensions();
            string   desc      = e.GetFileDialogDescription();
            string   exts      = CreateExtensionsString(extenders, ",");
            string   extsSemis = CreateExtensionsString(extenders, ";");

            return(desc + "(" + exts + ")|" + extsSemis);
        }
Esempio n. 8
0
        protected virtual string[] GetExtensions()
        {
            ArrayList list = new ArrayList();

            for (int i = 0; i < this.GetImageExtenders().Length; i++)
            {
                ImageEditor editor = (ImageEditor)Activator.CreateInstance(this.GetImageExtenders()[i], BindingFlags.CreateInstance | BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance, null, null, null);
                if (!editor.GetType().Equals(typeof(ImageEditor)))
                {
                    list.AddRange(new ArrayList(editor.GetExtensions()));
                }
            }
            return((string[])list.ToArray(typeof(string)));
        }
Esempio n. 9
0
        [SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")] // everything in this assembly is full trust.
        protected virtual string[] GetExtensions()
        {
            // We should probably smash them together...
            ArrayList list = new ArrayList();

            for (int i = 0; i < GetImageExtenders().Length; i++)
            {
                ImageEditor e = (ImageEditor)Activator.CreateInstance(GetImageExtenders()[i], BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.CreateInstance, null, null, null);   //.CreateInstance();
                if (e.GetType() != typeof(ImageEditor))
                {
                    list.AddRange(new ArrayList(e.GetExtensions()));
                }
            }
            return((string[])list.ToArray(typeof(string)));
        }
Esempio n. 10
0
		protected static string CreateFilterEntry (ImageEditor e)
		{
			StringBuilder sb = new StringBuilder();
			string ExtStr = CreateExtensionsString (e.GetExtensions(), ";");

			sb.Append (e.GetFileDialogDescription());
			sb.Append (" (" + ExtStr + ")" + "|");
			sb.Append (ExtStr);
			return sb.ToString();
		}