Exemplo n.º 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;
        }
Exemplo n.º 2
0
        public static string GetNamespaceName(string description)
        {
            HxRegistryWalkerClass registryWalker;
            IHxRegNamespaceList   help2Namespaces;

            try
            {
                registryWalker  = new HxRegistryWalkerClass();
                help2Namespaces = registryWalker.get_RegisteredNamespaceList("");
            }
            catch (System.Runtime.InteropServices.COMException)
            {
                help2Namespaces = null;
                registryWalker  = null;
            }

            if (registryWalker == null || help2Namespaces == null || help2Namespaces.Count == 0)
            {
                return(string.Empty);
            }
            foreach (IHxRegNamespace currentNamespace in help2Namespaces)
            {
                string currentDescription =
                    (string)currentNamespace.GetProperty(HxRegNamespacePropId.HxRegNamespaceDescription);
                if (string.Compare(currentDescription, description) == 0)
                {
                    return(currentNamespace.Name);
                }
            }
            return(string.Empty);
        }
Exemplo n.º 3
0
        public static string GetFirstMatchingNamespaceName(string matchingName)
        {
            HxRegistryWalkerClass registryWalker;
            IHxRegNamespaceList   help2Namespaces;

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

                if (registryWalker == null || help2Namespaces == null || help2Namespaces.Count == 0 || string.IsNullOrEmpty(matchingName))
                {
                    return(string.Empty);
                }
                foreach (IHxRegNamespace currentNamespace in help2Namespaces)
                {
                    if (NativeMethods.PathMatchSpec(currentNamespace.Name, matchingName))
                    {
                        return(currentNamespace.Name);
                    }
                }
                return(help2Namespaces.ItemAt(1).Name);
            }
            catch (System.Runtime.InteropServices.COMException)
            {
                return(string.Empty);
            }
        }
Exemplo n.º 4
0
        public static bool BuildNamespacesList(ComboBox help2Collections, string selectedHelp2Collection)
        {
            if (help2Collections == null)
            {
                throw new ArgumentNullException("help2Collections");
            }

            HxRegistryWalkerClass registryWalker;
            IHxRegNamespaceList   help2Namespaces;

            try
            {
                registryWalker  = new HxRegistryWalkerClass();
                help2Namespaces = registryWalker.get_RegisteredNamespaceList("");
            }
            catch (System.Runtime.InteropServices.COMException)
            {
                help2Namespaces = null;
                registryWalker  = null;
            }

            if (registryWalker == null || help2Namespaces == null || help2Namespaces.Count == 0)
            {
                return(false);
            }

            help2Collections.Items.Clear();
            help2Collections.BeginUpdate();
            try
            {
                string currentDescription = string.Empty;

                foreach (IHxRegNamespace currentNamespace in help2Namespaces)
                {
                    help2Collections.Items.Add
                        ((string)currentNamespace.GetProperty(HxRegNamespacePropId.HxRegNamespaceDescription));

                    if (!string.IsNullOrEmpty(selectedHelp2Collection) &&
                        string.Compare(selectedHelp2Collection, currentNamespace.Name) == 0)
                    {
                        currentDescription =
                            (string)currentNamespace.GetProperty(HxRegNamespacePropId.HxRegNamespaceDescription);
                    }
                }

                if (!string.IsNullOrEmpty(currentDescription))
                {
                    help2Collections.SelectedIndex = help2Collections.Items.IndexOf(currentDescription);
                }
                else
                {
                    help2Collections.SelectedIndex = 0;
                }
            }
            finally
            {
                help2Collections.EndUpdate();
            }
            return(true);
        }
Exemplo n.º 5
0
		public static string GetFirstMatchingNamespaceName(string matchingName)
		{
			HxRegistryWalkerClass registryWalker;
			IHxRegNamespaceList help2Namespaces;
			try
			{
				registryWalker = new HxRegistryWalkerClass();
				help2Namespaces = registryWalker.get_RegisteredNamespaceList("");
			}
			catch (COMException)
			{
				help2Namespaces = null;
				registryWalker = null;
			}

			if (registryWalker == null || help2Namespaces == null || 
                help2Namespaces.Count == 0 || String.IsNullOrEmpty(matchingName))
			{
				return String.Empty;
			}
			foreach (IHxRegNamespace currentNamespace in help2Namespaces)
			{
				if (PathMatchSpec(currentNamespace.Name, matchingName))
				{
					return currentNamespace.Name;
				}
			}

			return help2Namespaces.ItemAt(1).Name;
		}
Exemplo n.º 6
0
        public static string GetFirstNamespace(string name)
        {
            HxRegistryWalkerClass registryWalker;
            IHxRegNamespaceList   help2Namespaces;

            try
            {
                registryWalker  = new HxRegistryWalkerClass();
                help2Namespaces = registryWalker.get_RegisteredNamespaceList("");
            }
            catch (System.Runtime.InteropServices.COMException)
            {
                help2Namespaces = null;
                registryWalker  = null;
            }

            if (registryWalker == null || help2Namespaces == null || help2Namespaces.Count == 0)
            {
                return(string.Empty);
            }
            foreach (IHxRegNamespace currentNamespace in help2Namespaces)
            {
                if (string.Compare(currentNamespace.Name, name) == 0)
                {
                    return(name);
                }
            }
            return(help2Namespaces.ItemAt(1).Name);
        }
		public static string GetNamespaceName(string description)
		{
			HxRegistryWalkerClass registryWalker;
			IHxRegNamespaceList help2Namespaces;
			try
			{
				registryWalker = new HxRegistryWalkerClass();
				help2Namespaces = registryWalker.get_RegisteredNamespaceList("");
			}
			catch (System.Runtime.InteropServices.COMException)
			{
				help2Namespaces = null;
				registryWalker = null;
			}

			if (registryWalker == null || help2Namespaces == null || help2Namespaces.Count == 0)
			{
				return string.Empty;
			}
			foreach (IHxRegNamespace currentNamespace in help2Namespaces)
			{
				string currentDescription =
					(string)currentNamespace.GetProperty(HxRegNamespacePropId.HxRegNamespaceDescription);
				if (string.Compare(currentDescription, description) == 0)
				{
					return currentNamespace.Name;
				}
			}
			return string.Empty;
		}
        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);
        }
        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);
        }
		public static bool BuildNamespacesList(ComboBox help2Collections, string selectedHelp2Collection)
		{
			if (help2Collections == null)
			{
				throw new ArgumentNullException("help2Collections");
			}

			HxRegistryWalkerClass registryWalker;
			IHxRegNamespaceList help2Namespaces;
			try
			{
				registryWalker = new HxRegistryWalkerClass();
				help2Namespaces = registryWalker.get_RegisteredNamespaceList("");
			}
			catch (System.Runtime.InteropServices.COMException)
			{
				help2Namespaces = null;
				registryWalker = null;
			}

			if (registryWalker == null || help2Namespaces == null || help2Namespaces.Count == 0)
			{
				return false;
			}

			help2Collections.Items.Clear();
			help2Collections.BeginUpdate();
			try
			{
				string currentDescription = string.Empty;

				foreach (IHxRegNamespace currentNamespace in help2Namespaces)
				{
					help2Collections.Items.Add
						((string)currentNamespace.GetProperty(HxRegNamespacePropId.HxRegNamespaceDescription));

					if (!string.IsNullOrEmpty(selectedHelp2Collection) &&
					    string.Compare(selectedHelp2Collection, currentNamespace.Name) == 0)
					{
						currentDescription =
							(string)currentNamespace.GetProperty(HxRegNamespacePropId.HxRegNamespaceDescription);
					}
				}

				if (!string.IsNullOrEmpty(currentDescription))
					help2Collections.SelectedIndex = help2Collections.Items.IndexOf(currentDescription);
				else
					help2Collections.SelectedIndex = 0;
			}
			finally
			{
				help2Collections.EndUpdate();
			}
			return true;
		}
Exemplo n.º 11
0
        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();
		}
Exemplo n.º 12
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.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;
		}
Exemplo n.º 13
0
        public static string GetFirstMatchingNamespaceName(string matchingName)
        {
            HxRegistryWalkerClass registryWalker;
            IHxRegNamespaceList help2Namespaces;
            try
            {
                registryWalker = new HxRegistryWalkerClass();
                help2Namespaces = registryWalker.get_RegisteredNamespaceList("");
            }
            catch (System.Runtime.InteropServices.COMException)
            {
                help2Namespaces = null;
                registryWalker = null;
            }

            if (registryWalker == null || help2Namespaces == null || help2Namespaces.Count == 0 || string.IsNullOrEmpty(matchingName))
            {
                return string.Empty;
            }
            foreach (IHxRegNamespace currentNamespace in help2Namespaces)
            {
                if (NativeMethods.PathMatchSpec(currentNamespace.Name, matchingName))
                {
                    return currentNamespace.Name;
                }
            }
            return help2Namespaces.ItemAt(1).Name;
        }
Exemplo n.º 14
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;
        }
		public static string GetFirstNamespace(string name)
		{
			HxRegistryWalkerClass registryWalker;
			IHxRegNamespaceList help2Namespaces;
			try
			{
				registryWalker = new HxRegistryWalkerClass();
				help2Namespaces = registryWalker.get_RegisteredNamespaceList("");
			}
			catch (System.Runtime.InteropServices.COMException)
			{
				help2Namespaces = null;
				registryWalker = null;
			}

			if (registryWalker == null || help2Namespaces == null || help2Namespaces.Count == 0)
			{
				return string.Empty;
			}
			foreach (IHxRegNamespace currentNamespace in help2Namespaces)
			{
				if (string.Compare(currentNamespace.Name, name) == 0)
				{
					return name;
				}
			}
			return help2Namespaces.ItemAt(1).Name;
		}