public static void RegisterFileGroup(string sViewerAppPageName, string sViewerAppAssyName, bool bViewerAppAllowList, bool bViewerAppSendContent, string sGroup, string sExtList)
        {
            if (sGroup.Length == 0)
            {
                return;
            }

            string [] asExts = sExtList.Split(';');
            foreach (string sExt in asExts)
            {
                if (sExt.Length == 0)
                {
                    continue;
                }

                string sExtNorm = sExt.ToLower();
                int    iPos     = sExtNorm.LastIndexOf('.');
                if (iPos >= 0)
                {
                    sExtNorm = sExtNorm.Substring(iPos);
                }
                else
                {
                    sExtNorm = "." + sExtNorm;
                }

                RscRegistry.WriteString(HKEY.HKEY_CLASSES_ROOT, "()" + sExtNorm, "Group", sGroup);
            }

            RscRegistry.WriteString(HKEY.HKEY_CLASSES_ROOT, "Groups\\" + sGroup, "ViewerAppPageName", sViewerAppPageName);
            RscRegistry.WriteString(HKEY.HKEY_CLASSES_ROOT, "Groups\\" + sGroup, "ViewerAppAssyName", sViewerAppAssyName);
            RscRegistry.WriteBool(HKEY.HKEY_CLASSES_ROOT, "Groups\\" + sGroup, "ViewerAppAllowList", bViewerAppAllowList);
            RscRegistry.WriteBool(HKEY.HKEY_CLASSES_ROOT, "Groups\\" + sGroup, "ViewerAppSendContent", bViewerAppSendContent);
        }
Example #2
0
        public void Flush()
        {
            for (int i = 0; i < m_a.Count; i++)
            {
                RscRegistry.WriteString(m_hk, m_sPath, m_sTitle + i.ToString(), m_a[i]);
            }
            RscRegistry.WriteDWORD(m_hk, m_sPath, m_sTitle + "Count", m_a.Count);

            for (int i = ((m_a.Count - 1) + 1); i < (m_iCountWritten - 1); i++)
            {
                RscRegistry.DeleteValue(m_hk, m_sPath, m_sTitle + i.ToString());
            }
        }
Example #3
0
        public RscRegistryValueList(HKEY hk, string sPath, string sTitle = "Item")
        {
            m_hk     = hk;
            m_sPath  = sPath;
            m_sTitle = sTitle;

            m_iCountWritten = RscRegistry.ReadDWORD(m_hk, m_sPath, sTitle + "Count", 0);
            for (int i = 0; i < m_iCountWritten; i++)
            {
                string sVal = RscRegistry.ReadString(m_hk, m_sPath, sTitle + i.ToString(), "");
                m_a.Add(sVal);
            }
        }
        public static string GetFileGroupEx(string sExtension)
        {
            if (sExtension.Length == 0)
            {
                return("");
            }
            if (sExtension[0] != '.')
            {
                sExtension = "." + sExtension;
            }

            return(RscRegistry.ReadString(HKEY.HKEY_CLASSES_ROOT, "()" + sExtension, "Group", ""));
        }
 public static bool GetViewerAppSendContent(string sGroup)
 {
     return(RscRegistry.ReadBool(HKEY.HKEY_CLASSES_ROOT, "Groups\\" + sGroup, "ViewerAppSendContent", false));
 }
 public static string GetViewerAppAssyName(string sGroup)
 {
     return(RscRegistry.ReadString(HKEY.HKEY_CLASSES_ROOT, "Groups\\" + sGroup, "ViewerAppAssyName", ""));
 }