IsValidGUID() public static method

public static IsValidGUID ( string guid ) : bool
guid string
return bool
Exemplo n.º 1
0
        public dynamic QueryInterface(string name)
        {
            Guid   iid = Guid.Empty;
            object o   = null;

            if (COMUtilities.IsValidGUID(name))
            {
                iid = new Guid(name);
            }
            else
            {
                foreach (KeyValuePair <Guid, string> pair in Interfaces)
                {
                    if (String.Compare(pair.Value, name, true) == 0)
                    {
                        iid = pair.Key;
                        break;
                    }
                }
            }

            Type type = COMUtilities.GetInterfaceType(iid);

            if (type != null)
            {
                o = new DynamicComObjectWrapper(m_registry, type, Instance);
            }

            return(o);
        }
Exemplo n.º 2
0
        private object QueryInterface(string name)
        {
            Guid   iid = Guid.Empty;
            object o   = null;

            if (COMUtilities.IsValidGUID(name))
            {
                iid = new Guid(name);
            }
            else
            {
                foreach (COMInterfaceEntry ent in GetInterfaces())
                {
                    if (String.Equals(ent.Name, name, StringComparison.OrdinalIgnoreCase))
                    {
                        iid = ent.Iid;
                        break;
                    }
                }
            }

            Type type = COMUtilities.GetInterfaceType(iid);

            if (type != null)
            {
                o = new DynamicComObjectWrapper(_registry, type, _target);
            }

            return(o);
        }
Exemplo n.º 3
0
        public COMMimeType(string mime_type, RegistryKey key)
        {
            string clsid     = key.GetValue("CLSID") as string;
            string extension = key.GetValue("Extension") as string;

            if ((clsid != null) && (COMUtilities.IsValidGUID(clsid)))
            {
                Clsid = Guid.Parse(clsid);
            }
            Extension = extension;
            MimeType  = mime_type;
        }
Exemplo n.º 4
0
        internal COMCLSIDElevationEntry(RegistryKey key, RegistryKey vso_key, bool auto_approval)
        {
            Enabled       = COMUtilities.ReadIntFromKey(key, null, "Enabled") != 0;
            IconReference = COMUtilities.ReadStringFromKey(key, null, "IconReference");
            HashSet <Guid> vsos = new HashSet <Guid>();

            if (vso_key != null)
            {
                foreach (string value in vso_key.GetValueNames())
                {
                    if (COMUtilities.IsValidGUID(value))
                    {
                        vsos.Add(new Guid(value));
                    }
                }
            }
            AutoApproval         = auto_approval;
            VirtualServerObjects = new List <Guid>(vsos).AsReadOnly();
        }