Пример #1
1
 private void InitScopeItems()
 {
     ScopeItems = new Caliburn.Micro.BindableCollection<LookupItem>();
     ScopeItems.Add(new LookupItem() { Text = "Machine", Value = PasswordProtectionScope.LocalMachine });
     ScopeItems.Add(new LookupItem() { Text = "User", Value = PasswordProtectionScope.CurrentUser });
     SelectedScope = ScopeItems.FirstOrDefault();
 }
Пример #2
0
        public RenameManager(Document doc)
        {
            this.doc         = doc;
            renameCandidates = new Caliburn.Micro.BindableCollection <RenameCandidate>();
            renameCommands   = new Caliburn.Micro.BindableCollection <RenameCommand>();
            renameCommands.Add(new RenameCommand((a, c, b) => a, "None"));
            renameCommands.Add(new RenameCommand((a, c, b) => a.ToUpper(System.Globalization.CultureInfo.CurrentCulture), "UpperCase"));
            renameCommands.Add(new RenameCommand((a, c, b) => a.ToLower(System.Globalization.CultureInfo.CurrentCulture), "Lowercase"));
            renameCommands.Add(new RenameCommand((a, c, b) => a.Replace(' ', '_'), "Spaces to Underscore"));
            renameCommands.Add(new RenameCommand((a, c, b) => a.Replace(' ', '-'), "Spaces to Hyphen"));
            renameCommands.Add(new RenameCommand(RegexReplace, "Custom Replace", string.Empty, string.Empty));
            renameCommands.Add(new RenameCommand(Increment, "Increment Match", string.Empty, string.Empty)
            {
                ReplacementPatternHint = "Increment Ammount"
            });
            renameCommands.Add(new RenameCommand(Streetify, "Streetify String", string.Empty, string.Empty)
            {
                SearchPatternHint = "Search Filter", ReplacementPatternHint = "Char Spacing"
            });

            ////inc last
            var lastRenameCommand = new RenameCommand(IncrementLast, "Increment Last", @"(^\D+)(\d+$)", string.Empty);

            lastRenameCommand.ReplacementPatternHint = "Increment Amount";
            renameCommands.Add(lastRenameCommand);

            renameCommand = renameCommands[0];
        }
Пример #3
0
 private void InitModeItems()
 {
     ModeItems = new Caliburn.Micro.BindableCollection <LookupItem>();
     ModeItems.Add(new LookupItem()
     {
         Text = "Auto", Value = ModeOptions.Auto
     });
     ModeItems.Add(new LookupItem()
     {
         Text = "Manual", Value = ModeOptions.Manual
     });
     SelectedMode = OriginalValue.IsNullOrEmpty() ? ModeItems.Last() : ModeItems.First();
 }
Пример #4
0
 private void InitScopeItems()
 {
     ScopeItems = new Caliburn.Micro.BindableCollection <LookupItem>();
     ScopeItems.Add(new LookupItem()
     {
         Text = "Machine", Value = PasswordProtectionScope.LocalMachine
     });
     ScopeItems.Add(new LookupItem()
     {
         Text = "User", Value = PasswordProtectionScope.CurrentUser
     });
     SelectedScope = ScopeItems.FirstOrDefault();
 }
Пример #5
0
 private void CreateLookups()
 {
     Lookups = new Caliburn.Micro.BindableCollection <LookupItem>();
     if (Editor == EditorOptions.TrueFalse)
     {
         Lookups.Add(new LookupItem()
         {
             Text = "True", Value = "True"
         });
         Lookups.Add(new LookupItem()
         {
             Text = "False", Value = "False"
         });
     }
     else if (Editor == EditorOptions.Lookup)
     {
         Lookups.AddRange(Parameter.Lookups.Select(item => new LookupItem()
         {
             Text = item.Text, Value = item.Value
         }));
     }
 }
Пример #6
0
 private void InitModeItems()
 {
     ModeItems = new Caliburn.Micro.BindableCollection<LookupItem>();
     ModeItems.Add(new LookupItem() { Text = "Auto", Value = ModeOptions.Auto });
     ModeItems.Add(new LookupItem() { Text = "Manual", Value = ModeOptions.Manual });
     SelectedMode = OriginalValue.IsNullOrEmpty() ? ModeItems.Last() : ModeItems.First();
 }
Пример #7
0
 private void CreateLookups()
 {
     Lookups = new Caliburn.Micro.BindableCollection<LookupItem>();
     if (Editor == EditorOptions.TrueFalse)
     {
         Lookups.Add(new LookupItem() {Text = "True", Value = "True"});
         Lookups.Add(new LookupItem() {Text = "False", Value = "False" });
     }
     else if (Editor == EditorOptions.Lookup)
     {
         Lookups.AddRange(Parameter.Lookups.Select(item => new LookupItem() { Text = item.Text, Value = item.Value}));
     }
 }