Ejemplo n.º 1
0
                public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
                {
                    ContentFileDescriptor descriptor = context != null ? context.Instance as ContentFileDescriptor : null;

                    if (descriptor == null || descriptor.file == null)
                    {
                        return(new StandardValuesCollection(null));
                    }

                    ContentProject project = descriptor.file.Project as ContentProject;

                    if (project == null)
                    {
                        return(new StandardValuesCollection(null));
                    }

                    List <string> ret = new List <string>();

                    foreach (ContentProcessorInfo info in project.Processors)
                    {
                        ret.Add(info.Name);
                    }

                    return(new StandardValuesCollection(ret));
                }
Ejemplo n.º 2
0
                public override bool IsValid(ITypeDescriptorContext context, object value)
                {
                    string str = value as string;

                    if (str == null)
                    {
                        return(false);
                    }

                    ContentFileDescriptor descriptor = context != null ? context.Instance as ContentFileDescriptor : null;

                    if (descriptor == null || descriptor.file == null)
                    {
                        return(false);
                    }

                    ContentProject project = descriptor.file.Project as ContentProject;

                    if (project == null)
                    {
                        return(false);
                    }

                    foreach (ContentProcessorInfo info in project.Processors)
                    {
                        if (info.Name == str || info.DisplayName == str)
                        {
                            return(true);
                        }
                    }

                    return(false);
                }
Ejemplo n.º 3
0
                public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
                {
                    ContentFileDescriptor descriptor = context != null ? context.Instance as ContentFileDescriptor : null;

                    if (descriptor == null || descriptor.file == null)
                    {
                        return(false);
                    }

                    ContentProject project = descriptor.file.Project as ContentProject;

                    return(project != null);
                }