コード例 #1
0
        public override object Load(string fileToLoad, ShowFlags showFlags)
        {
            WpfListerControl lc = null;

//            _controlfp(0x9001F, 0xFFFFF);
            if (!String.IsNullOrEmpty(fileToLoad))
            {
                if ((showFlags & ShowFlags.ForceShow).Equals(ShowFlags.ForceShow))
                {
                    string ext = Path.GetExtension(fileToLoad);
                    if (AllowedExtensionsOnForceShow.IndexOf(ext, StringComparison.InvariantCultureIgnoreCase) < 0)
                    {
                        return(null);
                    }
                }
                lc = new WpfListerControl {
                    WrapText     = GetWrapping(showFlags),
                    AsciiCharset = (showFlags & ShowFlags.Ascii).Equals(ShowFlags.Ascii)
                };

                lc.FileLoad(fileToLoad);
                ScrollProc(0);
                controls.Add(lc);
            }
            return(lc);
        }
コード例 #2
0
        public override ListerResult LoadNext(object control, string fileToLoad, ShowFlags showFlags)
        {
            WpfListerControl lc = (WpfListerControl)control;

            if (!String.IsNullOrEmpty(fileToLoad))
            {
                if ((showFlags & ShowFlags.ForceShow).Equals(ShowFlags.ForceShow))
                {
                    string ext = Path.GetExtension(fileToLoad);
                    if (AllowedExtensionsOnForceShow.IndexOf(ext, StringComparison.InvariantCultureIgnoreCase) < 0)
                    {
                        return(ListerResult.Error);
                    }
                }
                lc.WrapText     = GetWrapping(showFlags);
                lc.AsciiCharset = (showFlags & ShowFlags.Ascii).Equals(ShowFlags.Ascii);
                lc.FileLoad(fileToLoad);
                ScrollProc(0);
                return(ListerResult.OK);
            }
            return(ListerResult.Error);
        }