Ejemplo n.º 1
0
 public SaveRestoreContext(FrameworkElement element, FileAppearanceSettingsClient[] fileNames, bool overwriteIfExits, SaveRestoreActionType actionType, Dictionary <string, FileAppearanceSettingsDb> filesDb, FormComponents formComponents, Type[] actionProcessingObjectTypes = null, Type[] doNotActionProcessingObjectTypes = null)
 {
     ProcessingObject                 = element;
     FileNames                        = fileNames;
     OverwriteIfExits                 = overwriteIfExits;
     ActionType                       = actionType;
     FilesDb                          = filesDb;
     FormComponents                   = formComponents;
     ActionProcessingObjectTypes      = actionProcessingObjectTypes;
     DoNotActionProcessingObjectTypes = doNotActionProcessingObjectTypes;
 }
Ejemplo n.º 2
0
        private static bool RunActions(FrameworkElement element, SaveRestoreActionType actionType, Dictionary <string, FileAppearanceSettingsDb> filesDb, FormComponents formComponents, Type[] actionProcessingObjectTypes = null, Type[] doNotActionProcessingObjectTypes = null)
        {
            if (element == null)
            {
                throw new ArgumentNullException("element");
            }

            var actions = GetActionsForObj(element);

            if (actions.Length == 0)
            {
                return(false);
            }

            var context = new SaveRestoreContext(element, GetSettingsFullFileName(element), true, actionType, filesDb, formComponents, actionProcessingObjectTypes, doNotActionProcessingObjectTypes);

            foreach (var action in actions)
            {
                action(context);
            }

            return(true);
        }