コード例 #1
0
        public static ReadOnlyCollection <string> FindPluginAsGenericList(string pluginName)
        {
            List <string> namespaces = new List <string>();

            try
            {
                HxRegistryWalkerClass registryWalker  = new HxRegistryWalkerClass();
                IHxRegNamespaceList   help2Namespaces = registryWalker.get_RegisteredNamespaceList("");

                foreach (IHxRegNamespace currentNamespace in help2Namespaces)
                {
                    IHxRegPlugInList p =
                        (IHxRegPlugInList)currentNamespace.GetProperty(HxRegNamespacePropId.HxRegNamespacePlugInList);
                    foreach (IHxRegPlugIn plugin in p)
                    {
                        string currentName = (string)plugin.GetProperty(HxRegPlugInPropId.HxRegPlugInName);
                        if (string.Compare(currentName, pluginName) == 0)
                        {
                            namespaces.Add(currentNamespace.Name);
                            break;
                        }
                    }
                }
            }
            catch (System.Runtime.InteropServices.COMException)
            {
            }
            ReadOnlyCollection <string> roNamespaces = new ReadOnlyCollection <string>(namespaces);

            return(roNamespaces);
        }
コード例 #2
0
        public static bool PluginDoesExist(string namespaceName, string pluginName)
        {
            if (string.IsNullOrEmpty(namespaceName) || string.IsNullOrEmpty(pluginName))
            {
                return(false);
            }

            try
            {
                HxRegistryWalkerClass registryWalker  = new HxRegistryWalkerClass();
                IHxRegNamespaceList   help2Namespaces = registryWalker.get_RegisteredNamespaceList("");

                foreach (IHxRegNamespace currentNamespace in help2Namespaces)
                {
                    if (string.Compare(currentNamespace.Name, namespaceName) == 0)
                    {
                        IHxRegPlugInList p =
                            (IHxRegPlugInList)currentNamespace.GetProperty(HxRegNamespacePropId.HxRegNamespacePlugInList);
                        foreach (IHxRegPlugIn plugin in p)
                        {
                            string currentName = (string)plugin.GetProperty(HxRegPlugInPropId.HxRegPlugInName);
                            if (string.Compare(currentName, pluginName) == 0)
                            {
                                return(true);
                            }
                        }
                    }
                }
            }
            catch (System.Runtime.InteropServices.COMException)
            {
            }
            return(false);
        }
コード例 #3
0
ファイル: PluginSearch.cs プロジェクト: paulushub/SandAssists
        public static IList<string> FindPluginAsGenericList(string pluginName)
		{
			List<string> namespaces = new List<string>();
            if (String.IsNullOrEmpty(pluginName))
            {
                return namespaces;
            }

            try
			{
				HxRegistryWalkerClass registryWalker = new HxRegistryWalkerClass();
				IHxRegNamespaceList help2Namespaces  = 
                    registryWalker.get_RegisteredNamespaceList("");
				
				foreach (IHxRegNamespace currentNamespace in help2Namespaces)
				{
					IHxRegPlugInList p = 
                        (IHxRegPlugInList)currentNamespace.GetProperty(
                        HxRegNamespacePropId.HxRegNamespacePlugInList);
					foreach (IHxRegPlugIn plugin in p)
					{
						string currentName = (string)plugin.GetProperty(
                            HxRegPlugInPropId.HxRegPlugInName);
						if (String.Compare(currentName, pluginName) == 0)
						{
							namespaces.Add(currentNamespace.Name);
							break;
						}
					}
				}
			}
			catch (COMException)
			{
			}

            return namespaces.AsReadOnly();
		}
コード例 #4
0
ファイル: PluginSearch.cs プロジェクト: paulushub/SandAssists
		public static bool PluginDoesExist(string namespaceName, string pluginName)
		{
			if (String.IsNullOrEmpty(namespaceName) || String.IsNullOrEmpty(pluginName))
			{
				return false;
			}

			try
			{
				HxRegistryWalkerClass registryWalker = new HxRegistryWalkerClass();
				IHxRegNamespaceList help2Namespaces  = 
                    registryWalker.get_RegisteredNamespaceList("");

				foreach (IHxRegNamespace currentNamespace in help2Namespaces)
				{
					if (String.Equals(currentNamespace.Name, namespaceName))
					{
						IHxRegPlugInList p =
							(IHxRegPlugInList)currentNamespace.GetProperty(
                            HxRegNamespacePropId.HxRegNamespacePlugInList);
						foreach (IHxRegPlugIn plugin in p)
						{
							string currentName = (string)plugin.GetProperty(
                                HxRegPlugInPropId.HxRegPlugInName);
							if (String.Equals(currentName, pluginName))
							{
								return true;
							}
						}
					}
				}
			}
			catch (COMException)
			{
			}
			return false;
		}