public SearchViewModel() { ContentId = ToolContentId; loader = new JsonOptionsLoader(); QueryEditor = new QueryEditorViewModel(Session, () => { if (SearchCommand.CanExecute(null)) { SearchCommand.Execute(null); } }); QueryEditor.SendToSearchCommand.IsVisible = false; var ests = EntityQuery <Estimator> .All(Session)(); Estimators = new ObservableCollection <Estimator>(ests); SelectedEstimator = ests.FirstOrDefault(); emh.Add( this.Subscribe(Event.SendToSearch, (e) => { object pack = null; try { pack = e.GetValue <object>(MessageKeys.ToSearchPackage); } catch { return; } OpenHrSearch(); var hrs = pack as IEnumerable <HealthRecord>; var hios = pack as IEnumerable <ConfWithHio>; var opt = pack as SearchOptions; if (hrs != null && hrs.Any()) { RecieveHealthRecords(hrs); } else if (hios != null && hios.Any()) { RecieveHrItemObjects(hios); } else if (opt != null) { RecieveOptions(opt); } Contract.Assume(LastRecieverQueryBlock != null); Activate(); }) ); ControlsVisible = true; }
/// <summary> /// Loads the options menu /// </summary> public void LoadOptions() { OptionsLoader.GetInstance((c) => { c.Open(pauseMenuUI); }); pauseMenuUI.SetActive(false); options = true; Debug.Log("Loading options"); }
public static Options LoadOptions(string scriptsPath) { var configPath = Path.Combine(scriptsPath, "config.xml"); var optionsStream = new FileStream(configPath, FileMode.Open, FileAccess.Read, FileShare.Read); var optionsLoader = new OptionsLoader(); return(optionsLoader.Load(optionsStream, null, null, Path.GetDirectoryName(configPath))); }
/// <summary> /// Loads the options scene into the current one /// </summary> void Start() { DontDestroyOnLoad(this.gameObject); _instance = this; Debug.Log("ran"); loaded = true; gameObject.SetActive(false); if (doWhenReady != null) { doWhenReady(this); } }
public OptionsLoaderViewModel(QueryEditorViewModel queryeditor, OptionsLoader loader, ISession session, bool useBuffer = false) { this.master = queryeditor; this.useBuffer = useBuffer; this.loader = loader; this.session = session; handler = this.Subscribe(Event.NewSession, (e) => { var s = e.GetValue <ISession>(MessageKeys.Session); ReplaceSession(s); }); }
public static void Main(string[] args) { // Try processing the standalone arguments if (ProcessStandaloneArguments(args)) return; // Try processing the common arguments (bool success, MediaType mediaType, RedumpSystem? knownSystem) = ProcessCommonArguments(args); if (!success) return; // Loop through and process options (Options options, string path, int startIndex) = OptionsLoader.LoadFromArguments(args, startIndex: 2); // Make new Progress objects var resultProgress = new Progress<Result>(); resultProgress.ProgressChanged += ProgressUpdated; var protectionProgress = new Progress<ProtectionProgress>(); protectionProgress.ProgressChanged += ProgressUpdated; // Validate the supplied credentials (bool? _, string message) = RedumpWebClient.ValidateCredentials(options?.RedumpUsername, options?.RedumpPassword); if (!string.IsNullOrWhiteSpace(message)) Console.WriteLine(message); // Loop through all the rest of the args for (int i = startIndex; i < args.Length; i++) { // Check for a file if (!File.Exists(args[i].Trim('"'))) { DisplayHelp($"{args[i].Trim('"')} does not exist"); return; } // Get the full file path string filepath = Path.GetFullPath(args[i].Trim('"')); // Now populate an environment Drive drive = null; if (!string.IsNullOrWhiteSpace(path)) drive = Drive.Create(null, path); var env = new DumpEnvironment(options, "", filepath, drive, knownSystem, mediaType, null); // Finally, attempt to do the output dance var result = env.VerifyAndSaveDumpOutput(resultProgress, protectionProgress).ConfigureAwait(false).GetAwaiter().GetResult(); Console.WriteLine(result.Message); } }
protected override void OnOk() { foreach (var crit in word.Crits) { var l = OptionsLoader.FromFormat(crit.OptionsFormat); crit.Options = l.ReplaceWord(crit.Options, oldTitle, word.Title); } (word as IEditableObject).EndEdit(); // если такое слово уже было, делааем доступным врачу var toSave = WordQuery.ByTitle(Session)(word.Title) ?? word; AuthorityController.CurrentDoctor.AddWords(toSave.ToEnumerable()); Session.DoSave(toSave); this.Send(Event.EntitySaved, toSave.AsParams(MessageKeys.Entity)); }
public EstimatorEditorViewModel(Estimator estimator) { this.estimator = estimator; loader = new JsonOptionsLoader(); CriteriaGroups = new ObservableCollection <CriteriaGroupEditorViewModel>(); QueryEditor = new QueryEditorViewModel(Session); var opt = loader.ReadOptions(estimator.Options, Session); QueryEditor.SetOptions(opt); Estimator = new EstimatorViewModel(estimator); (estimator as IEditableObject).BeginEdit(); Title = "Редактор приказа"; HelpTopic = ""; WithHelpButton = false; }
public CriterionEditorViewModel(Criterion cr) { this.criterion = cr; loader = new JsonOptionsLoader(); QueryEditor = new QueryEditorViewModel(Session); Criterion = new CriterionViewModel(criterion); tester = new ExistanceTester <Criterion>(cr, Criterion, Session); tester.Test(); var opt = loader.ReadOptions(criterion.Options, Session); QueryEditor.SetOptions(opt); (criterion as IEditableObject).BeginEdit(); Title = "Редактор критерия"; HelpTopic = "editcriterion"; WithHelpButton = false; }
/// <summary> /// Display help for MPF.Check /// </summary> /// <param name="error">Error string to prefix the help text with</param> private static void DisplayHelp(string error = null) { if (error != null) Console.WriteLine(error); Console.WriteLine("Usage:"); Console.WriteLine("MPF.Check.exe <mediatype> <system> [options] </path/to/output.cue/iso> ..."); Console.WriteLine(); Console.WriteLine("Standalone Options:"); Console.WriteLine("-h, -? Show this help text"); Console.WriteLine("-lm, --listmedia List supported media types"); Console.WriteLine("-ls, --listsystems List supported system types"); Console.WriteLine("-lp, --listprograms List supported dumping program outputs"); Console.WriteLine(); Console.WriteLine("Check Options:"); var supportedArguments = OptionsLoader.PrintSupportedArguments(); foreach (string argument in supportedArguments) { Console.WriteLine(argument); } Console.WriteLine(); }
//Opens Options menu public void OptionsMenu() { OptionsLoader.GetInstance((c) => { c.Open(); }); }
private void InitPickersDataSources() { OfferTypes = new OptionsLoader <OfferType>().LoadOptions(); PriceSortings = new OptionsLoader <PriceSorting>().LoadOptions(); TitleSortings = new OptionsLoader <TitleSorting>().LoadOptions(); }
/// <summary> /// Closes the options menu /// </summary> public void Enable() { OptionsLoader.GetInstance((c) => { c.Close(); }); }
private void InitOfferTypes() { OfferTypes = new OptionsLoader <OfferType>().LoadOptions(); OfferTypes.Remove(OfferType.AnyOffer); }