示例#1
0
        public bool ShowViewer(IUserControl uc, ChitinKey ckey, ResourceClass.IResource irFile)
        {
            this.uc = uc;

            // -1 == bad load so close formresource
            //  0 == bad load but keep formresource open
            //  1 == good load
            if (uc.SetResourceParams(ckey, irFile) < 0)
            {
                return(false);
            }

            this.TabText = ResourceStruct.ResourceFileExt(ckey.resourceType) + ":" + ckey.name;
            this.Text    = this.TabText;

            if ((!isCommon) || ((this.viewUControl == null) && (this.editUControl == null)))
            {
                ReloadViewer(uc);
                //ReloadEditor(uc);
            }

            this.Show(ApplicationRuntime.DockPanel);

            return(true);
        }
 private static IDockContent GetContentFromPersistString(string persistString)
 {
     if (persistString == "")
     {
         return(null);
         // return new FormResource();
     }
     else
     {
         ResourceStruct.ResourceType rType =
             ResourceStruct.ResourceFromCode(Convert.ToInt32(persistString));
         return(explorers[rType].Form);
     }
 }
示例#3
0
        public static string FindOverrideFile(string keyName, ResourceStruct.ResourceType resourceType)
        {
            // First try the override File
            string overrideFile = Path.Combine(ApplicationRuntime.AppPaths.OverrideDirectory,
                                               keyName + "." + ResourceStruct.ResourceFileExt(resourceType));

            if (File.Exists(overrideFile))
            {
                return(overrideFile.ToUpper());
            }
            else
            {
                return(null);
            }
        }
示例#4
0
        private static ChitinKey CreateChitinKey(ref FileStruct.TSChitinKey tsChitinKey)
        {
            ChitinKey ckey = new ChitinKey();

            ckey.name = Utils.CharsToString(tsChitinKey.ckeyName).ToUpper();

            if (ckey.name == "")
            {
                return(null);
            }

            ckey.resourceType = ResourceStruct.ResourceFromCode(tsChitinKey.ckeyType);
            ckey.ckeyIndex    = (ushort)(tsChitinKey.ckeyIndex & 0x3FFF);
            ckey.tileIndex    = (ushort)(((tsChitinKey.ckeyIndex >> 14) | ((tsChitinKey.biffIndex & 0x0F) << 2)) - 1);
            ckey.biffIndex    = (ushort)(tsChitinKey.biffIndex >> 4);
            ckey.isBiffed     = true;

            return(ckey);
        } // false for override