diff --git a/Build.bat b/Build.bat new file mode 100644 index 0000000..7d1b15f --- /dev/null +++ b/Build.bat @@ -0,0 +1 @@ +msbuild Wide.sln \ No newline at end of file diff --git a/Clean.bat b/Clean.bat new file mode 100644 index 0000000..5a75962 --- /dev/null +++ b/Clean.bat @@ -0,0 +1,3 @@ +msbuild Wide.sln /t:clean +FOR /D %%p IN ("Build\*.*") DO rmdir "%%p" /s /q +rmdir Build /s /q \ No newline at end of file diff --git a/Libs/AvalonDock.Themes.Aero.dll b/Libs/AvalonDock.Themes.Aero.dll new file mode 100644 index 0000000..e497a43 Binary files /dev/null and b/Libs/AvalonDock.Themes.Aero.dll differ diff --git a/Libs/AvalonDock.Themes.Expression.dll b/Libs/AvalonDock.Themes.Expression.dll new file mode 100644 index 0000000..afac4f1 Binary files /dev/null and b/Libs/AvalonDock.Themes.Expression.dll differ diff --git a/Libs/AvalonDock.Themes.Metro.dll b/Libs/AvalonDock.Themes.Metro.dll new file mode 100644 index 0000000..a5faef3 Binary files /dev/null and b/Libs/AvalonDock.Themes.Metro.dll differ diff --git a/Libs/AvalonDock.Themes.VS2010.dll b/Libs/AvalonDock.Themes.VS2010.dll new file mode 100644 index 0000000..a98f58b Binary files /dev/null and b/Libs/AvalonDock.Themes.VS2010.dll differ diff --git a/Libs/AvalonDock.Themes.VS2012.dll b/Libs/AvalonDock.Themes.VS2012.dll new file mode 100644 index 0000000..c15762a Binary files /dev/null and b/Libs/AvalonDock.Themes.VS2012.dll differ diff --git a/Libs/AvalonDock.Themes.VS2012.pdb b/Libs/AvalonDock.Themes.VS2012.pdb new file mode 100644 index 0000000..6e6145d Binary files /dev/null and b/Libs/AvalonDock.Themes.VS2012.pdb differ diff --git a/Libs/AvalonDock.dll b/Libs/AvalonDock.dll new file mode 100644 index 0000000..e27d52e Binary files /dev/null and b/Libs/AvalonDock.dll differ diff --git a/Libs/AvalonDock.pdb b/Libs/AvalonDock.pdb new file mode 100644 index 0000000..9c98185 Binary files /dev/null and b/Libs/AvalonDock.pdb differ diff --git a/Libs/ICSharpCode.AvalonEdit.dll b/Libs/ICSharpCode.AvalonEdit.dll new file mode 100644 index 0000000..49dba29 Binary files /dev/null and b/Libs/ICSharpCode.AvalonEdit.dll differ diff --git a/Libs/MahApps.Metro.Resources.dll b/Libs/MahApps.Metro.Resources.dll new file mode 100644 index 0000000..8f61eec Binary files /dev/null and b/Libs/MahApps.Metro.Resources.dll differ diff --git a/Libs/MahApps.Metro.dll b/Libs/MahApps.Metro.dll new file mode 100644 index 0000000..d64df88 Binary files /dev/null and b/Libs/MahApps.Metro.dll differ diff --git a/Libs/Microsoft.Practices.Prism.Interactivity.XML b/Libs/Microsoft.Practices.Prism.Interactivity.XML new file mode 100644 index 0000000..35a1444 --- /dev/null +++ b/Libs/Microsoft.Practices.Prism.Interactivity.XML @@ -0,0 +1,174 @@ + + + + Microsoft.Practices.Prism.Interactivity + + + + + Represents an interaction request used for confirmations. + + + + + Represents an interaction request used for notifications. + + + + + Gets or sets the title to use for the notification. + + + + + Gets or sets the content of the notification. + + + + + Gets or sets a value indicating that the confirmation is confirmed. + + + + + Represents a request from user interaction. + + + View models can expose interaction request objects through properties and raise them when user interaction + is required so views associated with the view models can materialize the user interaction using an appropriate + mechanism. + + + + + Fired when the interaction is needed. + + + + + Implementation of the interface. + + + + + Fires the Raised event. + + The context for the interaction request. + + + + Fires the Raised event. + + The context for the interaction request. + The callback to execute when the interaction is completed. + + + + Fired when interaction is needed. + + + + + Event args for the event. + + + + + Constructs a new instance of + + + + + + + Gets the context for a requested interaction. + + + + + Gets the callback to execute when an interaction is completed. + + + + + Custom event trigger for using with objects. + + + The standard class can be used instead, as long as the 'Raised' event + name is specified. + + + + + Specifies the name of the Event this EventTriggerBase is listening for. + + This implementation always returns the Raised event name for ease of connection with . + + + + Trigger action that executes a command when invoked. + It also maintains the Enabled state of the target control based on the CanExecute method of the command. + + + + + Dependency property identifying the command to execute when invoked. + + + + + Dependency property identifying the command parameter to supply on command execution. + + + + + Public wrapper of the Invoke method. No parameter is passed here, as the parameter in the Invoke method is ignored in this class. + + + + + Executes the command + + This parameter is ignored; the CommandParameter specified in the CommandParameterProperty is used for command invocation. + + + + Sets the Command and CommandParameter properties to null. + + + + + This method is called after the behavior is attached. + It updates the command behavior's Command and CommandParameter properties if necessary. + + + + + Gets or sets the command to execute when invoked. + + + + + Gets or sets the command parameter to supply on command execution. + + + + + A CommandBehavior that exposes a public ExecuteCommand method. It provides the functionality to invoke commands and update Enabled state of the target control. + It is not possible to make the inherit from , since the + must already inherit from , so we chose to follow the aggregation approach. + + + + + Constructor specifying the target object. + + The target object the behavior is attached to. + + + + Executes the command, if it's set, providing the + + + + diff --git a/Libs/Microsoft.Practices.Prism.Interactivity.dll b/Libs/Microsoft.Practices.Prism.Interactivity.dll new file mode 100644 index 0000000..91e4ccd Binary files /dev/null and b/Libs/Microsoft.Practices.Prism.Interactivity.dll differ diff --git a/Libs/Microsoft.Practices.Prism.Interactivity.pdb b/Libs/Microsoft.Practices.Prism.Interactivity.pdb new file mode 100644 index 0000000..4f33b0f Binary files /dev/null and b/Libs/Microsoft.Practices.Prism.Interactivity.pdb differ diff --git a/Libs/Microsoft.Practices.Prism.MefExtensions.XML b/Libs/Microsoft.Practices.Prism.MefExtensions.XML new file mode 100644 index 0000000..8a214e5 --- /dev/null +++ b/Libs/Microsoft.Practices.Prism.MefExtensions.XML @@ -0,0 +1,779 @@ + + + + Microsoft.Practices.Prism.MefExtensions + + + + + DefaultPrismServiceRegistrationAgent allows the Prism required types to be registered if necessary. + + + + + Registers the required Prism types that are not already registered in the . + + The to register the required types in, if they are not already registered. + + + + Returns an for the current assembly + + + Due to the security restrictions in Silverlight, you cannot call + Assembly.GetAssembly(typeof(MefBootstrapper)) + So, we are forced to use Assembly.GetCallingAssembly() instead. + To ensure that the calling assembly is this one, the call is in this + private helper method. + + + Returns an for the current assembly + + + + + Exports the EventAggregator using the Managed Extensibility Framework (MEF). + + + This allows the MefBootstrapper to provide this class as a default implementation. + If another implementation is found, this export will not be used. + + + + + Base class that provides a basic bootstrapping sequence that registers most of the Composite Application Library assets in a MEF . + + + This class must be overriden to provide application specific configuration. + + + + + Run the bootstrapper process. + + If , registers default + Composite Application Library services in the container. This is the default behavior. + + + + Configures the used by MEF. + + + The base implementation returns a new AggregateCatalog. + + An to be used by the bootstrapper. + + + + Configures the used by MEF. + + + The base implementation does nothing. + + + + + Creates the that will be used as the default container. + + A new instance of . + + The base implementation registers a default MEF catalog of exports of key Prism types. + Exporting your own types will replace these defaults. + + + + + Configures the . + May be overwritten in a derived class to add specific type mappings required by the application. + + + The base implementation registers all the types direct instantiated by the bootstrapper with the container. + If the method is overwritten, the new implementation should call the base class version. + + + + + Helper method for configuring the . + Registers defaults for all the types necessary for Prism to work, if they are not already registered. + + + + + Helper method for configuring the . + Registers all the types direct instantiated by the bootstrapper with the container. + + + + + Configures the LocatorProvider for the . + + + The base implementation also sets the ServiceLocator provider singleton. + + + + + Initializes the shell. + + + The base implementation ensures the shell is composed in the container. + + + + + Initializes the modules. May be overwritten in a derived class to use a custom Modules Catalog + + + + + Gets or sets the default for the application. + + The default instance. + + + + Gets or sets the default for the application. + + The default instance. + + + + Holds a collection of composable part catalogs keyed by module info. + + + + + Adds the specified catalog using the module info as a key. + + The module info. + The catalog. + + + + Gets the catalog for the specified module info. + + The module info. + + + + + Tries to ge the catalog for the specified module info. + + The module info. + The catalog. + true if found; otherwise false; + + + + Removes the catalgo for the specified module info. + + The module info. + + + + Clears the collection of catalogs. + + + + + Describe the Managed Extensibility Framework export of an IModule. + + + This interface is used when importing classes exported with the ModuleExportAttribute. + This interface and the ModuleExport class properties should match. + + + + + Gets the name of the module. + + The name of the module. + + + + Gets the type of the module. + + The type of the module. + + + + Gets when the module should have Initialize() called. + + The initialization mode. + + + + Gets the names of modules this module depends upon. + + An array of module names. + + + + Loads modules from an arbitrary location on the filesystem. This typeloader is only called if + classes have a Ref parameter that starts with "file://". + This class is only used on the Desktop version of the Composite Application Library when used with Managed Extensibility Framework. + + + + + Initializes a new instance of the MefFileModuleTypeLoader class. + This instance is used to load requested module types. + + + + + Evaluates the property to see if the current typeloader will be able to retrieve the . + Returns true if the property starts with "file://", because this indicates that the file + is a local file. + + Module that should have it's type loaded. + + if the current typeloader is able to retrieve the module, otherwise . + + + + + Retrieves the . + + Module that should have it's type loaded. + + + + Raised repeatedly to provide progress as modules are loaded in the background. + + + + + Raised when a module is loaded or fails to load. + + + + + Exports the ModuleInitializer using the Managed Extensibility Framework (MEF). + + + This allows the MefBootstrapper to provide this class as a default implementation. + If another implementation is found, this export will not be used. + + + + + Initializes a new instance of the class. + + The container that will be used to resolve the modules by specifying its type. + The logger to use. + The downloaded part catalogs. + The aggregate catalog. + + + + Uses the container to resolve a new by specifying its . + + The module to create. + + A new instance of the module specified by . + + + + + Import the available modules from the MEF container + + + + + Component responsible for coordinating the modules' type loading and module initialization process. + + + This allows the MefBootstrapper to provide this class as a default implementation. + If another implementation is found, this export will not be used. + + + Component responsible for coordinating the modules' type loading and module initialization process. + + + This allows the MefBootstrapper to provide this class as a default implementation. + If another implementation is found, this export will not be used. + + + + + Initializes a new instance of the class. + + Service used for initialization of modules. + Catalog that enumerates the modules to be loaded and initialized. + Logger used during the load and initialization of modules. + + + + Called when a part's imports have been satisfied and it is safe to use. + + + Whenever the MEF container loads new types that cause ImportedModules to be recomposed, this is called. + This method ensures that as the MEF container discovered new modules, the ModuleCatalog is updated. + + + + + Checks if the module needs to be retrieved before it's initialized. + + Module that is being checked if needs retrieval. + True if the module needs to be retrieved. Otherwise, false. + + + + Gets or sets the modules to be imported. + + Import the available modules from the MEF container + + + + Gets or sets the type loaders used by the module manager. + + + + + Provides service location utilizing the Managed Extensibility Framework container. + + + + + Initializes a new instance of the class. + + The MEF composition container. + + + + Resolves the instance of the requested service. + + Type of instance requested. + The requested service instance. + + + + Resolves all the instances of the requested service. + + Type of service requested. + Name of registered service you want. May be null. + Sequence of service instance objects. + + + + An attribute that is applied to describe the Managed Extensibility Framework export of an IModule. + + + + + Initializes a new instance of the class. + + The concrete type of the module being exported. Not typeof(IModule). + + + + Initializes a new instance of the class. + + The contract name of the module. + The concrete type of the module being exported. Not typeof(IModule). + + + + Gets the contract name of the module. + + + + + Gets concrete type of the module being exported. Not typeof(IModule). + + + + + Gets or sets when the module should have Initialize() called. + + + + + Gets or sets the contract names of modules this module depends upon. + + + + + A very simple custom that takes an enumeration + of parts and returns them when requested. + + + + + Creates a PrismDefaultsCatalog that will return the provided parts when requested. + + Parts to add to the catalog + Thrown if the parts parameter is null. + + + + Gets the parts contained in the catalog. + + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to Bootstrapper sequence completed. + + + + + Looks up a localized string similar to Configuring catalog for MEF. + + + + + Looks up a localized string similar to Configuring default region behaviors. + + + + + Looks up a localized string similar to Configuring MEF container. + + + + + Looks up a localized string similar to Configuring module catalog.. + + + + + Looks up a localized string similar to Configuring region adapters. + + + + + Looks up a localized string similar to Configuring ServiceLocator singleton. + + + + + Looks up a localized string similar to Creating catalog for MEF. + + + + + Looks up a localized string similar to Creating Mef container. + + + + + Looks up a localized string similar to Creating module catalog.. + + + + + Looks up a localized string similar to Creating shell. + + + + + Looks up a localized string similar to Unable to locate the module with type '{0}' among the exported modules. Make sure the module name in the module catalog matches that specified on ModuleExportAttribute for the module type.. + + + + + Looks up a localized string similar to Initializing modules. + + + + + Looks up a localized string similar to Initializing shell. + + + + + Looks up a localized string similar to Logger was created successfully.. + + + + + Looks up a localized string similar to The CompositionContainer is required and cannot be null.. + + + + + Looks up a localized string similar to The ILoggerFacade is required and cannot be null.. + + + + + Looks up a localized string similar to The IModuleCatalog is required and cannot be null in order to initialize the modules.. + + + + + Looks up a localized string similar to Registering Framework Exception Types. + + + + + Looks up a localized string similar to Setting the RegionManager.. + + + + + Looks up a localized string similar to Updating Regions.. + + + + + Exports the AutoPopulateRegionBehavior using the Managed Extensibility Framework (MEF). + + + This allows the MefBootstrapper to provide this class as a default implementation. + If another implementation is found, this export will not be used. + + + + + Initializes a new instance of the class. + + that the behavior will monitor for views to populate the region. + + + + Exports the BindRegionContextToDependencyObjectBehavior using the Managed Extensibility Framework (MEF). + + + This allows the MefBootstrapper to provide this class as a default implementation. + If another implementation is found, this export will not be used. + + + + + Exports the ClearChildViewsRegionBehavior using the Managed Extensibility Framework (MEF). + + + This allows the MefBootstrapper to provide this class as a default implementation. + If another implementation is found, this export will not be used. + + + + + Exports the DelayedRegionCreationBehavior using the Managed Extensibility Framework (MEF). + + + This allows the MefBootstrapper to provide this class as a default implementation. + If another implementation is found, this export will not be used. + + + + + Initializes a new instance of the class. + + The region adapter mappings, that are used to find the correct adapter for + a given controltype. The controltype is determined by the value. + + + + Exports the RegionActiveAwareBehavior using the Managed Extensibility Framework (MEF). + + + This allows the MefBootstrapper to provide this class as a default implementation. + If another implementation is found, this export will not be used. + + + + + Exports the AutoPopulateRegionBehavior using the Managed Extensibility Framework (MEF). + + + This allows the MefBootstrapper to provide this class as a default implementation. + If another implementation is found, this export will not be used. + + + + + Initializes a new instance of the class. + + + + + Exports the RegionManagerRegistrationBehavior using the Managed Extensibility Framework (MEF). + + + This allows the MefBootstrapper to provide this class as a default implementation. + If another implementation is found, this export will not be used. + + + + + Exports the SelectorItemsSourceSyncBehavior using the Managed Extensibility Framework (MEF). + + + This allows the MefBootstrapper to provide this class as a default implementation. + If another implementation is found, this export will not be used. + + + + + Exports the SyncRegionContextWithHostBehavior using the Managed Extensibility Framework (MEF). + + + This allows the MefBootstrapper to provide this class as a default implementation. + If another implementation is found, this export will not be used. + + + + + Exports the ContentControlRegionAdapter using the Managed Extensibility Framework (MEF). + + + This allows the to provide this class as a default implementation. + If another implementation is found, this export will not be used. + + + + + Initializes a new instance of the class. + + The region behavior factory. + + + + Exports the ItemsControlRegionAdapter using the Managed Extensibility Framework (MEF). + + + This allows the MefBootstrapper to provide this class as a default implementation. + If another implementation is found, this export will not be used. + + + + + Initializes a new instance of the class. + + The factory used to create the region behaviors to attach to the created regions. + + + + Exports the LocatorNavigationTargetHandler using the Managed Extensibility Framework (MEF). + + + This allows the MefBootstrapper to provide this class as a default implementation. + If another implementation is found, this export will not be used. + + + + + Initializes a new instance of the class. + + used to create the instance of the view from its . + + + + Exports the RegionAdapterMappings using the Managed Extensibility Framework (MEF). + + + This allows the MefBootstrapper to provide this class as a default implementation. + If another implementation is found, this export will not be used. + + + + + Exports the RegionBehaviorFactory using the Managed Extensibility Framework (MEF). + + + This allows the MefBootstrapper to provide this class as a default implementation. + If another implementation is found, this export will not be used. + + + + + Initializes a new instance of the class. + + used to create the instance of the behavior from its . + + + + Exports the RegionManager using the Managed Extensibility Framework (MEF). + + + This allows the MefBootstrapper to provide this class as a default implementation. + If another implementation is found, this export will not be used. + + + + + Exports the MefRegionNavigationJournal using the Managed Extensibility Framework (MEF). + + + This allows the MefBootstrapper to provide this class as a default implementation. + If another implementation is found, this export will not be used. + + + + + Exports the RegionNavigationJournalEntry using the Managed Extensibility Framework (MEF). + + + This allows the MefBootstrapper to provide this class as a default implementation. + If another implementation is found, this export will not be used. + + + + + Exports the MefRegionNavigationService using the Managed Extensibility Framework (MEF). + + + This allows the MefBootstrapper to provide this class as a default implementation. + If another implementation is found, this export will not be used. + + + + + Initializes a new instance of the class. + + The service locator. + The navigation content loader. + The navigation journal. + + + + Exports the RegionViewRegistry using the Managed Extensibility Framework (MEF). + + + This allows the MefBootstrapper to provide this class as a default implementation. + If another implementation is found, this export will not be used. + + + + + Initializes a new instance of the class. + + The service locator. + + + + Exports the SelectorRegionAdapter using the Managed Extensibility Framework (MEF). + + + This allows the MefBootstrapper to provide this class as a default implementation. + If another implementation is found, this export will not be used. + + + + + Initializes a new instance of the class. + + The factory used to create the region behaviors to attach to the created regions. + + + diff --git a/Libs/Microsoft.Practices.Prism.MefExtensions.dll b/Libs/Microsoft.Practices.Prism.MefExtensions.dll new file mode 100644 index 0000000..f17209b Binary files /dev/null and b/Libs/Microsoft.Practices.Prism.MefExtensions.dll differ diff --git a/Libs/Microsoft.Practices.Prism.MefExtensions.pdb b/Libs/Microsoft.Practices.Prism.MefExtensions.pdb new file mode 100644 index 0000000..e71a487 Binary files /dev/null and b/Libs/Microsoft.Practices.Prism.MefExtensions.pdb differ diff --git a/Libs/Microsoft.Practices.Prism.UnityExtensions.dll b/Libs/Microsoft.Practices.Prism.UnityExtensions.dll new file mode 100644 index 0000000..f9273bc Binary files /dev/null and b/Libs/Microsoft.Practices.Prism.UnityExtensions.dll differ diff --git a/Libs/Microsoft.Practices.Prism.UnityExtensions.pdb b/Libs/Microsoft.Practices.Prism.UnityExtensions.pdb new file mode 100644 index 0000000..e1b07b7 Binary files /dev/null and b/Libs/Microsoft.Practices.Prism.UnityExtensions.pdb differ diff --git a/Libs/Microsoft.Practices.Prism.UnityExtensions.xml b/Libs/Microsoft.Practices.Prism.UnityExtensions.xml new file mode 100644 index 0000000..aef8121 --- /dev/null +++ b/Libs/Microsoft.Practices.Prism.UnityExtensions.xml @@ -0,0 +1,268 @@ + + + + Microsoft.Practices.Prism.UnityExtensions + + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to Adding UnityBootstrapperExtension to container.. + + + + + Looks up a localized string similar to Bootstrapper sequence completed.. + + + + + Looks up a localized string similar to Configuring default region behaviors.. + + + + + Looks up a localized string similar to Configuring module catalog.. + + + + + Looks up a localized string similar to Configuring region adapters.. + + + + + Looks up a localized string similar to Configuring ServiceLocator singleton.. + + + + + Looks up a localized string similar to Configuring the Unity container.. + + + + + Looks up a localized string similar to Creating module catalog.. + + + + + Looks up a localized string similar to Creating the shell.. + + + + + Looks up a localized string similar to Creating Unity container.. + + + + + Looks up a localized string similar to Initializing modules.. + + + + + Looks up a localized string similar to Initializing the shell.. + + + + + Looks up a localized string similar to Logger was created successfully.. + + + + + Looks up a localized string similar to The method 'GetModuleEnumerator' of the bootstrapper must be overwritten in order to use the default module initialization logic.. + + + + + Looks up a localized string similar to The ILoggerFacade is required and cannot be null.. + + + + + Looks up a localized string similar to The IModuleCatalog is required and cannot be null in order to initialize the modules.. + + + + + Looks up a localized string similar to The IUnityContainer is required and cannot be null.. + + + + + Looks up a localized string similar to Registering Framework Exception Types.. + + + + + Looks up a localized string similar to Setting the RegionManager.. + + + + + Looks up a localized string similar to Type '{0}' was already registered by the application. Skipping.... + + + + + Looks up a localized string similar to Updating Regions.. + + + + + Base class that provides a basic bootstrapping sequence that + registers most of the Composite Application Library assets + in a . + + + This class must be overriden to provide application specific configuration. + + + + + Run the bootstrapper process. + + If , registers default Composite Application Library services in the container. This is the default behavior. + + + + Configures the LocatorProvider for the . + + + + + Registers in the the of the Exceptions + that are not considered root exceptions by the . + + + + + Configures the . May be overwritten in a derived class to add specific + type mappings required by the application. + + + + + Initializes the modules. May be overwritten in a derived class to use a custom Modules Catalog + + + + + Creates the that will be used as the default container. + + A new instance of . + + + + Registers a type in the container only if that type was not already registered. + + The interface type to register. + The type implementing the interface. + Registers the type as a singleton. + + + + Gets the default for the application. + + The default instance. + + + + Implements a that checks if a specific type was registered with the container. + + + + + Evaluates if a specified type was registered in the container. + + The container to check if the type was registered in. + The type to check if it was registered. + if the was registered with the container. + + In order to use this extension, you must first call + and specify as the extension type. + + + + + Initializes the container with this extension's functionality. + + + + + Defines a adapter for the interface to be used by the Composite Application Library. + + + + + Initializes a new instance of . + + The that will be used + by the and methods. + + + + Resolves the instance of the requested service. + + Type of instance requested. + Name of registered service you want. May be null. + The requested service instance. + + + + Resolves all the instances of the requested service. + + Type of service requested. + Sequence of service instance objects. + + + + Extensions methods to extend and facilitate the usage of . + + + + + Returns whether a specified type has a type mapping registered in the container. + + The to check for the type mapping. + The type to check if there is a type mapping for. + if there is a type mapping registered for . + In order to use this extension method, you first need to add the + extension to the . + + + + + Utility method to try to resolve a service from the container avoiding an exception if the container cannot build the type. + + The cointainer that will be used to resolve the type. + The type to resolve. + The instance of built up by the container. + + + + Utility method to try to resolve a service from the container avoiding an exception if the container cannot build the type. + + The cointainer that will be used to resolve the type. + The type to resolve. + The instance of built up by the container. + + + diff --git a/Libs/Microsoft.Practices.Prism.XML b/Libs/Microsoft.Practices.Prism.XML new file mode 100644 index 0000000..d6c3071 --- /dev/null +++ b/Libs/Microsoft.Practices.Prism.XML @@ -0,0 +1,5949 @@ + + + + Microsoft.Practices.Prism + + + + + Base class that provides a basic bootstrapping sequence and hooks + that specific implementations can override + + + This class must be overriden to provide application specific configuration. + + + + + Create the used by the bootstrapper. + + + The base implementation returns a new TextLogger. + + + + + Runs the bootstrapper process. + + + + + Creates the used by Prism. + + + The base implementation returns a new ModuleCatalog. + + + + + Configures the used by Prism. + + + + + Registers the s of the Exceptions that are not considered + root exceptions by the . + + + + + Initializes the modules. May be overwritten in a derived class to use a custom Modules Catalog + + + + + Configures the default region adapter mappings to use in the application, in order + to adapt UI controls defined in XAML to use a region and register it automatically. + May be overwritten in a derived class to add specific mappings required by the application. + + The instance containing all the mappings. + + + + Configures the . + This will be the list of default behaviors that will be added to a region. + + + + + Initializes the shell. + + + + + Run the bootstrapper process. + + If , registers default + Composite Application Library services in the container. This is the default behavior. + + + + Creates the shell or main window of the application. + + The shell of the application. + + If the returned instance is a , the + will attach the default of + the application in its attached property + in order to be able to add regions by using the + attached property from XAML. + + + + + Configures the LocatorProvider for the . + + + + + Gets the for the application. + + A instance. + + + + Gets the default for the application. + + The default instance. + + + + Gets the shell user interface + + The shell user interface. + + + + Behavior that allows controls that derrive from to hook up with objects. + + + This Behavior is required in Silverlight, because Silverlight does not have Commanding support. + + + + + Base behavior to handle connecting a to a Command. + + The target object must derive from Control + + CommandBehaviorBase can be used to provide new behaviors for commands. + + + + + Constructor specifying the target object. + + The target object the behavior is attached to. + + + + Updates the target object's IsEnabled property based on the commands ability to execute. + + + + + Executes the command, if it's set, providing the + + + + + Corresponding command to be execute and monitored for + + + + + The parameter to supply the command during execution + + + + + Object to which this behavior is attached. + + + + + Initializes a new instance of the class and hooks up the Click event of + to the ExecuteCommand() method. + + The clickable object. + + + + Static Class that holds all Dependency Properties and Static methods to allow + the Click event of the ButtonBase class to be attached to a Command. + + + This class is required, because Silverlight doesn't have native support for Commands. + + + + + Command to execute on click event. + + + + + Command parameter to supply on command execution. + + + + + Sets the to execute on the click event. + + ButtonBase dependency object to attach command + Command to attach + + + + Retrieves the attached to the . + + ButtonBase containing the Command dependency property + The value of the command attached + + + + Sets the value for the CommandParameter attached property on the provided . + + ButtonBase to attach CommandParameter + Parameter value to attach + + + + Gets the value in CommandParameter attached property on the provided + + ButtonBase that has the CommandParameter + The value of the property + + + + The CompositeCommand composes one or more ICommands. + + + + + Initializes a new instance of . + + + + + Initializes a new instance of . + + Indicates when the command activity is going to be monitored. + + + + Adds a command to the collection and signs up for the event of it. + + + If this command is set to monitor command activity, and + implements the interface, this method will subscribe to its + event. + + The command to register. + + + + Removes a command from the collection and removes itself from the event of it. + + The command to unregister. + + + + Forwards to the registered commands and returns + if all of the commands return . + + Data used by the command. + If the command does not require data to be passed, this object can be set to . + + if all of the commands return ; otherwise, . + + + + Forwards to the registered commands. + + Data used by the command. + If the command does not require data to be passed, this object can be set to . + + + + + Evaluates if a command should execute. + + The command to evaluate. + A value indicating whether the command should be used + when evaluating and . + + If this command is set to monitor command activity, and + implements the interface, + this method will return if the command's + property is ; otherwise it always returns . + + + + Raises on the UI thread so every + command invoker can requery to check if the + can execute. + + + + + Handler for IsActiveChanged events of registered commands. + + The sender. + EventArgs to pass to the event. + + + + Occurs when any of the registered commands raise . You must keep a hard + reference to the handler to avoid garbage collection and unexpected results. See remarks for more information. + + + When subscribing to the event using + code (not when binding using XAML) will need to keep a hard reference to the event handler. This is to prevent + garbage collection of the event handler because the command implements the Weak Event pattern so it does not have + a hard reference to this handler. An example implementation can be seen in the CompositeCommand and CommandBehaviorBase + classes. In most scenarios, there is no reason to sign up to the CanExecuteChanged event directly, but if you do, you + are responsible for maintaining the reference. + + + The following code holds a reference to the event handler. The myEventHandlerReference value should be stored + in an instance member to avoid it from being garbage collected. + + EventHandler myEventHandlerReference = new EventHandler(this.OnCanExecuteChanged); + command.CanExecuteChanged += myEventHandlerReference; + + + + + + Gets the list of all the registered commands. + + A list of registered commands. + This returns a copy of the commands subscribed to the CompositeCommand. + + + + An whose delegates can be attached for and . + It also implements the interface, which is useful when registering this command in a that monitors command's activity. + + Parameter type. + + The constructor deliberately prevent the use of value types. + Because ICommand takes an object, having a value type for T would cause unexpected behavior when CanExecute(null) is called during XAML initialization for command bindings. + Using default(T) was considered and rejected as a solution because the implementor would not be able to distinguish between a valid and defaulted values. + + Instead, callers should support a value type by using a nullable value type and checking the HasValue property before using the Value property. + + + public MyClass() + { + this.submitCommand = new DelegateCommand<int?>(this.Submit, this.CanSubmit); + } + + private bool CanSubmit(int? customerId) + { + return (customerId.HasValue && customers.Contains(customerId.Value)); + } + + + + + + + An whose delegates can be attached for and . + It also implements the interface, which is + useful when registering this command in a + that monitors command's activity. + + + + + Interface that defines if the object instance is active + and notifies when the activity changes. + + + + + Gets or sets a value indicating whether the object is active. + + if the object is active; otherwise . + + + + Notifies that the value for property has changed. + + + + + Createse a new instance of a , specifying both the execute action and the can execute function. + + The to execute when is invoked. + The to invoked when is invoked. + + + + Raises on the UI thread so every + command invoker can requery to check if the + can execute. + + + + + Raises on the UI thread so every command invoker + can requery to check if the command can execute. + Note that this will trigger the execution of once for each invoker. + + + + + This raises the event. + + + + + Executes the command with the provided parameter by invoking the supplied during construction. + + + + + + Determines if the command can execute with the provided parameter by invoing the supplied during construction. + + The parameter to use when determining if this command can execute. + Returns if the command can execute. otherwise. + + + + Gets or sets a value indicating whether the object is active. + + if the object is active; otherwise . + + + + Fired if the property changes. + + + + + Occurs when changes occur that affect whether or not the command should execute. You must keep a hard + reference to the handler to avoid garbage collection and unexpected results. See remarks for more information. + + + When subscribing to the event using + code (not when binding using XAML) will need to keep a hard reference to the event handler. This is to prevent + garbage collection of the event handler because the command implements the Weak Event pattern so it does not have + a hard reference to this handler. An example implementation can be seen in the CompositeCommand and CommandBehaviorBase + classes. In most scenarios, there is no reason to sign up to the CanExecuteChanged event directly, but if you do, you + are responsible for maintaining the reference. + + + The following code holds a reference to the event handler. The myEventHandlerReference value should be stored + in an instance member to avoid it from being garbage collected. + + EventHandler myEventHandlerReference = new EventHandler(this.OnCanExecuteChanged); + command.CanExecuteChanged += myEventHandlerReference; + + + + + + Initializes a new instance of . + + Delegate to execute when Execute is called on the command. This can be null to just hook up a CanExecute delegate. + will always return true. + + + + Initializes a new instance of . + + Delegate to execute when Execute is called on the command. This can be null to just hook up a CanExecute delegate. + Delegate to execute when CanExecute is called on the command. This can be null. + When both and ar . + + + + Determines if the command can execute by invoked the provided during construction. + + Data used by the command to determine if it can execute. + + if this command can be executed; otherwise, . + + + + + Executes the command and invokes the provided during construction. + + Data used by the command. + + + + An whose delegates do not take any parameters for and . + + + + + + + Creates a new instance of with the to invoke on execution. + + The to invoke when is called. + + + + Creates a new instance of with the to invoke on execution + and a to query for determining if the command can execute. + + The to invoke when is called. + The to invoke when is called + + + + Executes the command. + + + + + Determines if the command can be executed. + + Returns if the command can execute,otherwise returns . + + + + Handles management and dispatching of EventHandlers in a weak way. + + + + + Invokes the handlers + + + + + + + Adds a handler to the supplied list in a weak way. + + Existing handler list. It will be created if null. + Handler to add. + Default list size. + + + + Removes an event handler from the reference list. + + Handler list to remove reference from. + Handler to remove. + + + + Hides the dispatcher mis-match between Silverlight and .Net, largely so code reads a bit easier + + + + + Extends to invoke the delegate in a background thread. + + The type to use for the generic and types. + + + + Provides a way to retrieve a to execute an action depending + on the value of a second filter predicate that returns true if the action should execute. + + The type to use for the generic and types. + + + + Defines a contract for an event subscription to be used by . + + + + + Gets the execution strategy to publish this event. + + An with the execution strategy, or if the is no longer valid. + + + + Gets or sets a that identifies this . + + A token that identifies this . + + + + Creates a new instance of . + + A reference to a delegate of type . + A reference to a delegate of type . + When or are . + When the target of is not of type , + or the target of is not of type . + + + + Gets the execution strategy to publish this event. + + An with the execution strategy, or if the is no longer valid. + + If or are no longer valid because they were + garbage collected, this method will return . + Otherwise it will return a delegate that evaluates the and if it + returns will then call . The returned + delegate holds hard references to the and target + delegates. As long as the returned delegate is not garbage collected, + the and references delegates won't get collected either. + + + + + Invokes the specified synchronously when not overriden. + + The action to execute. + The payload to pass while invoking it. + An is thrown if is null. + + + + Gets the target that is referenced by the . + + An or if the referenced target is not alive. + + + + Gets the target that is referenced by the . + + An or if the referenced target is not alive. + + + + Gets or sets a that identifies this . + + A token that identifies this . + + + + Creates a new instance of . + + A reference to a delegate of type . + A reference to a delegate of type . + When or are . + When the target of is not of type , + or the target of is not of type . + + + + Invokes the specified in an asynchronous thread by using a . + + The action to execute. + The payload to pass while invoking it. + + + + Defines a class that manages publication and subscription to events. + + The type of message that will be passed to the subscribers. + + + + Defines a base class to publish and subscribe to events. + + + + + Adds the specified to the subscribers' collection. + + The subscriber. + The that uniquely identifies every subscriber. + + Adds the subscription to the internal list and assigns it a new . + + + + + Calls all the execution strategies exposed by the list of . + + The arguments that will be passed to the listeners. + Before executing the strategies, this class will prune all the subscribers from the + list that return a when calling the + method. + + + + Removes the subscriber matching the . + + The returned by while subscribing to the event. + + + + Returns if there is a subscriber matching . + + The returned by while subscribing to the event. + if there is a that matches; otherwise . + + + + Gets the list of current subscriptions. + + The current subscribers. + + + + Subscribes a delegate to an event that will be published on the . + will maintain a to the target of the supplied delegate. + + The delegate that gets executed when the event is published. + A that uniquely identifies the added subscription. + + The CompositePresentationEvent collection is thread-safe. + + + + + Subscribes a delegate to an event. + CompositePresentationEvent will maintain a to the Target of the supplied delegate. + + The delegate that gets executed when the event is raised. + Specifies on which thread to receive the delegate callback. + A that uniquely identifies the added subscription. + + The CompositePresentationEvent collection is thread-safe. + + + + + Subscribes a delegate to an event that will be published on the . + + The delegate that gets executed when the event is published. + When , the keeps a reference to the subscriber so it does not get garbage collected. + A that uniquely identifies the added subscription. + + If is set to , will maintain a to the Target of the supplied delegate. + If not using a WeakReference ( is ), the user must explicitly call Unsubscribe for the event when disposing the subscriber in order to avoid memory leaks or unexepcted behavior. + + The CompositePresentationEvent collection is thread-safe. + + + + + Subscribes a delegate to an event. + + The delegate that gets executed when the event is published. + Specifies on which thread to receive the delegate callback. + When , the keeps a reference to the subscriber so it does not get garbage collected. + A that uniquely identifies the added subscription. + + If is set to , will maintain a to the Target of the supplied delegate. + If not using a WeakReference ( is ), the user must explicitly call Unsubscribe for the event when disposing the subscriber in order to avoid memory leaks or unexepcted behavior. + + The CompositePresentationEvent collection is thread-safe. + + + + + Subscribes a delegate to an event. + + The delegate that gets executed when the event is published. + Specifies on which thread to receive the delegate callback. + When , the keeps a reference to the subscriber so it does not get garbage collected. + Filter to evaluate if the subscriber should receive the event. + A that uniquely identifies the added subscription. + + If is set to , will maintain a to the Target of the supplied delegate. + If not using a WeakReference ( is ), the user must explicitly call Unsubscribe for the event when disposing the subscriber in order to avoid memory leaks or unexepcted behavior. + + The CompositePresentationEvent collection is thread-safe. + + + + + Publishes the . + + Message to pass to the subscribers. + + + + Removes the first subscriber matching from the subscribers' list. + + The used when subscribing to the event. + + + + Returns if there is a subscriber matching . + + The used when subscribing to the event. + if there is an that matches; otherwise . + + + + Gets the that is bound to the UI elements. + + The to use when subscribing using . + + + + Generic arguments class to pass to event handlers that need to receive data. + + The type of data to pass. + + + + Initializes the DataEventArgs class. + + Information related to the event. + + + + Gets the information related to the event. + + Information related to the event. + + + + Wraps the Application Dispatcher. + + + + + Defines the interface for invoking methods through a Dispatcher Facade + + + + + Dispatches an invocation to the method received as parameter. + + Method to be invoked. + Arguments to pass to the invoked method. + + + + Forwards the BeginInvoke to the current application's . + + Method to be invoked. + Arguments to pass to the invoked method. + + + + Represents a reference to a that may contain a + to the target. This class is used + internally by the Composite Application Library. + + + + + Represents a reference to a . + + + + + Gets the referenced object. + + A instance if the target is valid; otherwise . + + + + Initializes a new instance of . + + The original to create a reference for. + If the class will create a weak reference to the delegate, allowing it to be garbage collected. Otherwise it will keep a strong reference to the target. + If the passed is not assignable to . + + + + Gets the (the target) referenced by the current object. + + if the object referenced by the current object has been garbage collected; otherwise, a reference to the referenced by the current object. + + + + Extends to invoke the delegate + in a specific . + + The type to use for the generic and types. + + + + Creates a new instance of . + + A reference to a delegate of type . + A reference to a delegate of type . + The dispatcher to use when executing the delegate. + When or are . + When the target of is not of type , + or the target of is not of type . + + + + Invokes the specified asynchronously in the specified . + + The action to execute. + The payload to pass while invoking it. + + + + Implements . + + + + + Defines an interface to get instances of an event type. + + + + + Gets an instance of an event type. + + The type of event to get. + An instance of an event object of type . + + + + Gets the single instance of the event managed by this EventAggregator. Multiple calls to this method with the same returns the same event instance. + + The type of event to get. This must inherit from . + A singleton instance of an event object of type . + + + + Subscription token returned from on subscribe. + + + + + Initializes a new instance of . + + + + + Indicates whether the current object is equal to another object of the same type. + + + if the current object is equal to the parameter; otherwise, . + + An object to compare with this object. + + + + Determines whether the specified is equal to the current . + + + true if the specified is equal to the current ; otherwise, false. + + The to compare with the current . + The parameter is null.2 + + + + Serves as a hash function for a particular type. + + + A hash code for the current . + + 2 + + + + Disposes the SubscriptionToken, removing the subscription from the corresponding . + + + + + Specifies on which thread a subscriber will be called. + + + + + The call is done on the same thread on which the was published. + + + + + The call is done on the UI thread. + + + + + The call is done asynchronously on a background thread. + + + + + A dictionary of lists. + + The key to use for lists. + The type of the value held by lists. + + + + If a list does not already exist, it will be created automatically. + + The key of the list that will hold the value. + + + + Adds a value to a list with the given key. If a list does not already exist, + it will be created automatically. + + The key of the list that will hold the value. + The value to add to the list under the given key. + + + + Removes all entries in the dictionary. + + + + + Determines whether the dictionary contains the specified value. + + The value to locate. + true if the dictionary contains the value in any list; otherwise, false. + + + + Determines whether the dictionary contains the given key. + + The key to locate. + true if the dictionary contains the given key; otherwise, false. + + + + Retrieves the all the elements from the list which have a key that matches the condition + defined by the specified predicate. + + The filter with the condition to use to filter lists by their key. + The elements that have a key that matches the condition defined by the specified predicate. + + + + Retrieves all the elements that match the condition defined by the specified predicate. + + The filter with the condition to use to filter values. + The elements that match the condition defined by the specified predicate. + + + + Removes a list by key. + + The key of the list to remove. + if the element was removed. + + + + Removes a value from the list with the given key. + + The key of the list where the value exists. + The value to remove. + + + + Removes a value from all lists where it may be found. + + The value to remove. + + + + See for more information. + + + + + See for more information. + + + + + See for more information. + + + + + See for more information. + + + + + See for more information. + + + + + See for more information. + + + + + See for more information. + + + + + See for more information. + + + + + Gets a shallow copy of all values in all lists. + + List of values. + + + + Gets the list of keys in the dictionary. + + Collection of keys. + + + + Gets or sets the list associated with the given key. The + access always succeeds, eventually returning an empty list. + + The key of the list to access. + The list associated with the key. + + + + Gets the number of lists in the dictionary. + + Value indicating the values count. + + + + See for more information. + + + + + See for more information. + + + + + Defines values for the categories used by . + + + + + Debug category. + + + + + Exception category. + + + + + Informational category. + + + + + Warning category. + + + + + Implementation of that does nothing. This + implementation is useful when the application does not need logging + but there are infrastructure pieces that assume there is a logger. + + + + + Defines a simple logger façade to be used by the Composite Application Library. + + + + + Write a new log entry with the specified category and priority. + + Message body to log. + Category of the entry. + The priority of the entry. + + + + This method does nothing. + + Message body to log. + Category of the entry. + The priority of the entry. + + + + Defines values for the priorities used by . + + + + + No priority specified. + + + + + High priority entry. + + + + + Medium priority entry. + + + + + Low priority entry. + + + + + Implementation of that logs into a . + + + + + Initializes a new instance of that writes to + the console output. + + + + + Initializes a new instance of . + + The writer to use for writing log entries. + + + + Write a new log entry with the specified category and priority. + + Message body to log. + Category of the entry. + The priority of the entry. + + + + Disposes the associated . + + When , disposes the associated . + + + + Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + + Calls . + 2 + + + + Implementation of that logs to .NET class. + + + + + Write a new log entry with the specified category and priority. + + Message body to log. + Category of the entry. + The priority of the entry. + + + + Handles AppDomain's AssemblyResolve event to be able to load assemblies dynamically in + the LoadFrom context, but be able to reference the type from assemblies loaded in the Load context. + + + + + Interface for classes that are responsible for resolving and loading assembly files. + + + + + Load an assembly when it's required by the application. + + + + + + Registers the specified assembly and resolves the types in it when the AppDomain requests for it. + + The path to the assemly to load in the LoadFrom context. + This method does not load the assembly immediately, but lazily until someone requests a + declared in the assembly. + + + + Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + + Calls . + 2 + + + + Disposes the associated . + + When , it is being called from the Dispose method. + + + + Defines a store for the module metadata. + + + + + Defines a store for the module metadata. + + + + + Gets the module configuration data. + + A instance. + + + + Gets the module configuration data. + + A instance. + + + + Loads modules from an arbitrary location on the filesystem. This typeloader is only called if + classes have a Ref parameter that starts with "file://". + This class is only used on the Desktop version of the Composite Application Library. + + + + + Defines the interface for moduleTypeLoaders + + + + + Evaluates the property to see if the current typeloader will be able to retrieve the . + + Module that should have it's type loaded. + if the current typeloader is able to retrieve the module, otherwise . + + + + Retrieves the . + + Module that should have it's type loaded. + + + + Raised repeatedly to provide progress as modules are downloaded in the background. + + + + + Raised when a module is loaded or fails to load. + + + This event is raised once per ModuleInfo instance requested in . + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The assembly resolver. + + + + Evaluates the property to see if the current typeloader will be able to retrieve the . + Returns true if the property starts with "file://", because this indicates that the file + is a local file. + + Module that should have it's type loaded. + + if the current typeloader is able to retrieve the module, otherwise . + + An is thrown if is null. + + + + Retrieves the . + + Module that should have it's type loaded. + + + + Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + + Calls . + 2 + + + + Disposes the associated . + + When , it is being called from the Dispose method. + + + + Raised repeatedly to provide progress as modules are loaded in the background. + + + + + Raised when a module is loaded or fails to load. + + + + + Base class for exceptions that are thrown because of a problem with modules. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The exception message. + + + + Initializes a new instance of the class. + + The exception message. + The inner exception. + + + + Initializes the exception with a particular module and error message. + + The name of the module. + The error message that explains the reason for the exception. + + + + Initializes the exception with a particular module, error message and inner exception that happened. + + The name of the module. + The error message that explains the reason for the exception. + The exception that is the cause of the current exception, + or a reference if no inner exception is specified. + + + + Initializes a new instance with serialized data. + + The that holds the serialized object data about the exception being thrown. + The that contains contextual information about the source or destination. + + + + Sets the with information about the exception. + + The that holds the serialized object data about the exception being thrown. + The that contains contextual information about the source or destination. + + + + Gets or sets the name of the module that this exception refers to. + + The name of the module. + + + + Provides completion information after a module is loaded, or fails to load. + + + + + Initializes a new instance of the class. + + The module info. + Any error that occurred during the call. + + + + Gets the module info. + + The module info. + + + + Gets any error that occurred + + The exception if an error occurred; otherwise null. + + + + Gets or sets a value indicating whether the error has been handled by the event subscriber. + + trueif the error is handled; otherwise, false. + + If there is an error on this event and no event subscriber sets this to true, an exception will be thrown by the event publisher. + + + + + Provides progress information as a module downloads. + + + + + Initializes a new instance of the class. + + The module info. + The bytes received. + The total bytes to receive. + + + + Getsthe module info. + + The module info. + + + + Gets the bytes received. + + The bytes received. + + + + Gets the total bytes to receive. + + The total bytes to receive. + + + + Defines the metadata that describes a module. + + + + + Marker interface that allows both s and s to be + added to the from code and XAML. + + + + + Initializes a new empty instance of . + + + + + Initializes a new instance of . + + The module's name. + The module 's AssemblyQualifiedName. + The modules this instance depends on. + An is thrown if is . + + + + Initializes a new instance of . + + The module's name. + The module's type. + + + + Gets or sets the name of the module. + + The name of the module. + + + + Gets or sets the module 's AssemblyQualifiedName. + + The type of the module. + + + + Gets or sets the list of modules that this module depends upon. + + The list of modules that this module depends upon. + + + + Specifies on which stage the Module will be initialized. + + + + + Reference to the location of the module assembly. + The following are examples of valid values: + http://myDomain/ClientBin/MyModules.xap for remote module in Silverlight + file://c:/MyProject/Modules/MyModule.dll for a loose DLL in WPF. + + + + + + Gets or sets the state of the with regards to the module loading and initialization process. + + + + + Exception thrown when a requested is not found. + + + Exception thrown when a requested was not found. + + + + + Initializes a new instance of the class + with the serialization data. + + Holds the serialized object data about the exception being thrown. + Contains contextual information about the source or destination. + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class with a specified error message. + + + The message that describes the error. + + + + + Initializes a new instance of the class with a specified error message. + + + The message that describes the error. + + The inner exception + + + + Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. + + The name of the module. + The error message that explains the reason for the exception. + + + + Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. + + The name of the module. + The error message that explains the reason for the exception. + The exception that is the cause of the current exception, or a null reference if no inner exception is specified. + + + + Represents the exception that is thrown when there is a circular dependency + between modules during the module loading process. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class + with the specified error message. + + The message that describes the error. + + + + Initializes a new instance of the class + with the specified error message and inner exception. + + The error message that explains the reason for the exception. + The exception that is the cause of the current exception. + + + + Initializes the exception with a particular module, error message and inner exception that happened. + + The name of the module. + The error message that explains the reason for the exception. + The exception that is the cause of the current exception, + or a reference if no inner exception is specified. + + + + Initializes a new instance of the class + with the serialization data. + + Holds the serialized object data about the exception being thrown. + Contains contextual information about the source or destination. + + + + Exception thrown when a module is declared twice in the same catalog. + + + + + Initializes a new instance of the class + with the serialization data. + + Holds the serialized object data about the exception being thrown. + Contains contextual information about the source or destination. + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The exception message. + + + + Initializes a new instance of the class. + + The exception message. + The inner exception. + + + + Initializes a new instance of the class with a specified error message. + + The name of the module. + The message that describes the error. + + + + Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. + + The name of the module. + The error message that explains the reason for the exception. + The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. + + + + Defines the contract for the modules deployed in the application. + + + + + Notifies the module that it has be initialized. + + + + + This is the expected catalog definition for the ModuleManager. + The ModuleCatalog holds information about the modules that can be used by the + application. Each module is described in a ModuleInfo class, that records the + name, type and location of the module. + + + + + Return the list of s that depends on. + + The to get the + An enumeration of that depends on. + + + + Returns the collection of s that contain both the s in + , but also all the modules they depend on. + + The modules to get the dependencies for. + + A collection of that contains both all s in + and also all the they depend on. + + + + + Initializes the catalog, which may load and validate the modules. + + + + + Adds a to the . + + The to add. + The for easily adding multiple modules. + + + + Gets all the classes that are in the . + + + + + Declares a service which initializes the modules into the application. + + + + + Initializes the specified module. + + The module to initialize + + + + Defines the interface for the service that will retrieve and initialize the application's modules. + + + + + Initializes the modules marked as on the . + + + + + Loads and initializes the module on the with the name . + + Name of the module requested for initialization. + + + + Raised repeatedly to provide progress as modules are downloaded. + + + + + Raised when a module is loaded or fails to load. + + + + + Defines extension methods for the class. + + + + + Adds a new module that is statically referenced to the specified module info group. + + The group where to add the module info in. + The name for the module. + The type for the module. This type should be a descendant of . + The names for the modules that this module depends on. + Returns the instance of the passed in module info group, to provide a fluid interface. + + + + Adds a new module that is statically referenced to the specified module info group. + + The group where to add the module info in. + The type for the module. This type should be a descendant of . + The names for the modules that this module depends on. + Returns the instance of the passed in module info group, to provide a fluid interface. + The name of the module will be the type name. + + + + Component responsible for coordinating the modules' type loading and module initialization process. + + + Component responsible for coordinating the modules' type loading and module initialization process. + + + + + Initializes an instance of the class. + + Service used for initialization of modules. + Catalog that enumerates the modules to be loaded and initialized. + Logger used during the load and initialization of modules. + + + + Initializes the modules marked as on the . + + + + + Loads and initializes the module on the with the name . + + Name of the module requested for initialization. + + + + Checks if the module needs to be retrieved before it's initialized. + + Module that is being checked if needs retrieval. + + + + + Loads the modules that are not intialized and have their dependencies loaded. + + + + + Handles any exception ocurred in the module typeloading process, + logs the error using the and throws a . + This method can be overriden to provide a different behavior. + + The module metadata where the error happenened. + The exception thrown that is the cause of the current error. + + + + + Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + + Calls . + 2 + + + + Disposes the associated s. + + When , it is being called from the Dispose method. + + + + The module catalog specified in the constructor. + + + + + Raised repeatedly to provide progress as modules are loaded in the background. + + + + + Raised when a module is loaded or fails to load. + + + + + Returns the list of registered instances that will be + used to load the types of modules. + + The module type loaders. + + + + Indicates that the class should be considered a named module using the + provided module name. + + + + + Gets or sets the name of the module. + + The name of the module. + + + + Gets or sets a value indicating whether the module should be loaded at startup. + + When (default value), it indicates that this module should be loaded at startup. + Otherwise you should explicitly load this module on demand. + A value. + + + + Gets or sets the value indicating whether the module should be loaded OnDemand. + + When (default value), it indicates the module should be loaded as soon as it's dependencies are satisfied. + Otherwise you should explicitily load this module via the . + + + + The holds information about the modules that can be used by the + application. Each module is described in a class, that records the + name, type and location of the module. + + It also verifies that the is internally valid. That means that + it does not have: + + Circular dependencies + Missing dependencies + + Invalid dependencies, such as a Module that's loaded at startup that depends on a module + that might need to be retrieved. + + + The also serves as a baseclass for more specialized Catalogs . + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class while providing an + initial list of s. + + The initial list of modules. + + + + Creates a from XAML. + + that contains the XAML declaration of the catalog. + An instance of built from the XAML. + + + + Creates a from a XAML included as an Application Resource. + + Relative that identifies the XAML included as an Application Resource. + An instance of build from the XAML. + + + + Loads the catalog if necessary. + + + + + Return the list of s that depends on. + + + If the was not yet validated, this method will call . + + The to get the + An enumeration of that depends on. + + + + Returns a list of s that contain both the s in + , but also all the modules they depend on. + + The modules to get the dependencies for. + + A list of that contains both all s in + but also all the they depend on. + + + + + Validates the . + + When validation of the fails. + + + + Adds a to the . + + The to add. + The for easily adding multiple modules. + + + + Adds a groupless to the catalog. + + of the module to be added. + Collection of module names () of the modules on which the module to be added logically depends on. + The same instance with the added module. + + + + Adds a groupless to the catalog. + + of the module to be added. + Stage on which the module to be added will be initialized. + Collection of module names () of the modules on which the module to be added logically depends on. + The same instance with the added module. + + + + Adds a groupless to the catalog. + + Name of the module to be added. + of the module to be added. + Collection of module names () of the modules on which the module to be added logically depends on. + The same instance with the added module. + + + + Adds a groupless to the catalog. + + Name of the module to be added. + of the module to be added. + Stage on which the module to be added will be initialized. + Collection of module names () of the modules on which the module to be added logically depends on. + The same instance with the added module. + + + + Adds a groupless to the catalog. + + Name of the module to be added. + of the module to be added. + Reference to the location of the module to be added assembly. + Stage on which the module to be added will be initialized. + Collection of module names () of the modules on which the module to be added logically depends on. + The same instance with the added module. + + + + Initializes the catalog, which may load and validate the modules. + + When validation of the fails, because this method calls . + + + + Creates and adds a to the catalog. + + Stage on which the module group to be added will be initialized. + Reference to the location of the module group to be added. + Collection of included in the group. + with the added module group. + + + + Checks for cyclic dependencies, by calling the dependencysolver. + + the. + + + + + Ensures that all the dependencies within refer to s + within that list. + + The modules to validate modules for. + + Throws if a in depends on a module that's + not in . + + Throws if is . + + + + Does the actual work of loading the catalog. The base implementation does nothing. + + + + + Sorts a list of s. This method is called by + to return a sorted list. + + The s to sort. + Sorted list of s + + + + Makes sure all modules have an Unique name. + + + Thrown if the names of one or more modules are not unique. + + + + + Ensures that there are no cyclic dependencies. + + + + + Ensures that there are no dependencies between modules on different groups. + + + A groupless module can only depend on other groupless modules. + A module within a group can depend on other modules within the same group and/or on groupless modules. + + + + + Ensures that there are no modules marked to be loaded + depending on modules loaded + + + + + Returns the on which the received module dependens on. + + Module whose dependant modules are requested. + Collection of dependants of . + + + + Ensures that the catalog is validated. + + + + + Gets the items in the . This property is mainly used to add s or + s through XAML. + + The items in the catalog. + + + + Gets all the classes that are in the , regardless + if they are within a or not. + + The modules. + + + + Gets the s that have been added to the . + + The groups. + + + + Gets or sets a value that remembers whether the has been validated already. + + + + + Returns the list of s that are not contained within any . + + The groupless modules. + + + + A configuration element to declare module metadata. + + + + + Initializes a new instance of . + + + + + Initializes a new instance of . + + The assembly file where the module is located. + The type of the module. + The name of the module. + This attribute specifies whether the module is loaded at startup. + + + + Gets or sets the assembly file. + + The assembly file. + + + + Gets or sets the module type. + + The module's type. + + + + Gets or sets the module name. + + The module's name. + + + + Gets or sets a value indicating whether the module should be loaded at startup. + + A value indicating whether the module should be loaded at startup. + + + + Gets or sets the modules this module depends on. + + The names of the modules that this depends on. + + + + A collection of . + + + + + Initializes a new instance of . + + + + + Initializes a new . + + The initial set of . + An is thrown if is . + + + + Adds a to the collection. + + A instance. + + + + Tests if the collection contains the configuration for the specified module name. + + The name of the module to search the configuration for. + if a configuration for the module is present; otherwise . + + + + Searches the collection for all the that match the specified predicate. + + A that implements the match test. + A with the successful matches. + An is thrown if is null. + + + + Creates a new . + + A . + + + + Gets the element key for a specified configuration element when overridden in a derived class. + + The to return the key for. + + An that acts as the key for the specified . + + + + + Gets a value indicating whether an exception should be raised if a duplicate element is found. + This property will always return true. + + A value. + + + + Gets the type of the . + + + The of this collection. + + + + + Gets the name used to identify this collection of elements in the configuration file when overridden in a derived class. + + + The name of the collection; otherwise, an empty string. + + + + + Gets the located at the specified index in the collection. + + The index of the element in the collection. + A . + + + + Specifies that the current module has a dependency on another module. This attribute should be used on classes that implement . + + + + + Initializes a new instance of . + + The name of the module that this module is dependant upon. + + + + Gets the name of the module that this module is dependant upon. + + The name of the module that this module is dependant upon. + + + + A collection of . + + + + + Initializes a new instance of . + + + + + Initializes a new instance of . + + An array of with initial list of dependencies. + + + + Creates a new . + + A . + + + + Gets the element key for a specified configuration element when overridden in a derived class. + + The to return the key for. + + An that acts as the key for the specified . + + + + + Gets the type of the . + + + The of this collection. + + + + + Gets the name used to identify this collection of elements in the configuration file when overridden in a derived class. + + + The name of the collection; otherwise, an empty string. + + + + + Gets the located at the specified index in the collection. + + The index of the element in the collection. + A . + + + + A for module dependencies. + + + + + Initializes a new instance of . + + + + + Initializes a new instance of . + + A module name. + + + + Gets or sets the name of a module antoher module depends on. + + The name of a module antoher module depends on. + + + + Used by to get the load sequence + for the modules to load according to their dependencies. + + + + + Adds a module to the solver. + + The name that uniquely identifies the module. + + + + Adds a module dependency between the modules specified by dependingModule and + dependentModule. + + The name of the module with the dependency. + The name of the module dependingModule + depends on. + + + + Calculates an ordered vector according to the defined dependencies. + Non-dependant modules appears at the beginning of the resulting array. + + The resulting ordered list of modules. + This exception is thrown + when a cycle is found in the defined depedency graph. + + + + Gets the number of modules added to the solver. + + The number of modules. + + + + Specifies on which stage the Module group will be initialized. + + + + + The module will be initialized when it is available on application start-up. + + + + + The module will be initialized when requested, and not automatically on application start-up. + + + + + Represents a group of instances that are usually deployed together. s + are also used by the to prevent common deployment problems such as having a module that's required + at startup that depends on modules that will only be downloaded on demand. + + The group also forwards and values to the s that it + contains. + + + + + Adds an moduleInfo to the . + + The to the . + + + + Forwards and properties from this + to . + + The module info to forward values to. + An is thrown if is . + + + + Removes all s from the . + + + + + Determines whether the contains a specific value. + + The object to locate in the . + + true if is found in the ; otherwise, false. + + + + + Copies the elements of the to an , starting at a particular index. + + The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. + The zero-based index in at which copying begins. + + is null. + + + is less than 0. + + + is multidimensional. + -or- + is equal to or greater than the length of . + -or- + The number of elements in the source is greater than the available space from to the end of the destination . + + + + + Removes the first occurrence of a specific object from the . + + The object to remove from the . + + true if was successfully removed from the ; otherwise, false. This method also returns false if is not found in the original . + + + + + Returns an enumerator that iterates through the collection. + + + A that can be used to iterate through the collection. + + + + + Returns an enumerator that iterates through a collection. + + + An object that can be used to iterate through the collection. + + + + + Adds an item to the . + + + The to add to the . + Must be of type + + + The position into which the new element was inserted. + + + + + Determines whether the contains a specific value. + + + The to locate in the . + Must be of type + + + true if the is found in the ; otherwise, false. + + + + + Determines the index of a specific item in the . + + + The to locate in the . + Must be of type + + + The index of if found in the list; otherwise, -1. + + + + + Inserts an item to the at the specified index. + + The zero-based index at which should be inserted. + + The to insert into the . + Must be of type + + + is not a valid index in the . + + + If is null. + + + If is not of type + + + + + Removes the first occurrence of a specific object from the . + + + The to remove from the . + Must be of type + + + + + Removes the item at the specified index. + + The zero-based index of the item to remove. + + is not a valid index in the . + + + The is read-only. + + + + + Copies the elements of the to an , starting at a particular index. + + The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. + The zero-based index in at which copying begins. + + is null. + + + is less than zero. + + + is multidimensional. + -or- + is equal to or greater than the length of . + -or- + The number of elements in the source is greater than the available space from to the end of the destination . + + + The type of the source cannot be cast automatically to the type of the destination . + + + + + Determines the index of a specific item in the . + + The object to locate in the . + + The index of if found in the list; otherwise, -1. + + + + + Inserts an item to the at the specified index. + + The zero-based index at which should be inserted. + The object to insert into the . + + is not a valid index in the . + + + + + Gets or sets the for the whole group. Any classes that are + added after setting this value will also get this . + + + The initialization mode. + + + + Gets or sets the value for the whole group. Any classes that are + added after setting this value will also get this . + + The ref value will also be used by the to determine which to use. + For example, if the ref property can be converted to an URL, it the XapModuleTypeLoader will be used + (Only available in the Silverlight version of CAL). + For example, using an "file://" prefix with a valid URL will cause the FileModuleTypeLoader to be used + (Only available in the desktop version of CAL). + + + The ref value that will be used. + + + + Gets the number of elements contained in the . + + + + The number of elements contained in the . + + + + + Gets a value indicating whether the is read-only. + + + false, because the is not Read-Only. + + + + + Gets a value indicating whether the has a fixed size. + + false, because the does not have a fixed length. + + + + + Gets or sets the at the specified index. + + + + + + Gets a value indicating whether access to the is synchronized (thread safe). + + + true if access to the is synchronized (thread safe); otherwise, false. + + + + + Gets an object that can be used to synchronize access to the . + + + + An object that can be used to synchronize access to the . + + + + + Gets or sets the at the specified index. + + The at the specified index + + + + Implements the interface. Handles loading of a module based on a type. + + + + + Initializes a new instance of . + + The container that will be used to resolve the modules by specifying its type. + The logger to use. + + + + Initializes the specified module. + + The module to initialize + + + + Handles any exception ocurred in the module Initialization process, + logs the error using the and throws a . + This method can be overriden to provide a different behavior. + + The module metadata where the error happenened. + The assembly name. + The exception thrown that is the cause of the current error. + + + + + Uses the container to resolve a new by specifying its . + + The module to create. + A new instance of the module specified by . + + + + Uses the container to resolve a new by specifying its . + + The type name to resolve. This type must implement . + A new instance of . + + + + Exception thrown by implementations whenever + a module fails to retrieve. + + + + + Initializes a new instance. + + + + + Initializes a new instance with a specified error message. + + The message that describes the error. + + + + Initializes a new instance with a specified error message + and a reference to the inner exception that is the cause of this exception. + + The error message that explains the reason for the exception. + The exception that is the cause of the current exception, + or a reference if no inner exception is specified. + + + + Initializes the exception with a particular module and error message. + + The name of the module. + The error message that explains the reason for the exception. + + + + Initializes the exception with a particular module, error message and inner exception that happened. + + The name of the module. + The error message that explains the reason for the exception. + The exception that is the cause of the current exception, + or a reference if no inner exception is specified. + + + + Initializes a new instance with serialized data. + + The that holds the serialized object data about the exception being thrown. + The that contains contextual information about the source or destination. + + + + A for module configuration. + + + + + Gets or sets the collection of modules configuration. + + A of . + + + + Defines the states a can be in, with regards to the module loading and initialization process. + + + + + Initial state for s. The is defined, + but it has not been loaded, retrieved or initialized yet. + + + + + The assembly that contains the type of the module is currently being loaded by an instance of a + . + + + + + The assembly that holds the Module is present. This means the type of the can be instantiated and initialized. + + + + + The module is currently Initializing, by the + + + + + The module is initialized and ready to be used. + + + + + Class that wraps an object, so that other classes can notify for Change events. Typically, this class is set as + a Dependency Property on DependencyObjects, and allows other classes to observe any changes in the Value. + + + This class is required, because in Silverlight, it's not possible to receive Change notifications for Dependency properties that you do not own. + + The type of the property that's wrapped in the Observable object + + + + Identifies the Value property of the ObservableObject + + + + + Event that gets invoked when the Value property changes. + + + + + The value that's wrapped inside the ObservableObject. + + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to The object must be of type '{0}' in order to use the current region adapter.. + + + + + Looks up a localized string similar to Cannot change the region name once is set. The current region name is '{0}'.. + + + + + Looks up a localized string similar to Cannot create navigation target '{0}'.. + + + + + Looks up a localized string similar to Cannot register a CompositeCommand in itself.. + + + + + Looks up a localized string similar to Cannot register the same command twice in the same CompositeCommand.. + + + + + Looks up a localized string similar to Type '{0}' does not implement from IRegionBehavior.. + + + + + Looks up a localized string similar to The ConfigurationStore cannot contain a null value. . + + + + + Looks up a localized string similar to ContentControl's Content property is not empty. + This control is being associated with a region, but the control is already bound to something else. + If you did not explicitly set the control's Content property, + this exception may be caused by a change in the value of the inherited RegionManager attached property.. + + + + + Looks up a localized string similar to At least one cyclic dependency has been found in the module catalog. Cycles in the module dependencies must be avoided.. + + + + + Looks up a localized string similar to Deactivation is not possible in this type of region.. + + + + + Looks up a localized string similar to {1}: {2}. Priority: {3}. Timestamp:{0:u}.. + + + + + Looks up a localized string similar to Neither the executeMethod nor the canExecuteMethod delegates can be null.. + + + + + Looks up a localized string similar to T for DelegateCommand<T> is not an object nor Nullable.. + + + + + Looks up a localized string similar to Cannot add dependency for unknown module {0}. + + + + + Looks up a localized string similar to A module declared a dependency on another module which is not declared to be loaded. Missing module(s): {0}. + + + + + Looks up a localized string similar to Directory {0} was not found.. + + + + + Looks up a localized string similar to A duplicated module with name {0} has been found by the loader.. + + + + + Looks up a localized string similar to A duplicated module group with name {0} has been found by the loader.. + + + + + Looks up a localized string similar to Unable to retrieve the module type {0} from the loaded assemblies. You may need to specify a more fully-qualified type name.. + + + + + Looks up a localized string similar to An exception occurred while initializing module '{0}'. + - The exception message was: {2} + - The Assembly that the module was trying to be loaded from was:{1} + Check the InnerException property of the exception for more information. If the exception occurred while creating an object in a DI container, you can exception.GetRootException() to help locate the root cause of the problem. + . + + + + + Looks up a localized string similar to An exception occurred while initializing module '{0}'. + - The exception message was: {1} + Check the InnerException property of the exception for more information. If the exception occurred + while creating an object in a DI container, you can exception.GetRootException() to help locate the + root cause of the problem. . + + + + + Looks up a localized string similar to Failed to load type for module {0}. + + If this error occurred when using MEF in a Silverlight application, please ensure that the CopyLocal property of the reference to the MefExtensions assembly is set to true in the main application/shell and false in all other assemblies. + + Error was: {1}.. + + + + + Looks up a localized string similar to HostControl cannot have null value when behavior attaches. . + + + + + Looks up a localized string similar to The HostControl property cannot be set after Attach method has been called.. + + + + + Looks up a localized string similar to HostControl type must be a TabControl.. + + + + + Looks up a localized string similar to The IModuleEnumerator interface is no longer used and has been replaced by ModuleCatalog.. + + + + + Looks up a localized string similar to The argument must be a valid absolute Uri to an assembly file.. + + + + + Looks up a localized string similar to The Target of the IDelegateReference should be of type {0}.. + + + + + Looks up a localized string similar to ItemsControl's ItemsSource property is not empty. + This control is being associated with a region, but the control is already bound to something else. + If you did not explicitly set the control's ItemSource property, + this exception may be caused by a change in the value of the inherited RegionManager attached property.. + + + + + Looks up a localized string similar to Mapping with the given type is already registered: {0}.. + + + + + Looks up a localized string similar to Module {0} depends on other modules that don't belong to the same group.. + + + + + Looks up a localized string similar to Module {0} was not found in the catalog.. + + + + + Looks up a localized string similar to The ModulePath cannot contain a null value or be empty. + + + + + Looks up a localized string similar to Failed to load type '{0}' from assembly '{1}'.. + + + + + Looks up a localized string similar to Navigation is already in progress on region with name '{0}'.. + + + + + Looks up a localized string similar to Navigation cannot proceed until a region is set for the RegionNavigationService.. + + + + + Looks up a localized string similar to The IRegionAdapter for the type {0} is not registered in the region adapter mappings. You can register an IRegionAdapter for this control by overriding the ConfigureRegionAdapterMappings method in the bootstrapper.. + + + + + Looks up a localized string similar to There is currently no moduleTypeLoader in the ModuleManager that can retrieve the specified module.. + + + + + Looks up a localized string similar to An exception has occurred while trying to add a view to region '{0}'. + - The most likely causing exception was was: '{1}'. + But also check the InnerExceptions for more detail or call .GetRootException(). . + + + + + Looks up a localized string similar to The member access expression does not access a property.. + + + + + Looks up a localized string similar to The expression is not a member access expression.. + + + + + Looks up a localized string similar to The referenced property is a static property.. + + + + + Looks up a localized string similar to The Attach method cannot be called when Region property is null.. + + + + + Looks up a localized string similar to The Region property cannot be set after Attach method has been called.. + + + + + Looks up a localized string similar to An exception occurred while creating a region with name '{0}'. The exception was: {1}. . + + + + + Looks up a localized string similar to The region being added already has a name of '{0}' and cannot be added to the region manager with a different name ('{1}').. + + + + + Looks up a localized string similar to The region name cannot be null or empty.. + + + + + Looks up a localized string similar to Region with the given name is already registered: {0}. + + + + + Looks up a localized string similar to This RegionManager does not contain a Region with the name '{0}'.. + + + + + Looks up a localized string similar to The region manager does not contain the {0} region.. + + + + + Looks up a localized string similar to View already exists in region.. + + + + + Looks up a localized string similar to View with name '{0}' already exists in the region.. + + + + + Looks up a localized string similar to Module {0} is marked for automatic initialization when the application starts, but it depends on modules that are marked as OnDemand initialization. To fix this error, mark the dependency modules for InitializationMode=WhenAvailable, or remove this validation by extending the ModuleCatalog class.. + + + + + Looks up a localized string similar to The provided String argument {0} must not be null or empty.. + + + + + Looks up a localized string similar to The provided String argument {0} must not be null or empty.. + + + + + Looks up a localized string similar to No BehaviorType with key '{0}' was registered.. + + + + + Looks up a localized string similar to An exception occurred while trying to create region objects. + - The most likely causing exception was: '{0}'. + But also check the InnerExceptions for more detail or call .GetRootException(). . + + + + + Looks up a localized string similar to The value must be of type ModuleInfo.. + + + + + Looks up a localized string similar to {0} not found.. + + + + + Looks up a localized string similar to The region does not contain the specified view.. + + + + + Region that keeps all the views in it as active. Deactivation of views is not allowed. + + + + + Implementation of that allows multiple active views. + + + + + Defines a model that can be used to compose views. + + + + + Provides methods to perform navigation. + + + Convenience overloads for the methods in this interface can be found as extension methods on the + class. + + + + + Initiates navigation to the target specified by the . + + The navigation target + The callback executed when the navigation request is completed. + + Convenience overloads for this method can be found as extension methods on the + class. + + + + Adds a new view to the region. + + Adds a new view to the region. + + The view to add. + The that is set on the view if it is a . It will be the current region manager when using this overload. + + + + Adds a new view to the region. + + The view to add. + The name of the view. This can be used to retrieve it later by calling . + The that is set on the view if it is a . It will be the current region manager when using this overload. + + + + Adds a new view to the region. + + The view to add. + The name of the view. This can be used to retrieve it later by calling . + When , the added view will receive a new instance of , otherwise it will use the current region manager for this region. + The that is set on the view if it is a . + + + + Removes the specified view from the region. + + The view to remove. + + + + Marks the specified view as active. + + The view to activate. + + + + Marks the specified view as inactive. + + The view to deactivate. + + + + Returns the view instance that was added to the region using a specific name. + + The name used when adding the view to the region. + Returns the named view or if the view with does not exist in the current region. + + + + Gets a readonly view of the collection of views in the region. + + An of all the added views. + + + + Gets a readonly view of the collection of all the active views in the region. + + An of all the active views. + + + + Gets or sets a context for the region. This value can be used by the user to share context with the views. + + The context value to be shared. + + + + Gets the name of the region that uniequely identifies the region within a . + + The name of the region. + + + + Gets or sets the comparison used to sort the views. + + The comparison to use. + + + + Gets or sets the that will be passed to the views when adding them to the region, unless the view is added by specifying createRegionManagerScope as . + + The where this is registered. + This is usually used by implementations of and should not be + used by the developer explicitely. + + + + Gets the collection of s that can extend the behavior of regions. + + + + + Gets or sets the navigation service. + + The navigation service. + + + + Initializes a new instance of . + + + + Adds a new view to the region. + + Adds a new view to the region. + + The view to add. + The that is set on the view if it is a . It will be the current region manager when using this overload. + + + + Adds a new view to the region. + + The view to add. + The name of the view. This can be used to retrieve it later by calling . + The that is set on the view if it is a . It will be the current region manager when using this overload. + + + + Adds a new view to the region. + + The view to add. + The name of the view. This can be used to retrieve it later by calling . + When , the added view will receive a new instance of , otherwise it will use the current region manager for this region. + The that is set on the view if it is a . + + + + Removes the specified view from the region. + + The view to remove. + + + + Marks the specified view as active. + + The view to activate. + + + + Marks the specified view as inactive. + + The view to deactivate. + + + + Returns the view instance that was added to the region using a specific name. + + The name used when adding the view to the region. + Returns the named view or if the view with does not exist in the current region. + + + + Initiates navigation to the specified target. + + The target. + A callback to execute when the navigation request is completed. + + + + The default sort algorithm. + + The first view to compare. + The second view to compare. + + + + + Occurs when a property value changes. + + + + + Gets the collection of s that can extend the behavior of regions. + + + + + Gets or sets a context for the region. This value can be used by the user to share context with the views. + + The context value to be shared. + + + + Gets the name of the region that uniequely identifies the region within a . + + The name of the region. + + + + Gets a readonly view of the collection of views in the region. + + An of all the added views. + + + + Gets a readonly view of the collection of all the active views in the region. + + An of all the active views. + + + + Gets or sets the comparison used to sort the views. + + The comparison to use. + + + + Gets or sets the that will be passed to the views when adding them to the region, unless the view is added by specifying createRegionManagerScope as . + + The where this is registered. + This is usually used by implementations of and should not be + used by the developer explicitely. + + + + Gets the navigation service. + + The navigation service. + + + + Gets the collection with all the views along with their metadata. + + An of with all the added views. + + + + Deactive is not valid in this Region. This method will always throw . + + The view to deactivate. + Every time this method is called. + + + + Gets a readonly view of the collection of all the active views in the region. These are all the added views. + + An of all the active views. + + + + Populates the target region with the views registered to it in the . + + + + + Provides a base class for region's behaviors. + + + + + Interface for allowing extensible behavior on regions. + + + + + Attaches the behavior to the specified region. + + + + + The region that this behavior is extending. + + + + + Attaches the behavior to the region. + + + + + Override this method to perform the logic after the behavior has been attached. + + + + + Behavior's attached region. + + + + + Returns if the behavior is attached to a region, otherwise. + + + + + The key of this behavior. + + + + + Creates a new instance of the AutoPopulateRegionBehavior + associated with the received. + + that the behavior will monitor for views to populate the region. + + + + Attaches the AutoPopulateRegionBehavior to the Region. + + + + + Returns a collection of views that will be added to the + View collection. + + + + + + Adds a view into the views collection of this region. + + + + + + Handler of the event that fires when a new viewtype is registered to the registry. + + Although this is a public method to support Weak Delegates in Silverlight, it should not be called by the user. + + + + + + Defines a behavior that forwards the + to the views in the region. + + + + + The key of this behavior. + + + + + Attaches the behavior to the specified region. + + + + + Behavior's attached region. + + + + + Behavior that removes the RegionManager attached property of all the views in a region once the RegionManager property of a region becomes null. + This is useful when removing views with nested regions, to ensure these nested regions get removed from the RegionManager as well. + + This behavior does not apply by default. + In order to activate it, the ClearChildViews attached property must be set to True in the view containing the affected child regions. + + + + + + The behavior key. + + + + + This attached property can be defined on a view to indicate that regions defined in it must be removed from the region manager when the parent view gets removed from a region. + + + + + Gets the ClearChildViews attached property from a DependencyObject. + + The object from which to get the value. + The value of the ClearChildViews attached property in the target specified. + + + + Sets the ClearChildViews attached property in a DependencyObject. + + The object in which to set the value. + The value of to set in the target object's ClearChildViews attached property. + + + + Subscribes to the 's PropertyChanged method to monitor its RegionManager property. + + + + + Behavior that creates a new , when the control that will host the (see ) + is added to the VisualTree. This behavior will use the class to find the right type of adapter to create + the region. After the region is created, this behavior will detach. + + + Attached property value inheritance is not available in Silverlight, so the current approach walks up the visual tree when requesting a region from a region manager. + The is now responsible for walking up the Tree. + + + + + Initializes a new instance of the class. + + + The region adapter mappings, that are used to find the correct adapter for + a given controltype. The controltype is determined by the value. + + + + + Start monitoring the and the to detect when the becomes + part of the Visual Tree. When that happens, the Region will be created and the behavior will . + + + + + Stop monitoring the and the , so that this behavior can be garbage collected. + + + + + Called when the is updating it's collection. + + + This method has to be public, because it has to be callable using weak references in silverlight and other partial trust environments. + + The . + The instance containing the event data. + + + + Method that will create the region, by calling the right . + + The target element that will host the . + Name of the region. + The created + + + + Sets a class that interfaces between the 's static properties/events and this behavior, + so this behavior can be tested in isolation. + + The region manager accessor. + + + + The element that will host the Region. + + The target element. + + + + Defines a that not allows extensible behaviors on regions which also interact + with the target element that the is attached to. + + + + + Gets or sets the that the is attached to. + + A that the is attached to. + This is usually a that is part of the tree. + + + + Behavior that monitors a object and + changes the value for the property when + an object that implements gets added or removed + from the collection. + + + This class can also sync the active state for any scoped regions directly on the view based on the . + If you use the method with the createRegionManagerScope option, the scoped manager will be attached to the view. + + + + + Name that identifies the behavior in a collection of . + + + + + Attaches the behavior to the specified region + + + + + Detaches the behavior from the . + + + + + The region that this behavior is extending + + + + + Represents errors that occured during region creation. + + + + + + + + Initializes a new instance of the + + + + + Initializes a new instance of the class with a specified error message. + + The message that describes the error. + + + + Initializes a new instance of the class with a specified error message and a reference + to the inner exception that is the cause of this exception. + + The error message that explains the reason for the exception. + The exception that is the cause of the current exception, or a null reference + (Nothing in Visual Basic) if no inner exception is specified. + + + + Initializes a new instance of the class with serialized data. + + The that holds the serialized object data about the exception being thrown. + The that contains contextual information about the source or destination. + + + + The RegionMemberLifetimeBehavior determines if items should be removed from the + when they are deactivated. + + + The monitors the + collection to discover items that transition into a deactivated state. +

+ The behavior checks the removed items for either the + or the (in that order) to determine if it should be kept + alive on removal. +

+ If the item in the collection is a , it will + also check it's DataContext for or the . +

+ The order of checks are: + + Region Item's IRegionMemberLifetime.KeepAlive value. + Region Item's DataContext's IRegionMemberLifetime.KeepAlive value. + Region Item's RegionMemberLifetimeAttribute.KeepAlive value. + Region Item's DataContext's RegionMemberLifetimeAttribute.KeepAlive value. + + + + +

+ The key for this behavior. + +
+ + + Override this method to perform the logic after the behavior has been attached. + + + + + Subscribes to a static event from the in order to register the target + in a when one is available on the host control by walking up the tree and finding + a control whose property is not . + + + + + The key of this behavior. + + + + + Initializes a new instance of . + + + + + When the has a name assigned, the behavior will start monitoring the ancestor controls in the element tree + to look for an where to register the region in. + + + + + This event handler gets called when a RegionManager is requering the instances of a region to be registered if they are not already. + Although this is a public method to support Weak Delegates in Silverlight, it should not be called by the user. + + The sender. + The arguments. + + + + Provides an abstraction on top of the RegionManager static members. + + + + + Gets or sets the that the is attached to. + + A that the is attached to. + This is usually a that is part of the tree. + When this member is set after the method has being called. + + + + Defines the attached behavior that keeps the items of the host control in synchronization with the . + + This behavior also makes sure that, if you activate a view in a region, the SelectedItem is set. If you set the SelectedItem or SelectedItems (ListBox) + then this behavior will also call Activate on the selected items. + + When calling Activate on a view, you can only select a single active view at a time. By setting the SelectedItems property of a listbox, you can set + multiple views to active. + + + + + + Name that identifies the SelectorItemsSourceSyncBehavior behavior in a collection of RegionsBehaviors. + + + + + Starts to monitor the to keep it in synch with the items of the . + + + + + Gets or sets the that the is attached to. + + + A that the is attached to. + + For this behavior, the host control must always be a or an inherited class. + + + + Behavior that synchronizes the property of a with + the control that hosts the Region. It does this by setting the + Dependency Property on the host control. + + This behavior allows the usage of two way databinding of the RegionContext from XAML. + + + + + Name that identifies the SyncRegionContextWithHostBehavior behavior in a collection of RegionsBehaviors. + + + + + Override this method to perform the logic after the behavior has been attached. + + + + + Gets or sets the that the is attached to. + + + A that the is attached to. + This is usually a that is part of the tree. + + + + + Adapter that creates a new and monitors its + active view to set it on the adapted . + + + + + Base class to facilitate the creation of implementations. + + Type of object to adapt. + + + + Defines an interfaces to adapt an object and bind it to a new . + + + + + Adapts an object and binds it to a new . + + The object to adapt. + The name of the region to be created. + The new instance of that the is bound to. + + + + Initializes a new instance of . + + The factory used to create the region behaviors to attach to the created regions. + + + + Adapts an object and binds it to a new . + + The object to adapt. + The name of the region to be created. + The new instance of that the is bound to. + + + + Adapts an object and binds it to a new . + + The object to adapt. + The name of the region to be created. + The new instance of that the is bound to. + This methods performs validation to check that + is of type . + When is . + When is not of type . + + + + This method adds the default behaviors by using the object. + + The region being used. + The object to adapt. + + + + Template method to attach new behaviors. + + The region being used. + The object to adapt. + + + + Template method to adapt the object to an . + + The new region being used. + The object to adapt. + + + + Template method to create a new instance of + that will be used to adapt the object. + + A new instance of . + + + + Gets or sets the factory used to create the region behaviors to attach to the created regions. + + + + + Initializes a new instance of . + + The factory used to create the region behaviors to attach to the created regions. + + + + Adapts a to an . + + The new region being used. + The object to adapt. + + + + Creates a new instance of . + + A new instance of . + + + + Provides an abstraction on top of the RegionManager static members. + + + + + Gets the value for the RegionName attached property. + + The object to adapt. This is typically a container (i.e a control). + The name of the region that should be created when + the RegionManager is also set in this element. + + + + Gets the value of the RegionName attached property. + + The target element. + The attached to the element. + + + + Notification used by attached behaviors to update the region managers appropriatelly if needed to. + + This event uses weak references to the event handler to prevent this static event of keeping the + target element longer than expected. For security reasons, to use weak delegates in Silverlight you must provide + a delegate that is available in the public API of the class (no private or anonymous delegates allowed). + + + + Gets the value for the RegionName attached property. + + The object to adapt. This is typically a container (i.e a control). + The name of the region that should be created when + the RegionManager is also set in this element. + + + + Gets the value of the RegionName attached property. + + The target element. + The attached to the element. + + + + Notification used by attached behaviors to update the region managers appropriatelly if needed to. + + This event uses weak references to the event handler to prevent this static event of keeping the + target element longer than expected. For security reasons, to use weak delegates in Silverlight you must provide + a delegate that is available in the public API of the class (no private or anonymous delegates allowed). + + + + Provides a way for objects involved in navigation to be notified of navigation activities. + + + + + Called when the implementer has been navigated to. + + The navigation context. + + + + Called to determine if this instance can handle the navigation request. + + The navigation context. + + if this instance accepts the navigation request; otherwise, . + + + + + Called when the implementer is being navigated away from. + + The navigation context. + + + + When implemented, allows an instance placed in a + that uses a to indicate + it should be removed when it transitions from an activated to deactived state. + + + + + Gets a value indicating whether this instance should be kept-alive upon deactivation. + + + + + Identifies the view in a region that is the target of a navigation request. + + + + + Gets the content to which the navigation request represented by applies. + + + If none of the items in the region match the target of the navigation request, a new item + will be created and added to the region. + + The region. + The context representing the navigation request. + The item to be the target of the navigation request. + when a new item cannot be created for the navigation request. + + + + Interface for RegionBehaviorFactories. This factory allows the registration of the default set of RegionBehaviors, that will + be added to the s of all s, unless overridden on a 'per-region' basis. + + + + + Adds a particular type of RegionBehavior if it was not already registered. the string is used to check if the behavior is already present + + The behavior key that's used to find if a certain behavior is already added. + Type of the behavior to add. . + + + + Determines whether a behavior with the specified key already exists + + The behavior key. + + if a behavior with the specified key is present; otherwise, . + + + + + Creates an instance of the Behaviortype that's registered using the specified key. + + The key that's used to register a behavior type. + The created behavior. + + + + Provides journaling of current, back, and forward navigation within regions. + + + + + Navigates to the most recent entry in the back navigation history, or does nothing if no entry exists in back navigation. + + + + + Navigates to the most recent entry in the forward navigation history, or does nothing if no entry exists in forward navigation. + + + + + Records the navigation to the entry.. + + The entry to record. + + + + Clears the journal of current, back, and forward navigation histories. + + + + + Gets a value that indicates whether there is at least one entry in the back navigation history. + + + true if the journal can go back; otherwise, false. + + + + + Gets a value that indicates whether there is at least one entry in the forward navigation history. + + + true if this instance can go forward; otherwise, false. + + + + + Gets the current navigation entry of the content that is currently displayed. + + The current entry. + + + + Gets or sets the target that implements INavigateAsync. + + The INavigate implementation. + + This is set by the owner of this journal. + + + + + An entry in an IRegionNavigationJournal representing the URI navigated to. + + + + + Gets or sets the URI. + + The URI. + + + + Provides navigation for regions. + + + + + Gets or sets the region owning this service. + + A Region. + + + + Gets the journal. + + The journal. + + + + Raised when the region is about to be navigated to content. + + + + + Raised when the region is navigated to content. + + + + + Raised when a navigation request fails. + + + + + Defines a class that wraps an item and adds metadata for it. + + + + + The name of the wrapped item. + + + + + Value indicating whether the wrapped item is considered active. + + + + + Initializes a new instance of . + + The item to wrap. + + + + Explicitly invokes to notify listeners. + + + + + Gets the wrapped item. + + The wrapped item. + + + + Gets or sets a name for the wrapped item. + + The name of the wrapped item. + + + + Gets or sets a value indicating whether the wrapped item is considered active. + + if the item should be considered active; otherwise . + + + + Occurs when metadata on the item changes. + + + + + Adapter that creates a new and binds all + the views to the adapted . + + + + + Initializes a new instance of . + + The factory used to create the region behaviors to attach to the created regions. + + + + Adapts an to an . + + The new region being used. + The object to adapt. + + + + Creates a new instance of . + + A new instance of . + + + + Provides a way for objects involved in navigation to determine if a navigation request should continue. + + + + + Determines whether this instance accepts being navigated away from. + + The navigation context. + The callback to indicate when navigation can proceed. + + Implementors of this method do not need to invoke the callback before this method is completed, + but they must ensure the callback is eventually invoked. + + + + + Provides additional methods to the interface. + + + + + Initiates navigation to the target specified by the . + + The navigation object. + The navigation target + + + + Initiates navigation to the target specified by the . + + The navigation object. + The navigation target + The callback executed when the navigation request is completed. + + + + Initiates navigation to the target specified by the . + + The navigation object. + The navigation target + + + + When is applied to class provides data + the can use to determine if the instance should + be removed when it is deactivated. + + + + + Instantiates an instance of + + + + + Determines if the region member should be kept-alive + when deactivated. + + + + + Implementation of that relies on a + to create new views when necessary. + + + + + Initializes a new instance of the class with a service locator. + + The service locator. + + + + Gets the view to which the navigation request represented by applies. + + The region. + The context representing the navigation request. + + The view to be the target of the navigation request. + + + If none of the views in the region can be the target of the navigation request, a new view + is created and added to the region. + + when a new view cannot be created for the navigation request. + + + + Provides a new item for the region based on the supplied candidate target contract name. + + The target contract to build. + An instance of an item to put into the . + + + + Returns the candidate TargetContract based on the . + + The navigation contract. + The candidate contract to seek within the and to use, if not found, when resolving from the container. + + + + Returns the set of candidates that may satisfiy this navigation request. + + The region containing items that may satisfy the navigation request. + The candidate navigation target as determined by + An enumerable of candidate objects from the + + + + Encapsulates information about a navigation request. + + + + + Initializes a new instance of the class for a region name and a + . + + The navigation service. + The Uri. + + + + Gets the region navigation service. + + The navigation service. + + + + Gets the navigation URI. + + The navigation URI. + + + + Gets the extracted from the URI. + + The URI query. + + + + Represents the result of navigating to a URI. + + + + + Initializes a new instance of the class. + + The context. + The result. + + + + Initializes a new instance of the class. + + The context. + The error. + + + + Gets the result. + + The result. + + + + Gets an exception that occurred while navigating. + + The exception. + + + + Gets the navigation context. + + The navigation context. + + + + This class maps with . + + + + + Registers the mapping between a type and an adapter. + + The type of the control. + The adapter to use with the type. + When any of or are . + If a mapping for already exists. + + + + Returns the adapter associated with the type provided. + + The type to obtain the mapped. + The mapped to the . + This class will look for a registered type for and if there is not any, + it will look for a registered type for any of its ancestors in the class hierarchy. + If there is no registered type for or any of its ancestors, + an exception will be thrown. + When there is no registered type for or any of its ancestors. + + + + A collection of instances, that are stored and retrieved by Key. + + + + + Defines the interface for a collection of classes on a Region. + + + + + Adds a to the collection, using the specified key as an indexer. + + + The key that specifies the type of that's added. + + The to add. + + + + Checks if a with the specified key is already present. + + The key to use to find a particular . + + + + + Gets the with the specified key. + + The registered + + + + Initializes a new instance of the class and associates it with a region. + + The region to associate the behavior collection with. + + + + Adds a to the collection, using the specified key as an indexer. + + The key that specifies the type of that's added. + The to add. + + Thrown is the parameter is Null, + or if the parameter is Null. + + Thrown if a behavior with the specified Key parameter already exists. + + + + Checks if a with the specified key is already present. + + The key to use to find a particular . + + + + + Returns an enumerator that iterates through the collection. + + + A that can be used to iterate through the collection. + + + + + Returns an enumerator that iterates through a collection. + + + An object that can be used to iterate through the collection. + + + + + Gets the with the specified key. + + The RegionBehavior that's registered with the key. + + + + Defines a factory that allows the registration of the default set of , that will + be added to the of all s, unless overridden on a 'per-region' basis. + + + + + Initializes a new instance of . + + used to create the instance of the behavior from its . + + + + Adds a particular type of RegionBehavior if it was not already registered. The string is used to check if the behavior is already present + + The behavior key that's used to find if a certain behavior is already added. + Type of the behavior to add. + + + + Creates an instance of the behavior that is registered using the specified key. + + The key that is used to register a behavior type. + A new instance of the behavior. + + + + Returns an enumerator that iterates through the collection. + + + A that can be used to iterate through the collection. + + 1 + + + + Returns an enumerator that iterates through a collection. + + + An object that can be used to iterate through the collection. + + 2 + + + + Determines whether a behavior with the specified key already exists. + + The behavior key. + + if a behavior with the specified key is present; otherwise, . + + + + + Class that holds methods to Set and Get the RegionContext from a DependencyObject. + + RegionContext allows sharing of contextual information between the view that's hosting a + and any views that are inside the Region. + + + + + Returns an wrapper around the RegionContext value. The RegionContext + will be set on any views (dependency objects) that are inside the collection by + the Behavior. + The RegionContext will also be set to the control that hosts the Region, by the Behavior. + + If the wrapper does not already exist, an empty one will be created. This way, an observer can + notify when the value is set for the first time. + + Any view that hold the RegionContext value. + Wrapper around the Regioncontext value. + + + + This class is responsible for maintaining a collection of regions and attaching regions to controls. + + + This class supplies the attached properties that can be used for simple region creation from XAML. + + + + + Defines an interface to manage a set of regions and to attach regions to objects (typically controls). + + + + + Creates a new region manager. + + A new region manager that can be used as a different scope from the current region manager. + + + + Gets a collection of that identify each region by name. You can use this collection to add or remove regions to the current region manager. + + + + + Identifies the RegionName attached property. + + + When a control has both the and + attached properties set to + a value different than and there is a + mapping registered for the control, it + will create and adapt a new region for that control, and register it + in the with the specified region name. + + + + + Sets the attached property. + + The object to adapt. This is typically a container (i.e a control). + The name of the region to register. + + + + Gets the value for the attached property. + + The object to adapt. This is typically a container (i.e a control). + The name of the region that should be created when + is also set in this element. + + + + Returns an wrapper that can hold an . Using this wrapper + you can detect when an has been created by the . + + If the wrapper does not yet exist, a new wrapper will be created. When the region + gets created and assigned to the wrapper, you can use the event + to get notified of that change. + + The view that will host the region. + Wrapper that can hold an value and can notify when the value changes. + + + + Identifies the RegionManager attached property. + + + When a control has both the and + attached properties set to + a value different than and there is a + mapping registered for the control, it + will create and adapt a new region for that control, and register it + in the with the specified region name. + + + + + Gets the value of the attached property. + + The target element. + The attached to the element. + + + + Sets the attached property. + + The target element. + The value. + + + + Identifies the RegionContext attached property. + + + + + Gets the value of the attached property. + + The target element. + The region context to pass to the contained views. + + + + Sets the attached property. + + The target element. + The value. + + + + Notifies attached behaviors to update the region managers appropriatelly if needed to. + + + This method is normally called internally, and there is usually no need to call this from user code. + + + + + Initializes a new instance of . + + + + + Creates a new region manager. + + A new region manager that can be used as a different scope from the current region manager. + + + + Notification used by attached behaviors to update the region managers appropriatelly if needed to. + + This event uses weak references to the event handler to prevent this static event of keeping the + target element longer than expected. For security reasons, to use weak delegates in Silverlight you must provide + a delegate that is available in the public API of the class (no private or anonymous delegates allowed). + + + + Gets a collection of that identify each region by name. You can use this collection to add or remove regions to the current region manager. + + A with all the registered regions. + + + + Defines a collection of uniquely identified by their Name. + + + + + Adds a to the collection. + + Region to be added to the collection. + + + + Removes a from the collection. + + Name of the region to be removed. + if the region was removed from the collection, otherwise . + + + + Checks if the collection contains a with the name received as parameter. + + The name of the region to look for. + if the region is contained in the collection, otherwise . + + + + Gets the IRegion with the name received as index. + + Name of the region to be retrieved. + The identified with the requested name. + + + + EventArgs used with the Navigated event. + + + + + Initializes a new instance of the class. + + The navigation context. + + + + Gets the navigation context. + + The navigation context. + + + + Gets the navigation URI + + The URI. + + This is a convenience accessor around NavigationContext.Uri. + + + + + EventArgs used with the NavigationFailed event. + + + + + Initializes a new instance of the class. + + The navigation context. + + + + Initializes a new instance of the class. + + The navigation context. + The error. + + + + Gets the navigation context. + + The navigation context. + + + + Gets the error. + + The , or if the failure was not caused by an exception. + + + + Gets the navigation URI + + The URI. + + This is a convenience accessor around NavigationContext.Uri. + + + + + Provides journaling of current, back, and forward navigation within regions. + + + + + Navigates to the most recent entry in the back navigation history, or does nothing if no entry exists in back navigation. + + + + + Navigates to the most recent entry in the forward navigation history, or does nothing if no entry exists in forward navigation. + + + + + Records the navigation to the entry.. + + The entry to record. + + + + Clears the journal of current, back, and forward navigation histories. + + + + + Gets or sets the target that implements INavigate. + + The INavigate implementation. + + This is set by the owner of this journal. + + + + + Gets the current navigation entry of the content that is currently displayed. + + The current entry. + + + + Gets a value that indicates whether there is at least one entry in the back navigation history. + + true if the journal can go back; otherwise, false. + + + + Gets a value that indicates whether there is at least one entry in the forward navigation history. + + + true if this instance can go forward; otherwise, false. + + + + + An entry in an IRegionNavigationJournal representing the URI navigated to. + + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Gets or sets the URI. + + The URI. + + + + Defines a registry for the content of the regions used on View Discovery composition. + + + + + Defines the interface for the registry of region's content. + + + + + Returns the contents associated with a region name. + + Region name for which contents are requested. + Collection of contents associated with the . + + + + Registers a content type with a region name. + + Region name to which the will be registered. + Content type to be registered for the . + + + + Registers a delegate that can be used to retrieve the content associated with a region name. + + Region name to which the will be registered. + Delegate used to retrieve the content associated with the . + + + + Event triggered when a content is registered to a region name. + + + This event uses weak references to the event handler to prevent this service (typically a singleton) of keeping the + target element longer than expected. For security reasons, to use weak delegates in Silverlight you must provide + a delegate that is available in the public API of the class (no private or anonymous delegates allowed). + + + + + Creates a new instance of the class. + + used to create the instance of the views from its . + + + + Returns the contents registered for a region. + + Name of the region which content is being requested. + Collection of contents registered for the region. + + + + Registers a content type with a region name. + + Region name to which the will be registered. + Content type to be registered for the . + + + + Registers a delegate that can be used to retrieve the content associated with a region name. + + Region name to which the will be registered. + Delegate used to retrieve the content associated with the . + + + + Creates an instance of a registered view . + + Type of the registered view. + Instance of the registered view. + + + + Occurs whenever a new view is registered. + + + + + Adapter that creates a new and binds all + the views to the adapted . + It also keeps the and the selected items + of the in sync. + + + + + Initializes a new instance of . + + The factory used to create the region behaviors to attach to the created regions. + + + + Adapts an to an . + + The new region being used. + The object to adapt. + + + + Attach new behaviors. + + The region being used. + The object to adapt. + + This class attaches the base behaviors and also listens for changes in the + activity of the region or the control selection and keeps the in sync. + + + + + Creates a new instance of . + + A new instance of . + + + + Region that allows a maximum of one active view at a time. + + + + + Marks the specified view as active. + + The view to activate. + If there is an active view before calling this method, + that view will be deactivated automatically. + + + + Defines that a view is synchronized with its parent view's Active state. + + + + + Represents errors that occured during the regions' update. + + + Represents errors that occured during the regions' update. + + + + + Initializes a new instance of the + + + + + Initializes a new instance of the class with a specified error message. + + The message that describes the error. + + + + Initializes a new instance of the class with a specified error message and a reference + to the inner exception that is the cause of this exception. + + The error message that explains the reason for the exception. + The exception that is the cause of the current exception, or a null reference + (Nothing in Visual Basic) if no inner exception is specified. + + + + Initializes a new instance of the class with serialized data. + + The that holds the serialized object data about the exception being thrown. + The that contains contextual information about the source or destination. + + + + Argument class used by the event when a new content is registered. + + + + + Initializes the ViewRegisteredEventArgs class. + + The region name to which the content was registered. + The content which was registered. + + + + Gets the region name to which the content was registered. + + + + + Gets the content which was registered. + + + + + Defines a view of a collection. + + + + + Determines whether the collection contains a specific value. + + The object to locate in the collection. + if is found in the collection; otherwise, . + + + + Class that creates a fluent interface for the class, with respect to + adding views to regions (View Injection pattern), registering view types to regions (View Discovery pattern) + + + + + Add a view to the Views collection of a Region. Note that the region must already exist in this regionmanager. + + The regionmanager that this extension method effects. + The name of the region to add a view to + The view to add to the views collection + The RegionManager, to easily add several views. + + + + Associate a view with a region, by registering a type. When the region get's displayed + this type will be resolved using the ServiceLocator into a concrete instance. The instance + will be added to the Views collection of the region + + The regionmanager that this extension method effects. + The name of the region to associate the view with. + The type of the view to register with the + The regionmanager, for adding several views easily + + + + Associate a view with a region, using a delegate to resolve a concreate instance of the view. + When the region get's displayed, this delelgate will be called and the result will be added to the + views collection of the region. + + The regionmanager that this extension method effects. + The name of the region to associate the view with. + The delegate used to resolve a concreate instance of the view. + The regionmanager, for adding several views easily + + + + Adds a region to the regionmanager with the name received as argument. + + The regionmanager's collection of regions. + The name to be given to the region. + The region to be added to the regionmanager. + Thrown if or is . + Thrown if and 's name do not match and the is not . + + + + Navigates the specified region manager. + + The regionmanager that this extension method effects. + The name of the region to call Navigate on. + The URI of the content to display. + The navigation callback. + + + + Navigates the specified region manager. + + The regionmanager that this extension method effects. + The name of the region to call Navigate on. + The URI of the content to display. + + + + Navigates the specified region manager. + + The regionmanager that this extension method effects. + The name of the region to call Navigate on. + The URI of the content to display. + The navigation callback. + + + + Navigates the specified region manager. + + The regionmanager that this extension method effects. + The name of the region to call Navigate on. + The URI of the content to display. + + + + Exception that's thrown when something goes wrong while Registering a View with a region name in the class. + + + Exception that's thrown when something goes wrong while Registering a View with a region name in the class. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The exception message. + + + + Initializes a new instance of the class. + + The exception message. + The inner exception. + + + + Initializes a new instance of the class with serialized data. + + The that holds the serialized + object data about the exception being thrown. + The that contains contextual information about the source or destination. + + + + Implementation of that takes an of + and filters it to display an collection of + elements (the items which the wraps). + + + + + Initializes a new instance of the class. + + The list to wrap and filter. + A predicate to filter the collection. + + + + Determines whether the collection contains a specific value. + + The object to locate in the collection. + if is found in the collection; otherwise, . + + + + Returns an enumerator that iterates through the collection. + + + A that can be used to iterate through the collection. + + + + + Returns an enumerator that iterates through a collection. + + + An object that can be used to iterate through the collection. + + + + + Used to invoked the event. + + + + + + Removes all monitoring of underlying MetadataItems and re-adds them. + + + + + Adds all underlying MetadataItems to the list from the subjectCollection + + + + + Removes all monitored items from our monitoring list. + + + + + Adds handler to monitor the MetadatItem and adds it to our monitoring list. + + + + + + + Unhooks from the MetadataItem change event and removes from our monitoring list. + + + + + + Invoked when any of the underlying ItemMetadata items we're monitoring changes. + + + + + + + The event handler due to changes in the underlying collection. + + + + + + + Occurs when the collection changes. + + + + + Gets or sets the comparison used to sort the views. + + The comparison to use. + + + + Provides a hint from a view to a region on how to sort the view. + + + + + Initializes a new instance of the class. + + The hint to use for sorting. + + + + Gets the hint. + + The hint to use for sorting. + + + + Defines extension methods for the class. + + + + + Attempts to resolve specified type from the underlying . + + + This will return null on any . + Locator to use in resolving. + Type to resolve. + T or null + Thrown when is . + + + + Attempts to resolve specified type from the underlying . + + + This will return null on any . + Type to resolve. + Locator to use in resolving. + T or null + + + + Manages validation errors for an object, notifying when the error state changes. + + The type of the error object. + + + + Initializes a new instance of the class. + + The action that invoked if when errors are added for an object./> + event. + + + + Gets the validation errors for a specified property. + + The name of the property. + The validation errors of type for the property. + + + + Clears the errors for the property indicated by the property expression. + + The property type. + The expression indicating a property. + + container.ClearErrors(()=>SomeProperty); + + + + + Clears the errors for a property. + + The name of th property for which to clear errors. + + container.ClearErrors("SomeProperty"); + + + + + Sets the validation errors for the specified property. + + The property type for which to set errors. + The indicating the property. + The list of errors to set for the property. + + + + Sets the validation errors for the specified property. + + + If a change is detected then the errors changed event is raised. + + The name of the property. + The new validation errors. + + + + Gets a value indicating whether the object has validation errors. + + + + + Helper class for parsing instances. + + + + + Gets the query part of . + + The Uri. + + + + Gets the AbsolutePath part of . + + The Uri. + + + + Parses the query of into a dictionary. + + The URI. + + + + Represents a query in a Uri. + + + This class can be used to parse a query string to access + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class with a query string. + + The query string. + + + + Gets the enumerator. + + + + + + Adds the specified key and value. + + The name. + The value. + + + + Returns a that represents this instance as a query string. + + + A that represents this instance. + + + + + Gets the with the specified key. + + The value for the specified key, or if the query does not contain such a key. + + + + Base class for items that support property notification. + + + This class provides basic support for implementing the interface and for + marshalling execution to the UI thread. + + + + + Raises this object's PropertyChanged event. + + The property that has a new value. + + + + Raises this object's PropertyChanged event for each of the properties. + + The properties that have a new value. + + + + Raises this object's PropertyChanged event. + + The type of the property that has a new value + A Lambda expression representing the property that has a new value. + + + + Raised when a property on this object has a new value. + + + + + Provides support for extracting property information based on a property expression. + + + + + Extracts the property name from a property expression. + + The object type containing the property specified in the expression. + The property expression (e.g. p => p.PropertyName) + The name of the property. + Thrown if the is null. + Thrown when the expression is:
+ Not a
+ The does not represent a property.
+ Or, the property is static. +
+
+ + + Class that provides extension methods to Collection + + + + + Add a range of items to a collection. + + Type of objects within the collection. + The collection to add items to. + The items to add to the collection. + The collection. + An is thrown if or is . + + + + Class that provides extension methods for the Exception class. These extension methods provide + a mechanism for developers to get more easily to the root cause of an exception, especially in combination with + DI-containers such as Unity. + + + + + Register the type of an Exception that is thrown by the framework. The method uses + this list of Exception types to find out if something has gone wrong. + + The type of exception to register. + + + + Determines whether the exception type is already registered using the + method + + The type of framework exception to find. + + true if the exception type is already registered; otherwise, false. + + + + + Looks at all the inner exceptions of the parameter to find the + most likely root cause of the exception. This works by skipping all registered exception types. + + + This method is not 100% accurate and should only be used to point a developer into the most likely direction. + It should not be used to replace the Inner Exception stack of an exception, because this might hide required exception + information. + + The exception that will provide the list of inner exeptions to examine. + + The exception that most likely caused the exception to occur. If it can't find the root exception, it will return the + value itself. + + + + + A catalog built from a configuration file. + + + + + Builds an instance of ConfigurationModuleCatalog with a as the default store. + + + + + Loads the catalog from the configuration. + + + + + Gets or sets the store where the configuration is kept. + + + + + Represets a catalog created from a directory on disk. + + + The directory catalog will scan the contents of a directory, locating classes that implement + and add them to the catalog based on contents in their associated . + Assemblies are loaded into a new application domain with ReflectionOnlyLoad. The application domain is destroyed + once the assemblies have been discovered. + + The diretory catalog does not continue to monitor the directory after it has created the initialze catalog. + + + + + Drives the main logic of building the child domain and searching for the assemblies. + + + + + Creates a new child domain and copies the evidence from a parent domain. + + The parent domain. + The new child domain. + + Grabs the evidence and uses it to construct the new + because in a ClickOnce execution environment, creating an + will by default pick up the partial trust environment of + the AppLaunch.exe, which was the root executable. The AppLaunch.exe does a + create domain and applies the evidence from the ClickOnce manifests to + create the domain that the application is actually executing in. This will + need to be Full Trust for Composite Application Library applications. + + An is thrown if is null. + + + + Directory containing modules to search for. + + + + + Exception thrown by implementations whenever + a module fails to load. + + + + + Initializes a new instance. + + + + + Initializes a new instance of the class. + + The exception message. + + + + Initializes a new instance of the class. + + The exception message. + The inner exception. + + + + Initializes the exception with a particular module and error message. + + The name of the module. + The assembly where the module is located. + The error message that explains the reason for the exception. + + + + Initializes the exception with a particular module, error message and inner exception + that happened. + + The name of the module. + The assembly where the module is located. + The error message that explains the reason for the exception. + The exception that is the cause of the current exception, + or a reference if no inner exception is specified. + + + + Initializes the exception with a particular module, error message and inner exception that happened. + + The name of the module. + The error message that explains the reason for the exception. + The exception that is the cause of the current exception, + or a reference if no inner exception is specified. + + + + Initializes a new instance with serialized data. + + The that holds the serialized object data about the exception being thrown. + The that contains contextual information about the source or destination. + + + + Exception that's thrown when there is no registered in + that can handle this particular type of module. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class with a specified error message. + + + The message that describes the error. + + + + + Initializes a new instance of the class with a specified error message. + + + The message that describes the error. + + The inner exception + + + + Initializes the exception with a particular module, error message and inner exception that happened. + + The name of the module. + The error message that explains the reason for the exception. + The exception that is the cause of the current exception, + or a reference if no inner exception is specified. + + + + Initializes a new instance with serialized data. + + The that holds the serialized object data about the exception being thrown. + The that contains contextual information about the source or destination. + + + + Provides navigation for regions. + + + + + Initializes a new instance of the class. + + The service locator. + The navigation target handler. + The journal. + + + + Initiates navigation to the specified target. + + The target. + A callback to execute when the navigation request is completed. + + + + Gets or sets the region. + + The region. + + + + Gets the journal. + + The journal. + + + + Raised when the region is about to be navigated to content. + + + + + Raised when the region is navigated to content. + + + + + Raised when a navigation request fails. + + +
+
diff --git a/Libs/Microsoft.Practices.Prism.dll b/Libs/Microsoft.Practices.Prism.dll new file mode 100644 index 0000000..4222fd8 Binary files /dev/null and b/Libs/Microsoft.Practices.Prism.dll differ diff --git a/Libs/Microsoft.Practices.Prism.pdb b/Libs/Microsoft.Practices.Prism.pdb new file mode 100644 index 0000000..4e96077 Binary files /dev/null and b/Libs/Microsoft.Practices.Prism.pdb differ diff --git a/Libs/Microsoft.Practices.ServiceLocation.XML b/Libs/Microsoft.Practices.ServiceLocation.XML new file mode 100644 index 0000000..6c6f2fe --- /dev/null +++ b/Libs/Microsoft.Practices.ServiceLocation.XML @@ -0,0 +1,280 @@ + + + + Microsoft.Practices.ServiceLocation + + + + + The standard exception thrown when a ServiceLocator has an error in resolving an object. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class with a specified error message. + + + The message that describes the error. + + + + + Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. + + + The error message that explains the reason for the exception. + + + The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. + + + + + Initializes a new instance of the class with serialized data. + + + The that holds the serialized object data about the exception being thrown. + + + The that contains contextual information about the source or destination. + + + The parameter is null. + + + The class name is null or is zero (0). + + + + + The generic Service Locator interface. This interface is used + to retrieve services (instances identified by type and optional + name) from a container. + + + + + Get an instance of the given . + + Type of object requested. + if there is an error resolving + the service instance. + The requested service instance. + + + + Get an instance of the given named . + + Type of object requested. + Name the object was registered with. + if there is an error resolving + the service instance. + The requested service instance. + + + + Get all instances of the given currently + registered in the container. + + Type of object requested. + if there is are errors resolving + the service instance. + A sequence of instances of the requested . + + + + Get an instance of the given . + + Type of object requested. + if there is are errors resolving + the service instance. + The requested service instance. + + + + Get an instance of the given named . + + Type of object requested. + Name the object was registered with. + if there is are errors resolving + the service instance. + The requested service instance. + + + + Get all instances of the given currently + registered in the container. + + Type of object requested. + if there is are errors resolving + the service instance. + A sequence of instances of the requested . + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to Activation error occured while trying to get all instances of type {0}. + + + + + Looks up a localized string similar to Activation error occured while trying to get instance of type {0}, key "{1}". + + + + + This class provides the ambient container for this application. If your + framework defines such an ambient container, use ServiceLocator.Current + to get it. + + + + + Set the delegate that is used to retrieve the current container. + + Delegate that, when called, will return + the current ambient container. + + + + The current ambient container. + + + + + This class is a helper that provides a default implementation + for most of the methods of . + + + + + Implementation of . + + The requested service. + if there is an error in resolving the service instance. + The requested object. + + + + Get an instance of the given . + + Type of object requested. + if there is an error resolving + the service instance. + The requested service instance. + + + + Get an instance of the given named . + + Type of object requested. + Name the object was registered with. + if there is an error resolving + the service instance. + The requested service instance. + + + + Get all instances of the given currently + registered in the container. + + Type of object requested. + if there is are errors resolving + the service instance. + A sequence of instances of the requested . + + + + Get an instance of the given . + + Type of object requested. + if there is are errors resolving + the service instance. + The requested service instance. + + + + Get an instance of the given named . + + Type of object requested. + Name the object was registered with. + if there is are errors resolving + the service instance. + The requested service instance. + + + + Get all instances of the given currently + registered in the container. + + Type of object requested. + if there is are errors resolving + the service instance. + A sequence of instances of the requested . + + + + When implemented by inheriting classes, this method will do the actual work of resolving + the requested service instance. + + Type of instance requested. + Name of registered service you want. May be null. + The requested service instance. + + + + When implemented by inheriting classes, this method will do the actual work of + resolving all the requested service instances. + + Type of service requested. + Sequence of service instance objects. + + + + Format the exception message for use in an + that occurs while resolving a single service. + + The actual exception thrown by the implementation. + Type of service requested. + Name requested. + The formatted exception message string. + + + + Format the exception message for use in an + that occurs while resolving multiple service instances. + + The actual exception thrown by the implementation. + Type of service requested. + The formatted exception message string. + + + + This delegate type is used to provide a method that will + return the current container. Used with the + static accessor class. + + An . + + + diff --git a/Libs/Microsoft.Practices.ServiceLocation.dll b/Libs/Microsoft.Practices.ServiceLocation.dll new file mode 100644 index 0000000..3f88954 Binary files /dev/null and b/Libs/Microsoft.Practices.ServiceLocation.dll differ diff --git a/Libs/Microsoft.Practices.Unity.dll b/Libs/Microsoft.Practices.Unity.dll new file mode 100644 index 0000000..0d1a895 Binary files /dev/null and b/Libs/Microsoft.Practices.Unity.dll differ diff --git a/Libs/Microsoft.Practices.Unity.xml b/Libs/Microsoft.Practices.Unity.xml new file mode 100644 index 0000000..3e46f33 --- /dev/null +++ b/Libs/Microsoft.Practices.Unity.xml @@ -0,0 +1,5910 @@ + + + + Microsoft.Practices.Unity + + + + + Base class for attributes that can be placed on parameters + or properties to specify how to resolve the value for + that parameter or property. + + + + + Create an instance of that + will be used to get the value for the member this attribute is + applied to. + + Type of parameter or property that + this attribute is decoration. + The resolver object. + + + + This attribute is used to indicate which constructor to choose when + the container attempts to build a type. + + + + + This attribute is used to mark methods that should be called when + the container is building an object. + + + + + This attribute is used to mark properties and parameters as targets for injection. + + + For properties, this attribute is necessary for injection to happen. For parameters, + it's not needed unless you want to specify additional information to control how + the parameter is resolved. + + + + + Create an instance of with no name. + + + + + Create an instance of with the given name. + + Name to use when resolving this dependency. + + + + Create an instance of that + will be used to get the value for the member this attribute is + applied to. + + Type of parameter or property that + this attribute is decoration. + The resolver object. + + + + The name specified in the constructor. + + + + + An used to mark a dependency + as optional - the container will try to resolve it, and return null + if the resolution fails rather than throw. + + + + + Construct a new object. + + + + + Construct a new object that + specifies a named dependency. + + Name of the dependency. + + + + Create an instance of that + will be used to get the value for the member this attribute is + applied to. + + Type of parameter or property that + this attribute is decoration. + The resolver object. + + + + Name of the dependency. + + + + + A that composites other + ResolverOverride objects. The GetResolver operation then + returns the resolver from the first child override that + matches the current context and request. + + + + + Base class for all override objects passed in the + method. + + + + + Return a that can be used to give a value + for the given desired dependency. + + Current build context. + Type of dependency desired. + a object if this override applies, null if not. + + + + Wrap this resolver in one that verifies the type of the object being built. + This allows you to narrow any override down to a specific type easily. + + Type to constrain the override to. + The new override. + + + + Wrap this resolver in one that verifies the type of the object being built. + This allows you to narrow any override down to a specific type easily. + + Type to constrain the override to. + The new override. + + + + Add a new to the collection + that is checked. + + item to add. + + + + Add a setof s to the collection. + + items to add. + + + + Returns an enumerator that iterates through a collection. + + + An object that can be used to iterate through the collection. + + 2 + + + + Returns an enumerator that iterates through the collection. + + + A that can be used to iterate through the collection. + + 1 + + + + Return a that can be used to give a value + for the given desired dependency. + + Current build context. + Type of dependency desired. + a object if this override applies, null if not. + + + + Class that returns information about the types registered in a container. + + + + + The type that was passed to the method + as the "from" type, or the only type if type mapping wasn't done. + + + + + The type that this registration is mapped to. If no type mapping was done, the + property and this one will have the same value. + + + + + Name the type was registered under. Null for default registration. + + + + + The registered lifetime manager instance. + + + + + The lifetime manager for this registration. + + + This property will be null if this registration is for an open generic. + + + + A class that overrides + the value injected whenever there is a dependency of the + given type, regardless of where it appears in the object graph. + + + + + Create an instance of to override + the given type with the given value. + + Type of the dependency. + Value to use. + + + + Return a that can be used to give a value + for the given desired dependency. + + Current build context. + Type of dependency desired. + a object if this override applies, null if not. + + + + A convenience version of that lets you + specify the dependency type using generic syntax. + + Type of the dependency to override. + + + + Construct a new object that will + override the given dependency, and pass the given value. + + + + + A convenience form of that lets you + specify multiple parameter overrides in one shot rather than having + to construct multiple objects. + + + This class isn't really a collection, it just implements IEnumerable + so that we get use of the nice C# collection initializer syntax. + + + + + Base helper class for creating collections of objects + for use in passing a bunch of them to the resolve call. This base class provides + the mechanics needed to allow you to use the C# collection initializer syntax. + + Concrete type of the this class collects. + Key used to create the underlying override object. + Value that the override returns. + + + + Add a new override to the collection with the given key and value. + + Key - for example, a parameter or property name. + Value - the value to be returned by the override. + + + + Return a that can be used to give a value + for the given desired dependency. + + Current build context. + Type of dependency desired. + a object if this override applies, null if not. + + + + Returns an enumerator that iterates through a collection. + + + An object that can be used to iterate through the collection. + + 2 + + + + Returns an enumerator that iterates through the collection. + + + A that can be used to iterate through the collection. + + 1 + + + + When implemented in derived classes, this method is called from the + method to create the actual objects. + + Key value to create the resolver. + Value to store in the resolver. + The created . + + + + When implemented in derived classes, this method is called from the + method to create the actual objects. + + Key value to create the resolver. + Value to store in the resolver. + The created . + + + + Event argument class for the event. + + + + + Construct a new object with the + given child container object. + + An for the newly created child + container. + + + + The newly created child container. + + + + + An extension context for the created child container. + + + + + Base class for subclasses that let you specify that + an instance of a generic type parameter should be resolved. + + + + + Base type for objects that are used to configure parameters for + constructor or method injection, or for getting the value to + be injected into a property. + + + + + Test to see if this parameter value has a matching type for the given type. + + Type to check. + True if this parameter value is compatible with type , + false if not. + + + + Return a instance that will + return this types value for the parameter. + + Type that contains the member that needs this parameter. Used + to resolve open generic parameters. + The . + + + + Convert the given set of arbitrary values to a sequence of InjectionParameterValue + objects. The rules are: If it's already an InjectionParameterValue, return it. If + it's a Type, return a ResolvedParameter object for that type. Otherwise return + an InjectionParameter object for that value. + + The values to build the sequence from. + The resulting converted sequence. + + + + Convert an arbitrary value to an InjectionParameterValue object. The rules are: + If it's already an InjectionParameterValue, return it. If it's a Type, return a + ResolvedParameter object for that type. Otherwise return an InjectionParameter + object for that value. + + The value to convert. + The resulting . + + + + Name for the type represented by this . + This may be an actual type name or a generic argument name. + + + + + Create a new instance that specifies + that the given named generic parameter should be resolved. + + The generic parameter name to resolve. + + + + Create a new instance that specifies + that the given named generic parameter should be resolved. + + The generic parameter name to resolve. + name to use when looking up in the container. + + + + Test to see if this parameter value has a matching type for the given type. + + Type to check. + True if this parameter value is compatible with type , + false if not. + + + + Return a instance that will + return this types value for the parameter. + + Type that contains the member that needs this parameter. Used + to resolve open generic parameters. + The . + + + + Return a instance that will + return this types value for the parameter. + + The actual type to resolve. + The resolution key. + The . + + + + Name for the type represented by this . + This may be an actual type name or a generic argument name. + + + + + A that lets you specify that + an instance of a generic type parameter should be resolved, providing the + value if resolving fails. + + + + + Create a new instance that specifies + that the given named generic parameter should be resolved. + + The generic parameter name to resolve. + + + + Create a new instance that specifies + that the given named generic parameter should be resolved. + + The generic parameter name to resolve. + name to use when looking up in the container. + + + + Return a instance that will + return this types value for the parameter. + + The actual type to resolve. + The resolution key. + The . + + + + A class that lets you specify a factory method the container + will use to create the object. + + This is a significantly easier way to do the same + thing the old static factory extension was used for. + + + + Base class for objects that can be used to configure what + class members get injected by the container. + + + + + Add policies to the to configure the + container to call this constructor with the appropriate parameter values. + + Type to register. + Policy list to add policies to. + + + + Add policies to the to configure the + container to call this constructor with the appropriate parameter values. + + Type of interface being registered. If no interface, + this will be null. + Type of concrete type being registered. + Name used to resolve the type object. + Policy list to add policies to. + + + + Create a new instance of with + the given factory function. + + Factory function. + + + + Create a new instance of with + the given factory function. + + Factory function. + + + + Add policies to the to configure the + container to call this constructor with the appropriate parameter values. + + Type of interface being registered. If no interface, + this will be null. This parameter is ignored in this implementation. + Type of concrete type being registered. + Name used to resolve the type object. + Policy list to add policies to. + + + + A that can be passed to + to configure a + parameter or property as an optional dependency. + + + + + A base class for implementing classes + that deal in explicit types. + + + + + Create a new that exposes + information about the given . + + Type of the parameter. + + + + Test to see if this parameter value has a matching type for the given type. + + Type to check. + True if this parameter value is compatible with type , + false if not. + + + + The type of parameter this object represents. + + + + + Name for the type represented by this . + This may be an actual type name or a generic argument name. + + + + + Construct a new object that + specifies the given . + + Type of the dependency. + + + + Construct a new object that + specifies the given and . + + Type of the dependency. + Name for the dependency. + + + + Return a instance that will + return this types value for the parameter. + + Type that contains the member that needs this parameter. Used + to resolve open generic parameters. + The . + + + + A generic version of that lets you + specify the type of the dependency using generics syntax. + + Type of the dependency. + + + + Construct a new . + + + + + Construct a new with the given + . + + Name of the dependency. + + + + A special lifetime manager which works like , + except that in the presence of child containers, each child gets it's own instance + of the object, instead of sharing one in the common parent. + + + + + A that holds onto the instance given to it. + When the is disposed, + the instance is disposed with it. + + + + + Base class for Lifetime managers which need to synchronize calls to + . + + + + The purpose of this class is to provide a basic implementation of the lifetime manager synchronization pattern. + + + Calls to the method of a + instance acquire a lock, and if the instance has not been initialized with a value yet the lock will only be released + when such an initialization takes place by calling the method or if + the build request which resulted in the call to the GetValue method fails. + + + + + + + Base class for Lifetime managers - classes that control how + and when instances are created by the Unity container. + + + + + A that controls how instances are + persisted and recovered from an external store. Used to implement + things like singletons and per-http-request lifetime. + + + + + Represents a builder policy interface. Since there are no fixed requirements + for policies, it acts as a marker interface from which to derive all other + policy interfaces. + + + + + Retrieve a value from the backing store associated with this Lifetime policy. + + the object desired, or null if no such object is currently stored. + + + + Stores the given value into backing store for retrieval later. + + The object to store. + + + + Remove the value this lifetime policy is managing from backing store. + + + + + Retrieve a value from the backing store associated with this Lifetime policy. + + the object desired, or null if no such object is currently stored. + + + + Stores the given value into backing store for retrieval later. + + The object being stored. + + + + Remove the given object from backing store. + + + + + This interface provides a hook for the builder context to + implement error recovery when a builder strategy throws + an exception. Since we can't get try/finally blocks onto + the call stack for later stages in the chain, we instead + add these objects to the context. If there's an exception, + all the current IRequiresRecovery instances will have + their Recover methods called. + + + + + A method that does whatever is needed to clean up + as part of cleaning up after an exception. + + + Don't do anything that could throw in this method, + it will cause later recover operations to get skipped + and play real havoc with the stack trace. + + + + + Retrieve a value from the backing store associated with this Lifetime policy. + + the object desired, or null if no such object is currently stored. + Calls to this method acquire a lock which is released only if a non-null value + has been set for the lifetime manager. + + + + Performs the actual retrieval of a value from the backing store associated + with this Lifetime policy. + + the object desired, or null if no such object is currently stored. + This method is invoked by + after it has acquired its lock. + + + + Stores the given value into backing store for retrieval later. + + The object being stored. + Setting a value will attempt to release the lock acquired by + . + + + + Performs the actual storage of the given value into backing store for retrieval later. + + The object being stored. + This method is invoked by + before releasing its lock. + + + + Remove the given object from backing store. + + + + + A method that does whatever is needed to clean up + as part of cleaning up after an exception. + + + Don't do anything that could throw in this method, + it will cause later recover operations to get skipped + and play real havoc with the stack trace. + + + + + Retrieve a value from the backing store associated with this Lifetime policy. + + the object desired, or null if no such object is currently stored. + + + + Stores the given value into backing store for retrieval later. + + The object being stored. + + + + Remove the given object from backing store. + + + + + Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + + 2 + + + + Standard Dispose pattern implementation. Not needed, but it keeps FxCop happy. + + Always true, since we don't have a finalizer. + + + + This is a custom lifetime manager that acts like , + but also provides a signal to the default build plan, marking the type so that + instances are reused across the build up object graph. + + + + + Construct a new object that does not + itself manage an instance. + + + + + Construct a new object that stores the + give value. This value will be returned by + but is not stored in the lifetime manager, nor is the value disposed. + This Lifetime manager is intended only for internal use, which is why the + normal method is not used here. + + Value to store. + + + + Retrieve a value from the backing store associated with this Lifetime policy. + + the object desired, or null if no such object is currently stored. + + + + Stores the given value into backing store for retrieval later. In this class, + this is a noop, since it has special hooks down in the guts. + + The object being stored. + + + + Remove the given object from backing store. Noop in this class. + + + + + A strategy that handles Hierarchical lifetimes across a set of parent/child + containers. + + + + + Represents a strategy in the chain of responsibility. + Strategies are required to support both BuildUp and TearDown. + + + + + Represents a strategy in the chain of responsibility. + Strategies are required to support both BuildUp and TearDown. Although you + can implement this interface directly, you may also choose to use + as the base class for your strategies, as + this class provides useful helper methods and makes support BuildUp and TearDown + optional. + + + + + Called during the chain of responsibility for a build operation. The + PreBuildUp method is called when the chain is being executed in the + forward direction. + + Context of the build operation. + + + + Called during the chain of responsibility for a build operation. The + PostBuildUp method is called when the chain has finished the PreBuildUp + phase and executes in reverse order from the PreBuildUp calls. + + Context of the build operation. + + + + Called during the chain of responsibility for a teardown operation. The + PreTearDown method is called when the chain is being executed in the + forward direction. + + Context of the teardown operation. + + + + Called during the chain of responsibility for a teardown operation. The + PostTearDown method is called when the chain has finished the PreTearDown + phase and executes in reverse order from the PreTearDown calls. + + Context of the teardown operation. + + + + Called during the chain of responsibility for a build operation. The + PreBuildUp method is called when the chain is being executed in the + forward direction. + + Context of the build operation. + + + + Called during the chain of responsibility for a build operation. The + PostBuildUp method is called when the chain has finished the PreBuildUp + phase and executes in reverse order from the PreBuildUp calls. + + Context of the build operation. + + + + Called during the chain of responsibility for a teardown operation. The + PreTearDown method is called when the chain is being executed in the + forward direction. + + Context of the teardown operation. + + + + Called during the chain of responsibility for a teardown operation. The + PostTearDown method is called when the chain has finished the PreTearDown + phase and executes in reverse order from the PreTearDown calls. + + Context of the teardown operation. + + + + Called during the chain of responsibility for a build operation. The + PreBuildUp method is called when the chain is being executed in the + forward direction. + + Context of the build operation. + + + + A that will attempt to + resolve a value, and return null if it cannot rather than throwing. + + + + + A that is used at build plan execution time + to resolve a dependent value. + + + + + Get the value for a dependency. + + Current build context. + The value for the dependency. + + + + Construct a new object + that will attempt to resolve the given name and type from the container. + + Type to resolve. Must be a reference type. + Name to resolve with. + + + + Construct a new object + that will attempt to resolve the given type from the container. + + Type to resolve. Must be a reference type. + + + + Get the value for a dependency. + + Current build context. + The value for the dependency. + + + + Type this resolver will resolve. + + + + + Name this resolver will resolve. + + + + + Extension methods on to provide convenience + overloads (generic versions, mostly). + + + + + Removes an individual policy type for a build key. + + The type the policy was registered as. + to remove the policy from. + The key the policy applies. + + + + Removes a default policy. + + The type the policy was registered as. + to remove the policy from. + + + + Gets an individual policy. + + The interface the policy is registered under. + to search. + The key the policy applies. + The policy in the list, if present; returns null otherwise. + + + + Gets an individual policy. + + The interface the policy is registered under. + to search. + The key the policy applies. + The policy list that actually contains the returned policy. + The policy in the list, if present; returns null otherwise. + + + + Gets an individual policy. + + to search. + The interface the policy is registered under. + The key the policy applies. + The policy in the list, if present; returns null otherwise. + + + + Gets an individual policy. + + to search. + The interface the policy is registered under. + The key the policy applies. + The policy list that actually contains the returned policy. + The policy in the list, if present; returns null otherwise. + + + + Gets an individual policy. + + The interface the policy is registered under. + to search. + The key the policy applies. + true if the policy searches local only; otherwise false to seach up the parent chain. + The policy in the list, if present; returns null otherwise. + + + + Gets an individual policy. + + The interface the policy is registered under. + to search. + The key the policy applies. + true if the policy searches local only; otherwise false to seach up the parent chain. + The policy list that actually contains the returned policy. + The policy in the list, if present; returns null otherwise. + + + + Gets an individual policy. + + to search. + The interface the policy is registered under. + The key the policy applies. + true if the policy searches local only; otherwise false to seach up the parent chain. + The policy in the list, if present; returns null otherwise. + + + + Get the non default policy. + + The interface the policy is registered under. + to search. + The key the policy applies. + true if the policy searches local only; otherwise false to seach up the parent chain. + The policy in the list, if present; returns null otherwise. + + + + Get the non default policy. + + The interface the policy is registered under. + to search. + The key the policy applies. + true if the policy searches local only; otherwise false to seach up the parent chain. + The policy list that actually contains the returned policy. + The policy in the list, if present; returns null otherwise. + + + + Get the non default policy. + + to search. + The interface the policy is registered under. + The key the policy applies. + true if the policy searches local only; otherwise false to seach up the parent chain. + The policy in the list, if present; returns null otherwise. + + + + Sets an individual policy. + + The interface the policy is registered under. + to add the policy to. + The policy to be registered. + The key the policy applies. + + + + Sets a default policy. When checking for a policy, if no specific individual policy + is available, the default will be used. + + The interface to register the policy under. + to add the policy to. + The default policy to be registered. + + + + Base class for the current operation stored in the build context. + + + + + Create a new . + + Type currently being built. + + + + The type that's currently being built. + + + + + Build plan for that will + return a func that will resolve the requested type + through this container later. + + + + + A build plan is an object that, when invoked, will create a new object + or fill in a given existing one. It encapsulates all the information + gathered by the strategies to construct a particular object. + + + + + Creates an instance of this build plan's type, or fills + in the existing type if passed in. + + Context used to build up the object. + + + + Creates an instance of this build plan's type, or fills + in the existing type if passed in. + + Context used to build up the object. + + + + The almost inevitable collection of extra helper methods on + to augment the rich set of what + Linq already gives us. + + + + + Execute the provided on every item in . + + Type of the items stored in + Sequence of items to process. + Code to run over each item. + + + + Create a single string from a sequenc of items, separated by the provided , + and with the conversion to string done by the given . + + This method does basically the same thing as , + but will work on any sequence of items, not just arrays. + Type of items in the sequence. + Sequence of items to convert. + Separator to place between the items in the string. + The conversion function to change TItem -> string. + The resulting string. + + + + Create a single string from a sequenc of items, separated by the provided , + and with the conversion to string done by the item's method. + + This method does basically the same thing as , + but will work on any sequence of items, not just arrays. + Type of items in the sequence. + Sequence of items to convert. + Separator to place between the items in the string. + The resulting string. + + + + A class that lets you + override a named parameter passed to a constructor. + + + + + Construct a new object that will + override the given named constructor parameter, and pass the given + value. + + Name of the constructor parameter. + Value to pass for the constructor. + + + + Return a that can be used to give a value + for the given desired dependency. + + Current build context. + Type of dependency desired. + a object if this override applies, null if not. + + + + A convenience form of that lets you + specify multiple parameter overrides in one shot rather than having + to construct multiple objects. + + + + + When implemented in derived classes, this method is called from the + method to create the actual objects. + + Key value to create the resolver. + Value to store in the resolver. + The created . + + + + A that lets you override + the value for a specified property. + + + + + Create an instance of . + + The property name. + Value to use for the property. + + + + Return a that can be used to give a value + for the given desired dependency. + + Current build context. + Type of dependency desired. + a object if this override applies, null if not. + + + + A convenience form of that lets you + specify multiple property overrides in one shot rather than having + to construct multiple objects. + + + + + When implemented in derived classes, this method is called from the + method to create the actual objects. + + Key value to create the resolver. + Value to store in the resolver. + The created . + + + + Interface defining the configuration interface exposed by the + Static Factory extension. + + + + + Base interface for all extension configuration interfaces. + + + + + Retrieve the container instance that we are currently configuring. + + + + + Register the given factory delegate to be called when the container is + asked to resolve . + + Type that will be requested from the container. + Delegate to invoke to create the instance. + The container extension object this method was invoked on. + + + + Register the given factory delegate to be called when the container is + asked to resolve and . + + Type that will be requested from the container. + The name that will be used when requesting to resolve this type. + Delegate to invoke to create the instance. + The container extension object this method was invoked on. + + + + Represents the context in which a build-up or tear-down operation runs. + + + + + Represents the context in which a build-up or tear-down operation runs. + + + + + Add a new set of resolver override objects to the current build operation. + + objects to add. + + + + Get a object for the given + or null if that dependency hasn't been overridden. + + Type of the dependency. + Resolver to use, or null if no override matches for the current operation. + + + + A convenience method to do a new buildup operation on an existing context. + + Key to use to build up. + Created object. + + + + A convenience method to do a new buildup operation on an existing context. This + overload allows you to specify extra policies which will be in effect for the duration + of the build. + + Key defining what to build up. + A delegate that takes a . This + is invoked with the new child context before the build up process starts. This gives callers + the opportunity to customize the context for the build process. + Created object. + + + + Gets the head of the strategy chain. + + + The strategy that's first in the chain; returns null if there are no + strategies in the chain. + + + + + Gets the associated with the build. + + + The associated with the build. + + + + + Gets the original build key for the build operation. + + + The original build key for the build operation. + + + + + Get the current build key for the current build operation. + + + + + The set of policies that were passed into this context. + + This returns the policies passed into the context. + Policies added here will remain after buildup completes. + The persistent policies for the current context. + + + + Gets the policies for the current context. + + Any policies added to this object are transient + and will be erased at the end of the buildup. + + The policies for the current context. + + + + + Gets the collection of objects + that need to execute in event of an exception. + + + + + The current object being built up or torn down. + + + The current object being manipulated by the build operation. May + be null if the object hasn't been created yet. + + + + Flag indicating if the build operation should continue. + + true means that building should not call any more + strategies, false means continue to the next strategy. + + + + An object representing what is currently being done in the + build chain. Used to report back errors if there's a failure. + + + + + The build context used to resolve a dependency during the build operation represented by this context. + + + + + Initialize a new instance of the class. + + + + + Initialize a new instance of the class with a , + , and the + build key used to start this build operation. + + The to use for this context. + The to use for this context. + The to use for this context. + Build key to start building. + The existing object to build up. + + + + Create a new using the explicitly provided + values. + + The to use for this context. + The to use for this context. + The set of persistent policies to use for this context. + The set of transient policies to use for this context. It is + the caller's responsibility to ensure that the transient and persistent policies are properly + combined. + Build key for this context. + Existing object to build up. + + + + Add a new set of resolver override objects to the current build operation. + + objects to add. + + + + Get a object for the given + or null if that dependency hasn't been overridden. + + Type of the dependency. + Resolver to use, or null if no override matches for the current operation. + + + + A convenience method to do a new buildup operation on an existing context. + + Key to use to build up. + Created object. + + + + A convenience method to do a new buildup operation on an existing context. This + overload allows you to specify extra policies which will be in effect for the duration + of the build. + + Key defining what to build up. + A delegate that takes a . This + is invoked with the new child context before the build up process starts. This gives callers + the opportunity to customize the context for the build process. + Created object. + + + + Gets the head of the strategy chain. + + + The strategy that's first in the chain; returns null if there are no + strategies in the chain. + + + + + Get the current build key for the current build operation. + + + + + The current object being built up or torn down. + + + The current object being manipulated by the build operation. May + be null if the object hasn't been created yet. + + + + Gets the associated with the build. + + + The associated with the build. + + + + + Gets the original build key for the build operation. + + + The original build key for the build operation. + + + + + The set of policies that were passed into this context. + + This returns the policies passed into the context. + Policies added here will remain after buildup completes. + The persistent policies for the current context. + + + + Gets the policies for the current context. + + + Any modifications will be transient (meaning, they will be forgotten when + the outer BuildUp for this context is finished executing). + + + The policies for the current context. + + + + + Gets the collection of objects + that need to execute in event of an exception. + + + + + Flag indicating if the build operation should continue. + + true means that building should not call any more + strategies, false means continue to the next strategy. + + + + An object representing what is currently being done in the + build chain. Used to report back errors if there's a failure. + + + + + The build context used to resolve a dependency during the build operation represented by this context. + + + + + Represents that a dependency could not be resolved. + + + Represents that a dependency could not be resolved. + + + + + Initializes a new instance of the class with no extra information. + + + + + Initializes a new instance of the class with the given message. + + Some random message. + + + + Initialize a new instance of the class with the given + message and inner exception. + + Some random message + Inner exception. + + + + Initializes a new instance of the class with the build key of the object begin built. + + The build key of the object begin built. + + + + Initializes a new instance of the class with serialized data. + + The that holds the serialized object data about the exception being thrown. + The that contains contextual information about the source or destination. + + + + The exception thrown when injection is attempted on a method + that is an open generic or has out or ref params. + + + The exception thrown when injection is attempted on a method + that is an open generic or has out or ref params. + + + + + Construct a new with no + message. + + + + + Construct a with the given message + + Message to return. + + + + Construct a with the given message + and inner exception. + + Message to return. + Inner exception + + + + Used for serialization. + + Serialization info. + Serialization context. + + + + Extension methods to provide convenience overloads over the + interface. + + + + + Start a recursive build up operation to retrieve the default + value for the given type. + + Type of object to build. + Parent context. + Resulting object. + + + + Start a recursive build up operation to retrieve the named + implementation for the given type. + + Type to resolve. + Parent context. + Name to resolve with. + The resulting object. + + + + Add a set of s to the context, specified as a + variable argument list. + + Context to add overrides to. + The overrides. + + + + Data structure that stores the set of + objects and executes them when requested. + + + + + Add a new object to this + list. + + Object to add. + + + + Execute the method + of everything in the recovery list. Recoveries will execute + in the opposite order of add - it's a stack. + + + + + Return the number of recovery objects currently in the stack. + + + + + Represents a lifetime container. + + + A lifetime container tracks the lifetime of an object, and implements + IDisposable. When the container is disposed, any objects in the + container which implement IDisposable are also disposed. + + + + + Adds an object to the lifetime container. + + The item to be added to the lifetime container. + + + + Determine if a given object is in the lifetime container. + + + The item to locate in the lifetime container. + + + Returns true if the object is contained in the lifetime + container; returns false otherwise. + + + + + Removes an item from the lifetime container. The item is + not disposed. + + The item to be removed. + + + + Gets the number of references in the lifetime container + + + The number of references in the lifetime container + + + + + Represents a lifetime container. + + + A lifetime container tracks the lifetime of an object, and implements + IDisposable. When the container is disposed, any objects in the + container which implement IDisposable are also disposed. + + + + + Adds an object to the lifetime container. + + The item to be added to the lifetime container. + + + + Determine if a given object is in the lifetime container. + + + The item to locate in the lifetime container. + + + Returns true if the object is contained in the lifetime + container; returns false otherwise. + + + + + Releases the resources used by the . + + + + + Releases the managed resources used by the DbDataReader and optionally releases the unmanaged resources. + + + true to release managed and unmanaged resources; false to release only unmanaged resources. + + + + + Returns an enumerator that iterates through the lifetime container. + + + An object that can be used to iterate through the life time container. + + + + + Returns an enumerator that iterates through the lifetime container. + + + An object that can be used to iterate through the life time container. + + + + + Removes an item from the lifetime container. The item is + not disposed. + + The item to be removed. + + + + Gets the number of references in the lifetime container + + + The number of references in the lifetime container + + + + + A custom collection over objects. + + + + + Removes an individual policy type for a build key. + + The type of policy to remove. + The key the policy applies. + + + + Removes all policies from the list. + + + + + Removes a default policy. + + The type the policy was registered as. + + + + Gets an individual policy. + + The interface the policy is registered under. + The key the policy applies. + true if the policy searches local only; otherwise false to seach up the parent chain. + The policy list in the chain that the searched for policy was found in, null if the policy was + not found. + The policy in the list, if present; returns null otherwise. + + + + Get the non default policy. + + The interface the policy is registered under. + The key the policy applies to. + True if the search should be in the local policy list only; otherwise false to search up the parent chain. + The policy list in the chain that the searched for policy was found in, null if the policy was + not found. + The policy in the list if present; returns null otherwise. + + + + Sets an individual policy. + + The of the policy. + The policy to be registered. + The key the policy applies. + + + + Sets a default policy. When checking for a policy, if no specific individual policy + is available, the default will be used. + + The interface to register the policy under. + The default policy to be registered. + + + + A custom collection wrapper over objects. + + + + + Initialize a new instance of a class. + + + + + Initialize a new instance of a class with another policy list. + + An inner policy list to search. + + + + Removes an individual policy type for a build key. + + The type of policy to remove. + The key the policy applies. + + + + Removes all policies from the list. + + + + + Removes a default policy. + + The type the policy was registered as. + + + + Gets an individual policy. + + The interface the policy is registered under. + The key the policy applies. + true if the policy searches local only; otherwise false to seach up the parent chain. + The policy list in the chain that the searched for policy was found in, null if the policy was + not found. + The policy in the list, if present; returns null otherwise. + + + + Get the non default policy. + + The interface the policy is registered under. + The key the policy applies to. + True if the search should be in the local policy list only; otherwise false to search up the parent chain. + The policy list in the chain that the searched for policy was found in, null if the policy was + not found. + The policy in the list if present; returns null otherwise. + + + + Sets an individual policy. + + The of the policy. + The policy to be registered. + The key the policy applies. + + + + Sets a default policy. When checking for a policy, if no specific individual policy + is available, the default will be used. + + The interface to register the policy under. + The default policy to be registered. + + + + Gets the number of items in the locator. + + + The number of items in the locator. + + + + + An implementation of . + + + + + Add a new object to this + list. + + Object to add. + + + + Execute the method + of everything in the recovery list. Recoveries will execute + in the opposite order of add - it's a stack. + + + + + Return the number of recovery objects currently in the stack. + + + + + Implementation of which will notify an object about + the completion of a BuildUp operation, or start of a TearDown operation. + + + This strategy checks the object that is passing through the builder chain to see if it + implements IBuilderAware and if it does, it will call + and . This strategy is meant to be used from the + stage. + + + + + Called during the chain of responsibility for a build operation. The + PreBuildUp method is called when the chain is being executed in the + forward direction. + + Context of the build operation. + + + + Called during the chain of responsibility for a teardown operation. The + PreTearDown method is called when the chain is being executed in the + forward direction. + + Context of the teardown operation. + + + + Implemented on a class when it wants to receive notifications + about the build process. + + + + + Called by the when the object is being built up. + + The key of the object that was just built up. + + + + Called by the when the object is being torn down. + + + + + Enumeration to represent the object builder stages. + + + The order of the values in the enumeration is the order in which the stages are run. + + + + + Strategies in this stage run before creation. Typical work done in this stage might + include strategies that use reflection to set policies into the context that other + strategies would later use. + + + + + Strategies in this stage create objects. Typically you will only have a single policy-driven + creation strategy in this stage. + + + + + Strategies in this stage work on created objects. Typical work done in this stage might + include setter injection and method calls. + + + + + Strategies in this stage work on objects that are already initialized. Typical work done in + this stage might include looking to see if the object implements some notification interface + to discover when its initialization stage has been completed. + + + + + Represents a builder policy for mapping build keys. + + + + + Represents a builder policy for mapping build keys. + + + + + Maps the build key. + + The build key to map. + Current build context. Used for contextual information + if writing a more sophisticated mapping. This parameter can be null + (called when getting container registrations). + The new build key. + + + + Initialize a new instance of the with the new build key. + + The new build key. + + + + Maps the build key. + + The build key to map. + Current build context. Used for contextual information + if writing a more sophisticated mapping, unused in this implementation. + The new build key. + + + + Represents a strategy for mapping build keys in the build up operation. + + + + + Called during the chain of responsibility for a build operation. Looks for the + and if found maps the build key for the current operation. + + The context for the operation. + + + + An implementation of that can map + generic types. + + + + + Create a new instance + that will map generic types. + + Build key to map to. This must be or contain an open generic type. + + + + Maps the build key. + + The build key to map. + Current build context. Used for contextual information + if writing a more sophisticated mapping. + The new build key. + + + + A that will look for a build plan + in the current context. If it exists, it invokes it, otherwise + it creates one and stores it for later, and invokes it. + + + + + Called during the chain of responsibility for a build operation. + + The context for the operation. + + + + An implementation of that chooses + constructors based on these criteria: first, pick a constructor marked with the + attribute. If there + isn't one, then choose the constructor with the longest parameter list. If that is ambiguous, + then throw. + + Thrown when the constructor to choose is ambiguous. + Attribute used to mark the constructor to call. + + + + Base class that provides an implementation of + which lets you override how the parameter resolvers are created. + + + + + A that, when implemented, + will determine which constructor to call from the build plan. + + + + + Choose the constructor to call for the given type. + + Current build context + The to add any + generated resolver objects into. + The chosen constructor. + + + + Choose the constructor to call for the given type. + + Current build context + The to add any + generated resolver objects into. + The chosen constructor. + + + + Create a instance for the given + . + + Parameter to create the resolver for. + The resolver object. + + + + Compares two objects and returns a value indicating whether one is less than, equal to, or greater than the other. + + + + Value Condition Less than zerox is less than y.Zerox equals y.Greater than zerox is greater than y. + + + The second object to compare. + The first object to compare. + + + + Create a instance for the given + . + + Parameter to create the resolver for. + The resolver object. + + + + Objects of this type are the return value from . + It encapsulates the desired with the string keys + needed to look up the for each + parameter. + + + + + Base class for return values from selector policies that + return a memberinfo of some sort plus a list of parameter + keys to look up the parameter resolvers. + + + + + Base class for return of selector policies that need + to keep track of a set of parameter keys. + + + + + Add a new parameter key to this object. Keys are assumed + to be in the order of the parameters to the constructor. + + Key for the next parameter to look up. + + + + The set of keys for the constructor parameters. + + + + + Construct a new , storing + the given member info. + + Member info to store. + + + + The member info stored. + + + + + Create a new instance which + contains the given constructor. + + The constructor to wrap. + + + + The constructor this object wraps. + + + + + This class records the information about which constructor argument is currently + being resolved, and is responsible for generating the error string required when + an error has occurred. + + + + + Initializes a new instance of the class. + + The type that is being constructed. + A string representing the constructor being called. + Parameter being resolved. + + + + Generate the string describing what parameter was being resolved. + + The description string. + + + + String describing the constructor being set up. + + + + + Parameter that's being resolved. + + + + + A that emits IL to call constructors + as part of creating a build plan. + + + + + Called during the chain of responsibility for a build operation. + + Existing object is an instance of . + The context for the operation. + + + + A helper method used by the generated IL to throw an exception if + a dependency cannot be resolved. + + The currently being + used for the build of this object. + + + + A helper method used by the generated IL to throw an exception if + a dependency cannot be resolved because of an invalid constructor. + + The currently being + used for the build of this object. + The signature of the invalid constructor. + + + + A helper method used by the generated IL to throw an exception if + no existing object is present, but the user is attempting to build + an interface (usually due to the lack of a type mapping). + + The currently being + used for the build of this object. + + + + A helper method used by the generated IL to store the current operation in the build context. + + + + + A helper method used by the generated IL to store the current operation in the build context. + + + + + A helper method used by the generated IL to set up a PerResolveLifetimeManager lifetime manager + if the current object is such. + + Current build context. + + + + A class that records that a constructor is about to be call, and is + responsible for generating the error string required when + an error has occurred. + + + + + Initializes a new instance of the class. + + + + + Generate the description string. + + The string. + + + + Constructor we're trying to call. + + + + + An implementation of that will + check for full trust and if we're building a class or an interface. If in full + trust, attach to the class or module of the interface respectively. If in partial + trust, attach to the OB2 module instead. + + + + + This interface defines a policy that manages creation of the dynamic methods + used by the ObjectBuilder code generation. This way, we can replace the details + of how the dynamic method is created to handle differences in CLR (like Silverlight + vs desktop) or security policies. + + + + + Create a builder method for the given type, using the given name. + + Type that will be built by the generated method. + Name to give to the method. + A object with the proper signature to use + as part of a build plan. + + + + Create a builder method for the given type, using the given name. + + Type that will be built by the generated method. + Name to give to the method. + A object with the proper signature to use + as part of a build plan. + + + + This object tracks the current state of the build plan generation, + accumulates the IL, provides the preamble & postamble for the dynamic + method, and tracks things like local variables in the generated IL + so that they can be reused across IL generation strategies. + + + + + Create a that is initialized + to handle creation of a dynamic method to build the given type. + + Type that we're trying to create a build plan for. + An object that actually + creates our object. + + + + Completes generation of the dynamic method and returns the + generated dynamic method delegate. + + The created + + + + Emit the IL to put the build context on top of the IL stack. + + + + + Emit the IL to put the current build key on top of the IL stack. + + + + + Emit the IL to put the current "existing" object on the top of the IL stack. + + + + + Emit the IL to make the top of the IL stack our current "existing" object. + + + + + Emit the IL to load the given object onto the top of the IL stack. + + Type to load on the stack. + + + + Emit the IL needed to look up an and + call it to get a value. + + Type of the dependency to resolve. + Key to look up the policy by. + + + + Emit the IL needed to clear the . + + + + + Emit the IL needed to either cast the top of the stack to the target type + or unbox it, if it's a value type. + + Type to convert the top of the stack to. + + + + A helper method used by the generated IL to clear the current operation in the build context. + + + + + Helper method used by generated IL to look up a dependency resolver based on the given key. + + Current build context. + Type of the dependency being resolved. + Key the resolver was stored under. + The found dependency resolver. + + + + A reflection helper method to make it easier to grab a property getter + for the given property. + + Type that implements the property we want. + Type of the property. + Name of the property. + The property getter's . + + + + A reflection helper method that makes it easier to grab a + for a method. + + Type that implements the method we want. + Name of the method. + Types of arguments to the method. + The method's . + + + + The underlying that can be used to + emit IL into the generated dynamic method. + + + + + The type we're currently creating the method to build. + + + + + A delegate type that defines the signature of the + dynamic method created by the build plans. + + used to build up the object. + + + + An implementation of that runs the + given delegate to execute the plan. + + + + + An implementation + that constructs a build plan via dynamic IL emission. + + + + + A that can create and return an + for the given build key. + + + + + Create a build plan using the given context and build key. + + Current build context. + Current build key. + The build plan. + + + + Construct a that + uses the given strategy chain to construct the build plan. + + The strategy chain. + + + + Construct a build plan. + + The current build context. + The current build key. + The created build plan. + + + + A class that records that a constructor is about to be call, and is + responsible for generating the error string required when + an error has occurred. + + + + + Initializes a new instance of the class. + + + + + Generate the description string. + + The string. + + + + Method we're trying to call. + + + + + This class records the information about which constructor argument is currently + being resolved, and is responsible for generating the error string required when + an error has occurred. + + + + + Initializes a new instance of the class. + + The type that is being constructed. + A string representing the method being called. + Parameter being resolved. + + + + Generate the string describing what parameter was being resolved. + + The description string. + + + + String describing the method being set up. + + + + + Parameter that's being resolved. + + + + + A that generates IL to call + chosen methods (as specified by the current ) + as part of object build up. + + + + + Called during the chain of responsibility for a build operation. The + PreBuildUp method is called when the chain is being executed in the + forward direction. + + Context of the build operation. + + + + A helper method used by the generated IL to store the current operation in the build context. + + + + + A helper method used by the generated IL to store the current operation in the build context. + + + + + A base class that holds the information shared by all operations + performed by the container while setting properties. + + + + + Initializes a new instance of the class. + + + + + Generate the description of this operation. + + The string. + + + + Get a format string used to create the description. Called by + the base method. + + The format string. + + + + The property value currently being resolved. + + + + + This class records the information about which property value is currently + being resolved, and is responsible for generating the error string required when + an error has occurred. + + + + + Initializes a new instance of the class. + + + + + Get a format string used to create the description. Called by + the base method. + + The format string. + + + + A that generates IL to resolve properties + on an object being built. + + + + + Called during the chain of responsibility for a build operation. + + The context for the operation. + + + + A helper method used by the generated IL to store the current operation in the build context. + + + + + A helper method used by the generated IL to store the current operation in the build context. + + + + + This class records the information about which property value is currently + being set, and is responsible for generating the error string required when + an error has occurred. + + + + + Initializes a new instance of the class. + + Type property is on. + Name of property being set. + + + + Get a format string used to create the description. Called by + the base method. + + The format string. + + + + Creates an instance of this build plan's type, or fills + in the existing type if passed in. + + Context used to build up the object. + + + + An that will examine the given + types and return a sequence of objects + that should be called as part of building the object. + + + + + Return the sequence of methods to call while building the target object. + + Current build context. + The to add any + generated resolver objects into. + Sequence of methods to call. + + + + An implementation of that selects + methods by looking for the given + attribute on those methods. + + Type of attribute used to mark methods + to inject. + + + + Base class that provides an implementation of + which lets you override how the parameter resolvers are created. + + Attribute that marks methods that should + be called. + + + + Return the sequence of methods to call while building the target object. + + Current build context. + The to add any + generated resolver objects into. + Sequence of methods to call. + + + + Create a instance for the given + . + + Parameter to create the resolver for. + The resolver object. + + + + Create a instance for the given + . + + Parameter to create the resolver for. + The resolver object. + + + + Objects of this type are the return value from . + It encapsulates the desired with the string keys + needed to look up the for each + parameter. + + + + + Create a new instance which + contains the given method. + + The method + + + + The constructor this object wraps. + + + + + An that returns a sequence + of properties that should be injected for the given type. + + + + + Returns sequence of properties on the given type that + should be set as part of building that object. + + Current build context. + The to add any + generated resolver objects into. + Sequence of objects + that contain the properties to set. + + + + Base class that provides an implementation of + which lets you override how the parameter resolvers are created. + + + + + Returns sequence of properties on the given type that + should be set as part of building that object. + + Current build context. + The to add any + generated resolver objects into. + Sequence of objects + that contain the properties to set. + + + + Create a for the given + property. + + Property to create resolver for. + The resolver object. + + + + An implementation of that looks + for properties marked with the + attribute that are also settable and not indexers. + + + + + + Create a for the given + property. + + Property to create resolver for. + The resolver object. + + + + Objects of this type are returned from + . + This class combines the about + the property with the string key used to look up the resolver + for this property's value. + + + + + Create an instance of + with the given and key. + + The property. + Key to use to look up the resolver. + + + + PropertyInfo for this property. + + + + + Key to look up this property's resolver. + + + + + Implementation of . + + + + + A builder policy that lets you keep track of the current + resolvers and will remove them from the given policy set. + + + + + Add a new resolver to track by key. + + Key that was used to add the resolver to the policy set. + + + + Remove the currently tracked resolvers from the given policy list. + + Policy list to remove the resolvers from. + + + + Add a new resolver to track by key. + + Key that was used to add the resolver to the policy set. + + + + Remove the currently tracked resolvers from the given policy list. + + Policy list to remove the resolvers from. + + + + Get an instance that implements , + either the current one in the policy set or creating a new one if it doesn't + exist. + + Policy list to look up from. + Build key to track. + The resolver tracker. + + + + Add a key to be tracked to the current tracker. + + Policy list containing the resolvers and trackers. + Build key for the resolvers being tracked. + Key for the resolver. + + + + Remove the resolvers for the given build key. + + Policy list containing the build key. + Build key. + + + + An implementation of that + calls back into the build chain to build up the dependency, passing + a type given at compile time as its build key. + + + + + Create a new instance storing the given type. + + Type to resolve. + + + + Get the value for a dependency. + + Current build context. + The value for the dependency. + + + + This interface defines a standard method to convert any + regardless + of the stage enum into a regular, flat strategy chain. + + + + + Convert this into + a flat . + + The flattened . + + + + Represents a chain of responsibility for builder strategies. + + + + + Reverse the order of the strategy chain. + + The reversed strategy chain. + + + + Execute this strategy chain against the given context, + calling the Buildup methods on the strategies. + + Context for the build process. + The build up object + + + + Execute this strategy chain against the given context, + calling the TearDown methods on the strategies. + + Context for the teardown process. + + + + A builder policy used to create lifetime policy instances. + Used by the LifetimeStrategy when instantiating open + generic types. + + + + + Create a new instance of . + + The new instance. + + + + The type of Lifetime manager that will be created by this factory. + + + + + An implementation that uses + a to figure out if an object + has already been created and to update or remove that + object from some backing store. + + + + + Called during the chain of responsibility for a build operation. The + PreBuildUp method is called when the chain is being executed in the + forward direction. + + Context of the build operation. + + + + Called during the chain of responsibility for a build operation. The + PostBuildUp method is called when the chain has finished the PreBuildUp + phase and executes in reverse order from the PreBuildUp calls. + + Context of the build operation. + + + + Represents a chain of responsibility for builder strategies partitioned by stages. + + The stage enumeration to partition the strategies. + + + + Initialize a new instance of the class. + + + + + Initialize a new instance of the class with an inner strategy chain to use when building. + + The inner strategy chain to use first when finding strategies in the build operation. + + + + Adds a strategy to the chain at a particular stage. + + The strategy to add to the chain. + The stage to add the strategy. + + + + Add a new strategy for the . + + The of + The stage to add the strategy. + + + + Clear the current strategy chain list. + + + This will not clear the inner strategy chain if this instane was created with one. + + + + + Makes a strategy chain based on this instance. + + A new . + + + + Represents a chain of responsibility for builder strategies. + + + + + Initialzie a new instance of the class. + + + + + Initialzie a new instance of the class with a colleciton of strategies. + + A collection of strategies to initialize the chain. + + + + Adds a strategy to the chain. + + The strategy to add to the chain. + + + + Adds strategies to the chain. + + The strategies to add to the chain. + + + + Reverse the order of the strategy chain. + + The reversed strategy chain. + + + + Execute this strategy chain against the given context to build up. + + Context for the build processes. + The build up object + + + + Execute this strategy chain against the given context, + calling the TearDown methods on the strategies. + + Context for the teardown process. + + + + Returns an enumerator that iterates through the collection. + + + + A that can be used to iterate through the collection. + + 1 + + + + Returns an enumerator that iterates through a collection. + + + + An object that can be used to iterate through the collection. + + 2 + + + + Build key used to combine a type object with a string name. Used by + ObjectBuilder to indicate exactly what is being built. + + + + + Create a new instance with the given + type and name. + + to build. + Key to use to look up type mappings and singletons. + + + + Create a new instance for the default + buildup of the given type. + + to build. + + + + This helper method creates a new instance. It is + initialized for the default key for the given type. + + Type to build. + A new instance. + + + + This helper method creates a new instance for + the given type and key. + + Type to build + Key to use to look up type mappings and singletons. + A new instance initialized with the given type and name. + + + + Compare two instances. + + Two instances compare equal + if they contain the same name and the same type. Also, comparing + against a different type will also return false. + Object to compare to. + True if the two keys are equal, false if not. + + + + Calculate a hash code for this instance. + + A hash code. + + + + Compare two instances for equality. + + Two instances compare equal + if they contain the same name and the same type. + First of the two keys to compare. + Second of the two keys to compare. + True if the values of the keys are the same, else false. + + + + Compare two instances for inequality. + + Two instances compare equal + if they contain the same name and the same type. If either field differs + the keys are not equal. + First of the two keys to compare. + Second of the two keys to compare. + false if the values of the keys are the same, else true. + + + + Formats the build key as a string (primarily for debugging). + + A readable string representation of the build key. + + + + Return the stored in this build key. + + The type to build. + + + + Returns the name stored in this build key. + + The name to use when building. + + + + A generic version of so that + you can new up a key using generic syntax. + + Type for the key. + + + + Construct a new that + specifies the given type. + + + + + Construct a new that + specifies the given type and name. + + Name for the key. + + + + A series of helper methods to deal with sequences - + objects that implement . + + + + + A function that turns an arbitrary parameter list into an + . + + Type of arguments. + The items to put into the collection. + An array that contains the values of the . + + + + Given two sequences, return a new sequence containing the corresponding values + from each one. + + Type of first sequence. + Type of second sequence. + First sequence of items. + Second sequence of items. + New sequence of pairs. This sequence ends when the shorter of sequence1 and sequence2 does. + + + + The exception thrown by the Unity container when + an attempt to resolve a dependency fails. + + + The exception thrown by the Unity container when + an attempt to resolve a dependency fails. + + + + + Constructor to create a from serialized state. + + Serialization info + Serialization context + + + + Serialize this object into the given context. + + Serialization info + Streaming context + + + + Create a new that records + the exception for the given type and name. + + Type requested from the container. + Name requested from the container. + The actual exception that caused the failure of the build. + The build context representing the failed operation. + + + + The type that was being requested from the container at the time of failure. + + + + + The name that was being requested from the container at the time of failure. + + + + + A that lets you register a + delegate with the container to create an object, rather than calling + the object's constructor. + + + + + Base class for all extension objects. + + + + + The container calls this method when the extension is added. + + A instance that gives the + extension access to the internals of the container. + + + + Initial the container with this extension's functionality. + + + When overridden in a derived class, this method will modify the given + by adding strategies, policies, etc. to + install it's functions into the container. + + + + Removes the extension's functions from the container. + + + + This method is called when extensions are being removed from the container. It can be + used to do things like disconnect event handlers or clean up member state. You do not + need to remove strategies or policies here; the container will do that automatically. + + + The default implementation of this method does nothing. + + + + + The container this extension has been added to. + + The that this extension has been added to. + + + + The object used to manipulate + the inner state of the container. + + + + + Initialize this extension. This particular extension requires no + initialization work. + + + + + Register the given factory delegate to be called when the container is + asked to resolve and . + + Type that will be requested from the container. + The name that will be used when requesting to resolve this type. + Delegate to invoke to create the instance. + The container extension object this method was invoked on. + + + + Register the given factory delegate to be called when the container is + asked to resolve . + + Type that will be requested from the container. + Delegate to invoke to create the instance. + The container extension object this method was invoked on. + + + + An implementation of that + acts as a decorator over another . + This checks to see if the current type being built is the + right one before checking the inner . + + + + + Create an instance of + + Type to check for. + Inner override to check after type matches. + + + + Return a that can be used to give a value + for the given desired dependency. + + Current build context. + Type of dependency desired. + a object if this override applies, null if not. + + + + A convenience version of that lets you + specify the type to construct via generics syntax. + + Type to check for. + + + + Create an instance of . + + Inner override to check after type matches. + + + + Extension class that adds a set of convenience overloads to the + interface. + + + + + Register a type with specific members to be injected. + + Type this registration is for. + Container to configure. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a type mapping with the container. + + + + This method is used to tell the container that when asked for type , + actually return an instance of type . This is very useful for + getting instances of interfaces. + + + This overload registers a default mapping and transient lifetime. + + + that will be requested. + that will actually be returned. + Container to configure. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a type mapping with the container, where the created instances will use + the given . + + that will be requested. + that will actually be returned. + Container to configure. + The that controls the lifetime + of the returned instance. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a type mapping with the container. + + + This method is used to tell the container that when asked for type , + actually return an instance of type . This is very useful for + getting instances of interfaces. + + that will be requested. + that will actually be returned. + Container to configure. + Name of this mapping. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a type mapping with the container, where the created instances will use + the given . + + that will be requested. + that will actually be returned. + Container to configure. + Name to use for registration, null if a default registration. + The that controls the lifetime + of the returned instance. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a for the given type with the container. + No type mapping is performed for this type. + + The type to apply the to. + Container to configure. + The that controls the lifetime + of the returned instance. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a for the given type with the container. + No type mapping is performed for this type. + + The type to configure injection on. + Container to configure. + Name that will be used to request the type. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a for the given type and name with the container. + No type mapping is performed for this type. + + The type to apply the to. + Container to configure. + Name that will be used to request the type. + The that controls the lifetime + of the returned instance. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a type with specific members to be injected. + + Container to configure. + Type this registration is for. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a type mapping with the container. + + + + This method is used to tell the container that when asked for type , + actually return an instance of type . This is very useful for + getting instances of interfaces. + + + This overload registers a default mapping. + + + Container to configure. + that will be requested. + that will actually be returned. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a type mapping with the container. + + + This method is used to tell the container that when asked for type , + actually return an instance of type . This is very useful for + getting instances of interfaces. + + Container to configure. + that will be requested. + that will actually be returned. + Name to use for registration, null if a default registration. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a type mapping with the container, where the created instances will use + the given . + + Container to configure. + that will be requested. + that will actually be returned. + The that controls the lifetime + of the returned instance. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a for the given type and name with the container. + No type mapping is performed for this type. + + Container to configure. + The to apply the to. + The that controls the lifetime + of the returned instance. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a for the given type and name with the container. + No type mapping is performed for this type. + + Container to configure. + The to configure in the container. + Name to use for registration, null if a default registration. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a for the given type and name with the container. + No type mapping is performed for this type. + + Container to configure. + The to apply the to. + Name to use for registration, null if a default registration. + The that controls the lifetime + of the returned instance. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register an instance with the container. + + + + Instance registration is much like setting a type as a singleton, except that instead + of the container creating the instance the first time it is requested, the user + creates the instance ahead of type and adds that instance to the container. + + + This overload does a default registration and has the container take over the lifetime of the instance. + + Type of instance to register (may be an implemented interface instead of the full type). + Container to configure. + Object to returned. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register an instance with the container. + + + + Instance registration is much like setting a type as a singleton, except that instead + of the container creating the instance the first time it is requested, the user + creates the instance ahead of type and adds that instance to the container. + + + This overload does a default registration (name = null). + + + Type of instance to register (may be an implemented interface instead of the full type). + Container to configure. + Object to returned. + + object that controls how this instance will be managed by the container. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register an instance with the container. + + + + Instance registration is much like setting a type as a singleton, except that instead + of the container creating the instance the first time it is requested, the user + creates the instance ahead of type and adds that instance to the container. + + + This overload automatically has the container take ownership of the . + + Type of instance to register (may be an implemented interface instead of the full type). + Object to returned. + Container to configure. + Name for registration. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register an instance with the container. + + + + Instance registration is much like setting a type as a singleton, except that instead + of the container creating the instance the first time it is requested, the user + creates the instance ahead of type and adds that instance to the container. + + + Type of instance to register (may be an implemented interface instead of the full type). + Object to returned. + Container to configure. + Name for registration. + + object that controls how this instance will be managed by the container. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register an instance with the container. + + + + Instance registration is much like setting a type as a singleton, except that instead + of the container creating the instance the first time it is requested, the user + creates the instance ahead of type and adds that instance to the container. + + + This overload does a default registration and has the container take over the lifetime of the instance. + + Container to configure. + Type of instance to register (may be an implemented interface instead of the full type). + Object to returned. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register an instance with the container. + + + + Instance registration is much like setting a type as a singleton, except that instead + of the container creating the instance the first time it is requested, the user + creates the instance ahead of type and adds that instance to the container. + + + This overload does a default registration (name = null). + + + Container to configure. + Type of instance to register (may be an implemented interface instead of the full type). + Object to returned. + + object that controls how this instance will be managed by the container. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register an instance with the container. + + + + Instance registration is much like setting a type as a singleton, except that instead + of the container creating the instance the first time it is requested, the user + creates the instance ahead of type and adds that instance to the container. + + + This overload automatically has the container take ownership of the . + + Container to configure. + Type of instance to register (may be an implemented interface instead of the full type). + Object to returned. + Name for registration. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Resolve an instance of the default requested type from the container. + + of object to get from the container. + Container to resolve from. + Any overrides for the resolve call. + The retrieved object. + + + + Resolve an instance of the requested type with the given name from the container. + + of object to get from the container. + Container to resolve from. + Name of the object to retrieve. + Any overrides for the resolve call. + The retrieved object. + + + + Resolve an instance of the default requested type from the container. + + Container to resolve from. + of object to get from the container. + Any overrides for the resolve call. + The retrieved object. + + + + Return instances of all registered types requested. + + + + This method is useful if you've registered multiple types with the same + but different names. + + + Be aware that this method does NOT return an instance for the default (unnamed) registration. + + + The type requested. + Container to resolve from. + Any overrides for the resolve calls. + Set of objects of type . + + + + Run an existing object through the container and perform injection on it. + + + + This method is useful when you don't control the construction of an + instance (ASP.NET pages or objects created via XAML, for instance) + but you still want properties and other injection performed. + + + This overload uses the default registrations. + + + of object to perform injection on. + Container to resolve through. + Instance to build up. + Any overrides for the buildup. + The resulting object. By default, this will be , but + container extensions may add things like automatic proxy creation which would + cause this to return a different object (but still type compatible with ). + + + + Run an existing object through the container and perform injection on it. + + + + This method is useful when you don't control the construction of an + instance (ASP.NET pages or objects created via XAML, for instance) + but you still want properties and other injection performed. + + of object to perform injection on. + Conatiner to resolve through. + Instance to build up. + name to use when looking up the typemappings and other configurations. + Any overrides for the Buildup. + The resulting object. By default, this will be , but + container extensions may add things like automatic proxy creation which would + cause this to return a different object (but still type compatible with ). + + + + Run an existing object through the container and perform injection on it. + + + + This method is useful when you don't control the construction of an + instance (ASP.NET pages or objects created via XAML, for instance) + but you still want properties and other injection performed. + + + This overload uses the default registrations. + + + Container to resolve through. + of object to perform injection on. + Instance to build up. + Any overrides for the Buildup. + The resulting object. By default, this will be , but + container extensions may add things like automatic proxy creation which would + cause this to return a different object (but still type compatible with ). + + + + Creates a new extension object and adds it to the container. + + Type of to add. The extension type + will be resolved from within the supplied . + Container to add the extension to. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Resolve access to a configuration interface exposed by an extension. + + Extensions can expose configuration interfaces as well as adding + strategies and policies to the container. This method walks the list of + added extensions and returns the first one that implements the requested type. + + The configuration interface required. + Container to configure. + The requested extension's configuration interface, or null if not found. + + + + Check if a particular type has been registered with the container with + the default name. + + Container to inspect. + Type to check registration for. + True if this type has been registered, false if not. + + + + Check if a particular type/name pair has been registered with the container. + + Container to inspect. + Type to check registration for. + Name to check registration for. + True if this type/name pair has been registered, false if not. + + + + Check if a particular type has been registered with the container with the default name. + + Type to check registration for. + Container to inspect. + True if this type has been registered, false if not. + + + + Check if a particular type/name pair has been registered with the container. + + Type to check registration for. + Container to inspect. + Name to check registration for. + True if this type/name pair has been registered, false if not. + + + + This extension installs the default strategies and policies into the container + to implement the standard behavior of the Unity container. + + + This extension installs the default strategies and policies into the container + to implement the standard behavior of the Unity container. + + + + + Add the correct to the policy + set. This version adds the appropriate policy for running on the desktop CLR. + + + + + Add the default ObjectBuilder strategies & policies to the container. + + + + + The class provides the means for extension objects + to manipulate the internal state of the . + + + + + Store a type/name pair for later resolution. + + + + When users register type mappings (or other things) with a named key, this method + allows you to register that name with the container so that when the + method is called, that name is included in the list that is returned. + + to register. + Name assocated with that type. + + + + The container that this context is associated with. + + The object. + + + + The strategies this container uses. + + The that the container uses to build objects. + + + + The strategies this container uses to construct build plans. + + The that this container uses when creating + build plans. + + + + The policies this container uses. + + The the that container uses to build objects. + + + + The that this container uses. + + The is used to manage objects that the container is managing. + + + + This event is raised when the method, + or one of its overloads, is called. + + + + + This event is raised when the method, + or one of its overloads, is called. + + + + + This event is raised when the method is called, providing + the newly created child container to extensions to act on as they see fit. + + + + + An EventArgs class that holds a string Name. + + + + + Create a new with a null name. + + + + + Create a new with the given name. + + Name to store. + + + + The name. + + Name used for this event arg object. + + + + Event argument class for the event. + + + + + Create a new instance of . + + Type to map from. + Type to map to. + Name for the registration. + to manage instances. + + + + Type to map from. + + + + + Type to map to. + + + + + to manage instances. + + + + + Event argument class for the event. + + + + + Create a default instance. + + + + + Create a instance initialized with the given arguments. + + Type of instance being registered. + The instance object itself. + Name to register under, null if default registration. + object that handles how + the instance will be owned. + + + + Type of instance being registered. + + + Type of instance being registered. + + + + + Instance object being registered. + + Instance object being registered + + + + that controls ownership of + this instance. + + + + + A that lets you specify that + an instance of a generic type parameter should be resolved. + + + + + Create a new instance that specifies + that the given named generic parameter should be resolved. + + The generic parameter name to resolve. + + + + Create a new instance that specifies + that the given named generic parameter should be resolved. + + The generic parameter name to resolve. + name to use when looking up in the container. + + + + Return a instance that will + return this types value for the parameter. + + The actual type to resolve. + The resolution key. + The . + + + + A that lets you specify that + an array containing the registered instances of a generic type parameter + should be resolved. + + + + + Create a new instance that specifies + that the given named generic parameter should be resolved. + + The generic parameter name to resolve. + The values for the elements, that will + be converted to objects. + + + + Test to see if this parameter value has a matching type for the given type. + + Type to check. + True if this parameter value is compatible with type , + false if not. + A type is considered compatible if it is an array type of rank one + and its element type is a generic type parameter with a name matching this generic + parameter name configured for the receiver. + + + + Return a instance that will + return this types value for the parameter. + + Type that contains the member that needs this parameter. Used + to resolve open generic parameters. + The . + + + + Name for the type represented by this . + This may be an actual type name or a generic argument name. + + + + + A Unity container extension that allows you to configure + which constructors, properties, and methods get injected + via an API rather than through attributes. + + + + + Initial the container with this extension's functionality. + + + When overridden in a derived class, this method will modify the given + by adding strategies, policies, etc. to + install it's functions into the container. + + + + API to configure the injection settings for a particular type. + + Type the injection is being configured for. + Objects containing the details on which members to inject and how. + This extension object. + + + + API to configure the injection settings for a particular type/name pair. + + Type the injection is being configured for. + Name of registration + Objects containing the details on which members to inject and how. + This extension object. + + + + API to configure the injection settings for a particular type. + + Type to configure. + Objects containing the details on which members to inject and how. + This extension object. + + + + API to configure the injection settings for a particular type/name pair. + + Type to configure. + Name of registration. + Objects containing the details on which members to inject and how. + This extension object. + + + + API to configure the injection settings for a particular type/name pair. + + Type of interface/base class being registered (may be null). + Type of actual implementation class being registered. + Name of registration. + Objects containing the details on which members to inject and how. + This extension object. + + + + A class that holds the collection of information + for a constructor, so that the container can + be configured to call this constructor. + + + + + Create a new instance of that looks + for a constructor with the given set of parameters. + + The values for the parameters, that will + be converted to objects. + + + + Add policies to the to configure the + container to call this constructor with the appropriate parameter values. + + Interface registered, ignored in this implementation. + Type to register. + Name used to resolve the type object. + Policy list to add policies to. + + + + An that configures the + container to call a method as part of buildup. + + + + + Create a new instance which will configure + the container to call the given methods with the given parameters. + + Name of the method to call. + Parameter values for the method. + + + + Add policies to the to configure the + container to call this constructor with the appropriate parameter values. + + Type of interface registered, ignored in this implementation. + Type to register. + Name used to resolve the type object. + Policy list to add policies to. + + + + A small function to handle name matching. You can override this + to do things like case insensitive comparisons. + + MethodInfo for the method you're checking. + Name of the method you're looking for. + True if a match, false if not. + + + + A class that holds on to the given value and provides + the required + when the container is configured. + + + + + Create an instance of that stores + the given value, using the runtime type of that value as the + type of the parameter. + + Value to be injected for this parameter. + + + + Create an instance of that stores + the given value, associated with the given type. + + Type of the parameter. + Value of the parameter + + + + Return a instance that will + return this types value for the parameter. + + Type that contains the member that needs this parameter. Used + to resolve open generic parameters. + The . + + + + A generic version of that makes it a + little easier to specify the type of the parameter. + + Type of parameter. + + + + Create a new . + + Value for the parameter. + + + + This class stores information about which properties to inject, + and will configure the container accordingly. + + + + + Configure the container to inject the given property name, + resolving the value via the container. + + Name of the property to inject. + + + + Configure the container to inject the given property name, + using the value supplied. This value is converted to an + object using the + rules defined by the + method. + + Name of property to inject. + Value for property. + + + + Add policies to the to configure the + container to call this constructor with the appropriate parameter values. + + Interface being registered, ignored in this implemenation. + Type to register. + Name used to resolve the type object. + Policy list to add policies to. + + + + A class that stores a type, and generates a + resolver object that resolves all the named instances or the + type registered in a container. + + + + + Construct a new that + resolves to the given element type and collection of element values. + + The type of elements to resolve. + The values for the elements, that will + be converted to objects. + + + + Construct a new that + resolves to the given array and element types and collection of element values. + + The type for the array of elements to resolve. + The type of elements to resolve. + The values for the elements, that will + be converted to objects. + + + + Return a instance that will + return this types value for the parameter. + + Type that contains the member that needs this parameter. Used + to resolve open generic parameters. + The . + + + + A generic version of for convenience + when creating them by hand. + + Type of the elements for the array of the parameter. + + + + Construct a new that + resolves to the given element generic type with the given element values. + + The values for the elements, that will + be converted to objects. + + + + Interface defining the behavior of the Unity dependency injection container. + + + + + Register a type mapping with the container, where the created instances will use + the given . + + that will be requested. + that will actually be returned. + Name to use for registration, null if a default registration. + The that controls the lifetime + of the returned instance. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register an instance with the container. + + + + Instance registration is much like setting a type as a singleton, except that instead + of the container creating the instance the first time it is requested, the user + creates the instance ahead of type and adds that instance to the container. + + + Type of instance to register (may be an implemented interface instead of the full type). + Object to returned. + Name for registration. + + object that controls how this instance will be managed by the container. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Resolve an instance of the requested type with the given name from the container. + + of object to get from the container. + Name of the object to retrieve. + Any overrides for the resolve call. + The retrieved object. + + + + Return instances of all registered types requested. + + + + This method is useful if you've registered multiple types with the same + but different names. + + + Be aware that this method does NOT return an instance for the default (unnamed) registration. + + + The type requested. + Any overrides for the resolve calls. + Set of objects of type . + + + + Run an existing object through the container and perform injection on it. + + + + This method is useful when you don't control the construction of an + instance (ASP.NET pages or objects created via XAML, for instance) + but you still want properties and other injection performed. + + of object to perform injection on. + Instance to build up. + name to use when looking up the typemappings and other configurations. + Any overrides for the resolve calls. + The resulting object. By default, this will be , but + container extensions may add things like automatic proxy creation which would + cause this to return a different object (but still type compatible with ). + + + + Run an existing object through the container, and clean it up. + + The object to tear down. + + + + Add an extension object to the container. + + to add. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Resolve access to a configuration interface exposed by an extension. + + Extensions can expose configuration interfaces as well as adding + strategies and policies to the container. This method walks the list of + added extensions and returns the first one that implements the requested type. + + of configuration interface required. + The requested extension's configuration interface, or null if not found. + + + + Remove all installed extensions from this container. + + + + This method removes all extensions from the container, including the default ones + that implement the out-of-the-box behavior. After this method, if you want to use + the container again you will need to either readd the default extensions or replace + them with your own. + + + The registered instances and singletons that have already been set up in this container + do not get removed. + + + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Create a child container. + + + A child container shares the parent's configuration, but can be configured with different + settings or lifetime. + The new child container. + + + + The parent of this container. + + The parent container, or null if this container doesn't have one. + + + + Get a sequence of that describe the current state + of the container. + + + + + A that holds a weak reference to + it's managed instance. + + + + + Retrieve a value from the backing store associated with this Lifetime policy. + + the object desired, or null if no such object is currently stored. + + + + Stores the given value into backing store for retrieval later. + + The object being stored. + + + + Remove the given object from backing store. + + + + + An implementation of that + creates instances of the type of the given Lifetime Manager + by resolving them through the container. + + + + + Create a new that will + return instances of the given type, creating them by + resolving through the container. + + Container to resolve with. + Type of LifetimeManager to create. + + + + Create a new instance of . + + The new instance. + + + + The type of Lifetime manager that will be created by this factory. + + + + + A that holds the instances given to it, + keeping one instance per thread. + + + + This LifetimeManager does not dispose the instances it holds. + + + + + + Initializes a new instance of the class. + + + + + Retrieve a value from the backing store associated with this Lifetime policy for the + current thread. + + the object desired, or if no such object is currently + stored for the current thread. + + + + Stores the given value into backing store for retrieval later when requested + in the current thread. + + The object being stored. + + + + Remove the given object from backing store. + + Not implemented for this lifetime manager. + + + + An implementation that does nothing, + thus ensuring that instances are created new every time. + + + + + Retrieve a value from the backing store associated with this Lifetime policy. + + the object desired, or null if no such object is currently stored. + + + + Stores the given value into backing store for retrieval later. + + The object being stored. + + + + Remove the given object from backing store. + + + + + This strategy implements the logic that will call container.ResolveAll + when an array parameter is detected. + + + + + Do the PreBuildUp stage of construction. This is where the actual work is performed. + + Current build context. + + + + An implementation of that is + aware of the build keys used by the Unity container. + + + + + Create a instance for the given + . + + + This implementation looks for the Unity on the + parameter and uses it to create an instance of + for this parameter. + Parameter to create the resolver for. + The resolver object. + + + + An implementation of that is aware + of the build keys used by the Unity container. + + + + + Create a instance for the given + . + + Parameter to create the resolver for. + The resolver object. + + + + An implementation of that is aware of + the build keys used by the unity container. + + + + + Create a for the given + property. + + Property to create resolver for. + The resolver object. + + + + A implementation that returns + the value set in the constructor. + + + + + Create a new instance of + which will return the given value when resolved. + + The value to return. + + + + Get the value for a dependency. + + Current build context. + The value for the dependency. + + + + An implementation of that stores a + type and name, and at resolution time puts them together into a + . + + + + + Create an instance of + with the given type and name. + + The type. + The name (may be null). + + + + Resolve the value for a dependency. + + Current build context. + The value for the dependency. + + + + The type that this resolver resolves. + + + + + The name that this resolver resolves. + + + + + An implementation of that resolves to + to an array populated with the values that result from resolving other instances + of . + + + + + Create an instance of + with the given type and a collection of + instances to use when populating the result. + + The type. + The resolver policies to use when populating an array. + + + + Resolve the value for a dependency. + + Current build context. + An array pupulated with the results of resolving the resolver policies. + + + + An implementation of that selects + the given constructor and creates the appropriate resolvers to call it with + the specified parameters. + + + + + Create an instance of that + will return the given constructor, being passed the given injection values + as parameters. + + The constructor to call. + Set of objects + that describes how to obtain the values for the constructor parameters. + + + + Choose the constructor to call for the given type. + + Current build context + The to add any + generated resolver objects into. + The chosen constructor. + + + + Helper class for implementing selector policies that need to + set up dependency resolver policies. + + + + + Add dependency resolvers to the parameter set. + + Type that's currently being built (used to resolve open generics). + PolicyList to add the resolvers to. + Objects supplying the dependency resolvers. + Result object to store the keys in. + + + + A implementation that calls the specific + methods with the given parameters. + + + + + Add the given method and parameter collection to the list of methods + that will be returned when the selector's + method is called. + + Method to call. + sequence of objects + that describe how to create the method parameter values. + + + + Return the sequence of methods to call while building the target object. + + Current build context. + The to add any + generated resolver objects into. + Sequence of methods to call. + + + + An implemnetation of which returns + the set of specific properties that the selector was configured with. + + + + + Add a property that will be par of the set returned when the + is called. + + The property to set. + object describing + how to create the value to inject. + + + + Returns sequence of properties on the given type that + should be set as part of building that object. + + Current build context. + The to add any + generated resolver objects into. + Sequence of objects + that contain the properties to set. + + + + A class that stores a name and type, and generates a + resolver object that resolves the parameter via the + container. + + + + + Construct a new that + resolves to the given type. + + Type of this parameter. + + + + Construct a new that + resolves the given type and name. + + Type of this parameter. + Name to use when resolving parameter. + + + + Return a instance that will + return this types value for the parameter. + + Type that contains the member that needs this parameter. Used + to resolve open generic parameters. + The . + + + + A generic version of for convenience + when creating them by hand. + + Type of the parameter + + + + Create a new for the given + generic type and the default name. + + + + + Create a new for the given + generic type and name. + + Name to use to resolve this parameter. + + + + An implementation of that wraps a Unity container. + + + + + Initializes a new instance of the class for a container. + + The to wrap with the + interface implementation. + + + + Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + + 2 + + + + When implemented by inheriting classes, this method will do the actual work of resolving + the requested service instance. + + Type of instance requested.Name of registered service you want. May be null. + + The requested service instance. + + + + + When implemented by inheriting classes, this method will do the actual work of + resolving all the requested service instances. + + Type of service requested. + + Sequence of service instance objects. + + + + + A static helper class that includes various parameter checking routines. + + + + + Throws if the given argument is null. + + if tested value if null. + Argument value to test. + Name of the argument being tested. + + + + Throws an exception if the tested string argument is null or the empty string. + + Thrown if string value is null. + Thrown if the string is empty + Argument value to check. + Name of argument being checked. + + + + Verifies that an argument type is assignable from the provided type (meaning + interfaces are implemented, or classes exist in the base class hierarchy). + + The argument type that will be assigned to. + The type of the value being assigned. + Argument name. + + + + Verifies that an argument instance is assignable from the provided type (meaning + interfaces are implemented, or classes exist in the base class hierarchy, or instance can be + assigned through a runtime wrapper, as is the case for COM Objects). + + The argument type that will be assigned to. + The instance that will be assigned. + Argument name. + + + + The build stages we use in the Unity container + strategy pipeline. + + + + + First stage. By default, nothing happens here. + + + + + Second stage. Type mapping occurs here. + + + + + Third stage. lifetime managers are checked here, + and if they're available the rest of the pipeline is skipped. + + + + + Fourth stage. Reflection over constructors, properties, etc. is + performed here. + + + + + Fifth stage. Instance creation happens here. + + + + + Sixth stage. Property sets and method injection happens here. + + + + + Seventh and final stage. By default, nothing happens here. + + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to The type {0} has multiple constructors of length {1}. Unable to disambiguate.. + + + + + Looks up a localized string similar to The provided string argument must not be empty.. + + + + + Looks up a localized string similar to The current build operation (build key {2}) failed: {3} (Strategy type {0}, index {1}). + + + + + Looks up a localized string similar to The current type, {0}, is an interface and cannot be constructed. Are you missing a type mapping?. + + + + + Looks up a localized string similar to Cannot extract type from build key {0}.. + + + + + Looks up a localized string similar to The method {0}.{1}({2}) is an open generic method. Open generic methods cannot be injected.. + + + + + Looks up a localized string similar to The property {0} on type {1} is an indexer. Indexed properties cannot be injected.. + + + + + Looks up a localized string similar to The method {1} on type {0} has an out parameter. Injection cannot be performed.. + + + + + Looks up a localized string similar to The method {0}.{1}({2}) has at least one out parameter. Methods with out parameters cannot be injected.. + + + + + Looks up a localized string similar to The method {0}.{1}({2}) has at least one ref parameter.Methods with ref parameters cannot be injected.. + + + + + Looks up a localized string similar to The method {1} on type {0} is marked for injection, but it is an open generic method. Injection cannot be performed.. + + + + + Looks up a localized string similar to The method {0}.{1}({2}) is static. Static methods cannot be injected.. + + + + + Looks up a localized string similar to The type {0} is an open generic type. An open generic type cannot be resolved.. + + + + + Looks up a localized string similar to Resolving parameter "{0}" of constructor {1}. + + + + + Looks up a localized string similar to The parameter {0} could not be resolved when attempting to call constructor {1}.. + + + + + Looks up a localized string similar to Parameter type inference does not work for null values. Indicate the parameter type explicitly using a properly configured instance of the InjectionParameter or InjectionParameter<T> classes.. + + + + + Looks up a localized string similar to Calling constructor {0}. + + + + + Looks up a localized string similar to Calling method {0}.{1}. + + + + + Looks up a localized string similar to An item with the given key is already present in the dictionary.. + + + + + Looks up a localized string similar to The lifetime manager is already registered. Lifetime managers cannot be reused, please create a new one.. + + + + + Looks up a localized string similar to The override marker build plan policy has been invoked. This should never happen, looks like a bug in the container.. + + + + + Looks up a localized string similar to Resolving parameter "{0}" of method {1}.{2}. + + + + + Looks up a localized string similar to The value for parameter "{1}" of method {0} could not be resolved. . + + + + + Looks up a localized string similar to Could not resolve dependency for build key {0}.. + + + + + Looks up a localized string similar to The type {0} has multiple constructors marked with the InjectionConstructor attribute. Unable to disambiguate.. + + + + + Looks up a localized string similar to The supplied type {0} must be an open generic type.. + + + + + Looks up a localized string similar to The supplied type {0} does not have the same number of generic arguments as the target type {1}.. + + + + + Looks up a localized string similar to The type {0} does not have an accessible constructor.. + + + + + Looks up a localized string similar to The type {0} does not have a generic argument named "{1}". + + + + + Looks up a localized string similar to while resolving. + + + + + Looks up a localized string similar to The type {0} does not have a constructor that takes the parameters ({1}).. + + + + + Looks up a localized string similar to The type {0} does not have a public method named {1} that takes the parameters ({2}).. + + + + + Looks up a localized string similar to The type {0} does not contain an instance property named {1}.. + + + + + Looks up a localized string similar to The type {0} is not a generic type, and you are attempting to inject a generic parameter named "{1}".. + + + + + Looks up a localized string similar to The type {0} is not an array type with rank 1, and you are attempting to use a [DependencyArray] attribute on a parameter or property with this type.. + + + + + Looks up a localized string similar to Optional dependencies must be reference types. The type {0} is a value type.. + + + + + Looks up a localized string similar to The property {0} on type {1} is not settable.. + + + + + Looks up a localized string similar to The property {0} on type {1} is of type {2}, and cannot be injected with a value of type {3}.. + + + + + Looks up a localized string similar to The value for the property "{0}" could not be resolved.. + + + + + Looks up a localized string similar to The provided string argument must not be empty.. + + + + + Looks up a localized string similar to Resolution of the dependency failed, type = "{0}", name = "{1}". + Exception occurred while: {2}. + Exception is: {3} - {4} + ----------------------------------------------- + At the time of the exception, the container was: + . + + + + + Looks up a localized string similar to Resolving {0},{1}. + + + + + Looks up a localized string similar to Resolving {0},{1} (mapped from {2}, {3}). + + + + + Looks up a localized string similar to Resolving value for property {0}.{1}. + + + + + Looks up a localized string similar to The constructor {1} selected for type {0} has ref or out parameters. Such parameters are not supported for constructor injection.. + + + + + Looks up a localized string similar to Setting value for property {0}.{1}. + + + + + Looks up a localized string similar to The type {0} cannot be constructed. You must configure the container to supply this value.. + + + + + Looks up a localized string similar to The type {1} cannot be assigned to variables of type {0}.. + + + + + Looks up a localized string similar to <unknown>. + + + + + A simple, extensible dependency injection container. + + + + + Create a default . + + + + + Create a with the given parent container. + + The parent . The current object + will apply its own settings first, and then check the parent for additional ones. + + + + RegisterType a type mapping with the container, where the created instances will use + the given . + + that will be requested. + that will actually be returned. + Name to use for registration, null if a default registration. + The that controls the lifetime + of the returned instance. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + RegisterType an instance with the container. + + + + Instance registration is much like setting a type as a singleton, except that instead + of the container creating the instance the first time it is requested, the user + creates the instance ahead of type and adds that instance to the container. + + + Type of instance to register (may be an implemented interface instead of the full type). + Object to returned. + Name for registration. + + If true, the container will take over the lifetime of the instance, + calling Dispose on it (if it's ) when the container is Disposed. + + If false, container will not maintain a strong reference to . User is reponsible + for disposing instance, and for keeping the instance from being garbage collected. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Get an instance of the requested type with the given name from the container. + + of object to get from the container. + Name of the object to retrieve. + Any overrides for the resolve call. + The retrieved object. + + + + Return instances of all registered types requested. + + + + This method is useful if you've registered multiple types with the same + but different names. + + + Be aware that this method does NOT return an instance for the default (unnamed) registration. + + + The type requested. + Any overrides for the resolve calls. + Set of objects of type . + + + + Run an existing object through the container and perform injection on it. + + + + This method is useful when you don't control the construction of an + instance (ASP.NET pages or objects created via XAML, for instance) + but you still want properties and other injection performed. + + of object to perform injection on. + Instance to build up. + name to use when looking up the typemappings and other configurations. + Any overrides for the buildup. + The resulting object. By default, this will be , but + container extensions may add things like automatic proxy creation which would + cause this to return a different object (but still type compatible with ). + + + + Run an existing object through the container, and clean it up. + + The object to tear down. + + + + Add an extension object to the container. + + to add. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Get access to a configuration interface exposed by an extension. + + Extensions can expose configuration interfaces as well as adding + strategies and policies to the container. This method walks the list of + added extensions and returns the first one that implements the requested type. + + of configuration interface required. + The requested extension's configuration interface, or null if not found. + + + + Remove all installed extensions from this container. + + + + This method removes all extensions from the container, including the default ones + that implement the out-of-the-box behavior. After this method, if you want to use + the container again you will need to either readd the default extensions or replace + them with your own. + + + The registered instances and singletons that have already been set up in this container + do not get removed. + + + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Create a child container. + + + A child container shares the parent's configuration, but can be configured with different + settings or lifetime. + The new child container. + + + + Dispose this container instance. + + + Disposing the container also disposes any child containers, + and disposes any instances whose lifetimes are managed + by the container. + + + + + Dispose this container instance. + + + This class doesn't have a finalizer, so will always be true. + True if being called from the IDisposable.Dispose + method, false if being called from a finalizer. + + + + Remove policies associated with building this type. This removes the + compiled build plan so that it can be rebuilt with the new settings + the next time this type is resolved. + + Type of object to clear the plan for. + Name the object is being registered with. + + + + The parent of this container. + + The parent container, or null if this container doesn't have one. + + + + Get a sequence of that describe the current state + of the container. + + + + + Implementation of the ExtensionContext that is actually used + by the UnityContainer implementation. + + + This is a nested class so that it can access state in the + container that would otherwise be inaccessible. + + + + + This event is raised when the method, + or one of its overloads, is called. + + + + + This extension supplies the default behavior of the UnityContainer API + by handling the context events and setting policies. + + + + + Install the default container behavior into the container. + + + + + Remove the default behavior from the container. + + + + + Helper class to wrap common reflection stuff dealing with + methods. + + + + + Create a new instance that + lets us do more reflection stuff on that method. + + The method to reflect on. + + + + Given our set of generic type arguments, + + The generic type arguments. + An array with closed parameter types. + + + + Returns true if any of the parameters of this method + are open generics. + + + + + Return the of each parameter for this + method. + + Sequence of objects, one for + each parameter in order. + + + + A helper class that encapsulates two different + data items together into a a single item. + + + + + Create a new containing + the two values give. + + First value + Second value + + + + The first value of the pair. + + + + + The second value of the pair. + + + + + Container for a Pair helper method. + + + + + A helper factory method that lets users take advantage of type inference. + + Type of first value. + Type of second value. + First value. + Second value. + A new instance. + + + + A utility class that handles the logic of matching parameter + lists, so we can find the right constructor and method overloads. + + + + + Create a new that will attempt to + match the given parameter types. + + Target parameters to match against. + + + + Tests to see if the given set of types matches the ones + we're looking for. + + parameter list to look for. + true if they match, false if they don't. + + + + Tests to see if the given set of types matches the ones we're looking for. + + Candidate method signature to look for. + True if they match, false if they don't. + + + + Another reflection helper class that has extra methods + for dealing with ParameterInfos. + + + + + A small helper class to encapsulate details of the + reflection API, particularly around generics. + + + + + Create a new instance that + lets you look at information about the given type. + + Type to do reflection on. + + + + Test the given object, looking at + the parameters. Determine if any of the parameters are + open generic types that need type attributes filled in. + + The method to check. + True if any of the parameters are open generics. False if not. + + + + If this type is an open generic, use the + given array to + determine what the required closed type is and return that. + + If the parameter is not an open type, just + return this parameter's type. + Type arguments to substitute in for + the open type parameters. + Corresponding closed type of this parameter. + + + + Given a generic argument name, return the corresponding type for this + closed type. For example, if the current type is SomeType<User>, and the + corresponding definition was SomeType<TSomething>, calling this method + and passing "TSomething" will return typeof(User). + + Name of the generic parameter. + Type of the corresponding generic parameter, or null if there + is no matching name. + + + + The object we're reflecting over. + + + + + Is this type generic? + + + + + Is this type an open generic (no type parameter specified) + + + + + Is this type an array type? + + + + + Is this type an array of generic elements? + + + + + The type of the elements in this type (if it's an array). + + + + + Create a new instance of that + lets you query information about the given ParameterInfo object. + + Parameter to query. + + + + A set of helper methods to pick through lambdas and pull out + from them. + + + + + Pull out a object from an expression of the form + () => SomeClass.SomeMethod() + + Expression describing the method to call. + Corresponding . + + + + Pull out a object from an expression of the form + x => x.SomeMethod() + + The type where the method is defined. + Expression describing the method to call. + Corresponding . + + + + Pull out a object for the get method from an expression of the form + x => x.SomeProperty + + The type where the method is defined. + The type for the property. + Expression describing the property for which the get method is to be extracted. + Corresponding . + + + + Pull out a object for the set method from an expression of the form + x => x.SomeProperty + + The type where the method is defined. + The type for the property. + Expression describing the property for which the set method is to be extracted. + Corresponding . + + + + Pull out a object from an expression of the form () => new SomeType() + + The type where the constructor is defined. + Expression invoking the desired constructor. + Corresponding . + + + diff --git a/Libs/Microsoft.Windows.Shell.dll b/Libs/Microsoft.Windows.Shell.dll new file mode 100644 index 0000000..8e44665 Binary files /dev/null and b/Libs/Microsoft.Windows.Shell.dll differ diff --git a/Libs/Microsoft.Windows.Shell.pdb b/Libs/Microsoft.Windows.Shell.pdb new file mode 100644 index 0000000..cbb7661 Binary files /dev/null and b/Libs/Microsoft.Windows.Shell.pdb differ diff --git a/Libs/NLog.Extended.dll b/Libs/NLog.Extended.dll new file mode 100644 index 0000000..2714263 Binary files /dev/null and b/Libs/NLog.Extended.dll differ diff --git a/Libs/NLog.dll b/Libs/NLog.dll new file mode 100644 index 0000000..88025f9 Binary files /dev/null and b/Libs/NLog.dll differ diff --git a/Libs/System.IO.Abstractions.dll b/Libs/System.IO.Abstractions.dll new file mode 100644 index 0000000..c8a10f8 Binary files /dev/null and b/Libs/System.IO.Abstractions.dll differ diff --git a/Libs/System.Windows.Interactivity.dll b/Libs/System.Windows.Interactivity.dll new file mode 100644 index 0000000..0419e95 Binary files /dev/null and b/Libs/System.Windows.Interactivity.dll differ diff --git a/Libs/WPF.Themes.dll b/Libs/WPF.Themes.dll new file mode 100644 index 0000000..f6df90d Binary files /dev/null and b/Libs/WPF.Themes.dll differ diff --git a/Libs/WPFToolkit.Extended.dll b/Libs/WPFToolkit.Extended.dll new file mode 100644 index 0000000..ae9f815 Binary files /dev/null and b/Libs/WPFToolkit.Extended.dll differ diff --git a/Src/Wide.Core/CoreModule.cs b/Src/Wide.Core/CoreModule.cs new file mode 100644 index 0000000..b5cfa84 --- /dev/null +++ b/Src/Wide.Core/CoreModule.cs @@ -0,0 +1,126 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using Wide.Core.Logging; +using Wide.Core.Services; +using Wide.Interfaces; +using Wide.Interfaces.Events; +using Wide.Interfaces.Services; +using Microsoft.Practices.Prism.Commands; +using Microsoft.Practices.Prism.Events; +using Microsoft.Practices.Prism.Modularity; +using Microsoft.Practices.Unity; +using System.Windows.Controls; +using Wide.Interfaces.Themes; +using CommandManager = Wide.Core.Services.CommandManager; + +namespace Wide.Core +{ + public class CoreModule : IModule + { + private readonly IUnityContainer _container; + + public CoreModule(IUnityContainer container) + { + _container = container; + } + + public void Initialize() + { + EventAggregator.GetEvent().Publish(new SplashMessageUpdateEvent { Message = "Loading Core Module" }); + _container.RegisterType(); + _container.RegisterType(); + _container.RegisterType(); + _container.RegisterType(); + + _container.RegisterType(new ContainerControlledLifetimeManager()); + _container.RegisterType(new ContainerControlledLifetimeManager()); + _container.RegisterType(new ContainerControlledLifetimeManager()); + _container.RegisterType(new ContainerControlledLifetimeManager()); + _container.RegisterType(new ContainerControlledLifetimeManager()); + _container.RegisterType(new ContainerControlledLifetimeManager()); + _container.RegisterType(new ContainerControlledLifetimeManager(), new InjectionConstructor(new InjectionParameter(typeof(string), "$MAIN$"), new InjectionParameter(typeof(int), 1), new InjectionParameter(typeof(ImageSource), null), new InjectionParameter(typeof(ICommand), null), new InjectionParameter(typeof(KeyGesture), null), new InjectionParameter(typeof(bool), false), new InjectionParameter(typeof(IUnityContainer), this._container))); + _container.RegisterType(new InjectionConstructor(new InjectionParameter(typeof(string), "$MAIN$"), new InjectionParameter(typeof(int), 1), new InjectionParameter(typeof(ImageSource), null), new InjectionParameter(typeof(ICommand), null), new InjectionParameter(typeof(bool), false), new InjectionParameter(typeof(IUnityContainer), this._container))); + + //Register a default file opener + IContentHandlerRegistry registry = _container.Resolve(); + registry.Register(_container.Resolve()); + + AppCommands(); + AppTheme(); + //AppMenu(); + //AppToolbar(); + + //Try resolving a workspace + IWorkspace workspace; + try + { + workspace = _container.Resolve(); + } + catch + { + _container.RegisterType(new ContainerControlledLifetimeManager()); + } + } + + private void AppCommands() + { + ICommandManager manager = _container.Resolve(); + + //TODO: Check if you can hook up to the Workspace.ActiveDocument.CloseCommand + DelegateCommand closeCommand = new DelegateCommand(CloseDocument, CanExecuteCloseDocument); + manager.RegisterCommand("CLOSE", closeCommand); + } + + #region Commands + private bool CanExecuteCloseDocument() + { + IWorkspace workspace = _container.Resolve(); + return workspace.ActiveDocument != null; + } + + private void CloseDocument() + { + IWorkspace workspace = _container.Resolve(); + MessageBoxResult res = MessageBoxResult.Cancel; + if (workspace.ActiveDocument.Model.IsDirty) + { + //means the document is dirty - show a message box and then handle based on the user's selection + res = MessageBox.Show(string.Format("Save changes for document '{0}'?", workspace.ActiveDocument.Title), "Are you sure?", MessageBoxButton.YesNoCancel); + if (res == MessageBoxResult.Yes) + { + workspace.ActiveDocument.Handler.SaveContent(workspace.ActiveDocument); + } + if (res != MessageBoxResult.Cancel) + { + workspace.Documents.Remove(workspace.ActiveDocument); + } + } + else + { + workspace.Documents.Remove(workspace.ActiveDocument); + } + + } + #endregion + + private void AppTheme() + { + IThemeManager manager = _container.Resolve(); + //manager.AddTheme(new DefaultTheme()); + //manager.AddTheme(new DarkTheme()); + } + + private IEventAggregator EventAggregator + { + get { return _container.Resolve(); } + } + } +} diff --git a/Src/Wide.Core/NLog.config b/Src/Wide.Core/NLog.config new file mode 100644 index 0000000..be0ff38 --- /dev/null +++ b/Src/Wide.Core/NLog.config @@ -0,0 +1,12 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Src/Wide.Core/Properties/AssemblyInfo.cs b/Src/Wide.Core/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..628413d --- /dev/null +++ b/Src/Wide.Core/Properties/AssemblyInfo.cs @@ -0,0 +1,55 @@ +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Wide.Core")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Wide.Core")] +[assembly: AssemblyCopyright("Copyright © 2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +//In order to begin building localizable applications, set +//CultureYouAreCodingWith in your .csproj file +//inside a . For example, if you are using US english +//in your source files, set the to en-US. Then uncomment +//the NeutralResourceLanguage attribute below. Update the "en-US" in +//the line below to match the UICulture setting in the project file. + +//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] + + +[assembly:ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] + + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Src/Wide.Core/Properties/Resources.Designer.cs b/Src/Wide.Core/Properties/Resources.Designer.cs new file mode 100644 index 0000000..3c3c98c --- /dev/null +++ b/Src/Wide.Core/Properties/Resources.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.18010 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Wide.Core.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Wide.Core.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/Src/Wide.Core/Properties/Resources.resx b/Src/Wide.Core/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/Src/Wide.Core/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Src/Wide.Core/Properties/Settings.Designer.cs b/Src/Wide.Core/Properties/Settings.Designer.cs new file mode 100644 index 0000000..4fa73a9 --- /dev/null +++ b/Src/Wide.Core/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.18010 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Wide.Core.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + } +} diff --git a/Src/Wide.Core/Properties/Settings.settings b/Src/Wide.Core/Properties/Settings.settings new file mode 100644 index 0000000..033d7a5 --- /dev/null +++ b/Src/Wide.Core/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Src/Wide.Core/Services/CommandManager.cs b/Src/Wide.Core/Services/CommandManager.cs new file mode 100644 index 0000000..73a871d --- /dev/null +++ b/Src/Wide.Core/Services/CommandManager.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Windows.Input; +using Microsoft.Practices.Prism.Commands; +using Wide.Interfaces.Services; + +namespace Wide.Core.Services +{ + internal sealed class CommandManager : ICommandManager + { + private Dictionary _commands; + + public CommandManager() + { + _commands = new Dictionary(); + } + + public bool RegisterCommand(string name, ICommand command) + { + if(_commands.ContainsKey(name)) + throw new Exception("Commmand " + name + " already exists !"); + + _commands.Add(name, command); + return true; + } + + public ICommand GetCommand(string name) + { + if (_commands.ContainsKey(name)) + return _commands[name]; + return null; + } + + + public void Refresh() + { + foreach (KeyValuePair keyValuePair in _commands) + { + if (keyValuePair.Value is DelegateCommand) + { + DelegateCommand c = keyValuePair.Value as DelegateCommand; + c.RaiseCanExecuteChanged(); + } + } + } + } +} diff --git a/Src/Wide.Core/Services/ContentHandlerRegistry.cs b/Src/Wide.Core/Services/ContentHandlerRegistry.cs new file mode 100644 index 0000000..696fd98 --- /dev/null +++ b/Src/Wide.Core/Services/ContentHandlerRegistry.cs @@ -0,0 +1,60 @@ +using System.Collections.Generic; +using Wide.Interfaces; +using Wide.Interfaces.Services; +using Microsoft.Practices.Unity; + +namespace Wide.Core.Services +{ + internal sealed class ContentHandlerRegistry : IContentHandlerRegistry + { + private List _contentHandlers; + private IUnityContainer _container; + + public ContentHandlerRegistry(IUnityContainer container) + { + _contentHandlers = new List(); + _container = container; + } + + public bool Register(IContentHandler handler) + { + _contentHandlers.Add(handler); + return true; + } + + public bool Unregister(IContentHandler handler) + { + return _contentHandlers.Remove(handler); + } + + #region Get the view model + public ContentViewModel GetViewModel(object info) + { + foreach (var opener in _contentHandlers) + { + if(opener.ValidateContentType(info)) + { + ContentViewModel vm = opener.OpenContent(info); + vm.Handler = opener; + return vm; + } + } + return null; + } + + public ContentViewModel GetViewModelFromContentId(string contentId) + { + foreach (var opener in _contentHandlers) + { + if (opener.ValidateContentFromId(contentId)) + { + ContentViewModel vm = opener.OpenContentFromId(contentId); + vm.Handler = opener; + return vm; + } + } + return null; + } + #endregion + } +} diff --git a/Src/Wide.Core/Services/NLogService.cs b/Src/Wide.Core/Services/NLogService.cs new file mode 100644 index 0000000..f1e0111 --- /dev/null +++ b/Src/Wide.Core/Services/NLogService.cs @@ -0,0 +1,47 @@ +using System.Diagnostics; +using System.Reflection; +using Wide.Interfaces.Events; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Microsoft.Practices.Prism.Events; +using NLog; +using Wide.Interfaces.Services; + +namespace Wide.Core.Logging +{ + public class NLogService : ILoggerService + { + private readonly IEventAggregator _aggregator; + private static Logger logger = LogManager.GetLogger("Wide"); + + private NLogService() + { + } + + public NLogService(IEventAggregator aggregator) + { + _aggregator = aggregator; + } + + public void Log(string message, LogCategory category, LogPriority priority) + { + this.Message = message; + this.Category = category; + this.Priority = priority; + + StackTrace trace = new StackTrace(); + StackFrame frame = trace.GetFrame(1); // 0 will be the inner-most method + MethodBase method = frame.GetMethod(); + + logger.Log(LogLevel.Error,method.DeclaringType + ": " + message); + + _aggregator.GetEvent().Publish(new NLogService(){Message = this.Message, Category = this.Category, Priority = this.Priority}); + } + + public string Message { get; internal set; } + public LogCategory Category { get; internal set; } + public LogPriority Priority { get; internal set; } + } +} diff --git a/Src/Wide.Core/Services/OpenFileService.cs b/Src/Wide.Core/Services/OpenFileService.cs new file mode 100644 index 0000000..02e4bd8 --- /dev/null +++ b/Src/Wide.Core/Services/OpenFileService.cs @@ -0,0 +1,119 @@ +using Wide.Interfaces; +using Wide.Interfaces.Events; +using Wide.Interfaces.Services; +using Microsoft.Practices.Prism.Events; +using Microsoft.Practices.Unity; +using Microsoft.Win32; + +namespace Wide.Core.Services +{ + internal sealed class OpenFileService : IOpenFileService + { + private IUnityContainer _container; + private IEventAggregator _eventAggregator; + private ILoggerService _logger; + + public OpenFileService(IUnityContainer container, IEventAggregator eventAggregator,ILoggerService logger) + { + _container = container; + _eventAggregator = eventAggregator; + _logger = logger; + } + + public ContentViewModel Open(object location = null) + { + IWorkspace workspace = _container.Resolve(); + + OpenFileDialog dialog = new OpenFileDialog(); + bool? result = false; + + if(location == null) + { + result = dialog.ShowDialog(); + location = dialog.FileName; + } + else + { + result = true; + } + + if (result == true && !string.IsNullOrWhiteSpace(location.ToString())) + { + IContentHandlerRegistry handler = _container.Resolve(); + + //Let the handler figure out which view model to return + ContentViewModel openValue = handler.GetViewModel(location); + + if (openValue != null) + { + //Check if the document is already open + foreach (ContentViewModel contentViewModel in workspace.Documents) + { + if (contentViewModel.Model.Location.Equals(openValue.Model.Location)) + { + _logger.Log("Document " + contentViewModel.Model.Location.ToString() + "already open - making it active", LogCategory.Info, LogPriority.Low); + workspace.ActiveDocument = contentViewModel; + return contentViewModel; + } + } + + _logger.Log("Opening file" + location.ToString() + " !!", LogCategory.Info, LogPriority.Low); + + // Publish the event to the Application - subscribers can use this object + _eventAggregator.GetEvent().Publish(openValue); + + //Add it to the actual workspace + workspace.Documents.Add(openValue); + + //Make it the active document + workspace.ActiveDocument = openValue; + } + else + { + _logger.Log("Unable to find a IContentHandler to open " + location.ToString(), LogCategory.Error, LogPriority.High); + } + } + else + { + _logger.Log("Canceled out of open file dialog", LogCategory.Info, LogPriority.Low); + } + return null; + } + + public ContentViewModel OpenFromID(string contentID) + { + IWorkspace workspace = _container.Resolve(); + IContentHandlerRegistry handler = _container.Resolve(); + + //Let the handler figure out which view model to return + ContentViewModel openValue = handler.GetViewModelFromContentId(contentID); + + if (openValue != null) + { + //Check if the document is already open + foreach (ContentViewModel contentViewModel in workspace.Documents) + { + if (contentViewModel.Model.Location.Equals(openValue.Model.Location)) + { + _logger.Log("Document " + contentViewModel.Model.Location.ToString() + "already open.", LogCategory.Info, LogPriority.Low); + return contentViewModel; + } + } + + _logger.Log("Opening content with " + contentID + " !!", LogCategory.Info, LogPriority.Low); + + // Publish the event to the Application - subscribers can use this object + _eventAggregator.GetEvent().Publish(openValue); + + workspace.Documents.Add(openValue); + + return openValue; + } + else + { + _logger.Log("Unable to find a IContentHandler to open content with ID = " + contentID, LogCategory.Error, LogPriority.High); + } + return null; + } + } +} diff --git a/Src/Wide.Core/Services/ThemeManager.cs b/Src/Wide.Core/Services/ThemeManager.cs new file mode 100644 index 0000000..75162d8 --- /dev/null +++ b/Src/Wide.Core/Services/ThemeManager.cs @@ -0,0 +1,79 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Text; +using System.Windows; +using Microsoft.Practices.Prism.Commands; +using Wide.Interfaces; +using Wide.Interfaces.Events; +using Wide.Interfaces.Services; +using Microsoft.Practices.Prism.Events; + +namespace Wide.Core.Services +{ + internal sealed class ThemeManager : IThemeManager + { + private static readonly Dictionary ThemeDictionary = new Dictionary(); + + private IEventAggregator _eventAggregator; + private ILoggerService _logger; + + public ThemeManager(IEventAggregator eventAggregator, ILoggerService logger) + { + Themes = new ObservableCollection(); + _eventAggregator = eventAggregator; + _logger = logger; + } + + public ObservableCollection Themes { get; internal set; } + + public ITheme CurrentTheme { get; internal set; } + + public bool SetCurrent(string name) + { + if(ThemeDictionary.ContainsKey(name)) + { + ITheme newTheme = ThemeDictionary[name]; + this.CurrentTheme = newTheme; + + ResourceDictionary theme = Application.Current.MainWindow.Resources.MergedDictionaries[0]; + ResourceDictionary appTheme = Application.Current.Resources.MergedDictionaries.Count > 0 ? Application.Current.Resources.MergedDictionaries[0] : null; + theme.MergedDictionaries.Clear(); + if(appTheme != null) + { + appTheme.MergedDictionaries.Clear(); + } + else + { + appTheme = new ResourceDictionary(); + Application.Current.Resources.MergedDictionaries.Add(appTheme); + } + appTheme.MergedDictionaries.Clear(); + foreach (var uri in newTheme.UriList) + { + theme.MergedDictionaries.Add(new ResourceDictionary() { Source = uri }); + if(uri.ToString().Contains("AvalonDock") && appTheme != null) + { + appTheme.MergedDictionaries.Add(new ResourceDictionary() {Source = uri}); + } + } + _logger.Log("Theme set to " + name, LogCategory.Info, LogPriority.None); + _eventAggregator.GetEvent().Publish(newTheme); + } + return false; + } + + public bool AddTheme(ITheme theme) + { + if(!ThemeDictionary.ContainsKey(theme.Name)) + { + //theme.UriList.Add(new Uri("pack://application:,,,/Wide.Core;component/Styles/MenuResource.xaml")); + ThemeDictionary.Add(theme.Name,theme); + Themes.Add(theme); + return true; + } + return false; + } + } +} diff --git a/Src/Wide.Core/Services/ToolbarService.cs b/Src/Wide.Core/Services/ToolbarService.cs new file mode 100644 index 0000000..3c5dc90 --- /dev/null +++ b/Src/Wide.Core/Services/ToolbarService.cs @@ -0,0 +1,75 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Markup; +using Microsoft.Practices.Unity; +using Wide.Interfaces; +using Wide.Interfaces.Services; + +namespace Wide.Core.Services +{ + internal sealed class ToolbarService : IToolbarService + { + private IUnityContainer _container; + private static Dictionary ToolbarDictionary = new Dictionary(); + + public ToolbarService(IUnityContainer container) + { + this._container = container; + } + + public bool Add(ToolbarViewModel item) + { + if (!ToolbarDictionary.ContainsKey(item.Key)) + { + ToolbarDictionary.Add(item.Key, item); + return true; + } + return false; + } + + public bool Remove(string key) + { + if (ToolbarDictionary.ContainsKey(key)) + { + ToolbarDictionary.Remove(key); + return true; + } + return false; + } + + public ToolbarViewModel Get(string key) + { + if(ToolbarDictionary.ContainsKey(key)) + { + return ToolbarDictionary[key]; + } + return null; + } + + public ToolBarTray ToolBarTray + { + get + { + ToolBarTray tray = new ToolBarTray(); + IAddChild child = tray; + foreach (KeyValuePair valuePair in ToolbarDictionary) + { + ToolBar tb = new ToolBar(); + DataTemplateSelector t = Application.Current.MainWindow.FindResource("toolBarItemTemplateSelector") as DataTemplateSelector; + tb.SetValue(ToolBar.ItemTemplateSelectorProperty, t); + //Need to set these by binding + tb.Band = valuePair.Value.Band; + tb.BandIndex = valuePair.Value.BandIndex; + + tb.ItemsSource = valuePair.Value.Children; + child.AddChild(tb); + } + return tray; + } + } + } +} diff --git a/Src/Wide.Core/TextDocument/AllFileHandler.cs b/Src/Wide.Core/TextDocument/AllFileHandler.cs new file mode 100644 index 0000000..34ebf3c --- /dev/null +++ b/Src/Wide.Core/TextDocument/AllFileHandler.cs @@ -0,0 +1,148 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using Microsoft.Practices.Unity; +using Wide.Interfaces; +using Wide.Interfaces.Services; +using System.Text.RegularExpressions; + +namespace Wide.Core +{ + internal class AllFileHandler : IContentHandler + { + private IUnityContainer _container; + private IOpenFileService _fileService; + private ILoggerService _loggerService; + + public AllFileHandler(IUnityContainer container, ILoggerService loggerService, IOpenFileService openFileService) + { + this._container = container; + _loggerService = loggerService; + _fileService = openFileService; + } + + public bool ValidateContentType(object info) + { + string location = info as string; + if(location != null) + { + return File.Exists(location); + } + return false; + } + + + public bool ValidateContentFromId(string contentId) + { + string[] split = Regex.Split(contentId,":##:"); + if (split.Count() == 2) + { + string identifier = split[0]; + string path = split[1]; + if (identifier == "FILE" && File.Exists(path)) + { + return true; + } + } + return false; + } + + public ContentViewModel OpenContent(object info) + { + string location = info as string; + if (location != null) + { + TextViewModel vm = _container.Resolve(); + TextModel model = _container.Resolve(); + TextView view = _container.Resolve(); + + //Model details + model.PropertyChanged += vm.ModelOnPropertyChanged; + model.Location = info; + try + { + model.Document.Text = File.ReadAllText(location); + model.IsDirty = false; + } + catch (Exception exception) + { + _loggerService.Log(exception.Message, LogCategory.Exception, LogPriority.High); + _loggerService.Log(exception.StackTrace, LogCategory.Exception, LogPriority.High); + return null; + } + + //Clear the undo stack + model.Document.UndoStack.ClearAll(); + + //Set the model and view + vm.Model = model; + vm.View = view; + vm.Title = Path.GetFileName(location); + vm.View.DataContext = model; + + return vm; + } + return null; + } + + public ContentViewModel OpenContentFromId(string contentId) + { + string[] split = Regex.Split(contentId, ":##:"); + if (split.Count() == 2) + { + string identifier = split[0]; + string path = split[1]; + if (identifier == "FILE" && File.Exists(path)) + { + return this.OpenContent(path); + } + } + return null; + } + + public bool SaveContent(ContentViewModel contentViewModel, bool saveAs = false) + { + TextViewModel textViewModel = contentViewModel as TextViewModel; + + if(textViewModel == null) + { + _loggerService.Log("ContentViewModel needs to be a TextViewModel to save details", LogCategory.Exception, LogPriority.High); + throw new ArgumentException("ContentViewModel needs to be a TextViewModel to save details"); + } + + TextModel textModel = textViewModel.Model as TextModel; + + if(textModel == null) + { + _loggerService.Log("TextViewModel does not have a TextModel which should have the text", LogCategory.Exception, LogPriority.High); + throw new ArgumentException("TextViewModel does not have a TextModel which should have the text"); + } + + if(saveAs) + { + //TODO: Save as...? + } + else + { + //Regular save + string location = textModel.Location as string; + try + { + File.WriteAllText(location, textModel.Document.Text); + textModel.IsDirty = false; + return true; + } + catch (Exception exception) + { + _loggerService.Log(exception.Message, LogCategory.Exception, LogPriority.High); + _loggerService.Log(exception.StackTrace, LogCategory.Exception, LogPriority.High); + return false; + } + } + + return false; + } + } +} diff --git a/Src/Wide.Core/TextDocument/TextModel.cs b/Src/Wide.Core/TextDocument/TextModel.cs new file mode 100644 index 0000000..4fa63f4 --- /dev/null +++ b/Src/Wide.Core/TextDocument/TextModel.cs @@ -0,0 +1,55 @@ +using System; +using System.ComponentModel; +using ICSharpCode.AvalonEdit.Document; +using Wide.Interfaces; +using Wide.Interfaces.Services; + +namespace Wide.Core +{ + public class TextModel : ContentModel + { + protected string _oldText; + private ICommandManager _commandManager; + + public TextModel(ICommandManager commandManager) + { + Document = new TextDocument(); + _commandManager = commandManager; + Document.PropertyChanged += Document_PropertyChanged; + Document.TextChanged += DocumentOnTextChanged; + _oldText = ""; + } + + private void DocumentOnTextChanged(object sender, EventArgs eventArgs) + { + IsDirty = (_oldText != Document.Text); + } + + void Document_PropertyChanged(object sender, PropertyChangedEventArgs e) + { + RaisePropertyChanged("Document"); + } + + public override bool IsDirty + { + get + { + return base.IsDirty; + } + set + { + base.IsDirty = value; + if(value == false) + { + _oldText = Document.Text; + } + else + { + _commandManager.Refresh(); + } + } + } + + public TextDocument Document { get; protected set; } + } +} \ No newline at end of file diff --git a/Src/Wide.Core/TextDocument/TextView.xaml b/Src/Wide.Core/TextDocument/TextView.xaml new file mode 100644 index 0000000..e7c3182 --- /dev/null +++ b/Src/Wide.Core/TextDocument/TextView.xaml @@ -0,0 +1,9 @@ + + + diff --git a/Src/Wide.Core/TextDocument/TextView.xaml.cs b/Src/Wide.Core/TextDocument/TextView.xaml.cs new file mode 100644 index 0000000..eb8d800 --- /dev/null +++ b/Src/Wide.Core/TextDocument/TextView.xaml.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; +using Wide.Interfaces; + +namespace Wide.Core +{ + /// + /// Interaction logic for TextView.xaml + /// + public partial class TextView : UserControl, IContentView + { + public TextView() + { + InitializeComponent(); + } + } +} diff --git a/Src/Wide.Core/TextDocument/TextViewModel.cs b/Src/Wide.Core/TextDocument/TextViewModel.cs new file mode 100644 index 0000000..74ee3c6 --- /dev/null +++ b/Src/Wide.Core/TextDocument/TextViewModel.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Input; +using Wide.Interfaces; +using Microsoft.Practices.Prism.Commands; +using Microsoft.Practices.Unity; +using Wide.Interfaces.Services; + +namespace Wide.Core +{ + internal class TextViewModel : ContentViewModel + { + public TextViewModel(AbstractWorkspace workspace, ICommandManager commandManager, ILoggerService logger):base(workspace, commandManager, logger) + { + } + + public override string Tooltip + { + get { return Model.Location as String; } + protected set { base.Tooltip = value; } + } + + public override string ContentId + { + get { return "FILE:##:" + Tooltip; } + } + } +} diff --git a/Src/Wide.Core/Wide.Core.csproj b/Src/Wide.Core/Wide.Core.csproj new file mode 100644 index 0000000..d21ebd2 --- /dev/null +++ b/Src/Wide.Core/Wide.Core.csproj @@ -0,0 +1,158 @@ + + + + + Debug + AnyCPU + {2155B852-E4EC-4BD1-9255-21CFAEADF268} + library + Properties + Wide.Core + Wide.Core + v4.0 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + + + + true + full + false + ..\..\Build\Internal\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + ..\..\Build\Internal\ + TRACE + prompt + 4 + + + + ..\..\Libs\ICSharpCode.AvalonEdit.dll + False + + + ..\..\Libs\MahApps.Metro.dll + False + + + ..\..\Libs\MahApps.Metro.Resources.dll + False + + + ..\..\Libs\Microsoft.Practices.Prism.dll + False + + + ..\..\Libs\Microsoft.Practices.Prism.Interactivity.dll + False + + + ..\..\Libs\Microsoft.Practices.Prism.MefExtensions.dll + False + + + ..\..\Libs\Microsoft.Practices.Prism.UnityExtensions.dll + False + + + ..\..\Libs\Microsoft.Practices.ServiceLocation.dll + False + + + ..\..\Libs\Microsoft.Practices.Unity.dll + False + + + ..\..\Libs\NLog.dll + False + + + ..\..\Libs\NLog.Extended.dll + False + + + + + + + + + + 4.0 + + + + + + + + + + + + + + TextView.xaml + + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + {9f20f5ef-4f7e-4ae2-a462-4cd2256fb3ff} + Wide.Interfaces + False + + + + + Designer + MSBuild:Compile + + + + + + copy "$(ProjectDir)NLog.config" "..\..\Build\NLog.config" + + + \ No newline at end of file diff --git a/Src/Wide.Core/Workspace.cs b/Src/Wide.Core/Workspace.cs new file mode 100644 index 0000000..814a476 --- /dev/null +++ b/Src/Wide.Core/Workspace.cs @@ -0,0 +1,16 @@ +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Windows.Controls; +using Wide.Interfaces; +using Wide.Interfaces.Services; +using Microsoft.Practices.Unity; + +namespace Wide.Core +{ + public class Workspace : AbstractWorkspace + { + public Workspace(IUnityContainer container) : base(container) + { + } + } +} diff --git a/Src/Wide.Interfaces/AbstractWorkspace.cs b/Src/Wide.Interfaces/AbstractWorkspace.cs new file mode 100644 index 0000000..c3c176c --- /dev/null +++ b/Src/Wide.Interfaces/AbstractWorkspace.cs @@ -0,0 +1,115 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Text; +using System.Windows.Controls; +using System.Windows.Media; +using Microsoft.Practices.Unity; +using Wide.Interfaces.Services; + +namespace Wide.Interfaces +{ + public abstract class AbstractWorkspace : ViewModelBase, IWorkspace + { + private IUnityContainer _container; + + protected ObservableCollection _docs = new ObservableCollection(); + protected ObservableCollection _tools = new ObservableCollection(); + protected ICommandManager _commandManager; + protected MenuItemViewModel _menus; + protected IToolbarService _toolbarService; + + public AbstractWorkspace(IUnityContainer container) + { + _container = container; + _docs = new ObservableCollection(); + _tools = new ObservableCollection(); + _menus = _container.Resolve() as MenuItemViewModel; + _menus.PropertyChanged += _menus_PropertyChanged; + _toolbarService = _container.Resolve(); + _commandManager = _container.Resolve(); + } + + + private void _menus_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) + { + RaisePropertyChanged("Menus"); + } + + public ObservableCollection Documents + { + get { return _docs; } + set { _docs = value; } + } + + public ObservableCollection Tools + { + get { return _tools; } + set { _tools = value; } + } + + public IList Menus + { + get + { + return _menus.Children; + } + } + + public IList EditToolBar + { + get + { + return _menus.Get("_Edit").Children; + } + } + + private ContentViewModel _activeDocument = null; + + public ContentViewModel ActiveDocument + { + get { return _activeDocument; } + set + { + if (_activeDocument != value) + { + _activeDocument = value; + RaisePropertyChanged("ActiveDocument"); + _commandManager.Refresh(); + //TODO: Implement pub/sub Active document changed event + } + } + } + + public virtual string Title + { + get { return "Wide"; } + } + + public virtual ImageSource Icon { get; protected set; } + + public virtual bool Closing() + { + for (int i = 0; i < Documents.Count; i++) + { + ContentViewModel vm = Documents[i]; + if (vm.Model.IsDirty) + { + this.ActiveDocument = vm; + if (!vm.CloseDocument(false)) + { + return false; + } + } + } + return true; + } + + public ToolBarTray ToolBarTray + { + get { return _toolbarService.ToolBarTray; } + } + } + +} diff --git a/Src/Wide.Interfaces/Base/AbstractPrioritizedTree.cs b/Src/Wide.Interfaces/Base/AbstractPrioritizedTree.cs new file mode 100644 index 0000000..7ada449 --- /dev/null +++ b/Src/Wide.Interfaces/Base/AbstractPrioritizedTree.cs @@ -0,0 +1,67 @@ +using System; +using System.Collections.ObjectModel; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; + +namespace Wide.Interfaces +{ + public abstract class AbstractPrioritizedTree : ViewModelBase, IPrioritizedTree + where T : IPrioritizedTree + { + protected ObservableCollection _children; + + public AbstractPrioritizedTree() + { + _children = new ObservableCollection(); + } + + public virtual bool Add(T item) + { + _children.Add(item); + RaisePropertyChanged("Children"); + return true; + } + + public virtual bool Remove(string key) + { + IEnumerable items = _children.Where(f => f.Key == key); + if (items.Any()) + { + _children.Remove(items.ElementAt(0)); + RaisePropertyChanged("Children"); + return true; + } + return false; + } + + public virtual T Get(string key) + { + IEnumerable items = _children.Where(f => f.Key == key); + if (items.Any()) + { + return items.ElementAt(0); + } + return default(T); + } + + [Browsable(false)] + public virtual ReadOnlyObservableCollection Children + { + get + { + var order = from c in _children + orderby c.Priority + select c; + return new ReadOnlyObservableCollection(new ObservableCollection(order.ToList())); + } + } + + [Browsable(false)] + public virtual int Priority { get; protected set; } + + [Browsable(false)] + public virtual string Key { get; protected set; } + } +} diff --git a/Src/Wide.Interfaces/Base/ICommandable.cs b/Src/Wide.Interfaces/Base/ICommandable.cs new file mode 100644 index 0000000..1735626 --- /dev/null +++ b/Src/Wide.Interfaces/Base/ICommandable.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows.Input; + +namespace Wide.Interfaces +{ + internal interface ICommandable + { + ICommand Command { get; } + object CommandParameter { get; set; } + string InputGestureText { get; } + } +} diff --git a/Src/Wide.Interfaces/Base/IPrioritizedTree.cs b/Src/Wide.Interfaces/Base/IPrioritizedTree.cs new file mode 100644 index 0000000..efa1ac6 --- /dev/null +++ b/Src/Wide.Interfaces/Base/IPrioritizedTree.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Text; + +namespace Wide.Interfaces +{ + public interface IPrioritizedTree + { + bool Add(T item); + bool Remove(string key); + T Get(string key); + ReadOnlyObservableCollection Children { get; } + int Priority { get; } + string Key { get; } + } +} diff --git a/Src/Wide.Interfaces/ContentModel.cs b/Src/Wide.Interfaces/ContentModel.cs new file mode 100644 index 0000000..33c7b80 --- /dev/null +++ b/Src/Wide.Interfaces/ContentModel.cs @@ -0,0 +1,37 @@ +using System.ComponentModel; + +namespace Wide.Interfaces +{ + public abstract class ContentModel + { + protected bool _isDirty; + + /// + /// The document location - could be a file location/server object etc. + /// + public virtual object Location { get; set; } + + /// + /// Is the document dirty - does it need to be saved? + /// + public virtual bool IsDirty + { + get { return _isDirty; } + set + { + _isDirty = value; + RaisePropertyChanged("IsDirty"); + } + } + + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void RaisePropertyChanged(string propertyName) + { + if (PropertyChanged != null) + { + PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); + } + } + } +} \ No newline at end of file diff --git a/Src/Wide.Interfaces/ContentViewModel.cs b/Src/Wide.Interfaces/ContentViewModel.cs new file mode 100644 index 0000000..60c86ac --- /dev/null +++ b/Src/Wide.Interfaces/ContentViewModel.cs @@ -0,0 +1,208 @@ +using System; +using System.ComponentModel; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Input; +using System.Windows.Media; +using Microsoft.Practices.Prism.Commands; +using Wide.Interfaces.Services; + +namespace Wide.Interfaces +{ + /// + /// The abstract class which has to be inherited if you want to create a document + /// + public abstract class ContentViewModel : ViewModelBase + { + #region Members + /// + /// The static count value for "Untitled" number. + /// + protected static int Count = 1; + + protected string _tooltip = null; + protected string _title = null; + protected string _contentId = null; + protected bool _isSelected = false; + protected bool _isActive = false; + protected ICommandManager _commandManager; + protected IWorkspace _workspace; + protected ILoggerService _logger; + #endregion + + #region CTOR + protected ContentViewModel(AbstractWorkspace workspace, ICommandManager commandManager, ILoggerService logger) + { + _workspace = workspace; + _commandManager = commandManager; + _logger = logger; + CloseCommand = new DelegateCommand(CloseDocument); + } + #endregion + + #region Property + + public virtual ICommand CloseCommand { get; set; } + + /// + /// The content model + /// + public virtual ContentModel Model { get; internal set; } + + /// + /// The content view + /// + public virtual UserControl View { get; internal set; } + + /// + /// The title of the document + /// + public virtual string Title + { + get + { + if(Model.IsDirty) + { + return _title + "*"; + } + return _title; + } + set + { + if (_title != value) + { + _title = value; + RaisePropertyChanged("Title"); + } + } + } + + /// + /// The title of the document + /// + public virtual string Tooltip + { + get + { + return _tooltip; + } + protected set + { + if (_tooltip != value) + { + _tooltip = value; + RaisePropertyChanged("Tooltip"); + } + } + } + + /// + /// The image souce that can be used as an icon in the tab + /// + public virtual ImageSource IconSource + { + get; + protected set; + } + + /// + /// The content ID - unique value for each document + /// + public virtual string ContentId + { + get { return _contentId; } + protected set + { + if (_contentId != value) + { + _contentId = value; + RaisePropertyChanged("ContentId"); + } + } + } + + /// + /// Is the document selected + /// + public virtual bool IsSelected + { + get { return _isSelected; } + set + { + if (_isSelected != value) + { + _isSelected = value; + RaisePropertyChanged("IsSelected"); + } + } + } + + /// + /// Is the document active + /// + public virtual bool IsActive + { + get { return _isActive; } + set + { + if (_isActive != value) + { + _isActive = value; + RaisePropertyChanged("IsActive"); + } + } + } + + /// + /// The content handler which does save and load of the file + /// + public IContentHandler Handler { get; internal set; } + + internal virtual void ModelOnPropertyChanged(object sender, PropertyChangedEventArgs propertyChangedEventArgs) + { + RaisePropertyChanged("Title"); + } + #endregion + + #region Methods + //Needed for content handlers to restore the layout + public bool CloseDocument(bool remove) + { + MessageBoxResult res = MessageBoxResult.Cancel; + if (this.Model.IsDirty) + { + //means the document is dirty - show a message box and then handle based on the user's selection + res = MessageBox.Show(string.Format("Save changes for document '{0}'?", this.Title), "Are you sure?", MessageBoxButton.YesNoCancel); + if (res == MessageBoxResult.Yes) + { + this.Handler.SaveContent(this); + } + if (res != MessageBoxResult.Cancel) + { + if(remove) + { + _workspace.Documents.Remove(this); + } + return true; + } + } + else + { + if (remove) + { + _logger.Log("Closing document " + this.Model.Location.ToString(), LogCategory.Info, LogPriority.None); + _workspace.Documents.Remove(this); + return true; + } + } + return false; + + } + + internal void CloseDocument() + { + CloseDocument(true); + } + #endregion + } +} \ No newline at end of file diff --git a/Src/Wide.Interfaces/Controls/AbstractCommandable.cs b/Src/Wide.Interfaces/Controls/AbstractCommandable.cs new file mode 100644 index 0000000..eca1933 --- /dev/null +++ b/Src/Wide.Interfaces/Controls/AbstractCommandable.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows.Input; + +namespace Wide.Interfaces +{ + public class AbstractCommandable : AbstractPrioritizedTree, ICommandable + { + #region CTOR + public AbstractCommandable() : base() {} + #endregion + + #region ICommandable + public virtual ICommand Command { get; internal set; } + + public virtual object CommandParameter { get; set; } + + public string InputGestureText { get; internal set; } + #endregion + } +} diff --git a/Src/Wide.Interfaces/Controls/AbstractMenuItem.cs b/Src/Wide.Interfaces/Controls/AbstractMenuItem.cs new file mode 100644 index 0000000..2647731 --- /dev/null +++ b/Src/Wide.Interfaces/Controls/AbstractMenuItem.cs @@ -0,0 +1,104 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Input; +using System.Windows.Media; +using Microsoft.Practices.Unity; + +namespace Wide.Interfaces +{ + public abstract class AbstractMenuItem : AbstractCommandable + { + #region Static + protected static int sepCount = 1; + #endregion + + #region Members + protected bool _isChecked; + protected IUnityContainer _container; + #endregion + + #region Methods and Properties + public virtual bool IsSeparator { get; internal set; } + + public virtual ImageSource Icon { get; internal set; } + + public virtual string ToolTip + { + get + { + string value = this.Header.Replace("_", ""); + if(!string.IsNullOrEmpty(this.InputGestureText)) + { + value += " " + InputGestureText; + } + return value; + } + } + + public virtual string Header { get; internal set; } + + public virtual bool IsCheckable { get; set; } + + public virtual bool IsVisible { get; internal set; } + + public virtual bool IsChecked + { + get { return _isChecked; } + set { _isChecked = value; RaisePropertyChanged("IsChecked"); } + } + + #endregion + + #region Overrides + public override string ToString() + { + return this.Header; + } + + public override bool Add(AbstractCommandable item) + { + if (item.GetType().IsAssignableFrom(typeof(AbstractMenuItem))) + { + throw new ArgumentException("Expected a AbstractMenuItem as the argument. Only Menu's can be added within a Menu."); + } + return base.Add(item); + } + #endregion + + #region CTOR + public AbstractMenuItem(string header, int priority, ImageSource icon = null, ICommand command = null, KeyGesture gesture = null, bool isCheckable = false) + : base() + { + this.Priority = priority; + this.IsSeparator = false; + this.Header = header; + this.Key = header; + this.Command = command; + this.IsCheckable = isCheckable; + this.Icon = icon; + if (gesture != null && command != null) + { + Application.Current.MainWindow.InputBindings.Add(new KeyBinding(command, gesture)); + this.InputGestureText = gesture.DisplayString; + } + if (isCheckable) + { + this.IsChecked = false; + } + if (this.Header == "SEP") + { + this.Key = "SEP" + sepCount.ToString(); + this.Header = ""; + sepCount++; + this.IsSeparator = true; + } + } + #endregion + } +} diff --git a/Src/Wide.Interfaces/Controls/MenuItemViewModel.cs b/Src/Wide.Interfaces/Controls/MenuItemViewModel.cs new file mode 100644 index 0000000..5f76106 --- /dev/null +++ b/Src/Wide.Interfaces/Controls/MenuItemViewModel.cs @@ -0,0 +1,31 @@ +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Windows.Controls; +using System.Windows.Input; +using System.Windows.Media; +using Microsoft.Practices.Unity; +using Wide.Interfaces; +using System.Windows; + +namespace Wide.Interfaces +{ + public sealed class MenuItemViewModel : AbstractMenuItem + { + #region CTOR + public MenuItemViewModel(string header, int priority, ImageSource icon = null, ICommand command = null, KeyGesture gesture = null, bool isCheckable = false, IUnityContainer container = null) + :base(header,priority,icon,command,gesture,isCheckable) + { + + } + #endregion + + #region Static + public static AbstractMenuItem Separator(int priority) + { + return new MenuItemViewModel("SEP",priority); + } + #endregion + } +} diff --git a/Src/Wide.Interfaces/Controls/ToolBarItemTemplateSelector.cs b/Src/Wide.Interfaces/Controls/ToolBarItemTemplateSelector.cs new file mode 100644 index 0000000..61969d4 --- /dev/null +++ b/Src/Wide.Interfaces/Controls/ToolBarItemTemplateSelector.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Text; +using System.Windows; +using System.Windows.Controls; + +namespace Wide.Interfaces +{ + public class ToolBarItemTemplateSelector : DataTemplateSelector + { + public DataTemplate ButtonTemplate { get; set; } + public DataTemplate SeparatorTemplate { get; set; } + + public override DataTemplate SelectTemplate(object item, DependencyObject container) + { + var toolBarItem = (MenuItemViewModel)item; + Debug.Assert(toolBarItem != null); + if (!toolBarItem.IsSeparator) + { + return ButtonTemplate; + } + return SeparatorTemplate; + } + } +} diff --git a/Src/Wide.Interfaces/Controls/ToolbarViewModel.cs b/Src/Wide.Interfaces/Controls/ToolbarViewModel.cs new file mode 100644 index 0000000..f849e3b --- /dev/null +++ b/Src/Wide.Interfaces/Controls/ToolbarViewModel.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Windows.Input; +using System.Windows.Media; +using Microsoft.Practices.Unity; + +namespace Wide.Interfaces +{ + // A toolbar basically has the same commands as the one's in the menu + public sealed class ToolbarViewModel : AbstractMenuItem + { + #region CTOR + public ToolbarViewModel(string header, int priority, ImageSource icon = null, ICommand command = null, bool isCheckable = false, IUnityContainer container = null) + : base(header,priority,icon,command,null,isCheckable) + { + this.Priority = priority; + this.IsSeparator = false; + this.Header = header; + this.Key = header; + this.Command = command; + this.IsCheckable = isCheckable; + this.Icon = icon; + if (isCheckable) + { + this.IsChecked = false; + } + if (this.Header == "SEP") + { + throw new ArgumentException("Header cannot be SEP for a Toolbar"); + } + } + #endregion + + #region Properties + public int Band { get; set; } + + public int BandIndex { get; set; } + #endregion + } +} \ No newline at end of file diff --git a/Src/Wide.Interfaces/Converters/PercentToFontSizeConverter.cs b/Src/Wide.Interfaces/Converters/PercentToFontSizeConverter.cs new file mode 100644 index 0000000..15f0c06 --- /dev/null +++ b/Src/Wide.Interfaces/Converters/PercentToFontSizeConverter.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows.Controls; +using System.Windows.Data; +using Microsoft.Practices.Unity; + +namespace Wide.Interfaces.Converters +{ + public class PercentToFontSizeConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) + { + //For now lets assume 12.00 to be 100% + double? fsize = value as double?; + if(fsize != null) + { + return ((fsize/12.00)*100) + " %"; + } + return "100 %"; + } + + public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) + { + double rValue = 12.0; + if (value != null) + { + string final = value as string; + final = final.Replace("%", ""); + if (double.TryParse(final, out rValue)) + { + rValue = (rValue/100.0)*12; + } + else + { + rValue = 12.0; + value = "100 %"; + } + } + return rValue; + } + } +} diff --git a/Src/Wide.Interfaces/Events/LogEvent.cs b/Src/Wide.Interfaces/Events/LogEvent.cs new file mode 100644 index 0000000..079d076 --- /dev/null +++ b/Src/Wide.Interfaces/Events/LogEvent.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Wide.Interfaces; +using Wide.Interfaces.Services; +using Microsoft.Practices.Prism.Events; + +namespace Wide.Interfaces.Events +{ + public class LogEvent : CompositePresentationEvent + { + } +} diff --git a/Src/Wide.Interfaces/Events/OpenContentEvent.cs b/Src/Wide.Interfaces/Events/OpenContentEvent.cs new file mode 100644 index 0000000..9109a65 --- /dev/null +++ b/Src/Wide.Interfaces/Events/OpenContentEvent.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Wide.Interfaces; +using Microsoft.Practices.Prism.Events; + +namespace Wide.Interfaces.Events +{ + public class OpenContentEvent : CompositePresentationEvent + { + } +} diff --git a/Src/Wide.Interfaces/Events/SplashCloseEvent.cs b/Src/Wide.Interfaces/Events/SplashCloseEvent.cs new file mode 100644 index 0000000..1428abe --- /dev/null +++ b/Src/Wide.Interfaces/Events/SplashCloseEvent.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Microsoft.Practices.Prism.Events; + +namespace Wide.Interfaces.Events +{ + public class SplashCloseEvent : CompositePresentationEvent + { + } +} diff --git a/Src/Wide.Interfaces/Events/SplashMessageUpdatedEvent.cs b/Src/Wide.Interfaces/Events/SplashMessageUpdatedEvent.cs new file mode 100644 index 0000000..3591d27 --- /dev/null +++ b/Src/Wide.Interfaces/Events/SplashMessageUpdatedEvent.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Microsoft.Practices.Prism.Events; + +namespace Wide.Interfaces.Events +{ + public class SplashMessageUpdateEvent : CompositePresentationEvent + { + public string Message { get; set; } + } +} diff --git a/Src/Wide.Interfaces/Events/ThemeChangeEvent.cs b/Src/Wide.Interfaces/Events/ThemeChangeEvent.cs new file mode 100644 index 0000000..8fa6b50 --- /dev/null +++ b/Src/Wide.Interfaces/Events/ThemeChangeEvent.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Microsoft.Practices.Prism.Events; + +namespace Wide.Interfaces.Events +{ + public class ThemeChangeEvent : CompositePresentationEvent + { + } +} diff --git a/Src/Wide.Interfaces/IContentView.cs b/Src/Wide.Interfaces/IContentView.cs new file mode 100644 index 0000000..cf5d42c --- /dev/null +++ b/Src/Wide.Interfaces/IContentView.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows; +using AvalonDock.Controls; +using System.ComponentModel; + +namespace Wide.Interfaces +{ + public interface IContentView + { + + } +} diff --git a/Src/Wide.Interfaces/IShell.cs b/Src/Wide.Interfaces/IShell.cs new file mode 100644 index 0000000..f134c9c --- /dev/null +++ b/Src/Wide.Interfaces/IShell.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Wide.Interfaces.Services; + +namespace Wide.Interfaces +{ + public interface IShell + { + void Show(); + void LoadLayout(); + void SaveLayout(); + } +} diff --git a/Src/Wide.Interfaces/ITheme.cs b/Src/Wide.Interfaces/ITheme.cs new file mode 100644 index 0000000..bb347cc --- /dev/null +++ b/Src/Wide.Interfaces/ITheme.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Wide.Interfaces +{ + /// + /// You can register a theme adding it to the list of themes in theme manager + /// + public interface ITheme + { + /// + /// Lists of valid URIs which will be loaded in the theme dictionary + /// + IList UriList { get; } + + /// + /// The name of the theme + /// + string Name { get; } + } +} diff --git a/Src/Wide.Interfaces/IWorkspace.cs b/Src/Wide.Interfaces/IWorkspace.cs new file mode 100644 index 0000000..f909c7f --- /dev/null +++ b/Src/Wide.Interfaces/IWorkspace.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Controls; +using System.Windows.Input; +using System.Windows.Media; + +namespace Wide.Interfaces +{ + public interface IWorkspace + { + /// + /// The list of documents which are open in the workspace + /// + ObservableCollection Documents { get; set; } + + /// + /// The list of tools that are available in the workspace + /// + ObservableCollection Tools { get; set; } + + /// + /// The current document which is active in the workspace + /// + ContentViewModel ActiveDocument { get; set; } + + string Title { get; } + + ImageSource Icon { get; } + + bool Closing(); + } +} diff --git a/Src/Wide.Interfaces/Properties/AssemblyInfo.cs b/Src/Wide.Interfaces/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..0ecdfcf --- /dev/null +++ b/Src/Wide.Interfaces/Properties/AssemblyInfo.cs @@ -0,0 +1,56 @@ +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Wide.Interfaces")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Wide.Interfaces")] +[assembly: AssemblyCopyright("Copyright © 2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +//In order to begin building localizable applications, set +//CultureYouAreCodingWith in your .csproj file +//inside a . For example, if you are using US english +//in your source files, set the to en-US. Then uncomment +//the NeutralResourceLanguage attribute below. Update the "en-US" in +//the line below to match the UICulture setting in the project file. + +//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] + + +[assembly:ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] + + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: InternalsVisibleTo("Wide.Core")] diff --git a/Src/Wide.Interfaces/Properties/Resources.Designer.cs b/Src/Wide.Interfaces/Properties/Resources.Designer.cs new file mode 100644 index 0000000..5a46a98 --- /dev/null +++ b/Src/Wide.Interfaces/Properties/Resources.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.18010 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Wide.Interfaces.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Wide.Interfaces.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/Src/Wide.Interfaces/Properties/Resources.resx b/Src/Wide.Interfaces/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/Src/Wide.Interfaces/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Src/Wide.Interfaces/Properties/Settings.Designer.cs b/Src/Wide.Interfaces/Properties/Settings.Designer.cs new file mode 100644 index 0000000..8408bae --- /dev/null +++ b/Src/Wide.Interfaces/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.18010 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Wide.Interfaces.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + } +} diff --git a/Src/Wide.Interfaces/Properties/Settings.settings b/Src/Wide.Interfaces/Properties/Settings.settings new file mode 100644 index 0000000..033d7a5 --- /dev/null +++ b/Src/Wide.Interfaces/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Src/Wide.Interfaces/Services/ICommandManager.cs b/Src/Wide.Interfaces/Services/ICommandManager.cs new file mode 100644 index 0000000..6500207 --- /dev/null +++ b/Src/Wide.Interfaces/Services/ICommandManager.cs @@ -0,0 +1,12 @@ +using System.Windows.Input; +using Microsoft.Practices.Prism.Commands; + +namespace Wide.Interfaces.Services +{ + public interface ICommandManager + { + bool RegisterCommand(string name, ICommand command); + ICommand GetCommand(string name); + void Refresh(); + } +} diff --git a/Src/Wide.Interfaces/Services/IContentHandler.cs b/Src/Wide.Interfaces/Services/IContentHandler.cs new file mode 100644 index 0000000..529722d --- /dev/null +++ b/Src/Wide.Interfaces/Services/IContentHandler.cs @@ -0,0 +1,11 @@ +namespace Wide.Interfaces.Services +{ + public interface IContentHandler + { + bool ValidateContentType(object info); + ContentViewModel OpenContent(object info); + ContentViewModel OpenContentFromId(string contentId); + bool SaveContent(ContentViewModel contentViewModel, bool saveAs = false); + bool ValidateContentFromId(string contentId); + } +} \ No newline at end of file diff --git a/Src/Wide.Interfaces/Services/IContentHandlerRegistry.cs b/Src/Wide.Interfaces/Services/IContentHandlerRegistry.cs new file mode 100644 index 0000000..e6ec02d --- /dev/null +++ b/Src/Wide.Interfaces/Services/IContentHandlerRegistry.cs @@ -0,0 +1,10 @@ +namespace Wide.Interfaces.Services +{ + public interface IContentHandlerRegistry + { + bool Register(IContentHandler handler); + bool Unregister(IContentHandler handler); + ContentViewModel GetViewModel(object info); + ContentViewModel GetViewModelFromContentId(string contentId); + } +} \ No newline at end of file diff --git a/Src/Wide.Interfaces/Services/ILoggerService.cs b/Src/Wide.Interfaces/Services/ILoggerService.cs new file mode 100644 index 0000000..7c3d59d --- /dev/null +++ b/Src/Wide.Interfaces/Services/ILoggerService.cs @@ -0,0 +1,27 @@ +namespace Wide.Interfaces.Services +{ + public enum LogCategory + { + Debug, + Exception, + Info, + Warn, + Error + } + + public enum LogPriority + { + None, + Low, + Medium, + High + } + + public interface ILoggerService + { + void Log(string message, LogCategory category, LogPriority priority); + string Message { get; } + LogCategory Category { get; } + LogPriority Priority { get; } + } +} \ No newline at end of file diff --git a/Src/Wide.Interfaces/Services/IOpenFileService.cs b/Src/Wide.Interfaces/Services/IOpenFileService.cs new file mode 100644 index 0000000..7999416 --- /dev/null +++ b/Src/Wide.Interfaces/Services/IOpenFileService.cs @@ -0,0 +1,8 @@ +namespace Wide.Interfaces.Services +{ + public interface IOpenFileService + { + ContentViewModel Open(object location = null); + ContentViewModel OpenFromID(string contentID); + } +} diff --git a/Src/Wide.Interfaces/Services/IThemeManager.cs b/Src/Wide.Interfaces/Services/IThemeManager.cs new file mode 100644 index 0000000..771ba18 --- /dev/null +++ b/Src/Wide.Interfaces/Services/IThemeManager.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Text; + +namespace Wide.Interfaces.Services +{ + public interface IThemeManager + { + /// + /// The list of themes registered with the theme manager + /// + ObservableCollection Themes { get; } + + /// + /// Adds a theme to the theme manager + /// + /// The theme to add + /// true, if successful + bool AddTheme(ITheme theme); + + /// + /// Called to set the current theme from the list of themes + /// + /// The name of the theme + /// true, if successful + bool SetCurrent(string name); + } +} diff --git a/Src/Wide.Interfaces/Services/IToolbarService.cs b/Src/Wide.Interfaces/Services/IToolbarService.cs new file mode 100644 index 0000000..606781a --- /dev/null +++ b/Src/Wide.Interfaces/Services/IToolbarService.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows.Controls; + +namespace Wide.Interfaces.Services +{ + public interface IToolbarService + { + bool Add(ToolbarViewModel item); + bool Remove(string key); + ToolbarViewModel Get(string key); + ToolBarTray ToolBarTray { get; } + } +} diff --git a/Src/Wide.Interfaces/Styles/Button.xaml b/Src/Wide.Interfaces/Styles/Button.xaml new file mode 100644 index 0000000..3583407 --- /dev/null +++ b/Src/Wide.Interfaces/Styles/Button.xaml @@ -0,0 +1,38 @@ + + + + \ No newline at end of file diff --git a/Src/Wide.Interfaces/Styles/Controls.xaml b/Src/Wide.Interfaces/Styles/Controls.xaml new file mode 100644 index 0000000..c50b26d --- /dev/null +++ b/Src/Wide.Interfaces/Styles/Controls.xaml @@ -0,0 +1,34 @@ + + + + + + + + + + \ No newline at end of file diff --git a/Src/Wide.Interfaces/Styles/ControlsMetro.xaml b/Src/Wide.Interfaces/Styles/ControlsMetro.xaml new file mode 100644 index 0000000..7690d12 --- /dev/null +++ b/Src/Wide.Interfaces/Styles/ControlsMetro.xaml @@ -0,0 +1,41 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Src/Wide.Interfaces/Styles/LightColors.xaml b/Src/Wide.Interfaces/Styles/LightColors.xaml new file mode 100644 index 0000000..099934a --- /dev/null +++ b/Src/Wide.Interfaces/Styles/LightColors.xaml @@ -0,0 +1,26 @@ + + + + #007ACC + #007ACC + #FEFEFE + #E7E8EC + #CCCEDB + + + + + + + + + + + + + Segoe UI, Segoe UI Light, Lucida Sans Unicode, Verdana + + + + \ No newline at end of file diff --git a/Src/Wide.Interfaces/Styles/LightTheme.xaml b/Src/Wide.Interfaces/Styles/LightTheme.xaml new file mode 100644 index 0000000..6da461a --- /dev/null +++ b/Src/Wide.Interfaces/Styles/LightTheme.xaml @@ -0,0 +1,9 @@ + + + + + + + + \ No newline at end of file diff --git a/Src/Wide.Interfaces/Styles/Menu.xaml b/Src/Wide.Interfaces/Styles/Menu.xaml new file mode 100644 index 0000000..e8de403 --- /dev/null +++ b/Src/Wide.Interfaces/Styles/Menu.xaml @@ -0,0 +1,288 @@ + + + M 0,5.1 L 1.7,5.2 L 3.4,7.1 L 8,0.4 L 9.2,0 L 3.3,10.8 Z + M 0,0 L 4,3.5 L 0,7 Z + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Src/Wide.Interfaces/Styles/WindowCommands.xaml b/Src/Wide.Interfaces/Styles/WindowCommands.xaml new file mode 100644 index 0000000..8c6955e --- /dev/null +++ b/Src/Wide.Interfaces/Styles/WindowCommands.xaml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Src/Wide.Interfaces/Themes/DarkTheme.cs b/Src/Wide.Interfaces/Themes/DarkTheme.cs new file mode 100644 index 0000000..a341845 --- /dev/null +++ b/Src/Wide.Interfaces/Themes/DarkTheme.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Wide.Interfaces.Themes +{ + public sealed class DarkTheme : ITheme + { + public DarkTheme() + { + this.UriList = new List(); + this.UriList.Add(new Uri("pack://application:,,,/MahApps.Metro;component/Styles/Colours.xaml")); + this.UriList.Add(new Uri("pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml")); + this.UriList.Add(new Uri("pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml")); + this.UriList.Add(new Uri("pack://application:,,,/MahApps.Metro;component/Styles/Controls.AnimatedSingleRowTabControl.xaml")); + //this.UriList.Add(new Uri("pack://application:,,,/MahApps.Metro.Resources;component/Icons.xaml")); + this.UriList.Add(new Uri("pack://application:,,,/MahApps.Metro;component/Styles/Accents/Blue.xaml")); + this.UriList.Add(new Uri("pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseDark.xaml")); + } + + public IList UriList { get; internal set; } + + public string Name + { + get { return "Dark"; } + } + } +} diff --git a/Src/Wide.Interfaces/Themes/DefaultTheme.cs b/Src/Wide.Interfaces/Themes/DefaultTheme.cs new file mode 100644 index 0000000..3e70acb --- /dev/null +++ b/Src/Wide.Interfaces/Themes/DefaultTheme.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Wide.Interfaces.Themes +{ + public sealed class DefaultTheme : ITheme + { + public DefaultTheme() + { + this.UriList = new List(); + this.UriList.Add(new Uri("pack://application:,,,/MahApps.Metro;component/Styles/Colours.xaml")); + this.UriList.Add(new Uri("pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml")); + this.UriList.Add(new Uri("pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml")); + this.UriList.Add(new Uri("pack://application:,,,/MahApps.Metro.Resources;component/Icons.xaml")); + this.UriList.Add(new Uri("pack://application:,,,/MahApps.Metro;component/Styles/Accents/Blue.xaml")); + this.UriList.Add(new Uri("pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseLight.xaml")); + } + + public IList UriList { get; internal set; } + + public string Name + { + get { return "Default"; } + } + } +} diff --git a/Src/Wide.Interfaces/Themes/LightTheme.cs b/Src/Wide.Interfaces/Themes/LightTheme.cs new file mode 100644 index 0000000..730f970 --- /dev/null +++ b/Src/Wide.Interfaces/Themes/LightTheme.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Wide.Interfaces; + +namespace Wide.Interfaces.Themes +{ + public sealed class LightTheme: ITheme + { + public LightTheme() + { + this.UriList = new List(); + this.UriList.Add(new Uri("pack://application:,,,/MahApps.Metro;component/Styles/Colours.xaml")); + this.UriList.Add(new Uri("pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml")); + this.UriList.Add(new Uri("pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml")); + this.UriList.Add(new Uri("pack://application:,,,/MahApps.Metro;component/Styles/Accents/Blue.xaml")); + this.UriList.Add(new Uri("pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseLight.xaml")); + this.UriList.Add(new Uri("pack://application:,,,/Wide.Interfaces;component/Styles/LightTheme.xaml")); + this.UriList.Add(new Uri("pack://application:,,,/AvalonDock.Themes.VS2012;component/Theme.xaml")); + } + + public IList UriList { get; internal set; } + + public string Name + { + get { return "Light"; } + } + } +} diff --git a/Src/Wide.Interfaces/Themes/VS2010.cs b/Src/Wide.Interfaces/Themes/VS2010.cs new file mode 100644 index 0000000..661aa99 --- /dev/null +++ b/Src/Wide.Interfaces/Themes/VS2010.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Wide.Interfaces; + +namespace Wide.Interfaces.Themes +{ + public sealed class VS2010 : ITheme + { + public VS2010() + { + this.UriList = new List(); + this.Name = "VS2010"; + this.UriList.Add(new Uri("pack://application:,,,/AvalonDock.Themes.VS2010;component/Theme.xaml")); + this.UriList.Add(new Uri("pack://application:,,,/Wide.Interfaces;component/Themes/VS2010/Theme.xaml")); + } + + public IList UriList { get; private set; } + public string Name { get; private set; } + } +} diff --git a/Src/Wide.Interfaces/Themes/VS2010/Brushes.xaml b/Src/Wide.Interfaces/Themes/VS2010/Brushes.xaml new file mode 100644 index 0000000..9fb8b2c --- /dev/null +++ b/Src/Wide.Interfaces/Themes/VS2010/Brushes.xaml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Src/Wide.Interfaces/Themes/VS2010/StatusBar.xaml b/Src/Wide.Interfaces/Themes/VS2010/StatusBar.xaml new file mode 100644 index 0000000..a1a4a58 --- /dev/null +++ b/Src/Wide.Interfaces/Themes/VS2010/StatusBar.xaml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Src/Wide.Interfaces/Themes/VS2010/Theme.xaml b/Src/Wide.Interfaces/Themes/VS2010/Theme.xaml new file mode 100644 index 0000000..bbbbbaa --- /dev/null +++ b/Src/Wide.Interfaces/Themes/VS2010/Theme.xaml @@ -0,0 +1,224 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Src/Wide.Interfaces/Themes/VS2010/Toolbar.xaml b/Src/Wide.Interfaces/Themes/VS2010/Toolbar.xaml new file mode 100644 index 0000000..589ef70 --- /dev/null +++ b/Src/Wide.Interfaces/Themes/VS2010/Toolbar.xaml @@ -0,0 +1,139 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/Src/Wide.Interfaces/ToolViewModel.cs b/Src/Wide.Interfaces/ToolViewModel.cs new file mode 100644 index 0000000..122e6ba --- /dev/null +++ b/Src/Wide.Interfaces/ToolViewModel.cs @@ -0,0 +1,136 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Media; + +namespace Wide.Interfaces +{ + /// + /// The abstract class which has to be inherited if you want to create a tool + /// + public abstract class ToolViewModel : ViewModelBase + { + #region Members + private bool _isVisible = true; + + protected string _title = null; + protected string _contentId = null; + protected bool _isSelected = false; + protected bool _isActive = false; + #endregion + + #region Property + /// + /// The name of the tool + /// + public string Name + { + get; + protected set; + } + + /// + /// The visibility of the tool + /// + public bool IsVisible + { + get { return _isVisible; } + set + { + if (_isVisible != value) + { + _isVisible = value; + RaisePropertyChanged("IsVisible"); + } + } + } + + /// + /// The content model + /// + public virtual INotifyPropertyChanged Model { get; set; } + + /// + /// The content view + /// + public virtual IContentView View { get; set; } + + /// + /// The title of the document + /// + public virtual string Title + { + get { return _title; } + protected set + { + if (_title != value) + { + _title = value; + RaisePropertyChanged("Title"); + } + } + } + + /// + /// The image souce that can be used as an icon in the tab + /// + public virtual ImageSource IconSource + { + get; + protected set; + } + + /// + /// The content ID - unique value for each document + /// + public virtual string ContentId + { + get { return _contentId; } + protected set + { + if (_contentId != value) + { + _contentId = value; + RaisePropertyChanged("ContentId"); + } + } + } + + /// + /// Is the document selected + /// + public virtual bool IsSelected + { + get { return _isSelected; } + set + { + if (_isSelected != value) + { + _isSelected = value; + RaisePropertyChanged("IsSelected"); + } + } + } + + /// + /// Is the document active + /// + public virtual bool IsActive + { + get { return _isActive; } + set + { + if (_isActive != value) + { + _isActive = value; + RaisePropertyChanged("IsActive"); + } + } + } + + #endregion + } +} diff --git a/Src/Wide.Interfaces/Utils/ListExtensions.cs b/Src/Wide.Interfaces/Utils/ListExtensions.cs new file mode 100644 index 0000000..d934132 --- /dev/null +++ b/Src/Wide.Interfaces/Utils/ListExtensions.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Text; + +namespace Wide.Interfaces.Utils +{ + public static class ListExtensions + { + public static IList Clone(this IList listToClone) where T : ICloneable + { + return listToClone.Select(item => (T)item.Clone()).ToList(); + } + + public static ObservableCollection ToObservableCollection(this IEnumerable enumerable) + { + var col = new ObservableCollection(); + foreach (var cur in enumerable) + { + col.Add(cur); + } + return col; + } + } +} diff --git a/Src/Wide.Interfaces/ViewModelBase.cs b/Src/Wide.Interfaces/ViewModelBase.cs new file mode 100644 index 0000000..5d648b0 --- /dev/null +++ b/Src/Wide.Interfaces/ViewModelBase.cs @@ -0,0 +1,25 @@ +using System.ComponentModel; + +namespace Wide.Interfaces +{ + /// + /// The view model base class + /// + public class ViewModelBase : INotifyPropertyChanged + { + /// + /// Should be called when a property value has changed + /// + /// The property name + protected virtual void RaisePropertyChanged(string propertyName) + { + if (PropertyChanged != null) + PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); + } + + /// + /// Event handler that gets triggered when a property changes + /// + public event PropertyChangedEventHandler PropertyChanged; + } +} \ No newline at end of file diff --git a/Src/Wide.Interfaces/Wide.Interfaces.csproj b/Src/Wide.Interfaces/Wide.Interfaces.csproj new file mode 100644 index 0000000..10bc1b1 --- /dev/null +++ b/Src/Wide.Interfaces/Wide.Interfaces.csproj @@ -0,0 +1,207 @@ + + + + + Debug + AnyCPU + {9F20F5EF-4F7E-4AE2-A462-4CD2256FB3FF} + library + Properties + Wide.Interfaces + Wide.Interfaces + v4.0 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + + + + true + full + false + ..\..\Build\Internal\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\Libs\AvalonDock.dll + False + + + ..\..\Libs\ICSharpCode.AvalonEdit.dll + False + + + ..\..\Libs\MahApps.Metro.dll + False + + + ..\..\Libs\Microsoft.Practices.Prism.dll + False + + + ..\..\Libs\Microsoft.Practices.Prism.Interactivity.dll + False + + + ..\..\Libs\Microsoft.Practices.Prism.MefExtensions.dll + False + + + ..\..\Libs\Microsoft.Practices.Prism.UnityExtensions.dll + False + + + ..\..\Libs\Microsoft.Practices.ServiceLocation.dll + False + + + ..\..\Libs\Microsoft.Practices.Unity.dll + False + + + + + + + + + + 4.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + + + + + + + + + + ResXFileCodeGenerator + Resources.Designer.cs + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + + + + + MSBuild:Compile + Designer + + + + + MSBuild:Compile + Designer + + + + + \ No newline at end of file diff --git a/Src/Wide.Settings/AbstractSettings.cs b/Src/Wide.Settings/AbstractSettings.cs new file mode 100644 index 0000000..05a49e1 --- /dev/null +++ b/Src/Wide.Settings/AbstractSettings.cs @@ -0,0 +1,73 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Windows; +using System.Windows.Controls; +using Wide.Interfaces; +using Wide.Interfaces.Utils; +using Wide.Interfaces.Utils; +using Xceed.Wpf.Toolkit.PropertyGrid; + +namespace Wide.Settings +{ + public abstract class AbstractSettings : AbstractPrioritizedTree, ICloneable + { + protected AbstractSettings() : base() + { + Reset(); + } + + [Browsable(false)] + public string Title { get; protected set; } + + [Browsable(false)] + public virtual ContentControl View + { + get + { + ContentControl c = new ContentControl(); + PropertyGrid propertyGrid = new PropertyGrid(); + propertyGrid.ShowSearchBox = false; + propertyGrid.SelectedObject = this; + c.Content = propertyGrid; + return c; + } + } + + public virtual void Reset() + { + // Iterate through each property and call ResetValue() + foreach (PropertyDescriptor property in TypeDescriptor.GetProperties(this)) + property.ResetValue(this); + + foreach (AbstractSettings settings in Children) + { + settings.Reset(); + } + } + + //Settings needs to override, save and call base.Save() + public virtual void Save() + { + foreach (AbstractSettings settings in Children) + { + settings.Save(); + } + } + + public abstract void Load(); + + public abstract object Clone(); + + protected ObservableCollection ChildClone() + { + ObservableCollection newChildren = + this.Children.Clone().ToObservableCollection(); + return newChildren; + } + } +} diff --git a/Src/Wide.Settings/Properties/AssemblyInfo.cs b/Src/Wide.Settings/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..af4c65c --- /dev/null +++ b/Src/Wide.Settings/Properties/AssemblyInfo.cs @@ -0,0 +1,55 @@ +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Wide.Settings")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Wide.Settings")] +[assembly: AssemblyCopyright("Copyright © 2013")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +//In order to begin building localizable applications, set +//CultureYouAreCodingWith in your .csproj file +//inside a . For example, if you are using US english +//in your source files, set the to en-US. Then uncomment +//the NeutralResourceLanguage attribute below. Update the "en-US" in +//the line below to match the UICulture setting in the project file. + +//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] + + +[assembly:ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] + + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Src/Wide.Settings/Properties/Resources.Designer.cs b/Src/Wide.Settings/Properties/Resources.Designer.cs new file mode 100644 index 0000000..08dc26c --- /dev/null +++ b/Src/Wide.Settings/Properties/Resources.Designer.cs @@ -0,0 +1,62 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.18010 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Wide.Settings.Properties { + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if ((resourceMan == null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Wide.Settings.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/Src/Wide.Settings/Properties/Resources.resx b/Src/Wide.Settings/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/Src/Wide.Settings/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Src/Wide.Settings/Properties/Settings.Designer.cs b/Src/Wide.Settings/Properties/Settings.Designer.cs new file mode 100644 index 0000000..62e7b43 --- /dev/null +++ b/Src/Wide.Settings/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.18010 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Wide.Settings.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/Src/Wide.Settings/Properties/Settings.settings b/Src/Wide.Settings/Properties/Settings.settings new file mode 100644 index 0000000..033d7a5 --- /dev/null +++ b/Src/Wide.Settings/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Src/Wide.Settings/SettingsManager.cs b/Src/Wide.Settings/SettingsManager.cs new file mode 100644 index 0000000..aba8f9e --- /dev/null +++ b/Src/Wide.Settings/SettingsManager.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Text; +using System.Windows.Controls; + +namespace Wide.Settings +{ + public interface ISettingsManager + { + AbstractSettings Get(string key); + bool Add(AbstractSettings settings); + } + + internal class WideSettingsManager : AbstractSettings, ISettingsManager + { + public WideSettingsManager() : base() + { + } + + //Don't need a view for the settings manager + public override ContentControl View + { + get { return null; } + } + + public override void Load() + { + throw new NotImplementedException("Don't need to load a WideSettingsManager"); + } + + public override object Clone() + { + //Need a clone + return null; + } + + public override void Reset() + { + foreach (AbstractSettings settings in Children) + { + settings.Reset(); + } + } + } +} diff --git a/Src/Wide.Settings/Wide.Settings.csproj b/Src/Wide.Settings/Wide.Settings.csproj new file mode 100644 index 0000000..f120907 --- /dev/null +++ b/Src/Wide.Settings/Wide.Settings.csproj @@ -0,0 +1,94 @@ + + + + + Debug + AnyCPU + {EC4B20C3-DF90-40F1-8547-ADCFCEBE5B81} + library + Properties + Wide.Settings + Wide.Settings + v4.0 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + + + true + full + false + ..\..\Build\Internal\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + ..\..\Build\Internal\ + TRACE + prompt + 4 + + + + + + + + + + + 4.0 + + + + + + ..\..\Libs\WPFToolkit.Extended.dll + False + + + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + ResXFileCodeGenerator + Resources.Designer.cs + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + {9f20f5ef-4f7e-4ae2-a462-4cd2256fb3ff} + Wide.Interfaces + False + + + + + \ No newline at end of file diff --git a/Src/Wide.Shell/ActiveDocumentConverter.cs b/Src/Wide.Shell/ActiveDocumentConverter.cs new file mode 100644 index 0000000..6acbfb2 --- /dev/null +++ b/Src/Wide.Shell/ActiveDocumentConverter.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows.Data; +using Wide.Interfaces; + +namespace Wide.Shell +{ + public class ActiveDocumentConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) + { + if (value is ContentViewModel) + return value; + + return Binding.DoNothing; + } + + public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) + { + if (value is ContentViewModel) + return value; + + return Binding.DoNothing; + } + } +} diff --git a/Src/Wide.Shell/LayoutInitializer.cs b/Src/Wide.Shell/LayoutInitializer.cs new file mode 100644 index 0000000..e93c29c --- /dev/null +++ b/Src/Wide.Shell/LayoutInitializer.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using AvalonDock.Layout; +using Wide.Interfaces; + +namespace Wide.Shell +{ + public class LayoutInitializer : ILayoutUpdateStrategy + { + public bool BeforeInsertAnchorable(LayoutRoot layout, LayoutAnchorable anchorableToShow, ILayoutContainer destinationContainer) + { + LayoutAnchorablePane destPane = destinationContainer as LayoutAnchorablePane; + if (destinationContainer != null && + destinationContainer.FindParent() != null) + return false; + + var toolsPane = layout.Descendents().OfType().FirstOrDefault(d => d.GetType() == typeof(IContentView)); + if (toolsPane != null) + { + toolsPane.Children.Add(anchorableToShow); + return true; + } + + return false; + + } + + + public void AfterInsertAnchorable(LayoutRoot layout, LayoutAnchorable anchorableShown) + { + } + + + public bool BeforeInsertDocument(LayoutRoot layout, LayoutDocument anchorableToShow, ILayoutContainer destinationContainer) + { + return false; + } + + public void AfterInsertDocument(LayoutRoot layout, LayoutDocument anchorableShown) + { + + } + } +} diff --git a/Src/Wide.Shell/PanesStyleSelector.cs b/Src/Wide.Shell/PanesStyleSelector.cs new file mode 100644 index 0000000..75b8f69 --- /dev/null +++ b/Src/Wide.Shell/PanesStyleSelector.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using Wide.Interfaces; + +namespace Wide.Shell +{ + public class PanesStyleSelector : StyleSelector + { + public Style ToolStyle + { + get; + set; + } + + public Style ContentStyle + { + get; + set; + } + + public override Style SelectStyle(object item, System.Windows.DependencyObject container) + { + if (item is ToolViewModel) + return ToolStyle; + + if (item is ContentViewModel) + return ContentStyle; + + return base.SelectStyle(item, container); + } + } +} diff --git a/Src/Wide.Shell/PanesTemplateSelector.cs b/Src/Wide.Shell/PanesTemplateSelector.cs new file mode 100644 index 0000000..7645018 --- /dev/null +++ b/Src/Wide.Shell/PanesTemplateSelector.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using AvalonDock.Layout; +using Wide.Interfaces; + +namespace Wide.Shell +{ + public class PanesTemplateSelector : DataTemplateSelector + { + public PanesTemplateSelector() + { + Console.WriteLine("I come here"); + } + + + public DataTemplate ContentViewTemplate + { + get; + set; + } + + public DataTemplate ToolViewTemplate + { + get; + set; + } + + public override DataTemplate SelectTemplate(object item, DependencyObject container) + { + var itemAsLayoutContent = item as LayoutContent; + + if (item is ContentViewModel) + return ContentViewTemplate; + + if (item is ToolViewModel) + return ToolViewTemplate; + + return base.SelectTemplate(item, container); + } + } +} diff --git a/Src/Wide.Shell/Properties/AssemblyInfo.cs b/Src/Wide.Shell/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..29ee592 --- /dev/null +++ b/Src/Wide.Shell/Properties/AssemblyInfo.cs @@ -0,0 +1,55 @@ +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Wide.Shell")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Wide.Shell")] +[assembly: AssemblyCopyright("Copyright © 2013")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +//In order to begin building localizable applications, set +//CultureYouAreCodingWith in your .csproj file +//inside a . For example, if you are using US english +//in your source files, set the to en-US. Then uncomment +//the NeutralResourceLanguage attribute below. Update the "en-US" in +//the line below to match the UICulture setting in the project file. + +//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] + + +[assembly:ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] + + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Src/Wide.Shell/Properties/Resources.Designer.cs b/Src/Wide.Shell/Properties/Resources.Designer.cs new file mode 100644 index 0000000..6e7a868 --- /dev/null +++ b/Src/Wide.Shell/Properties/Resources.Designer.cs @@ -0,0 +1,62 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.18010 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Wide.Shell.Properties { + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if ((resourceMan == null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Wide.Shell.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/Src/Wide.Shell/Properties/Resources.resx b/Src/Wide.Shell/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/Src/Wide.Shell/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Src/Wide.Shell/Properties/Settings.Designer.cs b/Src/Wide.Shell/Properties/Settings.Designer.cs new file mode 100644 index 0000000..051794c --- /dev/null +++ b/Src/Wide.Shell/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.18010 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Wide.Shell.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/Src/Wide.Shell/Properties/Settings.settings b/Src/Wide.Shell/Properties/Settings.settings new file mode 100644 index 0000000..033d7a5 --- /dev/null +++ b/Src/Wide.Shell/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Src/Wide.Shell/ShellView.xaml b/Src/Wide.Shell/ShellView.xaml new file mode 100644 index 0000000..de78d7d --- /dev/null +++ b/Src/Wide.Shell/ShellView.xaml @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Ready + + + Testing + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Src/Wide.Shell/ShellView.xaml.cs b/Src/Wide.Shell/ShellView.xaml.cs new file mode 100644 index 0000000..23eb39d --- /dev/null +++ b/Src/Wide.Shell/ShellView.xaml.cs @@ -0,0 +1,99 @@ +using AvalonDock.Layout.Serialization; +using MahApps.Metro.Controls; +using Microsoft.Practices.Unity; +using Wide.Interfaces; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Shapes; +using AvalonDock; +using AvalonDock.Layout; +using System.Collections.ObjectModel; +using Wide.Interfaces.Services; + +namespace Wide.Shell +{ + /// + /// Interaction logic for Shell.xaml + /// + public partial class ShellView : Window, IShell + { + private IUnityContainer _container; + + public ShellView(IUnityContainer container) + { + InitializeComponent(); + this._container = container; + } + + private void Window_Closing_1(object sender, System.ComponentModel.CancelEventArgs e) + { + IWorkspace workspace = this.DataContext as IWorkspace; + if(!workspace.Closing()) + { + e.Cancel = true; + return; + } + SaveLayout(); + } + + + public void LoadLayout() + { + var layoutSerializer = new XmlLayoutSerializer(dockManager); + layoutSerializer.LayoutSerializationCallback += (s, e) => + { + LayoutAnchorable anchorable = e.Model as LayoutAnchorable; + LayoutDocument document = e.Model as LayoutDocument; + IWorkspace workspace = _container.Resolve(); + + if (anchorable != null) + { + ToolViewModel model = workspace.Tools.First(f => f.ContentId == e.Model.ContentId); + if (model != null) + { + e.Content = model; + model.IsVisible = anchorable.IsVisible; + model.IsActive = anchorable.IsActive; + model.IsSelected = anchorable.IsSelected; + } + } + if (document != null) + { + IContentHandlerRegistry registry = _container.Resolve(); + ContentViewModel model = registry.GetViewModelFromContentId(e.Model.ContentId); + workspace.Documents.Add(model); + if (model != null) + { + e.Content = model; + model.IsActive = document.IsActive; + model.IsSelected = document.IsSelected; + } + } + }; + try + { + layoutSerializer.Deserialize(@".\AvalonDock.Layout.config"); + } + catch (Exception) + { + + } + } + + public void SaveLayout() + { + var layoutSerializer = new XmlLayoutSerializer(dockManager); + layoutSerializer.Serialize(@".\AvalonDock.Layout.config"); + } + } +} diff --git a/Src/Wide.Shell/ShellViewMetro.xaml b/Src/Wide.Shell/ShellViewMetro.xaml new file mode 100644 index 0000000..477b044 --- /dev/null +++ b/Src/Wide.Shell/ShellViewMetro.xaml @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Ready + + + Testing + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Src/Wide.Shell/ShellViewMetro.xaml.cs b/Src/Wide.Shell/ShellViewMetro.xaml.cs new file mode 100644 index 0000000..1af74f4 --- /dev/null +++ b/Src/Wide.Shell/ShellViewMetro.xaml.cs @@ -0,0 +1,108 @@ +using AvalonDock.Layout.Serialization; +using MahApps.Metro.Controls; +using Microsoft.Practices.Unity; +using Wide.Interfaces; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Shapes; +using AvalonDock; +using AvalonDock.Layout; +using System.Collections.ObjectModel; +using Wide.Interfaces.Services; + +namespace Wide.Shell +{ + /// + /// Interaction logic for Shell.xaml + /// + public partial class ShellViewMetro : MetroWindow, IShell + { + private IUnityContainer _container; + + public ShellViewMetro(IUnityContainer container) + { + InitializeComponent(); + _container = container; + this.Loaded += new RoutedEventHandler(MainWindow_Loaded); + this.Unloaded += new RoutedEventHandler(MainWindow_Unloaded); + } + + private void MainWindow_Unloaded(object sender, RoutedEventArgs e) + { + SaveLayout(); + } + + private void MainWindow_Loaded(object sender, RoutedEventArgs e) + { + LoadLayout(); + } + + private void Window_Closing_1(object sender, System.ComponentModel.CancelEventArgs e) + { + IWorkspace workspace = this.DataContext as IWorkspace; + if (!workspace.Closing()) + { + e.Cancel = true; + return; + } + } + + public void LoadLayout() + { + var layoutSerializer = new XmlLayoutSerializer(dockManager); + layoutSerializer.LayoutSerializationCallback += (s, e) => + { + LayoutAnchorable anchorable = e.Model as LayoutAnchorable; + LayoutDocument document = e.Model as LayoutDocument; + IWorkspace workspace = _container.Resolve(); + + if (anchorable != null) + { + ToolViewModel model = workspace.Tools.First(f => f.ContentId == e.Model.ContentId); + if (model != null) + { + e.Content = model; + model.IsVisible = anchorable.IsVisible; + model.IsActive = anchorable.IsActive; + model.IsSelected = anchorable.IsSelected; + } + } + if (document != null) + { + IOpenFileService fileService = _container.Resolve(); + ContentViewModel model = fileService.OpenFromID(e.Model.ContentId); + if (model != null) + { + e.Content = model; + model.IsActive = document.IsActive; + model.IsSelected = document.IsSelected; + } + } + }; + try + { + layoutSerializer.Deserialize(@".\AvalonDock.Layout.config"); + } + catch (Exception) + { + + } + } + + public void SaveLayout() + { + var layoutSerializer = new XmlLayoutSerializer(dockManager); + layoutSerializer.Serialize(@".\AvalonDock.Layout.config"); + } + } +} diff --git a/Src/Wide.Shell/Wide.Shell.csproj b/Src/Wide.Shell/Wide.Shell.csproj new file mode 100644 index 0000000..da359e7 --- /dev/null +++ b/Src/Wide.Shell/Wide.Shell.csproj @@ -0,0 +1,161 @@ + + + + + Debug + AnyCPU + {117809DE-4800-479B-BCA7-1D5AA6DBE30F} + library + Properties + Wide.Shell + Wide.Shell + v4.0 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + + + true + full + false + ..\..\Build\Internal\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + ..\..\Build\Internal\ + TRACE + prompt + 4 + + + + ..\..\Libs\AvalonDock.dll + False + + + ..\..\Libs\AvalonDock.Themes.VS2010.dll + False + + + ..\..\Libs\AvalonDock.Themes.VS2012.dll + False + + + False + ..\..\Libs\MahApps.Metro.dll + False + + + False + ..\..\Libs\MahApps.Metro.Resources.dll + False + + + ..\..\Libs\Microsoft.Practices.Prism.dll + False + + + ..\..\Libs\Microsoft.Practices.Prism.Interactivity.dll + False + + + ..\..\Libs\Microsoft.Practices.Prism.MefExtensions.dll + False + + + ..\..\Libs\Microsoft.Practices.Prism.UnityExtensions.dll + False + + + ..\..\Libs\Microsoft.Practices.ServiceLocation.dll + False + + + ..\..\Libs\Microsoft.Practices.Unity.dll + False + + + + + + + + + + 4.0 + + + + + + + + + ShellView.xaml + + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + ShellViewMetro.xaml + + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + + + {9f20f5ef-4f7e-4ae2-a462-4cd2256fb3ff} + Wide.Interfaces + False + + + {f5bfb5bd-08a3-46cf-a967-7d45772d9877} + Wide.Splash + False + + + + + \ No newline at end of file diff --git a/Src/Wide.Shell/WideBootstrapper.cs b/Src/Wide.Shell/WideBootstrapper.cs new file mode 100644 index 0000000..1f4c503 --- /dev/null +++ b/Src/Wide.Shell/WideBootstrapper.cs @@ -0,0 +1,81 @@ +using System.Threading; +using System.Windows.Controls; +using AvalonDock; +using AvalonDock.Layout; +using Wide.Interfaces; +using Wide.Interfaces.Events; +using Microsoft.Practices.Prism.Events; +using Microsoft.Practices.Prism.Logging; +using Microsoft.Practices.Prism.Modularity; +using Microsoft.Practices.Prism.Regions; +using Microsoft.Practices.Prism.UnityExtensions; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using Microsoft.Practices.ServiceLocation; +using Microsoft.Practices.Unity; +using Wide.Interfaces.Services; + +namespace Wide.Shell +{ + public class WideBootstrapper : UnityBootstrapper + { + private bool _isMetro; + + public WideBootstrapper(bool isMetro = true) + { + _isMetro = isMetro; + } + + //If you want your own splash window - inherit from the bootstrapper and register type ISplashView + protected override void InitializeModules() + { + if(!HideSplashWindow) + { + IModule splashModule = Container.Resolve(); + splashModule.Initialize(); + } + + base.InitializeModules(); + Application.Current.MainWindow.DataContext = Container.Resolve(); + } + + protected override IModuleCatalog CreateModuleCatalog() + { + DirectoryModuleCatalog catalog = new DirectoryModuleCatalog() {ModulePath = @".\Internal"}; + return catalog; + } + + protected override void ConfigureContainer() + { + //Create an instance of the workspace + if(_isMetro) + { + //Use MahApps Metro window + Container.RegisterType(new ContainerControlledLifetimeManager()); + } + else + { + //Use regular window + Container.RegisterType(new ContainerControlledLifetimeManager()); + } + base.ConfigureContainer(); + } + + protected override System.Windows.DependencyObject CreateShell() + { + return (DependencyObject)Container.Resolve(); + } + + protected override void InitializeShell() + { + base.InitializeShell(); + Application.Current.MainWindow = (Window)Shell; + } + + public bool HideSplashWindow { get; set; } + } +} diff --git a/Src/Wide.Shell/app.config b/Src/Wide.Shell/app.config new file mode 100644 index 0000000..efec2a5 --- /dev/null +++ b/Src/Wide.Shell/app.config @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/Src/Wide.Splash/Behaviours/SplashBehaviour.cs b/Src/Wide.Splash/Behaviours/SplashBehaviour.cs new file mode 100644 index 0000000..8ec1406 --- /dev/null +++ b/Src/Wide.Splash/Behaviours/SplashBehaviour.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; + +namespace Wide.Splash.Behaviours +{ + public class SplashBehaviour + { + #region Dependency Properties + public static readonly DependencyProperty EnabledProperty = DependencyProperty.RegisterAttached( + "Enabled", typeof(bool), typeof(SplashBehaviour), new PropertyMetadata(OnEnabledChanged)); + + public static bool GetEnabled(DependencyObject d_) + { + return (bool)d_.GetValue(EnabledProperty); + } + + public static void SetEnabled(DependencyObject d_, bool value_) + { + d_.SetValue(EnabledProperty, value_); + } + #endregion + + #region Event Handlers + private static void OnEnabledChanged(DependencyObject d_, DependencyPropertyChangedEventArgs arge_) + { + var splash = d_ as Window; + if (splash != null && arge_.NewValue is bool && (bool)arge_.NewValue) + { + splash.Closed += (s_, e_) => + { + splash.DataContext = null; + splash.Dispatcher.InvokeShutdown(); + }; + splash.MouseDoubleClick += (s_, e_) => splash.Close(); + splash.MouseLeftButtonDown += (s_, e_) => splash.DragMove(); + } + } + #endregion + } +} diff --git a/Src/Wide.Splash/ISplashView.cs b/Src/Wide.Splash/ISplashView.cs new file mode 100644 index 0000000..6806d7d --- /dev/null +++ b/Src/Wide.Splash/ISplashView.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Wide.Splash +{ + /// + /// Interface for SplashView + /// + public interface ISplashView + { + } +} diff --git a/Src/Wide.Splash/Module.cs b/Src/Wide.Splash/Module.cs new file mode 100644 index 0000000..0a37df7 --- /dev/null +++ b/Src/Wide.Splash/Module.cs @@ -0,0 +1,85 @@ +using System; +using System.Threading; +using System.Windows; +using System.Windows.Threading; +using Wide.Interfaces; +using Wide.Interfaces.Events; +using Microsoft.Practices.Prism.Events; +using Microsoft.Practices.Prism.Modularity; +using Microsoft.Practices.Unity; + +namespace Wide.Splash +{ + public class Module : IModule + { + #region ctors + public Module(IUnityContainer container_, IEventAggregator eventAggregator_, IShell shell_) + { + Container = container_; + EventAggregator = eventAggregator_; + Shell = shell_; + } + #endregion + + #region Private Properties + private IUnityContainer Container { get; set; } + + private IEventAggregator EventAggregator { get; set; } + + private IShell Shell { get; set; } + + private AutoResetEvent WaitForCreation { get; set; } + #endregion + + public void Initialize() + { + Dispatcher.CurrentDispatcher.BeginInvoke( + (Action)(() => + { + Shell.Show(); + EventAggregator.GetEvent().Publish(new SplashCloseEvent()); + })); + + WaitForCreation = new AutoResetEvent(false); + + ThreadStart showSplash = + () => + { + Dispatcher.CurrentDispatcher.BeginInvoke( + (Action)(() => + { + Container.RegisterType(); + ISplashView iSplashView = null; + try + { + //The end user might have set a splash view - try to use that + iSplashView = Container.Resolve(); + } + catch (Exception) + { + Container.RegisterType(); + iSplashView = Container.Resolve(); + } + Window splash = iSplashView as Window; + if (splash != null) + { + EventAggregator.GetEvent().Subscribe( + e_ => splash.Dispatcher.BeginInvoke((Action) splash.Close), + ThreadOption.PublisherThread, true); + + splash.Show(); + WaitForCreation.Set(); + } + })); + + Dispatcher.Run(); + }; + + var thread = new Thread(showSplash) { Name = "Splash Thread", IsBackground = true }; + thread.SetApartmentState(ApartmentState.STA); + thread.Start(); + + WaitForCreation.WaitOne(); + } + } +} diff --git a/Src/Wide.Splash/Properties/AssemblyInfo.cs b/Src/Wide.Splash/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..977961b --- /dev/null +++ b/Src/Wide.Splash/Properties/AssemblyInfo.cs @@ -0,0 +1,55 @@ +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Wide.Splash")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Wide.Splash")] +[assembly: AssemblyCopyright("Copyright © 2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +//In order to begin building localizable applications, set +//CultureYouAreCodingWith in your .csproj file +//inside a . For example, if you are using US english +//in your source files, set the to en-US. Then uncomment +//the NeutralResourceLanguage attribute below. Update the "en-US" in +//the line below to match the UICulture setting in the project file. + +//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] + + +[assembly:ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] + + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Src/Wide.Splash/Properties/Resources.Designer.cs b/Src/Wide.Splash/Properties/Resources.Designer.cs new file mode 100644 index 0000000..a84a238 --- /dev/null +++ b/Src/Wide.Splash/Properties/Resources.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.18010 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Wide.Splash.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Wide.Splash.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/Src/Wide.Splash/Properties/Resources.resx b/Src/Wide.Splash/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/Src/Wide.Splash/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Src/Wide.Splash/Properties/Settings.Designer.cs b/Src/Wide.Splash/Properties/Settings.Designer.cs new file mode 100644 index 0000000..ec17fe8 --- /dev/null +++ b/Src/Wide.Splash/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.18010 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Wide.Splash.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + } +} diff --git a/Src/Wide.Splash/Properties/Settings.settings b/Src/Wide.Splash/Properties/Settings.settings new file mode 100644 index 0000000..033d7a5 --- /dev/null +++ b/Src/Wide.Splash/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Src/Wide.Splash/SplashView.xaml b/Src/Wide.Splash/SplashView.xaml new file mode 100644 index 0000000..b7e7343 --- /dev/null +++ b/Src/Wide.Splash/SplashView.xaml @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Src/Wide.Splash/SplashView.xaml.cs b/Src/Wide.Splash/SplashView.xaml.cs new file mode 100644 index 0000000..8dc5ea4 --- /dev/null +++ b/Src/Wide.Splash/SplashView.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Shapes; + +namespace Wide.Splash +{ + /// + /// Interaction logic for SplashView.xaml + /// + public partial class SplashView : Window, ISplashView + { + public SplashView(SplashViewModel model) + { + InitializeComponent(); + this.DataContext = model; + } + } +} diff --git a/Src/Wide.Splash/SplashViewModel.cs b/Src/Wide.Splash/SplashViewModel.cs new file mode 100644 index 0000000..1476d94 --- /dev/null +++ b/Src/Wide.Splash/SplashViewModel.cs @@ -0,0 +1,62 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Wide.Interfaces.Events; +using Microsoft.Practices.Prism.Events; + +namespace Wide.Splash +{ + public class SplashViewModel : INotifyPropertyChanged + { + #region Declarations + private string _status; + #endregion + + #region ctor + public SplashViewModel(IEventAggregator eventAggregator_) + { + eventAggregator_.GetEvent().Subscribe(e_ => UpdateMessage(e_.Message)); + } + #endregion + + #region Public Properties + public string Status + { + get { return _status; } + set + { + _status = value; + NotifyPropertyChanged("Status"); + } + } + #endregion + + #region Private Methods + private void UpdateMessage(string message) + { + if (string.IsNullOrEmpty(message)) + { + return; + } + + Status += string.Concat(Environment.NewLine, message, "..."); + } + #endregion + + #region INotifyPropertyChanged Members + public event PropertyChangedEventHandler PropertyChanged; + + public void NotifyPropertyChanged(string propertyName_) + { + PropertyChangedEventHandler handler = PropertyChanged; + if (handler != null) + { + handler(this, new PropertyChangedEventArgs(propertyName_)); + } + } + #endregion + } +} diff --git a/Src/Wide.Splash/Wide.Splash.csproj b/Src/Wide.Splash/Wide.Splash.csproj new file mode 100644 index 0000000..0b426bb --- /dev/null +++ b/Src/Wide.Splash/Wide.Splash.csproj @@ -0,0 +1,130 @@ + + + + + Debug + AnyCPU + {F5BFB5BD-08A3-46CF-A967-7D45772D9877} + library + Properties + Wide.Splash + Wide.Splash + v4.0 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + + + + true + full + false + ..\..\Build\Internal\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + ..\..\Build\Internal\ + TRACE + prompt + 4 + + + + ..\..\Libs\Microsoft.Practices.Prism.dll + False + + + ..\..\Libs\Microsoft.Practices.Prism.Interactivity.dll + False + + + ..\..\Libs\Microsoft.Practices.Prism.MefExtensions.dll + False + + + ..\..\Libs\Microsoft.Practices.Prism.UnityExtensions.dll + False + + + ..\..\Libs\Microsoft.Practices.ServiceLocation.dll + False + + + ..\..\Libs\Microsoft.Practices.Unity.dll + False + + + + + + + + + + 4.0 + + + + + + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + SplashView.xaml + + + + ResXFileCodeGenerator + Resources.Designer.cs + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + {9f20f5ef-4f7e-4ae2-a462-4cd2256fb3ff} + Wide.Interfaces + False + + + + + Designer + MSBuild:Compile + + + + + + + + + \ No newline at end of file diff --git a/Src/Wide.Tools.Logger/LoggerModel.cs b/Src/Wide.Tools.Logger/LoggerModel.cs new file mode 100644 index 0000000..4d00e69 --- /dev/null +++ b/Src/Wide.Tools.Logger/LoggerModel.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Wide.Interfaces; +using Wide.Interfaces.Services; + +namespace Wide.Tools.Logger +{ + class LoggerModel : INotifyPropertyChanged + { + private string _text; + + public event PropertyChangedEventHandler PropertyChanged; + + public void AddLog(ILoggerService logger) + { + _text += logger.Message + "\n"; + RaisePropertyChanged("Text"); + } + + public string Text + { + get { return _text; } + } + + /// + /// Should be called when a property value has changed + /// + /// The property name + protected virtual void RaisePropertyChanged(string propertyName) + { + if (PropertyChanged != null) + PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); + } + } +} diff --git a/Src/Wide.Tools.Logger/LoggerModule.cs b/Src/Wide.Tools.Logger/LoggerModule.cs new file mode 100644 index 0000000..b5c9d97 --- /dev/null +++ b/Src/Wide.Tools.Logger/LoggerModule.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Wide.Interfaces; +using Wide.Interfaces.Events; +using Microsoft.Practices.Prism.Events; +using Microsoft.Practices.Prism.Modularity; +using Microsoft.Practices.Unity; +using Wide.Interfaces.Services; + +namespace Wide.Tools.Logger +{ + public class LoggerModule : IModule + { + private readonly IUnityContainer _container; + + public LoggerModule(IUnityContainer container) + { + _container = container; + } + + public void Initialize() + { + EventAggregator.GetEvent().Publish(new SplashMessageUpdateEvent { Message = "Loading Logger Module" }); + _container.RegisterType(); + IWorkspace workspace = _container.Resolve(); + workspace.Tools.Add(_container.Resolve()); + } + + private IEventAggregator EventAggregator + { + get { return _container.Resolve(); } + } + } +} diff --git a/Src/Wide.Tools.Logger/LoggerView.xaml b/Src/Wide.Tools.Logger/LoggerView.xaml new file mode 100644 index 0000000..7afc329 --- /dev/null +++ b/Src/Wide.Tools.Logger/LoggerView.xaml @@ -0,0 +1,11 @@ + + + + + diff --git a/Src/Wide.Tools.Logger/LoggerView.xaml.cs b/Src/Wide.Tools.Logger/LoggerView.xaml.cs new file mode 100644 index 0000000..7bbaa4a --- /dev/null +++ b/Src/Wide.Tools.Logger/LoggerView.xaml.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; +using Wide.Interfaces; + +namespace Wide.Tools.Logger +{ + /// + /// Interaction logic for LoggerView.xaml + /// + public partial class LoggerView : UserControl, IContentView + { + public LoggerView() + { + InitializeComponent(); + } + } +} diff --git a/Src/Wide.Tools.Logger/LoggerViewModel.cs b/Src/Wide.Tools.Logger/LoggerViewModel.cs new file mode 100644 index 0000000..0cb073b --- /dev/null +++ b/Src/Wide.Tools.Logger/LoggerViewModel.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Wide.Interfaces; +using Wide.Interfaces.Events; +using Microsoft.Practices.Prism.Events; +using Microsoft.Practices.Unity; +using Wide.Interfaces.Services; + +namespace Wide.Tools.Logger +{ + class LoggerViewModel : ToolViewModel + { + private LoggerModel _model; + private LoggerView _view; + private IWorkspace _workspace; + private IUnityContainer _container; + private IEventAggregator _aggregator; + + public LoggerViewModel(IUnityContainer container, AbstractWorkspace workspace) + { + _workspace = workspace; + _container = container; + this.Name = "Logger"; + this.Title = "Logger"; + this.ContentId = "Logger"; + _model = new LoggerModel(); + this.Model = _model; + this.IsVisible = false; + + _view = new LoggerView(); + _view.DataContext = _model; + this.View = _view; + + _aggregator = _container.Resolve(); + _aggregator.GetEvent().Subscribe(AddLog); + } + + private void AddLog(ILoggerService logger) + { + _model.AddLog(logger); + } + } +} diff --git a/Src/Wide.Tools.Logger/Properties/AssemblyInfo.cs b/Src/Wide.Tools.Logger/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..6fa3afb --- /dev/null +++ b/Src/Wide.Tools.Logger/Properties/AssemblyInfo.cs @@ -0,0 +1,55 @@ +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Wide.Tools.Logger")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Wide.Tools.Logger")] +[assembly: AssemblyCopyright("Copyright © 2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +//In order to begin building localizable applications, set +//CultureYouAreCodingWith in your .csproj file +//inside a . For example, if you are using US english +//in your source files, set the to en-US. Then uncomment +//the NeutralResourceLanguage attribute below. Update the "en-US" in +//the line below to match the UICulture setting in the project file. + +//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] + + +[assembly:ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] + + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Src/Wide.Tools.Logger/Properties/Resources.Designer.cs b/Src/Wide.Tools.Logger/Properties/Resources.Designer.cs new file mode 100644 index 0000000..d78e4c3 --- /dev/null +++ b/Src/Wide.Tools.Logger/Properties/Resources.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.18010 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Wide.Tools.Logger.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Wide.Tools.Logger.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/Src/Wide.Tools.Logger/Properties/Resources.resx b/Src/Wide.Tools.Logger/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/Src/Wide.Tools.Logger/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Src/Wide.Tools.Logger/Properties/Settings.Designer.cs b/Src/Wide.Tools.Logger/Properties/Settings.Designer.cs new file mode 100644 index 0000000..dee08ca --- /dev/null +++ b/Src/Wide.Tools.Logger/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.18010 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Wide.Tools.Logger.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + } +} diff --git a/Src/Wide.Tools.Logger/Properties/Settings.settings b/Src/Wide.Tools.Logger/Properties/Settings.settings new file mode 100644 index 0000000..033d7a5 --- /dev/null +++ b/Src/Wide.Tools.Logger/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Src/Wide.Tools.Logger/Wide.Tools.Logger.csproj b/Src/Wide.Tools.Logger/Wide.Tools.Logger.csproj new file mode 100644 index 0000000..c3748aa --- /dev/null +++ b/Src/Wide.Tools.Logger/Wide.Tools.Logger.csproj @@ -0,0 +1,133 @@ + + + + + Debug + AnyCPU + {982D3282-82A0-4586-99ED-F60D2FD67517} + library + Properties + Wide.Tools.Logger + Wide.Tools.Logger + v4.0 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + + + + true + full + false + ..\..\Build\Internal\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + ..\..\Build\Internal\ + TRACE + prompt + 4 + + + + ..\..\Libs\Microsoft.Practices.Prism.dll + False + + + ..\..\Libs\Microsoft.Practices.Prism.Interactivity.dll + False + + + ..\..\Libs\Microsoft.Practices.Prism.MefExtensions.dll + False + + + ..\..\Libs\Microsoft.Practices.Prism.UnityExtensions.dll + False + + + ..\..\Libs\Microsoft.Practices.ServiceLocation.dll + False + + + ..\..\Libs\Microsoft.Practices.Unity.dll + False + + + ..\..\Libs\NLog.dll + False + + + + + + + + + + 4.0 + + + + + + + + + + LoggerView.xaml + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + ResXFileCodeGenerator + Resources.Designer.cs + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + {9f20f5ef-4f7e-4ae2-a462-4cd2256fb3ff} + Wide.Interfaces + False + + + + + Designer + MSBuild:Compile + + + + + + + + + \ No newline at end of file diff --git a/Src/Wide/App.xaml b/Src/Wide/App.xaml new file mode 100644 index 0000000..ff36e97 --- /dev/null +++ b/Src/Wide/App.xaml @@ -0,0 +1,11 @@ + + + + + + + + + diff --git a/Src/Wide/App.xaml.cs b/Src/Wide/App.xaml.cs new file mode 100644 index 0000000..18cfb1b --- /dev/null +++ b/Src/Wide/App.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Threading.Tasks; +using System.Windows; +using Wide.Shell; + + +namespace WideTestApp +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + private AppBootstrapper b; + + protected override void OnStartup(StartupEventArgs e) + { + base.OnStartup(e); + b = new AppBootstrapper(); + b.Run(); + } + } +} diff --git a/Src/Wide/AppBootstrapper.cs b/Src/Wide/AppBootstrapper.cs new file mode 100644 index 0000000..4b8c90e --- /dev/null +++ b/Src/Wide/AppBootstrapper.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Wide.Interfaces; +using Wide.Shell; +using Microsoft.Practices.Unity; +using Wide.Splash; + +namespace WideTestApp +{ + class AppBootstrapper : WideBootstrapper + { + public AppBootstrapper(bool isMetro = true) : base(isMetro) + { + } + + protected override void InitializeModules() + { + //Register your splash view or else the default splash will load + //Container.RegisterType(); + + //Register your workspace here - if you have any + Container.RegisterType(new ContainerControlledLifetimeManager()); + + // You can also override the logger service. Currently, NLog is used. + // Since the config file is there in the output location, text files should be available in the Logs folder. + + //Initialize the original bootstrapper which will load modules from the probing path. Check app.config for probing path. + base.InitializeModules(); + + //Load the required stuff + //NOTE: this should probably be done from other modules. This is used only for demo purpose. + Loader loader = new Loader(Container); + } + } +} diff --git a/Src/Wide/AppSplash.xaml b/Src/Wide/AppSplash.xaml new file mode 100644 index 0000000..8622032 --- /dev/null +++ b/Src/Wide/AppSplash.xaml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Src/Wide/AppSplash.xaml.cs b/Src/Wide/AppSplash.xaml.cs new file mode 100644 index 0000000..e71be4f --- /dev/null +++ b/Src/Wide/AppSplash.xaml.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; +using Wide.Splash; + +namespace WideTestApp +{ + /// + /// Interaction logic for AppSplash.xaml + /// + public partial class AppSplash : Window, ISplashView + { + public AppSplash(SplashViewModel model) + { + InitializeComponent(); + this.DataContext = model; + } + } +} diff --git a/Src/Wide/Icon.png b/Src/Wide/Icon.png new file mode 100644 index 0000000..968d714 Binary files /dev/null and b/Src/Wide/Icon.png differ diff --git a/Src/Wide/IconWorkspace.cs b/Src/Wide/IconWorkspace.cs new file mode 100644 index 0000000..d79e33b --- /dev/null +++ b/Src/Wide/IconWorkspace.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows.Controls; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using Microsoft.Practices.Unity; +using Wide.Interfaces; + +namespace WideTestApp +{ + public class IconWorkspace : AbstractWorkspace + { + public IconWorkspace(IUnityContainer container) : base(container) + { + } + + public override ImageSource Icon + { + get + { + ImageSource imageSource = new BitmapImage(new Uri("pack://application:,,,/WideTestApp;component/Icon.png")); + return imageSource; + } + } + } +} diff --git a/Src/Wide/Loader.cs b/Src/Wide/Loader.cs new file mode 100644 index 0000000..6baecd0 --- /dev/null +++ b/Src/Wide/Loader.cs @@ -0,0 +1,152 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows; +using System.Windows.Input; +using System.Windows.Media.Imaging; +using Microsoft.Practices.Prism.Commands; +using Microsoft.Practices.Unity; +using Wide.Interfaces; +using Wide.Interfaces.Services; +using Wide.Interfaces.Themes; + +namespace WideTestApp +{ + /* + * NOTE: You don't need a loaded class to load menu/toolbar/commands + * The idea is to make the modules participate in adding the same. This way, + * each module can concentrate on a particular area and provide interfaces + * for other modules which can make use of it. + * The loader is just used for a demo purpose. I would recommend using modules. + */ + class Loader + { + private IUnityContainer _container; + + public Loader(IUnityContainer container) + { + _container = container; + LoadTheme(); + LoadCommands(); + LoadMenus(); + LoadToolbar(); + } + + private void LoadTheme() + { + IThemeManager manager = _container.Resolve(); + //manager.AddTheme(new VS2010()); + //manager.SetCurrent("VS2010"); + manager.AddTheme(new LightTheme()); + manager.SetCurrent("Light"); + } + + private void LoadMenus() + { + ICommandManager manager = _container.Resolve(); + AbstractMenuItem vm = _container.Resolve(); + IWorkspace workspace = _container.Resolve(); + ToolViewModel logger = workspace.Tools.First(f => f.ContentId == "Logger"); + + vm.Add(new MenuItemViewModel("_File", 1)); + + vm.Get("_File").Add((new MenuItemViewModel("_Open", 4, new BitmapImage(new Uri(@"E:\VS2012 Modern Image Library\Actions\png\OpenFileDialog_692.png")), manager.GetCommand("OPEN"), new KeyGesture(Key.O, ModifierKeys.Control, "Ctrl + O")))); + vm.Get("_File").Add(new MenuItemViewModel("_Save", 5, new BitmapImage(new Uri(@"E:\VS2012 Modern Image Library\Actions\png\Save_6530.png")), manager.GetCommand("SAVE"), new KeyGesture(Key.S, ModifierKeys.Control, "Ctrl + S"))); + vm.Get("_File").Add(new MenuItemViewModel("Close", 8, null, manager.GetCommand("CLOSE"), new KeyGesture(Key.F4, ModifierKeys.Control, "Ctrl + F4"))); + + + vm.Add(new MenuItemViewModel("_Edit", 2)); + vm.Get("_Edit").Add(new MenuItemViewModel("_Undo", 1, new BitmapImage(new Uri(@"E:\VS2012 Modern Image Library\Actions\png\Undo_16x.png")), ApplicationCommands.Undo)); + vm.Get("_Edit").Add(new MenuItemViewModel("_Redo", 2, new BitmapImage(new Uri(@"E:\VS2012 Modern Image Library\Actions\png\Redo_16x.png")), ApplicationCommands.Redo)); + vm.Get("_Edit").Add(MenuItemViewModel.Separator(15)); + vm.Get("_Edit").Add(new MenuItemViewModel("Cut", 20, new BitmapImage(new Uri(@"E:\VS2012 Modern Image Library\Actions\png\Cut_6523.png")), ApplicationCommands.Cut)); + vm.Get("_Edit").Add(new MenuItemViewModel("Copy", 21, new BitmapImage(new Uri(@"E:\VS2012 Modern Image Library\Actions\png\Copy_6524.png")), ApplicationCommands.Copy)); + vm.Get("_Edit").Add(new MenuItemViewModel("_Paste", 22, new BitmapImage(new Uri(@"E:\VS2012 Modern Image Library\Actions\png\Paste_6520.png")), ApplicationCommands.Paste)); + + vm.Add(new MenuItemViewModel("_View", 3)); + + if(logger != null) + vm.Get("_View").Add(new MenuItemViewModel("_Logger", 1, new BitmapImage(new Uri(@"E:\VS2012 Modern Image Library\Actions\png\Undo_16x.png")), manager.GetCommand("LOGSHOW")) {IsCheckable = true, IsChecked = logger.IsVisible}); + } + + private void LoadToolbar() + { + IToolbarService service = _container.Resolve(); + AbstractMenuItem vm = _container.Resolve(); + //Parameter overrides are used to set parameter value when you are resolving using the container + ToolbarViewModel mainToolbar = _container.Resolve(new ParameterOverride("header", "mainToolbar")); + ToolbarViewModel editToolbar = _container.Resolve(new ParameterOverride("header", "editToolbar")); + + mainToolbar.Band = 0; + mainToolbar.BandIndex = 1; + editToolbar.Add(vm.Get("_Edit").Get("_Undo")); + editToolbar.Add(MenuItemViewModel.Separator(2)); + editToolbar.Add(vm.Get("_Edit").Get("_Redo")); + mainToolbar.Add(vm.Get("_Edit").Get("Cut")); + mainToolbar.Add(vm.Get("_Edit").Get("Copy")); + mainToolbar.Add(vm.Get("_Edit").Get("_Paste")); + mainToolbar.Band = 0; + mainToolbar.BandIndex = 2; + service.Add(mainToolbar); + service.Add(editToolbar); + } + + private void LoadCommands() + { + ICommandManager manager = _container.Resolve(); + + //throw new NotImplementedException(); + DelegateCommand openCommand = new DelegateCommand(OpenModule); + DelegateCommand saveCommand = new DelegateCommand(SaveDocument, CanExecuteSaveDocument); + DelegateCommand loggerCommand = new DelegateCommand(ToggleLogger); + + + manager.RegisterCommand("OPEN", openCommand); + manager.RegisterCommand("SAVE", saveCommand); + manager.RegisterCommand("LOGSHOW", loggerCommand); + } + + private void ToggleLogger() + { + IWorkspace workspace = _container.Resolve(); + AbstractMenuItem vm = _container.Resolve(); + ToolViewModel logger = workspace.Tools.First(f => f.ContentId == "Logger"); + if(logger != null) + { + logger.IsVisible = !logger.IsVisible; + AbstractMenuItem mi = vm.Get("_View").Get("_Logger") as AbstractMenuItem; + mi.IsChecked = logger.IsVisible; + } + } + + #region Commands + #region Open + private void OpenModule() + { + IOpenFileService service = _container.Resolve(); + service.Open(); + } + #endregion + + #region Save + private bool CanExecuteSaveDocument() + { + IWorkspace workspace = _container.Resolve(); + if (workspace.ActiveDocument != null) + { + return workspace.ActiveDocument.Model.IsDirty; + } + return false; + } + + private void SaveDocument() + { + IWorkspace workspace = _container.Resolve(); + workspace.ActiveDocument.Handler.SaveContent(workspace.ActiveDocument); + } + #endregion + + #endregion + } +} diff --git a/Src/Wide/Properties/AssemblyInfo.cs b/Src/Wide/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..4942918 --- /dev/null +++ b/Src/Wide/Properties/AssemblyInfo.cs @@ -0,0 +1,55 @@ +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("WideTestApp")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Wide")] +[assembly: AssemblyProduct("Wide")] +[assembly: AssemblyCopyright("Copyright © 2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +//In order to begin building localizable applications, set +//CultureYouAreCodingWith in your .csproj file +//inside a . For example, if you are using US english +//in your source files, set the to en-US. Then uncomment +//the NeutralResourceLanguage attribute below. Update the "en-US" in +//the line below to match the UICulture setting in the project file. + +//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] + + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] + + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Src/Wide/Properties/Resources.Designer.cs b/Src/Wide/Properties/Resources.Designer.cs new file mode 100644 index 0000000..e4d2b74 --- /dev/null +++ b/Src/Wide/Properties/Resources.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.18010 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WideTestApp.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WideTestApp.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/Src/Wide/Properties/Resources.resx b/Src/Wide/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/Src/Wide/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Src/Wide/Properties/Settings.Designer.cs b/Src/Wide/Properties/Settings.Designer.cs new file mode 100644 index 0000000..1438f88 --- /dev/null +++ b/Src/Wide/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.18010 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WideTestApp.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + } +} diff --git a/Src/Wide/Properties/Settings.settings b/Src/Wide/Properties/Settings.settings new file mode 100644 index 0000000..033d7a5 --- /dev/null +++ b/Src/Wide/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Src/Wide/WideTestApp.csproj b/Src/Wide/WideTestApp.csproj new file mode 100644 index 0000000..cccab39 --- /dev/null +++ b/Src/Wide/WideTestApp.csproj @@ -0,0 +1,162 @@ + + + + + Debug + AnyCPU + {7121ACBA-A770-43A5-BE0A-3195A2182F11} + WinExe + Properties + WideTestApp + WideTestApp + v4.0 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + + + + + AnyCPU + true + full + false + ..\..\Build\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + ..\..\Build\ + TRACE + prompt + 4 + + + + ..\..\Libs\AvalonDock.dll + False + + + ..\..\Libs\Microsoft.Practices.Prism.dll + False + + + ..\..\Libs\Microsoft.Practices.Prism.UnityExtensions.dll + False + + + False + ..\..\Libs\Microsoft.Practices.ServiceLocation.dll + False + + + ..\..\Libs\Microsoft.Practices.Unity.dll + False + + + + + + + + + + 4.0 + + + + + + ..\..\Libs\WPF.Themes.dll + False + + + + + MSBuild:Compile + Designer + + + App.xaml + Code + + + + + + AppSplash.xaml + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + ResXFileCodeGenerator + Resources.Designer.cs + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + + + + {9f20f5ef-4f7e-4ae2-a462-4cd2256fb3ff} + Wide.Interfaces + False + + + {117809de-4800-479b-bca7-1d5aa6dbe30f} + Wide.Shell + False + + + {f5bfb5bd-08a3-46cf-a967-7d45772d9877} + Wide.Splash + False + + + + + Designer + MSBuild:Compile + + + + + + + + xcopy "$(SolutionDir)Libs" "$(TargetDir)External" /E /Y /I /R + + + + + + + \ No newline at end of file diff --git a/Src/Wide/app.config b/Src/Wide/app.config new file mode 100644 index 0000000..efec2a5 --- /dev/null +++ b/Src/Wide/app.config @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/Wide.sln b/Wide.sln new file mode 100644 index 0000000..45de37f --- /dev/null +++ b/Wide.sln @@ -0,0 +1,76 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WideTestApp", "Src\Wide\WideTestApp.csproj", "{7121ACBA-A770-43A5-BE0A-3195A2182F11}" + ProjectSection(ProjectDependencies) = postProject + {2155B852-E4EC-4BD1-9255-21CFAEADF268} = {2155B852-E4EC-4BD1-9255-21CFAEADF268} + {982D3282-82A0-4586-99ED-F60D2FD67517} = {982D3282-82A0-4586-99ED-F60D2FD67517} + {EC4B20C3-DF90-40F1-8547-ADCFCEBE5B81} = {EC4B20C3-DF90-40F1-8547-ADCFCEBE5B81} + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wide.Interfaces", "Src\Wide.Interfaces\Wide.Interfaces.csproj", "{9F20F5EF-4F7E-4AE2-A462-4CD2256FB3FF}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wide.Core", "Src\Wide.Core\Wide.Core.csproj", "{2155B852-E4EC-4BD1-9255-21CFAEADF268}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wide.Splash", "Src\Wide.Splash\Wide.Splash.csproj", "{F5BFB5BD-08A3-46CF-A967-7D45772D9877}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wide.Tools.Logger", "Src\Wide.Tools.Logger\Wide.Tools.Logger.csproj", "{982D3282-82A0-4586-99ED-F60D2FD67517}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Infrastructure", "Infrastructure", "{A1E44474-A9D9-46BD-B1A1-3DEE8C61B7AD}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Modules", "Modules", "{92EB10BB-F612-4C23-84BA-95A5D64F851B}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Test", "Test", "{4A44F9E9-0B25-4511-AB6D-2BB3E44DA808}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wide.Shell", "Src\Wide.Shell\Wide.Shell.csproj", "{117809DE-4800-479B-BCA7-1D5AA6DBE30F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wide.Settings", "Src\Wide.Settings\Wide.Settings.csproj", "{EC4B20C3-DF90-40F1-8547-ADCFCEBE5B81}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {7121ACBA-A770-43A5-BE0A-3195A2182F11}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7121ACBA-A770-43A5-BE0A-3195A2182F11}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7121ACBA-A770-43A5-BE0A-3195A2182F11}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7121ACBA-A770-43A5-BE0A-3195A2182F11}.Release|Any CPU.Build.0 = Release|Any CPU + {9F20F5EF-4F7E-4AE2-A462-4CD2256FB3FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9F20F5EF-4F7E-4AE2-A462-4CD2256FB3FF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9F20F5EF-4F7E-4AE2-A462-4CD2256FB3FF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9F20F5EF-4F7E-4AE2-A462-4CD2256FB3FF}.Release|Any CPU.Build.0 = Release|Any CPU + {2155B852-E4EC-4BD1-9255-21CFAEADF268}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2155B852-E4EC-4BD1-9255-21CFAEADF268}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2155B852-E4EC-4BD1-9255-21CFAEADF268}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2155B852-E4EC-4BD1-9255-21CFAEADF268}.Release|Any CPU.Build.0 = Release|Any CPU + {F5BFB5BD-08A3-46CF-A967-7D45772D9877}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F5BFB5BD-08A3-46CF-A967-7D45772D9877}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F5BFB5BD-08A3-46CF-A967-7D45772D9877}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F5BFB5BD-08A3-46CF-A967-7D45772D9877}.Release|Any CPU.Build.0 = Release|Any CPU + {982D3282-82A0-4586-99ED-F60D2FD67517}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {982D3282-82A0-4586-99ED-F60D2FD67517}.Debug|Any CPU.Build.0 = Debug|Any CPU + {982D3282-82A0-4586-99ED-F60D2FD67517}.Release|Any CPU.ActiveCfg = Release|Any CPU + {982D3282-82A0-4586-99ED-F60D2FD67517}.Release|Any CPU.Build.0 = Release|Any CPU + {117809DE-4800-479B-BCA7-1D5AA6DBE30F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {117809DE-4800-479B-BCA7-1D5AA6DBE30F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {117809DE-4800-479B-BCA7-1D5AA6DBE30F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {117809DE-4800-479B-BCA7-1D5AA6DBE30F}.Release|Any CPU.Build.0 = Release|Any CPU + {EC4B20C3-DF90-40F1-8547-ADCFCEBE5B81}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EC4B20C3-DF90-40F1-8547-ADCFCEBE5B81}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EC4B20C3-DF90-40F1-8547-ADCFCEBE5B81}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EC4B20C3-DF90-40F1-8547-ADCFCEBE5B81}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {7121ACBA-A770-43A5-BE0A-3195A2182F11} = {4A44F9E9-0B25-4511-AB6D-2BB3E44DA808} + {2155B852-E4EC-4BD1-9255-21CFAEADF268} = {A1E44474-A9D9-46BD-B1A1-3DEE8C61B7AD} + {9F20F5EF-4F7E-4AE2-A462-4CD2256FB3FF} = {A1E44474-A9D9-46BD-B1A1-3DEE8C61B7AD} + {117809DE-4800-479B-BCA7-1D5AA6DBE30F} = {A1E44474-A9D9-46BD-B1A1-3DEE8C61B7AD} + {982D3282-82A0-4586-99ED-F60D2FD67517} = {92EB10BB-F612-4C23-84BA-95A5D64F851B} + {F5BFB5BD-08A3-46CF-A967-7D45772D9877} = {92EB10BB-F612-4C23-84BA-95A5D64F851B} + {EC4B20C3-DF90-40F1-8547-ADCFCEBE5B81} = {92EB10BB-F612-4C23-84BA-95A5D64F851B} + EndGlobalSection +EndGlobal