Esempio n. 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);
        }
Esempio n. 2
0
        public override ListerResult SendCommand(object control, ListerCommand command, ShowFlags parameter)
        {
            WpfListerControl lc = (WpfListerControl)control;

            switch (command)
            {
            case ListerCommand.Copy:
                lc.Copy();
                break;

            case ListerCommand.SelectAll:
                lc.SelectAll();
                break;

            case ListerCommand.NewParams:
                lc.WrapText     = GetWrapping(parameter);
                lc.AsciiCharset = (parameter & ShowFlags.Ascii).Equals(ShowFlags.Ascii);
                break;

            case ListerCommand.SetPercent:
                lc.SetPercent((int)parameter);
                ScrollProc((int)parameter);
                break;
            }
            return(ListerResult.OK);
        }
Esempio n. 3
0
        public override ListerResult Print(object control, string fileToPrint, string defPrinter,
                                           PrintFlags printFlags, PrintMargins pMargins)
        {
            WpfListerControl lc     = (WpfListerControl)control;
            PrintDialog      dialog = new PrintDialog();

            if (dialog.ShowDialog().GetValueOrDefault(false))
            {
                MessageBox.Show("WPF Form print stub");
            }
            return(ListerResult.OK);
        }
Esempio n. 4
0
        public override ListerResult SearchText(object control, string searchString, SearchParameter searchParameter)
        {
            WpfListerControl lc         = (WpfListerControl)control;
            bool             matchCase  = (searchParameter & SearchParameter.MatchCase).Equals(SearchParameter.MatchCase);
            bool             wholeWords = (searchParameter & SearchParameter.WholeWords).Equals(SearchParameter.WholeWords);
            bool             findFirst  = (searchParameter & SearchParameter.FindFirst).Equals(SearchParameter.FindFirst);
            bool             backwards  = (searchParameter & SearchParameter.Backwards).Equals(SearchParameter.Backwards);
            int percent = lc.Search(searchString, matchCase, wholeWords, findFirst, backwards, 0);

            if (percent >= 0)
            {
                ScrollProc(percent);
            }
            return(ListerResult.OK);
        }
Esempio n. 5
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);
        }