Пример #1
0
        /// <summary>
        /// Is called by SimPe (through the Wrapper) when the Panel is going to be displayed, so
        /// you should updatet the Data displayed by the Panel with the Attributes stored in the
        /// passed Wrapper.
        /// </summary>
        /// <param name="wrapper">The Attributes of this Wrapper have to be displayed</param>
        public void UpdateGUI(IFileWrapper wrapper)
        {
            form.wrapper = (IFileWrapperSaveExtension)wrapper;
            Nref wrp = (Nref)wrapper;

            form.tbNref.Tag  = true;
            form.tbNref.Text = wrp.FileName;
            form.tbNref.Tag  = null;
        }
Пример #2
0
        public override void SearchPackage(SimPe.Interfaces.Files.IPackageFile pkg, SimPe.Interfaces.Files.IPackedFileDescriptor pfd)
        {
            if (pfd.Type != 0x4E524546)
            {
                return;
            }
            SimPe.PackedFiles.Wrapper.Nref nref = new Nref();
            nref.ProcessData(pfd, pkg);


            bool   found = false;
            string n     = nref.FileName.Trim().ToLower();

            if (compareType == CompareType.Equal)
            {
                found = n == name;
            }
            else if (compareType == CompareType.Start)
            {
                found = n.StartsWith(name);
            }
            else if (compareType == CompareType.End)
            {
                found = n.EndsWith(name);
            }
            else if (compareType == CompareType.Contain)
            {
                found = n.IndexOf(name) > -1;
            }
            else if (compareType == CompareType.RegExp && reg != null)
            {
                found = reg.IsMatch(n);
            }

            //we have a match, so add the result item
            if (found)
            {
                ResultGui.AddResult(pkg, pfd);
            }
        }