Exemple #1
0
 private void SetupSendDropDownCommands(ITranslationUpdater translationUpdater)
 {
     SendDropDownCommands = new CommandCollection <PrintJobViewTranslation>(translationUpdater);
     SendDropDownCommands.AddCommand(_changeJobCheckAndProceedCommandBuilder.BuildCommand(EnableSmtp), t => t.Smtp);
     SendDropDownCommands.AddCommand(_changeJobCheckAndProceedCommandBuilder.BuildCommand(EnableDropBox), t => t.Dropbox);
     SendDropDownCommands.AddCommand(_changeJobCheckAndProceedCommandBuilder.BuildCommand(EnableFtp), t => t.Ftp);
 }
Exemple #2
0
        private void SetupSaveCommands(ITranslationUpdater translationUpdater)
        {
            SaveCommand = _changeJobCheckAndProceedCommandBuilder.BuildCommand(j => { });

            SaveDropDownCommands = new CommandCollection <PrintJobViewTranslation>(translationUpdater);
            SaveDropDownCommands.AddCommand(_changeJobCheckAndProceedCommandBuilder.BuildCommand(DisableSaveFileTemporary, BrowseFileCommand), t => t.SaveAs);
            SaveDropDownCommands.AddCommand(_changeJobCheckAndProceedCommandBuilder.BuildCommand(EnableSaveToDesktop), t => t.SaveToDesktop);
        }
Exemple #3
0
        public PrintJobViewModel(
            ISettingsProvider settingsProvider,
            ITranslationUpdater translationUpdater,
            IJobInfoQueue jobInfoQueue,
            ICommandLocator commandLocator,
            IEventAggregator eventAggregator,
            ISelectedProfileProvider selectedProfileProvider,
            ICurrentSettings <ObservableCollection <ConversionProfile> > profilesProvider,
            IGpoSettings gpoSettings,
            ITargetFilePathComposer targetFilePathComposer,
            IJobInfoManager jobInfoManager,
            IChangeJobCheckAndProceedCommandBuilder changeJobCheckAndProceedCommandBuilder,
            IBrowseFileCommandBuilder browseFileCommandBuilder,
            IDispatcher dispatcher,
            IJobDataUpdater jobDataUpdater)
            : base(translationUpdater)
        {
            GpoSettings              = gpoSettings;
            _settingsProvider        = settingsProvider;
            _commandLocator          = commandLocator;
            _eventAggregator         = eventAggregator;
            _selectedProfileProvider = selectedProfileProvider;
            _profilesProvider        = profilesProvider;
            _targetFilePathComposer  = targetFilePathComposer;
            _jobInfoManager          = jobInfoManager;

            _changeJobCheckAndProceedCommandBuilder = changeJobCheckAndProceedCommandBuilder;
            _dispatcher     = dispatcher;
            _jobDataUpdater = jobDataUpdater;
            _changeJobCheckAndProceedCommandBuilder.Init(() => Job, CallFinishInteraction, () => _lastConfirmedFilePath, s => _lastConfirmedFilePath = s);

            SetOutputFormatCommand = new DelegateCommand <OutputFormat>(SetOutputFormatExecute);

            browseFileCommandBuilder.Init(() => Job, UpdateUiForJobOutputFileTemplate, () => _lastConfirmedFilePath, s => _lastConfirmedFilePath = s);
            BrowseFileCommand = browseFileCommandBuilder.BuildCommand();
            SetupEditProfileCommand(_commandLocator, eventAggregator);

            SetupSaveCommands(translationUpdater);

            EmailCommand = _changeJobCheckAndProceedCommandBuilder.BuildCommand(EnableEmailSettings);
            SetupSendDropDownCommands(translationUpdater);

            MergeCommand = new DelegateCommand(MergeExecute);
            var mergeAllAsyncCommand = new AsyncCommand(MergeAllExecuteAsync, o => jobInfoQueue.Count > 1);

            MergeDropDownCommands = new CommandCollection <PrintJobViewTranslation>(translationUpdater);
            MergeDropDownCommands.AddCommand(mergeAllAsyncCommand, t => t.MergeAll);
            CancelCommand          = new DelegateCommand(CancelExecute);
            CancelDropDownCommands = new CommandCollection <PrintJobViewTranslation>(translationUpdater);
            CancelDropDownCommands.AddCommand(new DelegateCommand(CancelAllExecute, o => jobInfoQueue.Count > 1), t => t.CancelAll);

            DisableSaveTempOnlyCommand = new DelegateCommand(DisableSaveFileTemporary);

            jobInfoQueue.OnNewJobInfo += (sender, args) => UpdateNumberOfPrintJobsHint(jobInfoQueue.Count);
            _jobInfoQueue              = jobInfoQueue;
            UpdateNumberOfPrintJobsHint(jobInfoQueue.Count);
        }
        /// <summary>
        /// Server Main Entry Point - Initialize as many things as possible here.
        /// Order is important here, any additional initialization should be place at the bottom.
        /// </summary>
        /// <param name="Directory">Start Directory.</param>
        public static void Start(string Directory)
        {
            try
            {
                // Initialize Setting
                Setting = new Setting(Directory);

                // Initialize Logger.
                Logger = new LoggerCollection();
                Logger.Start();

                if (Setting.Load())
                {
                    Setting.Save();
                }
                else
                {
                    Setting.Save();
                    Environment.Exit(0);
                    return;
                }

                // Initialize Updater
                if (Setting.CheckForUpdate)
                {
                    Updater = new Updater();
                    Updater.Update();
                }

                if (Setting.MainEntryPoint == Setting.MainEntryPointType.jianmingyong_Server)
                {
                    // Initialize Listener.
                    Listener = new Server_Client_Listener.Servers.Listener();
                    Listener.Start();

                    // Initialize RCONListener.
                    if (Setting.RCONEnable)
                    {
                        RCONListener = new RCON_Client_Listener.Servers.Listener();
                        RCONListener.Start();
                    }

                    // Initialize SCONListener.
                    if (Setting.SCONEnable)
                    {
                        SCONListener = new SCON_Client_Listener.Servers.ModuleSCON();
                        SCONListener.Start();
                        //Logger.Log("SCON have been disabled due to incompatible update. Sorry for the inconvience caused.", Server_Client_Listener.Loggers.Logger.LogTypes.Info);
                    }

                    // Initialize Nancy.
                    if (Setting.NancyEnable)
                    {
                        var dataApi = new NancyData();
                        dataApi.Add("online", GetOnlineClients);

                        NancyImpl.SetDataApi(dataApi);
                        NancyImpl.Start(Setting.NancyHost, Setting.NancyPort);
                    }
                }

                // Initialize Command.
                Command = new CommandCollection();
                Command.AddCommand();
            }
            catch (Exception ex)
            {
                ex.CatchError();
            }
        }
Exemple #5
0
        /// <summary>
        /// Server Main Entry Point - Initialize as many things as possible here.
        /// Order is important here, any additional initialization should be place at the bottom.
        /// </summary>
        /// <param name="Directory">Start Directory.</param>
        public static void Start(string Directory)
        {
            try
            {
                // Initialize Setting
                Setting = new Setting(Directory);

                // Initialize Logger.
                Logger = new LoggerCollection();
                Logger.Start();

                if (Setting.Load())
                {
                    Setting.Save();
                }
                else
                {
                    Setting.Save();
                    Environment.Exit(0);
                    return;
                }

                // Initialize Updater
                if (Setting.CheckForUpdate)
                {
                    Updater = new Updater();
                    Updater.Update();
                }

                if (Setting.MainEntryPoint == Setting.MainEntryPointType.jianmingyong_Server)
                {
                    // Initialize Listener.
                    Listener = new Server_Client_Listener.Servers.Listener();
                    Listener.Start();

                    // Initialize RCONListener.
                    if (Setting.RCONEnable)
                    {
                        RCONListener = new RCON_Client_Listener.Servers.Listener();
                        RCONListener.Start();
                    }

                    // Initialize SCONListener.
                    if (Setting.SCONEnable)
                    {
                        SCONListener = new SCON_Client_Listener.Servers.ModuleSCON();
                        SCONListener.Start();
                        //Logger.Log("SCON have been disabled due to incompatible update. Sorry for the inconvience caused.", Server_Client_Listener.Loggers.Logger.LogTypes.Info);
                    }

                    // Initialize Nancy.
                    if (Setting.NancyEnable)
                    {
                        var dataApi = new NancyData();
                        dataApi.Add("online", GetOnlineClients);

                        NancyImpl.SetDataApi(dataApi);
                        NancyImpl.Start(Setting.NancyHost, Setting.NancyPort);
                    }
                }

                // Initialize Command.
                Command = new CommandCollection();
                Command.AddCommand();
            }
            catch (Exception ex)
            {
                ex.CatchError();
            }
        }