Exemplo n.º 1
0
        private static ResourceClass.IResource LoadResourceFile(bool refresh, bool headerOnly,
                                                                string ckeyName, ResourceStruct.ResourceType resourceType)
        {
            ChitinKey ckey =
                (ApplicationRuntime.ChitinIndex.CkeyDictionary[resourceType])[ckeyName];

            if (ckey == null)
            {
                return(null);
            }

            ResourceStruct.ResInfo rInfo =
                ResourceStruct.OrderedListNames[ckey.resourceType];

            return(LoadResourceFile(refresh, headerOnly, ckey, rInfo.resourceFileReader));
        }
Exemplo n.º 2
0
        public static void LoadResource(ChitinKey ckey, bool closeResourceOnError)
        {
            ResourceStruct.ResInfo rInfo =
                ResourceStruct.OrderedListNames[ckey.resourceType];
            ResourceClass.IResource irFile =
                ResourceHandler.LoadResourceFile(ckey, rInfo.resourceFileReader);

            if (irFile != null)
            {
                // send the irFile into explorer
                IXExplorer explorer = ApplicationRuntime.Explorers[ckey.resourceType];
                if (!explorer.ShowViewer(rInfo.ViewUserControl, ckey, irFile, closeResourceOnError))
                {
                    MessageBox.Show("Error: Unable to load resource '" + ckey.name + "'!");
                }
            }
        }