예제 #1
0
 public CacheInitalizer(IMainWindowModel mainWindowHandle, ISqliteControler sqliteControler, ISettingsHandler settings, ILogger logger)
 {
     _mainWindowHandle = mainWindowHandle;
     _sqliteControler  = sqliteControler;
     _settings         = settings;
     _logger           = logger;
 }
예제 #2
0
 public SqliteDataFinder(ILogger logger, ISettingsHandler settings, IMainWindowModel mainWindowHandle, ISqliteControler sqLiteControler)
 {
     _mainWindowHandle = mainWindowHandle;
     _settingsHandle   = settings;
     _sqliteControler  = sqLiteControler;
     Start(logger);
 }
        public MainWindowViewModel(IMainWindowModel model)
        {
            if (model is null)
            {
                return;
            }

            _disposables = new CompositeDisposable();
            _model       = model;
            if (_model is IDisposable disposableModel)
            {
                _disposables.Add(disposableModel);
            }

            StartupShortcuts = _model.StartupShortcuts
                               .Select(x => x?.Select(i => new ShortcutForDisplay(i)).ToList())
                               .ToReadOnlyReactivePropertySlim(new List <ShortcutForDisplay>())
                               .AddTo(_disposables);

            AddCommand
            .Subscribe(AddShortcut)
            .AddTo(_disposables);

            RemoveCommand
            .Subscribe(RemoveShortcut)
            .AddTo(_disposables);

            OpenExplorerCommand
            .Subscribe(OpenExplorer)
            .AddTo(_disposables);
        }
예제 #4
0
 /// <summary>
 /// Constructor
 /// </summary>
 public VMMainWindow()
 {
     m_modelWindow = new MainWindowModel();
     m_modelWindow.PropertyChanged += delegate(Object sender, PropertyChangedEventArgs e) {
         NotifyPropertyChanged("VM_" + e.PropertyName);
     };
 }
예제 #5
0
 public SqliteDataFinder(ILogger logger, ISettings settings, IMainWindowModel mainWindowHandle, IDatabaseController databaseController)
 {
     _mainWindowHandle   = mainWindowHandle;
     _settings           = settings;
     _databaseController = databaseController;
     Start(logger);
 }
예제 #6
0
 public Updater(ILogger logger, IMainWindowModel mainWindowHandle)
 {
     _logger           = logger;
     _mainWindowHandle = mainWindowHandle;
     _mainWindowHandle.OnUpdateTextClicked += _mainWindowHandle_OnUpdateTextClicked;
     Start(logger);
 }
예제 #7
0
        private void SetApplicationView(ApplicationView view)
        {
            menuViewConversation.IsChecked = false;
            menuViewGraph.IsChecked        = false;

            switch (view)
            {
            case ApplicationView.ConversationView:
                menuViewConversation.IsChecked = true;
                menuEditCopy.Command           = CopyConversationTextCommand.CopyConversationText;
                _mainWindowModel = _conversationWindowModel;
                break;

            case ApplicationView.GraphView:
                menuViewGraph.IsChecked = true;
                menuEditCopy.Command    = CopyGraphCommand.CopyGraph;
                _mainWindowModel        = _graphWindowModel;
                break;

            default:
                throw new ArgumentException("Invalid conversation view.");
            }

            _currentView = view;
        }
예제 #8
0
 public CacheInitalizer(IMainWindowModel mainWindowHandle, IDatabaseController databaseControler, ISettings settings, ILogger logger)
 {
     _mainWindowHandle  = mainWindowHandle;
     _databaseControler = databaseControler;
     _settings          = settings;
     _logger            = logger;
 }
예제 #9
0
        public static AddressRetrieveViewModel FillAddressByDefault(IMainWindowModel model)
        {
            var resultModel = new AddressRetrieveViewModel();

            switch (GetLangByKey(model.SelectLanguage))
            {
            case "DE":
                resultModel.Name   = "Zusammenschluss \"pronovem\"";
                resultModel.Street = "c/o pronovem - Office Van Malderen Avenue Josse Goffin 158";
                resultModel.City   = "Brüssel";
                break;

            case "FR":
                resultModel.Name   = "Group de mandataire \"pronovem\"";
                resultModel.Street = "c/o pronovem - Office Van Malderen Avenue Josse Goffin 158";
                resultModel.City   = "Bruxelles";
                break;

            case "NL":
                resultModel.Name   = "Vertegenwoordiger groep \"pronovem\"";
                resultModel.Street = "c/o pronovem - Office Van Malderen Avenue Josse Goffin 158";
                resultModel.City   = "Brussel";
                break;
            }
            resultModel.Country  = "BE";
            resultModel.PostCode = "1082";
            resultModel.Fax      = "02 426 37 60";
            resultModel.Phone    = "02 426 38 10";
            resultModel.Email    = "*****@*****.**";

            return(resultModel);
        }
예제 #10
0
 public MainWindowViewModel(IMainWindowModel model)
 {
     _model          = model;
     DisplayMenuItem = _model.GetDisplayMenuItem;
     CommonButtons   = _model.GetCommonButtons;
     _model.ModuleInitialize();
 }
예제 #11
0
 public MainWindowViewModel(IMainWindowModel model)
 {
     this.mainWindowModel = model;
     this.mainWindowModel.PropertyChanged += delegate(Object sender, PropertyChangedEventArgs e)
     {
         NotifyPropertyChanged("VM_" + e.PropertyName);
     };
 }
예제 #12
0
        public void SetDataBindings(IMainWindowModel bindingSource)
        {
            NowPlaying.DataBindings.Add(AsyncBindingHelper.GetBinding(NowPlaying, "Text", bindingSource, "NowPlaying"));
            UpdateText.DataBindings.Add(AsyncBindingHelper.GetBinding(UpdateText, "Text", bindingSource, "UpdateText"));
            BeatmapsLoaded.DataBindings.Add(AsyncBindingHelper.GetBinding(BeatmapsLoaded, "Text", bindingSource, "BeatmapsLoaded"));

            OnUpdateTextClicked += bindingSource.UpdateTextClicked;
        }
 public MainWindowViewModel()
 {
     this.model = new MainWindowModel();
     this.model.PropertyChanged += delegate(object sender, PropertyChangedEventArgs e)
     {
         NotifyPropertyChanged("VM_" + e.PropertyName);
     };
 }
예제 #14
0
        public MainWindowViewModel(IMainWindowModel model)
        {
            _model = model;

            PageButtons   = _model.GetPageButtons;
            CommonButtons = _model.GetCommonButtons;
            ContentPages  = _model.GetContentPages;
            _model.ModelInitialize();
        }
예제 #15
0
 public MainWindowVM()
 {
     this.model         = new MainWindowModel();
     WindowCloseCommand = new DelegateCommand(() => {
         Console.WriteLine("In closeWindow Command");
         this.model.SendCloseCommandToService();
     }
                                              );
 }
예제 #16
0
 /// <summary>
 /// Creates a new main window view model instance.
 /// </summary>
 public MainWindowVM()
 {
     mainWindowModel = new MainWindowModel();
     mainWindowModel.PropertyChanged += delegate(Object sender, PropertyChangedEventArgs e)
     {
         NotifyPropertyChanged("VM_" + e.PropertyName);
     };
     CloseCommand = new DelegateCommand <object>(OnClose, CanClose);
 }
예제 #17
0
 public MainWindowViewModel(IMainWindowModel model)
 {
     this.mainWindowModel = model;
     this.mainWindowModel.PropertyChanged += delegate(Object sender, PropertyChangedEventArgs e)
     {
         NotifyPropertyChanged("VM_" + e.PropertyName);
     };
     //this.CloseCommand = new DelegateCommand<object>(this.OnClose, this.CanClose);
 }
예제 #18
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MainWindowViewModel"/> class.
 /// </summary>
 public MainWindowViewModel()
 {
     this.model                  = new MainWindowModel();
     this.discCommand            = new DelegateCommand <object>(this.OnDisconnect, this.CanDisconnect);
     this.model.PropertyChanged += delegate(object sender, PropertyChangedEventArgs e)
     {
         NotifyPropertyChanged("VM_" + e.PropertyName);
     };
 }
예제 #19
0
 /// <summary>
 /// c'tor
 /// </summary>
 public MainWindowVm()
 {
     this.model             = new MainWindowModel();
     model.PropertyChanged +=
         delegate(Object sender, PropertyChangedEventArgs e)
     {
         NotifyPropertyChanged("VM_" + e.PropertyName);
     };
     this.CloseCommand = new DelegateCommand <object>(this.OnClose, this.CanClose); // close the gui
 }
예제 #20
0
 public MainWindow(IMainWindowModel viewModel)
 {
     DataContext = viewModel;
     Loaded     += (sender, args) =>
     {
         BoundsListView.SelectedIndex = 0;
         BoundsListView.Focus();
     };
     InitializeComponent();
 }
예제 #21
0
        public void Model_PropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            IMainWindowModel m = sender as IMainWindowModel;

            if (m != null && m == model)
            {
                if (e.PropertyName.Equals("Degree"))
                {
                    // Degree = model.Degree;
                }
            }
        }
예제 #22
0
        public MainWindow(ISettingsHandler settings, IMainWindowModel mainWindowHandle, IEnumerable <ISettingsProvider> settingsProviders, Delegates.Exit exitAction)
        {
            _settings         = settings;
            _mainWindowHandle = mainWindowHandle;
            _exitAction       = exitAction;
            _settingsList     = settingsProviders.ToList();

            if (!_settings.Get <bool>(_names.StartHidden))
            {
                ShowWindow();
            }
        }
예제 #23
0
        public MainWindowViewModel(IMainWindowModel mainWindowModel)
        {
            if (mainWindowModel == null)
            {
                throw new ArgumentNullException(nameof(mainWindowModel));
            }

            _mainWindowModel = mainWindowModel;

            _startClickCommand = new CommandHandler(OnStartButtonClick, true);
            _stopClickCommand  = new CommandHandler(OnStopButtonClick, false);
        }
        /// <summary>
        /// MainWindowViewModel constructor
        /// </summary>
        public MainWindowViewModel()
        {
            //Creates a new main window model
            this.main_window_model = new MainWindowModel();
            this.cmd = new DelegateCommand <object>(this.OnDisconnect, this.CanDisconnect);

            //Sets property change delegation
            this.main_window_model.PropertyChanged += delegate(object sender, PropertyChangedEventArgs e)
            {
                NotifyPropertyChanged("VM_" + e.PropertyName);
            };
        }
예제 #25
0
        public MainWindow(IMainWindowModel data, ISettings settings)
        {
            SourceInitialized += Window_SourceInitialized;

            _settings = settings;
            RenderOptions.ProcessRenderMode = RenderMode.SoftwareOnly;

            InitializeComponent();

            SetTheme(_settings.Get <string>(MainWindowPlugin.Theme));
            Style         = (Style)FindResource(typeof(Window));
            DataContext   = data;
            StateChanged += OnStateChanged;
        }
예제 #26
0
        public MainWindowPlugin(ISettings settings, IMainWindowModel mainWindowModel, IEnumerable <ISettingsSource> settingsSources, Delegates.Exit exitAction)
        {
            _settings = settings;
            _settings.SettingUpdated += SettingUpdated;
            _mainWindowModel          = mainWindowModel;
            _exitAction   = exitAction;
            _settingsList = settingsSources.ToList();
            _settingsList.Add(this);

            if (!_settings.Get <bool>(_names.StartHidden))
            {
                ShowWindow();
            }

            _notifyIcon = CreateNotifyIcon();
        }
        public MainWindowViewModel(IMainWindowModel mainWindowModel)
        {
            try
            {
                if (mainWindowModel == null)
                {
                    throw new ArgumentNullException(nameof(mainWindowModel));
                }

                _MainWindowModel = mainWindowModel;

                SendStatusUpdate(Utils.Status_Ready);
            }
            catch (Exception ex)
            {
                //Logging Here
            }
        }
        public MainWindowViewModel(IMainWindowModel model)
        {
            _model       = model;
            TextProgress = new DebugViewItem()
            {
                MenuName       = "Please wait processing....",
                MenuStyle      = Application.Current.Resources["BaseTextBoxStyle"] as Style,
                MenuVisibility = true
            };

            ViewProgressBar = new ProgressBarViewItem()
            {
                MenuName     = "50",
                MenuMinValue = "0",
                MenuMaxValue = "100",
                MenuStyle    = Application.Current.Resources["CustomProgressBar"] as Style,
            };
            var resu = StartEntireProgress();

            CommonUILib.PrismDemoPubSubEvent <bool> .Instance.Subscribe(OnModuleLoaded);
        }
예제 #29
0
        private static List <RetrieveDocModel> GetOriginalDecDomPdf(IMainWindowModel model, SettingsConfigModel configModel)
        {
            SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["PatlabConnection"].ConnectionString);

            try
            {
                conn.Open();
                var exePath = Directory.GetCurrentDirectory();
                var sqlPath = Path.Combine(exePath, "SQL", CommonConst.RetrieveSqlName);

                string query = File.ReadAllText(sqlPath);
                List <RetrieveDocModel> lstRetrieve = null;
                query = query.Replace("@MatterId", model.MatterId);

                using (var cmd = new SqlCommand(query, conn))
                {
                    cmd.Parameters.Clear();
                    cmd.Parameters.AddWithValue("@Category_Id", configModel.CategoryId);
                    using (var dt = new DataTable {
                        TableName = "TableRetrieve"
                    })
                    {
                        dt.Load(cmd.ExecuteReader());
                        lstRetrieve = dt.DataTableMapTo <RetrieveDocModel>();
                    }
                }
                return(lstRetrieve);
            }
            finally
            {
                if (conn.State == ConnectionState.Open)
                {
                    conn.Close();
                }
            }
        }
예제 #30
0
 // -------------------------------------
 // [CONSTRUCTOR]
 // -------------------------------------
 public DocumentViewModel(IMainWindowModel mainWindowModel)
 {
     _mainWindowModel = mainWindowModel;
     ChordLinesView.CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(ChordLinesView_CollectionChanged);
 }
예제 #31
0
 public void GetMainWindowHandle(IMainWindowModel mainWindowHandle)
 {
     _mainWindowHandle = mainWindowHandle;
 }
예제 #32
0
        private void SetApplicationView(ApplicationView view)
        {
            menuViewConversation.IsChecked = false;
            menuViewGraph.IsChecked = false;

            switch (view)
            {
                case ApplicationView.ConversationView:
                    menuViewConversation.IsChecked = true;
                    menuEditCopy.Command = CopyConversationTextCommand.CopyConversationText;
                    _mainWindowModel = _conversationWindowModel;
                    break;
                case ApplicationView.GraphView:
                    menuViewGraph.IsChecked = true;
                    menuEditCopy.Command = CopyGraphCommand.CopyGraph;
                    _mainWindowModel = _graphWindowModel;
                    break;
                default:
                    throw new ArgumentException("Invalid conversation view.");
            }

            _currentView = view;
        }
예제 #33
0
 public virtual void SetMainWindowModel(IMainWindowModel mainModel)
 {
     _mainWindowModel = mainModel;
 }