public EditPage(string pageName)
        {
            InitializeComponent();

            _dal = new PagesDal(new LocalWikiStorage(), new DesktopHtmlWrapper());
            _pageName = pageName;

            Title = Title + " " + _pageName;
            textBox1.Text = _dal.GetTextOfPage(pageName);
            textBox1.AllowDrop = true;
        }
        public EditPage(string pageName)
        {
            InitializeComponent();

            _dal      = new PagesDal(new LocalWikiStorage(), new DesktopHtmlWrapper());
            _pageName = pageName;

            Title              = Title + " " + _pageName;
            textBox1.Text      = _dal.GetTextOfPage(pageName);
            textBox1.AllowDrop = true;
        }
Пример #3
0
        public EditPage(string pageName)
        {
            InitializeComponent();

            mDal      = new PagesDal();
            mPageName = pageName;

            Title              = Title + " " + mPageName;
            textBox1.Text      = mDal.GetTextOfPage(pageName);
            textBox1.AllowDrop = true;
        }
Пример #4
0
        public ViewPage()
        {
            InitializeComponent();

            DataContext = this;

            if (!string.IsNullOrEmpty(App.Command))
            {
                mCurrentPage = new HistoryItem(App.Command);
            }
            else
            {
                mCurrentPage = new HistoryItem(PagesDal.DEFAULT_PAGE);
            }

            Keyboard.AddGotKeyboardFocusHandler(this, gotKeyboardFocus);
            Keyboard.AddLostKeyboardFocusHandler(this, lostKeyboardFocus);

            webBrowser1.Navigating    += webBrowser1_Navigating;
            webBrowser1.LoadCompleted += webBrowser1_LoadCompleted;
            var jsinterop = new JavascriptInterop();

            webBrowser1.ObjectForScripting  = jsinterop;
            jsinterop.InvokeFromJavascript += jsinterop_InvokeFromJavascript;
            webBrowser1.PreviewKeyDown     += webBrowser1_KeyDown;

            mSearchWatermarkText      = textBoxSearch.Text;
            mSearchWatermarkBrush     = textBoxSearch.Foreground;
            mSearchWatermarkFontStyle = textBoxSearch.FontStyle;

            mDal = new PagesDal();

            EditCommand = new RelayCommand(() => buttonEdit_Click(null, null));
            InputBindings.Add(new KeyBinding(EditCommand, new KeyGesture(Key.E, ModifierKeys.Control)));
            BackCommand = new RelayCommand(() => buttonBack_Click(null, null));
            HomeCommand = new RelayCommand(() => buttonHome_Click(null, null));
            InputBindings.Add(new KeyBinding(HomeCommand, new KeyGesture(Key.Home, ModifierKeys.Alt)));
            FindCommand = new RelayCommand(() => textBoxSearch.Focus());
            InputBindings.Add(new KeyBinding(FindCommand, new KeyGesture(Key.OemQuestion, ModifierKeys.Control)));
            RecentCommand = new RelayCommand(() => recentModifications());
            InputBindings.Add(new KeyBinding(RecentCommand, new KeyGesture(Key.R, ModifierKeys.Control)));

            initWatcher();

            refresh();

            restorePosition();

            Loaded   += (sender, e) => registerHotkey();
            Unloaded += (sender, e) => unregisterHotkey();
        }
        public ViewPage()
        {
            InitializeComponent();

            DataContext = this;

            if (!string.IsNullOrEmpty(App.Command))
            {
                mCurrentPage = new HistoryItem(App.Command);
            }
            else
            {
                mCurrentPage = new HistoryItem(PagesDal.DEFAULT_PAGE);
            }

            Keyboard.AddGotKeyboardFocusHandler(this, gotKeyboardFocus);
            Keyboard.AddLostKeyboardFocusHandler(this, lostKeyboardFocus);

            webBrowser1.Navigating += webBrowser1_Navigating;
            webBrowser1.LoadCompleted += webBrowser1_LoadCompleted;
            var jsinterop = new JavascriptInterop();
            webBrowser1.ObjectForScripting = jsinterop;
            jsinterop.InvokeFromJavascript += jsinterop_InvokeFromJavascript;
            webBrowser1.PreviewKeyDown += webBrowser1_KeyDown;

            mSearchWatermarkText = textBoxSearch.Text;
            mSearchWatermarkBrush = textBoxSearch.Foreground;
            mSearchWatermarkFontStyle = textBoxSearch.FontStyle;

            mDal = new PagesDal();

            EditCommand = new RelayCommand(() => buttonEdit_Click(null, null));
            InputBindings.Add(new KeyBinding(EditCommand, new KeyGesture(Key.E, ModifierKeys.Control)));
            BackCommand = new RelayCommand(() => buttonBack_Click(null, null));
            HomeCommand = new RelayCommand(() => buttonHome_Click(null, null));
            InputBindings.Add(new KeyBinding(HomeCommand, new KeyGesture(Key.Home, ModifierKeys.Alt)));
            FindCommand = new RelayCommand(() => textBoxSearch.Focus());
            InputBindings.Add(new KeyBinding(FindCommand, new KeyGesture(Key.OemQuestion, ModifierKeys.Control)));
            RecentCommand = new RelayCommand(() => recentModifications());
            InputBindings.Add(new KeyBinding(RecentCommand, new KeyGesture(Key.R, ModifierKeys.Control)));

            initWatcher();

            refresh();

            restorePosition();

            Loaded += (sender, e) => registerHotkey();
            Unloaded += (sender, e) => unregisterHotkey();
        }