Exemplo n.º 1
0
 public GetTransactionReceiptsStrategy(
     IIconService iconService,
     ITryGetTransactionErrorStrategy tryGetTransactionErrorStrategy)
 {
     _tryGetTransactionErrorStrategy = tryGetTransactionErrorStrategy;
     _iconService = iconService;
 }
Exemplo n.º 2
0
 public IconController(IIconService iconService, IMapper mapper,
                       IHostingEnvironment hosting)
 {
     _iconService = iconService;
     _mapper      = mapper;
     _hosting     = hosting;
 }
Exemplo n.º 3
0
        public IconContentViewModel(IIconService iconService, ISetting setting)
        {
            _iconService            = iconService;
            _setting                = setting;
            CopyPathCommand         = new DelegateCommand <int?>(OnClickCopyPath);
            ChangeCartCommand       = new DelegateCommand <int?>(OnChangeCart);
            RemoveCartCommand       = new DelegateCommand <int?>(OnRemoveCart);
            ChangeCollectionCommand = new DelegateCommand <int?>(OnCollectionChanged);
            ClearCartCommand        = new DelegateCommand(OnClearCart);
            DownloadMaterial        = new DelegateCommand(OnDownloadMaterial, CanDownload);
            DownloadCode            = new DelegateCommand(OnDownloadCode, CanDownload);


            IconCarts.CollectionChanged    += IconCarts_CollectionChanged;
            MyCollection.CollectionChanged += MyCollection_CollectionChanged;

            ///加载用户数据库
            if (_setting.IconCarts != null)
            {
                IconCarts.AddRange(_setting.IconCarts);
            }

            ///加载用户数据收藏夹
            if (_setting.MyCollection != null)
            {
                MyCollection.AddRange(_setting.MyCollection);
            }

            InitData();
        }
        /// <summary>
        /// Initialize service
        /// </summary>
        public RenderingService(IDirectoryTypeService directoryTypeService, IIconService iconService)
        {
            this.directoryTypeService = directoryTypeService;
            this.iconService          = iconService;

            icons = new Dictionary <Guid, string>();
            GetIcons();
        }
Exemplo n.º 5
0
 public ScsMainController()
 {
     _registration              = Bootstrap.Container.Resolve <IScsRegistrationService>();
     _authenticationService     = Bootstrap.Container.Resolve <IAuthenticationService>();
     _jsonSerializationService  = Bootstrap.Container.Resolve <IJsonSerializationService>();
     _httpClientService         = Bootstrap.Container.Resolve <IHttpClientService>();
     _sitecoreDataAccessService = Bootstrap.Container.Resolve <ISitecoreDataAccessService>();
     _iconService = Bootstrap.Container.Resolve <IIconService>();
 }
Exemplo n.º 6
0
 public CollectionItemController(
     ICollectionItemService collectionItemService,
     ICollectionService collectionService,
     IIconService iconService)
 {
     _collectionItemService = collectionItemService;
     _collectionService     = collectionService;
     _iconService           = iconService;
 }
Exemplo n.º 7
0
 public BackOfficePreviewModel(
     UmbracoFeatures features,
     IGlobalSettings globalSettings,
     IEnumerable <ILanguage> languages,
     IIconService iconService)
     : base(features, globalSettings, iconService)
 {
     _features = features;
     Languages = languages;
 }
Exemplo n.º 8
0
        public static async Task <object> GetIconAsync(this IIconService service, string id, double height)
        {
            var icon = await service.GetIconAsync(id).ConfigureAwait(true);

            if (icon is FrameworkElement fe)
            {
                fe.MaxHeight = height;
            }

            return(icon);
        }
        /// <summary>
        /// Initialize viewmodel
        /// </summary>
        /// <param name="path">Path instance</param>
        /// <param name="fileStructureService">File structure service</param>
        /// <param name="directoryTypeService">Directory type service</param>
        /// <param name="iconService">Icon service</param>
        /// <param name="stackService">Stack service</param>
        public DocumentPathViewModel(FileStructureDocumenPath path, IFileStructureService fileStructureService, IDirectoryTypeService directoryTypeService, IIconService iconService, IStackService stackService)
        {
            this.path = path;
            this.fileStructureService = fileStructureService;
            this.iconService          = iconService;
            this.directoryTypeService = directoryTypeService;
            this.stackService         = stackService;

            VisualPathElements = new ObservableCollection <FrameworkElement>();

            RefreshPath();
        }
 public HomeController(IGameService gameService, IIconService iconService, IQuizCategoryService quizCategoryService, IOfferService offerService, IGameUserService gameUserService, IQuestionService questionService, IAnswerService answerService, IQuizHistoryService quizHistoryService, IQuizSummaryService quizSummaryService, IConfiguration configuration)
 {
     _gameService         = gameService;
     _iconService         = iconService;
     _quizCategoryService = quizCategoryService;
     _offerService        = offerService;
     _gameUserService     = gameUserService;
     _questionService     = questionService;
     _answerService       = answerService;
     _quizHistoryService  = quizHistoryService;
     _quizSummaryService  = quizSummaryService;
     _configuration       = configuration;
 }
 public void  Inject(
     IDataTransaction transaction,
     IMvvmService mvvm,
     IIconService icon,
     ILocalizationService localization)
 {
     IconService         = icon;
     LocalizationService = localization;
     _mvvm        = mvvm;
     _transaction = transaction;
     H.Initialize(this);
     User = Acl.Connection.User;
 }
Exemplo n.º 12
0
        public static void Initialize(IGlyphService glyphService, IIconService iconService)
        {
            var supportedGlyphGroups = new Dictionary <StandardGlyphGroup, string>
            {
                { StandardGlyphGroup.GlyphGroupError, "Error" },
                { StandardGlyphGroup.GlyphGroupDelegate, "Delegate" },
                { StandardGlyphGroup.GlyphGroupEnum, "Enum" },
                { StandardGlyphGroup.GlyphGroupStruct, "Struct" },
                { StandardGlyphGroup.GlyphGroupClass, "Class" },
                { StandardGlyphGroup.GlyphGroupInterface, "Interface" },
                { StandardGlyphGroup.GlyphGroupModule, "Module" },
                { StandardGlyphGroup.GlyphGroupConstant, "Constant" },
                { StandardGlyphGroup.GlyphGroupEnumMember, "EnumMember" },
                { StandardGlyphGroup.GlyphGroupEvent, "Event" },
                { StandardGlyphGroup.GlyphExtensionMethodPrivate, "ExtensionMethodPrivate" },
                { StandardGlyphGroup.GlyphExtensionMethodProtected, "ExtensionMethodProtected" },
                { StandardGlyphGroup.GlyphExtensionMethodInternal, "ExtensionMethodInternal" },
                { StandardGlyphGroup.GlyphExtensionMethod, "ExtensionMethod" },
                { StandardGlyphGroup.GlyphGroupMethod, "Method" },
                { StandardGlyphGroup.GlyphGroupProperty, "Property" },
                { StandardGlyphGroup.GlyphGroupField, "Field" },
                { StandardGlyphGroup.GlyphGroupOperator, "Operator" },
                { StandardGlyphGroup.GlyphReference, "Reference" }
            };

            var supportedGlyphItems = new Dictionary <StandardGlyphItem, string>
            {
                { StandardGlyphItem.GlyphItemPrivate, "Private" },
                { StandardGlyphItem.GlyphItemProtected, "Protected" },
                { StandardGlyphItem.GlyphItemInternal, "Internal" },
                { StandardGlyphItem.GlyphItemPublic, "Public" },
                { StandardGlyphItem.GlyphItemFriend, "Friend" }
            };

            foreach (var groupKvp in supportedGlyphGroups)
            {
                foreach (var itemKvp in supportedGlyphItems)
                {
                    var iconName   = GetIconName(groupKvp.Value, itemKvp.Value);
                    var localGroup = groupKvp.Key;
                    var localItem  = itemKvp.Key;
                    iconService.AddIcon(
                        iconName,
                        iconName,
                        () => glyphService.GetGlyph(localGroup, localItem)
                        );
                }
            }
        }
Exemplo n.º 13
0
 public PreviewController(
     UmbracoFeatures features,
     IGlobalSettings globalSettings,
     IPublishedSnapshotService publishedSnapshotService,
     IUmbracoContextAccessor umbracoContextAccessor,
     ILocalizationService localizationService,
     IIconService iconService)
 {
     _features                 = features;
     _globalSettings           = globalSettings;
     _publishedSnapshotService = publishedSnapshotService;
     _umbracoContextAccessor   = umbracoContextAccessor;
     _localizationService      = localizationService;
     _iconService              = iconService;
 }
Exemplo n.º 14
0
        public UserNotify(IIconService iconService)
        {
            _notify = new TaskbarIcon()
            {
                Visibility  = Visibility.Visible,
                ContextMenu = new ContextMenu(),
            };

            var rvc = IconView.GetIconService(_notify);

            IconView.SetIconService(_notify, iconService);

            SetOff();

            _notify.TrayLeftMouseUp  += _notify_TrayLeftMouseUp;;
            _notify.TrayRightMouseUp += _notify_TrayRightMouseUp;
        }
        /// <summary>
        /// Initialize viewmodel
        /// </summary>
        /// <param name="model"></param>
        public DirectoryViewModel(Directory model, FileStructureViewModel structureViewModel)
        {
            localizationService  = CommonServiceLocator.ServiceLocator.Current.GetInstance <ILocalizationService>();
            directoryTypeService = CommonServiceLocator.ServiceLocator.Current.GetInstance <IDirectoryTypeService>();
            iconService          = CommonServiceLocator.ServiceLocator.Current.GetInstance <IIconService>();

            directoryTypeFieldService = CommonServiceLocator.ServiceLocator.Current.GetInstance <IDirectoryClassificationFieldService>();
            directoryFieldService     = CommonServiceLocator.ServiceLocator.Current.GetInstance <IDirectoryFieldService>();
            fieldTypeService          = CommonServiceLocator.ServiceLocator.Current.GetInstance <IFieldTypeService>();


            directories = new ObservableCollection <DirectoryViewModel>();


            this.structureViewModel = structureViewModel;
            this.model = model;
        }
Exemplo n.º 16
0
        public static void Initialize(IGlyphService glyphService, IIconService iconService)
        {
            var supportedGlyphGroups = new Dictionary<StandardGlyphGroup, string>
            {
                { StandardGlyphGroup.GlyphGroupError, "Error" },
                { StandardGlyphGroup.GlyphGroupDelegate, "Delegate" },
                { StandardGlyphGroup.GlyphGroupEnum, "Enum" },
                { StandardGlyphGroup.GlyphGroupStruct, "Struct" },
                { StandardGlyphGroup.GlyphGroupClass, "Class" },
                { StandardGlyphGroup.GlyphGroupInterface, "Interface" },
                { StandardGlyphGroup.GlyphGroupModule, "Module" },
                { StandardGlyphGroup.GlyphGroupConstant, "Constant" },
                { StandardGlyphGroup.GlyphGroupEnumMember, "EnumMember" },
                { StandardGlyphGroup.GlyphGroupEvent, "Event" },
                { StandardGlyphGroup.GlyphExtensionMethodPrivate, "ExtensionMethodPrivate" },
                { StandardGlyphGroup.GlyphExtensionMethodProtected, "ExtensionMethodProtected" },
                { StandardGlyphGroup.GlyphExtensionMethodInternal, "ExtensionMethodInternal" },
                { StandardGlyphGroup.GlyphExtensionMethod, "ExtensionMethod" },
                { StandardGlyphGroup.GlyphGroupMethod, "Method" },
                { StandardGlyphGroup.GlyphGroupProperty, "Property" },
                { StandardGlyphGroup.GlyphGroupField, "Field" },
                { StandardGlyphGroup.GlyphGroupOperator, "Operator" },
                { StandardGlyphGroup.GlyphReference, "Reference" }
            };

            var supportedGlyphItems = new Dictionary<StandardGlyphItem, string>
            {
                { StandardGlyphItem.GlyphItemPrivate, "Private" },
                { StandardGlyphItem.GlyphItemProtected, "Protected" },
                { StandardGlyphItem.GlyphItemInternal, "Internal" },
                { StandardGlyphItem.GlyphItemPublic, "Public" },
                { StandardGlyphItem.GlyphItemFriend, "Friend" }
            };

            foreach (var groupKvp in supportedGlyphGroups)
            {
                foreach (var itemKvp in supportedGlyphItems)
                {
                    string iconName = GetIconName(groupKvp.Value, itemKvp.Value);
                    StandardGlyphGroup localGroup = groupKvp.Key;
                    StandardGlyphItem localItem = itemKvp.Key;
                    iconService.AddIcon(iconName, iconName, () => glyphService.GetGlyph(localGroup, localItem));
                }
            }
        }
Exemplo n.º 17
0
        public TestExplorer(IExplorerView view, IEventAggregator events, ITestFilterBar filterBar, ITestFilter filter,
                            IIconService icons)
        {
            _view   = view;
            _events = events;
            _filter = filter;
            _icons  = icons;

            if (filterBar != null)
            {
                filterBar.Observer = this;
            }
            _navigator = new SuiteNavigator
            {
                TestFilter  = _filter.Matches,
                SuiteFilter = _filter.Matches
            };
        }
Exemplo n.º 18
0
 public BackOfficeController(
     ManifestParser manifestParser,
     UmbracoFeatures features,
     IGlobalSettings globalSettings,
     IUmbracoContextAccessor umbracoContextAccessor,
     ServiceContext services,
     AppCaches appCaches,
     IProfilingLogger profilingLogger,
     IRuntimeState runtimeState,
     UmbracoHelper umbracoHelper,
     IIconService iconService)
     : base(globalSettings, umbracoContextAccessor, services, appCaches, profilingLogger, umbracoHelper)
 {
     _manifestParser = manifestParser;
     _features = features;
     _runtimeState = runtimeState;
     _iconService = iconService;
 }
Exemplo n.º 19
0
        public void Inject(
            IAclService acl,
            IMessageBus message,
            IDocumentService doc,
            IApplicationInfoService applicationInfo,
            ILocalizationService localizationService,
            Func <object, ISelectedMessage> getSelectedMessage,
            IIconService iconService)
        {
            Acl                 = acl;
            _message            = message;
            doc.MainViewModel   = this;
            _doc                = doc;
            ApplicationInfo     = applicationInfo;
            LocalizationService = localizationService;
            _getSelectedMessage = getSelectedMessage;
            IconService         = iconService;

            H.Initialize(this);
        }
Exemplo n.º 20
0
        public void Inject(
            ILocalizationService localizationService,
            IIconService iconService,
            IDataService dataService,
            IApplicationInfoService infoService)
        {
            LocalizationService = localizationService;
            IconService         = iconService;
            DataService         = dataService;
            InfoService         = infoService;
            H.Initialize(this);

            foreach (var connection in dataService.Connections)
            {
                Databases.Add(connection);
                AllowDatabaseSelection = true;
            }

            Database = DataService.Source;
        }
Exemplo n.º 21
0
 public BackOfficeModel(UmbracoFeatures features, IGlobalSettings globalSettings, IIconService iconService)
 {
     Features       = features;
     GlobalSettings = globalSettings;
     IconCheckData  = iconService.GetIcon("icon-check")?.SvgString;
     IconDeleteData = iconService.GetIcon("icon-delete")?.SvgString;
 }
Exemplo n.º 22
0
 public CalculateTransactionAmountStrategy(IIconService iconService)
 {
     _iconService = iconService;
 }
Exemplo n.º 23
0
 public IconController(IIconService iconService)
 {
     _iconService = iconService;
 }
        /// <summary>
        /// Create view model
        /// </summary>
        public FileStructureViewModel(RadTreeView directoryTreeView, Expander expander)
        {
            this.directoryTreeView = directoryTreeView;
            this.expander          = expander;

            localizationService               = CommonServiceLocator.ServiceLocator.Current.GetInstance <ILocalizationService>();
            directoryTypeService              = CommonServiceLocator.ServiceLocator.Current.GetInstance <IDirectoryTypeService>();
            iconService                       = CommonServiceLocator.ServiceLocator.Current.GetInstance <IIconService>();
            stackService                      = CommonServiceLocator.ServiceLocator.Current.GetInstance <IStackService>();
            fielStructureService              = CommonServiceLocator.ServiceLocator.Current.GetInstance <IFileStructureService>();
            documentWorkflowContextService    = CommonServiceLocator.ServiceLocator.Current.GetInstance <IDocumentWorkflowConfigurationService>();
            documentWorkflowAssignmentService = CommonServiceLocator.ServiceLocator.Current.GetInstance <IDocumentWorkflowAssignmentService>();



            directoryFieldService     = CommonServiceLocator.ServiceLocator.Current.GetInstance <IDirectoryFieldService>();
            directoryTypeFieldService = CommonServiceLocator.ServiceLocator.Current.GetInstance <IDirectoryClassificationFieldService>();

            rootPath           = "";
            VisualPathElements = new ObservableCollection <FrameworkElement>();

            directoryCategoryMenuItems = new ObservableCollection <RadMenuItem>();

            foreach (var category in directoryTypeService.GetAll().OrderBy(d => d.Category).GroupBy(d => d.Category))
            {
                var categoryItem = new RadMenuItem
                {
                    Header = category.Key,
                    Tag    = category.Key,
                    Icon   = new Image
                    {
                        Source = iconService.GetByNameAsImage("directory_add_x16"),
                        Width  = 16,
                        Height = 16
                    }
                };

                foreach (var type in category)
                {
                    var menuItem = new RadMenuItem
                    {
                        Header = localizationService.Translate(type.Name),
                        Icon   = new Image
                        {
                            Source = iconService.GetByIdAsImage(type.IconId),
                            Width  = 16,
                            Height = 16
                        },
                        Tag = type
                    };
                    menuItem.Click += AddDirectoryItemClick;
                    categoryItem.Items.Add(menuItem);
                }

                directoryCategoryMenuItems.Add(categoryItem);
            }

            // Create remove directory command
            removeDirectoryCommand = new RelayCommand((e) =>
            {
                if (SelectedDirectory != null)
                {
                    if (fielStructureService.GetDocuments(model, selectedDirectory.Model, true).Any())
                    {
                        MessageBox.Show(localizationService.Translate("filestructure_delete_notallowed"), localizationService.Translate("filestructure_delete_notallowed_title"), MessageBoxButton.OK, MessageBoxImage.Information);
                        return;
                    }

                    SelectedDirectory.RemoveDirectory();

                    SelectedDirectory = null;

                    IsDirty = true;

                    RefreshPath();
                }
            }, (e) => { return(selectedDirectory != null); });

            // Create edit metadata command
            editMetaDataCommand = new RelayCommand((e) =>
            {
                if (SelectedDirectory != null)
                {
                    var directoryFieldWindow = new DirectoryFieldWindow();

                    directoryFieldWindow.Initialize(SelectedDirectory.Model, GetStructure());
                    directoryFieldWindow.WindowMode = Framework.UI.WindowMode.Edit;
                    directoryFieldWindow.ShowDialog();
                    return;
                }
            }, (e) => { return(selectedDirectory != null); });

            renameDirectoryCommand = new RelayCommand((e) =>
            {
                if (SelectedDirectory != null)
                {
                    directoryTreeView.ContainerFromItemRecursive(directoryTreeView.SelectedItem).BeginEdit();
                    return;
                }
            }, (e) => { return(selectedDirectory != null); });

            // Command to assign the workflow
            assignWorkflowCommand = new RelayCommand((e) =>
            {
                if (selectedDirectory.Model.WorkflowId.HasValue)
                {
                    MessageBox.Show(localizationService.Translate("filestructure_workflow_assign_already"),
                                    localizationService.Translate("filestructure_delete_notallowed_title"), MessageBoxButton.OK, MessageBoxImage.Information);
                    return;
                }

                var box = ItemBoxManager.GetItemBoxFromDB("IB_Document_Workflow");
                box.ShowDialog();
                var result = box.GetSelectedItemCell("Guid");

                if (result is Guid guid)
                {
                    selectedDirectory.Model.WorkflowId = guid;
                    //Assign all parents and children the workflow
                    AssignedWorkflowToParentsAndChildren(guid);
                    Save();
                    RaisePropertyChanged(nameof(AssignedWorkflow));
                    RaisePropertyChanged(nameof(AssignedWorkflowVisibility));
                }
            });

            // Archive from clipboard click
            archiveFromClipboard = new RelayCommand((e) =>
            {
                // Save before archive
                if (IsDirty)
                {
                    Save();
                }

                if (IsWorkflowDirectory(selectedDirectory))
                {
                    return;
                }
                Helper.ArchiveHelper.ArchiveFromClipboard(model, selectedDirectory.Model);
            }, (e) => { return(selectedDirectory != null); });

            // Archive from scanner
            archiveFromScanner = new RelayCommand((e) =>
            {
                // Save before archive
                if (IsDirty)
                {
                    Save();
                }

                if (IsWorkflowDirectory(selectedDirectory))
                {
                    return;
                }

                Helper.ArchiveHelper.ArchiveFromScanClient(model, selectedDirectory.Model);
            }, (e) => { return(selectedDirectory != null); });

            setReturnDirectory = new RelayCommand((e) =>
            {
                var parentDirectory = selectedDirectory.StructureViewModel.Directories.FirstOrDefault(x =>
                {
                    return(x == selectedDirectory.Parent);
                });
                foreach (var directory in parentDirectory.Directories)
                {
                    directory.IsReturnDirectory = false;
                }
                selectedDirectory.IsReturnDirectory = true;
            }, (e) => { return(selectedDirectory != null); });
        }
 public IconController(IIconService iconService)
 {
     _iconService = iconService;
     helper       = new Helpers.Helper();
 }
Exemplo n.º 26
0
 /// <summary>
 /// 初始化图标控制器
 /// </summary>
 /// <param name="categoryService">图标分类服务</param>
 /// <param name="iconService">图标服务</param>
 public IconController(IIconCategoryService categoryService, IIconService iconService)
     : base(iconService)
 {
     CategoryService = categoryService;
     IconService     = iconService;
 }
Exemplo n.º 27
0
 public IconController(IIconService iconService)
 {
     this._iconService = iconService;
 }
Exemplo n.º 28
0
 /// <summary>
 /// Initializes a new instance of <see cref="InstallIconService"/>.
 /// </summary>
 /// <param name="iconService"></param>
 /// <param name="logService"></param>
 public InstallIconService(IIconService iconService, ILogService logService)
 {
     this.iconService = iconService;
     this.logService  = logService;
 }
Exemplo n.º 29
0
 [Import] public VcpPlugin(IIconService iconService, MainService mainService)
 {
     _iconService = iconService;
     _mainService = mainService;
 }
        /// <summary>
        /// Initialize viewmodel
        /// </summary>
        /// <param name="documentId">Document id</param>
        public DocumentPathOverViewViewModel(Guid documentId)
        {
            this.documentId = documentId;

            documentPathService  = ServiceLocator.Current.GetInstance <IFileStructureDocumentPathService>();
            fileStructureService = ServiceLocator.Current.GetInstance <IFileStructureService>();
            directoryTypeService = ServiceLocator.Current.GetInstance <IDirectoryTypeService>();
            iconService          = ServiceLocator.Current.GetInstance <IIconService>();
            localizationService  = ServiceLocator.Current.GetInstance <ILocalizationService>();
            stackService         = ServiceLocator.Current.GetInstance <IStackService>();
            documentWorkflowAssignmentService = ServiceLocator.Current.GetInstance <IDocumentWorkflowAssignmentService>();

            removedPaths = new List <DocumentPathViewModel>();

            paths = new ObservableCollection <DocumentPathViewModel>();
            foreach (var path in documentPathService.GetByDocumentId(documentId))
            {
                var pathVM = new DocumentPathViewModel(path, fileStructureService, directoryTypeService, iconService, stackService)
                {
                    Parent = this
                };

                paths.Add(pathVM);
            }

            // Add new document path
            addDocumentPathCommand = new RelayCommand((p) =>
            {
                var newDocumentPath = SelectPath();

                if (newDocumentPath != null)
                {
                    if (CheckPathExists(newDocumentPath.Id, newDocumentPath.DirectoryGuid, newDocumentPath.FileStructureGuid))
                    {
                        MessageBox.Show(localizationService.Translate("filestructure_path_exists"), localizationService.Translate("filestructure_path_exists_title"), MessageBoxButton.OK, MessageBoxImage.Information);
                        return;
                    }

                    var newDocumentPathVM = new DocumentPathViewModel(newDocumentPath, fileStructureService, directoryTypeService, iconService, stackService)
                    {
                        Parent = this
                    };

                    Paths.Add(newDocumentPathVM);
                }
            });

            // Change document path
            changeDocumentPathCommand = new RelayCommand((p) =>
            {
                var selectedPath = p as DocumentPathViewModel;

                if (selectedPath.IsProtectedPath)
                {
                    MessageBox.Show(localizationService.Translate("filestructure_path_protected"), localizationService.Translate("filestructure_path_protected_title"), MessageBoxButton.OK, MessageBoxImage.Information);
                    return;
                }

                var fileStructure = fileStructureService.Get(selectedPath.Model.FileStructureGuid);


                var selectPathWindow = new FileStructureWindow();
                selectPathWindow.Initialize(fileStructure);
                selectPathWindow.IsInSelectMode = true;

                selectPathWindow.Loaded += (s, e) =>
                {
                    selectPathWindow.ViewModel.SelectedDirectory = selectPathWindow.ViewModel.RawDirectories.FirstOrDefault(x => x.Model.Id == selectedPath.Model.DirectoryGuid);
                };

                selectPathWindow.ShowDialog();

                if (selectPathWindow.SelectedDirectory != null)
                {
                    if (CheckPathExists(selectedPath.Model.Id, selectPathWindow.SelectedDirectory.Id, fileStructure.Id))
                    {
                        MessageBox.Show(localizationService.Translate("filestructure_path_exists"), localizationService.Translate("filestructure_path_exists_title"), MessageBoxButton.OK, MessageBoxImage.Information);
                        return;
                    }

                    selectedPath.Model.DirectoryGuid = selectPathWindow.SelectedDirectory.Id;
                    selectedPath.Model.WorkflowId    = selectPathWindow.SelectedDirectory.WorkflowId;
                    selectedPath.RefreshPath();
                }
            });

            // Remove document path
            removeDocumentPathCommand = new RelayCommand((p) =>
            {
                var selectedPath = p as DocumentPathViewModel;

                if (selectedPath.IsProtectedPath)
                {
                    MessageBox.Show(localizationService.Translate("filestructure_path_protected"), localizationService.Translate("filestructure_path_protected_title"), MessageBoxButton.OK, MessageBoxImage.Information);
                    return;
                }

                var messageBoxResult = MessageBox.Show(localizationService.Translate("filestructure_remove_path"), localizationService.Translate("filestructure_remove_path_title"), MessageBoxButton.YesNo, MessageBoxImage.Question);

                if (messageBoxResult == MessageBoxResult.Yes)
                {
                    removedPaths.Add(selectedPath);
                    paths.Remove(selectedPath);
                }
            });
        }
Exemplo n.º 31
0
 public IconViewModel(IIconService icons)
 {
     _icons = icons;
     H.Initialize(this);
 }
Exemplo n.º 32
0
 public IconHelper(IIconService service)
 {
     _service = service;
 }