diff --git a/build/Build.proj b/build/Build.proj index 6c33dbdd12..e4a506b350 100644 --- a/build/Build.proj +++ b/build/Build.proj @@ -122,7 +122,7 @@ - + - - - - - - - - - + + + + + + + diff --git a/lib/CookComputing.XmlRpcV2.dll b/lib/CookComputing.XmlRpcV2.dll deleted file mode 100644 index 5b49862aa3..0000000000 Binary files a/lib/CookComputing.XmlRpcV2.dll and /dev/null differ diff --git a/lib/DLR 2.0 SP1/IronPython.Modules.dll b/lib/DLR 2.0 SP1/IronPython.Modules.dll deleted file mode 100644 index a24e7b82b3..0000000000 Binary files a/lib/DLR 2.0 SP1/IronPython.Modules.dll and /dev/null differ diff --git a/lib/DLR 2.0 SP1/IronPython.dll b/lib/DLR 2.0 SP1/IronPython.dll deleted file mode 100644 index b82653ff0f..0000000000 Binary files a/lib/DLR 2.0 SP1/IronPython.dll and /dev/null differ diff --git a/lib/DLR 2.0 SP1/IronRuby.Libraries.Yaml.dll b/lib/DLR 2.0 SP1/IronRuby.Libraries.Yaml.dll deleted file mode 100644 index 44a6de7e6e..0000000000 Binary files a/lib/DLR 2.0 SP1/IronRuby.Libraries.Yaml.dll and /dev/null differ diff --git a/lib/DLR 2.0 SP1/IronRuby.Libraries.dll b/lib/DLR 2.0 SP1/IronRuby.Libraries.dll deleted file mode 100644 index b0d5b42196..0000000000 Binary files a/lib/DLR 2.0 SP1/IronRuby.Libraries.dll and /dev/null differ diff --git a/lib/DLR 2.0 SP1/IronRuby.dll b/lib/DLR 2.0 SP1/IronRuby.dll deleted file mode 100644 index fcf40070f9..0000000000 Binary files a/lib/DLR 2.0 SP1/IronRuby.dll and /dev/null differ diff --git a/lib/DLR 2.0 SP1/Microsoft.Dynamic.dll b/lib/DLR 2.0 SP1/Microsoft.Dynamic.dll deleted file mode 100644 index c8fee0eefb..0000000000 Binary files a/lib/DLR 2.0 SP1/Microsoft.Dynamic.dll and /dev/null differ diff --git a/lib/DLR 2.0 SP1/Microsoft.Scripting.Core.dll b/lib/DLR 2.0 SP1/Microsoft.Scripting.Core.dll deleted file mode 100644 index b0c97f2400..0000000000 Binary files a/lib/DLR 2.0 SP1/Microsoft.Scripting.Core.dll and /dev/null differ diff --git a/lib/DLR 2.0 SP1/Microsoft.Scripting.Debugging.dll b/lib/DLR 2.0 SP1/Microsoft.Scripting.Debugging.dll deleted file mode 100644 index b39a623bf6..0000000000 Binary files a/lib/DLR 2.0 SP1/Microsoft.Scripting.Debugging.dll and /dev/null differ diff --git a/lib/DLR 2.0 SP1/Microsoft.Scripting.ExtensionAttribute.old b/lib/DLR 2.0 SP1/Microsoft.Scripting.ExtensionAttribute.old deleted file mode 100644 index 4ddf4f90d9..0000000000 Binary files a/lib/DLR 2.0 SP1/Microsoft.Scripting.ExtensionAttribute.old and /dev/null differ diff --git a/lib/DLR 2.0 SP1/Microsoft.Scripting.dll b/lib/DLR 2.0 SP1/Microsoft.Scripting.dll deleted file mode 100644 index aba0cdea9b..0000000000 Binary files a/lib/DLR 2.0 SP1/Microsoft.Scripting.dll and /dev/null differ diff --git a/lib/DLR 4.0/IronPython.Modules.dll b/lib/DLR 4.0/IronPython.Modules.dll deleted file mode 100644 index 7d93410e0b..0000000000 Binary files a/lib/DLR 4.0/IronPython.Modules.dll and /dev/null differ diff --git a/lib/DLR 4.0/IronPython.dll b/lib/DLR 4.0/IronPython.dll deleted file mode 100644 index 26fe7e1754..0000000000 Binary files a/lib/DLR 4.0/IronPython.dll and /dev/null differ diff --git a/lib/DLR 4.0/IronRuby.Libraries.Yaml.dll b/lib/DLR 4.0/IronRuby.Libraries.Yaml.dll deleted file mode 100644 index 30dea5a77c..0000000000 Binary files a/lib/DLR 4.0/IronRuby.Libraries.Yaml.dll and /dev/null differ diff --git a/lib/DLR 4.0/IronRuby.Libraries.dll b/lib/DLR 4.0/IronRuby.Libraries.dll deleted file mode 100644 index 65159680ca..0000000000 Binary files a/lib/DLR 4.0/IronRuby.Libraries.dll and /dev/null differ diff --git a/lib/DLR 4.0/IronRuby.dll b/lib/DLR 4.0/IronRuby.dll deleted file mode 100644 index b19a269466..0000000000 Binary files a/lib/DLR 4.0/IronRuby.dll and /dev/null differ diff --git a/lib/DLR 4.0/Microsoft.Dynamic.dll b/lib/DLR 4.0/Microsoft.Dynamic.dll deleted file mode 100644 index 0dc44480aa..0000000000 Binary files a/lib/DLR 4.0/Microsoft.Dynamic.dll and /dev/null differ diff --git a/lib/DLR 4.0/Microsoft.Scripting.Debugging.dll b/lib/DLR 4.0/Microsoft.Scripting.Debugging.dll deleted file mode 100644 index a129515cf7..0000000000 Binary files a/lib/DLR 4.0/Microsoft.Scripting.Debugging.dll and /dev/null differ diff --git a/lib/DLR 4.0/Microsoft.Scripting.dll b/lib/DLR 4.0/Microsoft.Scripting.dll deleted file mode 100644 index 65f1697576..0000000000 Binary files a/lib/DLR 4.0/Microsoft.Scripting.dll and /dev/null differ diff --git a/lib/Examine.dll b/lib/Examine.dll deleted file mode 100644 index 917f9c3109..0000000000 Binary files a/lib/Examine.dll and /dev/null differ diff --git a/lib/HtmlAgilityPack.dll b/lib/HtmlAgilityPack.dll deleted file mode 100644 index 7108ee47cd..0000000000 Binary files a/lib/HtmlAgilityPack.dll and /dev/null differ diff --git a/lib/ICSharpCode.SharpZipLib.dll b/lib/ICSharpCode.SharpZipLib.dll deleted file mode 100644 index fe643ebc63..0000000000 Binary files a/lib/ICSharpCode.SharpZipLib.dll and /dev/null differ diff --git a/lib/IronMath.dll b/lib/IronMath.dll deleted file mode 100644 index aca8253d2e..0000000000 Binary files a/lib/IronMath.dll and /dev/null differ diff --git a/lib/IronPython.Modules.xml b/lib/IronPython.Modules.xml deleted file mode 100644 index 714901ed0e..0000000000 --- a/lib/IronPython.Modules.xml +++ /dev/null @@ -1,1163 +0,0 @@ - - - - IronPython.Modules - - - - - Creates an optimized encoding mapping that can be consumed by an optimized version of charmap_encode. - - - - - Decodes the input string using the provided string mapping. - - - - - Encodes the input string with the specified optimized encoding map. - - - - - Optimied encoding mapping that can be consumed by charmap_encode. - - - - - Provides helper functions which need to be called from generated code to implement various - portions of modules. - - - - - BytesIO([initializer]) -> object - - Create a buffered I/O implementation using an in-memory bytes - buffer, ready for reading and writing. - - - - - close() -> None. Disable all I/O operations. - - - - - flush() -> None. Does nothing. - - - - - getvalue() -> bytes. - - Retrieve the entire contents of the BytesIO object. - - - - - True if the file is closed. - - - - - Walks the queue calling back to the specified delegate for - each populated index in the queue. - - - - - Throw TypeError with a specified message if object isn't callable. - - - - - Convert object to ushort, throwing ValueError on overflow. - - - - - Interface for "file-like objects" that implement the protocol needed by load() and friends. - This enables the creation of thin wrappers that make fast .NET types and slow Python types look the same. - - - - - Interface for "file-like objects" that implement the protocol needed by dump() and friends. - This enables the creation of thin wrappers that make fast .NET types and slow Python types look the same. - - - - - Call the appropriate reduce method for obj and pickle the object using - the resulting data. Use the first available of - copy_reg.dispatch_table[type(obj)], obj.__reduce_ex__, and obj.__reduce__. - - - - - Pickle the result of a reduce function. - - Only context, obj, func, and reduceCallable are required; all other arguments may be null. - - - - - Write value in pickle decimalnl_short format. - - - - - Write value in pickle float8 format. - - - - - Write value in pickle uint1 format. - - - - - Write value in pickle uint2 format. - - - - - Write value in pickle int4 format. - - - - - Write value in pickle decimalnl_short format. - - - - - Write value in pickle decimalnl_long format. - - - - - Write value in pickle unicodestringnl format. - - - - - Write value in pickle unicodestring4 format. - - - - - Write value in pickle stringnl_noescape_pair format. - - - - - Return true if value is appropriate for formatting in pickle uint1 format. - - - - - Return true if value is appropriate for formatting in pickle uint2 format. - - - - - Return true if value is appropriate for formatting in pickle int4 format. - - - - - Emit a series of opcodes that will set append all items indexed by iter - to the object at the top of the stack. Use APPENDS if possible, but - append no more than BatchSize items at a time. - - - - - Emit a series of opcodes that will set all (key, value) pairs indexed by - iter in the object at the top of the stack. Use SETITEMS if possible, - but append no more than BatchSize items at a time. - - - - - Find the module for obj and ensure that obj is reachable in that module by the given name. - - Throw PicklingError if any of the following are true: - - The module couldn't be determined. - - The module couldn't be loaded. - - The given name doesn't exist in the module. - - The given name is a different object than obj. - - Otherwise, return the name of the module. - - To determine which module obj lives in, obj.__module__ is used if available. The - module named by obj.__module__ is loaded if needed. If obj has no __module__ - attribute, then each loaded module is searched. If a loaded module has an - attribute with the given name, and that attribute is the same object as obj, - then that module is used. - - - - - Interpret everything from markIndex to the top of the stack as a sequence - of key, value, key, value, etc. Set dict[key] = value for each. Pop - everything from markIndex up when done. - - - - - Used to check the type to see if we can do a comparison. Returns true if we can - or false if we should return NotImplemented. May throw if the type's really wrong. - - - - - Helper function for doing the comparisons. time has no __cmp__ method - - - - - Base class used for iterator wrappers. - - - - - Popupates the given directory w/ the locale information from the given - CultureInfo. - - - - - Checks for the specific permissions, provided by the mode parameter, are available for the provided path. Permissions can be: - - F_OK: Check to see if the file exists - R_OK | W_OK | X_OK: Check for the specific permissions. Only W_OK is respected. - - - - - single instance of environment dictionary is shared between multiple runtimes because the environment - is shared by multiple runtimes. - - - - - spawns a new process. - - If mode is nt.P_WAIT then then the call blocks until the process exits and the return value - is the exit code. - - Otherwise the call returns a handle to the process. The caller must then call nt.waitpid(pid, options) - to free the handle and get the exit code of the process. Failure to call nt.waitpid will result - in a handle leak. - - - - - spawns a new process. - - If mode is nt.P_WAIT then then the call blocks until the process exits and the return value - is the exit code. - - Otherwise the call returns a handle to the process. The caller must then call nt.waitpid(pid, options) - to free the handle and get the exit code of the process. Failure to call nt.waitpid will result - in a handle leak. - - - - - spawns a new process. - - If mode is nt.P_WAIT then then the call blocks until the process exits and the return value - is the exit code. - - Otherwise the call returns a handle to the process. The caller must then call nt.waitpid(pid, options) - to free the handle and get the exit code of the process. Failure to call nt.waitpid will result - in a handle leak. - - - - - spawns a new process. - - If mode is nt.P_WAIT then then the call blocks until the process exits and the return value - is the exit code. - - Otherwise the call returns a handle to the process. The caller must then call nt.waitpid(pid, options) - to free the handle and get the exit code of the process. Failure to call nt.waitpid will result - in a handle leak. - - - - - Copy elements from a Python mapping of dict environment variables to a StringDictionary. - - - - - Convert a sequence of args to a string suitable for using to spawn a process. - - - - - Python regular expression module. - - - - - Preparses a regular expression text returning a ParsedRegex class - that can be used for further regular expressions. - - - - - Compiled reg-ex pattern - - - - - Process a sequence of objects that are compatible with ObjectToSocket(). Return two - things as out params: an in-order List of sockets that correspond to the original - objects in the passed-in sequence, and a mapping of these socket objects to their - original objects. - - The socketToOriginal mapping is generated because the CPython select module supports - passing to select either file descriptor numbers or an object with a fileno() method. - We try to be faithful to what was originally requested when we return. - - - - - Return the System.Net.Sockets.Socket object that corresponds to the passed-in - object. obj can be a System.Net.Sockets.Socket, a PythonSocket.SocketObj, a - long integer (representing a socket handle), or a Python object with a fileno() - method (whose result is used to look up an existing PythonSocket.SocketObj, - which is in turn converted to a Socket. - - - - - Convert an object to a 32-bit integer. This adds two features to Converter.ToInt32: - 1. Sign is ignored. For example, 0xffff0000 converts to 4294901760, where Convert.ToInt32 - would throw because 0xffff0000 is less than zero. - 2. Overflow exceptions are thrown. Converter.ToInt32 throws TypeError if x is - an integer, but is bigger than 32 bits. Instead, we throw OverflowException. - - - - - Convert an object to a 16-bit integer. This adds two features to Converter.ToInt16: - 1. Sign is ignored. For example, 0xff00 converts to 65280, where Convert.ToInt16 - would throw because signed 0xff00 is -256. - 2. Overflow exceptions are thrown. Converter.ToInt16 throws TypeError if x is - an integer, but is bigger than 16 bits. Instead, we throw OverflowException. - - - - - Return a standard socket exception (socket.error) whose message and error code come from a SocketException - This will eventually be enhanced to generate the correct error type (error, herror, gaierror) based on the error code. - - - - - Convert an IPv6 address byte array to a string in standard colon-hex notation. - The .NET IPAddress.ToString() method uses dotted-quad for the last 32 bits, - which differs from the normal Python implementation (but is allowed by the IETF); - this method returns the standard (no dotted-quad) colon-hex form. - - - - - Handle conversion of "" to INADDR_ANY and "<broadcast>" to INADDR_BROADCAST. - Otherwise returns host unchanged. - - - - - Return the IP address associated with host, with optional address family checking. - host may be either a name or an IP address (in string form). - - If family is non-null, a gaierror will be thrown if the host's address family is - not the same as the specified family. gaierror is also raised if the hostname cannot be - converted to an IP address (e.g. through a name lookup failure). - - - - - Return the IP address associated with host, with optional address family checking. - host may be either a name or an IP address (in string form). - - If family is non-null, a gaierror will be thrown if the host's address family is - not the same as the specified family. gaierror is also raised if the hostname cannot be - converted to an IP address (e.g. through a name lookup failure). - - - - - Return fqdn, but with its domain removed if it's on the same domain as the local machine. - - - - - Convert a (host, port) tuple [IPv4] (host, port, flowinfo, scopeid) tuple [IPv6] - to its corresponding IPEndPoint. - - Throws gaierror if host is not a valid address. - Throws ArgumentTypeException if any of the following are true: - - address does not have exactly two elements - - address[0] is not a string - - address[1] is not an int - - - - - Convert an IPEndPoint to its corresponding (host, port) [IPv4] or (host, port, flowinfo, scopeid) [IPv6] tuple. - Throws SocketException if the address family is other than IPv4 or IPv6. - - - - - handleToSocket allows us to translate from Python's idea of a socket resource (file - descriptor numbers) to .NET's idea of a socket resource (System.Net.Socket objects). - In particular, this allows the select module to convert file numbers (as returned by - fileno()) and convert them to Socket objects so that it can do something useful with them. - - - - - Return the internal System.Net.Sockets.Socket socket object associated with the given - handle (as returned by GetHandle()), or null if no corresponding socket exists. This is - primarily intended to be used by other modules (such as select) that implement - networking primitives. User code should not normally need to call this function. - - - - - Create a Python socket object from an existing .NET socket object - (like one returned from Socket.Accept()) - - - - - Perform initialization common to all constructors - - - - - Wrapper class for emitting locals/variables during marshalling code gen. - - - - - A wrapper around allocated memory to ensure it gets released and isn't accessed - when it could be finalized. - - - - - Creates a new MemoryHolder and allocates a buffer of the specified size. - - - - - Creates a new MemoryHolder at the specified address which is not tracked - by us and we will never free. - - - - - Creates a new MemoryHolder at the specified address which will keep alive the - parent memory holder. - - - - - Used to track the lifetime of objects when one memory region depends upon - another memory region. For example if you have an array of objects that - each have an element which has it's own lifetime the array needs to keep - the individual elements alive. - - The keys used here match CPython's keys as tested by CPython's test_ctypes. - Typically they are a string which is the array index, "ffffffff" when - from_buffer is used, or when it's a simple type there's just a string - instead of the full dictionary - we store that under the key "str". - - - - - Copies the data in data into this MemoryHolder. - - - - - Copies memory from one location to another keeping the associated memory holders alive during the - operation. - - - - - Gets the address of the held memory. The caller should ensure the MemoryHolder - is always alive as long as the address will continue to be accessed. - - - - - Gets a list of objects which need to be kept alive for this MemoryHolder to be - remain valid. - - - - - Native functions used for exposing ctypes functionality. - - - - - Allocates memory that's zero-filled - - - - - Helper function for implementing memset. Could be more efficient if we - could P/Invoke or call some otherwise native code to do this. - - - - - Provides support for interop with native code from Python code. - - - Provides support for interop with native code from Python code. - - - Provides support for interop with native code from Python code. - - - Provides support for interop with native code from Python code. - - - Provides support for interop with native code from Python code. - - - Provides support for interop with native code from Python code. - - - Provides support for interop with native code from Python code. - - - Provides support for interop with native code from Python code. - - - Provides support for interop with native code from Python code. - - - Provides support for interop with native code from Python code. - - - Provides support for interop with native code from Python code. - - - Provides support for interop with native code from Python code. - - - Provides support for interop with native code from Python code. - - - Provides support for interop with native code from Python code. - - - Provides support for interop with native code from Python code. - - - Provides support for interop with native code from Python code. - - - Provides support for interop with native code from Python code. - - - Provides support for interop with native code from Python code. - - - - - Implementation of our cast function. data is marshalled as a void* - so it ends up as an address. obj and type are marshalled as an object - so we need to unmarshal them. - - - - - Returns a new type which represents a pointer given the existing type. - - - - - Converts an address acquired from PyObj_FromPtr or that has been - marshaled as type 'O' back into an object. - - - - - Converts an object into an opaque address which can be handed out to - managed code. - - - - - Decreases the ref count on an object which has been increased with - Py_INCREF. - - - - - Increases the ref count on an object ensuring that it will not be collected. - - - - - returns address of C instance internal buffer. - - It is the callers responsibility to ensure that the provided instance will - stay alive if memory in the resulting address is to be used later. - - - - - Gets the required alignment of the given type. - - - - - Gets the required alignment of an object. - - - - - Returns a pointer instance for the given CData - - - - - Given a specific size returns a .NET type of the equivalent size that - we can use when marshalling these values across calls. - - - - - Shared helper between struct and union for getting field info and validating it. - - - - - Verifies that the provided bit field settings are valid for this type. - - - - - Shared helper to get the _fields_ list for struct/union and validate it. - - - - - Helper function for translating from memset to NT's FillMemory API. - - - - - Helper function for translating from memset to NT's FillMemory API. - - - - - Emits the marshalling code to create a CData object for reverse marshalling. - - - - - Gets a function which casts the specified memory. Because this is used only - w/ Python API we use a delegate as the return type instead of an actual address. - - - - - Gets the ModuleBuilder used to generate our unsafe call stubs into. - - - - - The enum used for tracking the various ctypes primitive types. - - - - 'c' - - - 'b' - - - 'B' - - - 'h' - - - 'H' - - - 'i' - - - 'I' - - - 'l' - - - 'L' - - - 'f' - - - 'd', 'g' - - - 'q' - - - 'Q' - - - 'O' - - - 'P' - - - 'z' - - - 'Z' - - - 'u' - - - '?' - - - 'v' - - - - Base class for all ctypes interop types. - - - - - The meta class for ctypes array instances. - - - - - Common functionality that all of the meta classes provide which is part of - our implementation. This is used to implement the serialization/deserialization - of values into/out of memory, emit the marshalling logic for call stubs, and - provide common information (size/alignment) for the types. - - - - - Deserialized the value of this type from the given address at the given - offset. Any new objects which are created will keep the provided - MemoryHolder alive. - - raw determines if the cdata is returned or if the primitive value is - returned. This is only applicable for subtypes of simple cdata types. - - - - - Serializes the provided value into the specified address at the given - offset. - - - - - Gets the .NET type which is used when calling or returning the value - from native code. - - - - - Gets the .NET type which the native type is converted into when going to Python - code. This is usually int, BigInt, double, object, or a CData type. - - - - - Emits marshalling of an object from Python to native code. This produces the - native type from the Python type. - - - - - Emits marshalling from native code to Python code This produces the python type - from the native type. This is used for return values and parameters - to Python callable objects that are passed back out to native code. - - - - - Gets the native size of the type - - - - - Gets the required alignment for the type - - - - - Returns a string which describes the type. Used for _buffer_info implementation which - only exists for testing purposes. - - - - - Converts an object into a function call parameter. - - - - - Creates a new CFuncPtr object from a tuple. The 1st element of the - tuple is the ordinal or function name. The second is an object with - a _handle property. The _handle property is the handle of the module - from which the function will be loaded. - - - - - Creates a new CFuncPtr with the specfied address. - - - - - Creates a new CFuncPtr with the specfied address. - - - - - we need to keep alive any methods which have arguments for the duration of the - call. Otherwise they could be collected on the finalizer thread before we come back. - - - - - Creates a method for calling with the specified signature. The returned method has a signature - of the form: - - (IntPtr funcAddress, arg0, arg1, ..., object[] constantPool) - - where IntPtr is the address of the function to be called. The arguments types are based upon - the types that the ArgumentMarshaller requires. - - - - - Base class for marshalling arguments from the user provided value to the - call stub. This class provides the logic for creating the call stub and - calling it. - - - - - Emits the IL to get the argument for the call stub generated into - a dynamic method. - - - - - Gets an expression which keeps alive the argument for the duration of the call. - - Returns null if a keep alive is not necessary. - - - - - Gets the expression used to provide the argument. This is the expression - from an incoming DynamicMetaObject. - - - - - Provides marshalling of primitive values when the function type - has no type information or when the user has provided us with - an explicit cdata instance. - - - - - Provides marshalling for when the function type provide argument information. - - - - - Provides marshalling for when the user provides a native argument object - (usually gotten by byref or pointer) and the function type has no type information. - - - - - The meta class for ctypes function pointer instances. - - - - - Converts an object into a function call parameter. - - - - - Fields are created when a Structure is defined and provide - introspection of the structure. - - - - - Called for fields which have been limited to a range of bits. Given the - value for the full type this extracts the individual bits. - - - - - Called for fields which have been limited to a range of bits. Sets the - specified value into the bits for the field. - - - - - The meta class for ctypes pointers. - - - - - Converts an object into a function call parameter. - - - - - Access an instance at the specified address - - - - - The meta class for ctypes simple data types. These include primitives like ints, - floats, etc... char/wchar pointers, and untyped pointers. - - - - - Converts an object into a function call parameter. - - - - - Helper function for reading char/wchar's. This is used for reading from - arrays and pointers to avoid creating lots of 1-char strings. - - - - - Meta class for structures. Validates _fields_ on creation, provides factory - methods for creating instances from addresses and translating to parameters. - - - - - Converts an object into a function call parameter. - - Structures just return themselves. - - - - - If our size/alignment hasn't been initialized then grabs the size/alignment - from all of our base classes. If later new _fields_ are added we'll be - initialized and these values will be replaced. - - - - - Base class for data structures. Subclasses can define _fields_ which - specifies the in memory layout of the values. Instances can then - be created with the initial values provided as the array. The values - can then be accessed from the instance by field name. The value can also - be passed to a foreign C API and the type can be used in other structures. - - class MyStructure(Structure): - _fields_ = [('a', c_int), ('b', c_int)] - - MyStructure(1, 2).a - MyStructure() - - class MyOtherStructure(Structure): - _fields_ = [('c', MyStructure), ('b', c_int)] - - MyOtherStructure((1, 2), 3) - MyOtherStructure(MyStructure(1, 2), 3) - - - - - The meta class for ctypes unions. - - - - - Converts an object into a function call parameter. - - - - - Enum which specifies the format type for a compiled struct - - - - - Struct used to store the format and the number of times it should be repeated. - - - - - Provides a dictionary storage implementation whose storage is local to - the thread. - - - - - Represents the date components that we found while parsing the date. Used for zeroing out values - which have different defaults from CPython. Currently we only know that we need to do this for - the year. - - - - - Samples on how to subtype built-in types from C# - - - - - an int variable for demonstration purposes - - - - - an int variable for demonstration purposes - - - - - Returns a new callable object with the provided initial set of arguments - bound to it. Calling the new function then appends to the additional - user provided arguments. - - - - - Creates a new partial object with the provided positional arguments. - - - - - Creates a new partial object with the provided positional and keyword arguments. - - - - - Calls func with the previously provided arguments and more positional arguments. - - - - - Calls func with the previously provided arguments and more positional arguments and keyword arguments. - - - - - Operator method to set arbitrary members on the partial object. - - - - - Operator method to get additional arbitrary members defined on the partial object. - - - - - Operator method to delete arbitrary members defined in the partial object. - - - - - Gets the function which will be called - - - - - Gets the initially provided positional arguments. - - - - - Gets the initially provided keyword arguments or None. - - - - - Gets or sets the dictionary used for storing extra attributes on the partial object. - - - - - BER encoding of an integer value is the number of bytes - required to represent the integer followed by the bytes - - - - - Special hash function because IStructuralEquatable.GetHashCode is not allowed to throw. - - - - - Special equals because none of the special cases in Ops.Equals - are applicable here, and the reference equality check breaks some tests. - - - - - gets the object or throws a reference exception - - - - - Special equality function because IStructuralEquatable.Equals is not allowed to throw. - - - - - gets the object or throws a reference exception - - - - - Special equality function because IStructuralEquatable.Equals is not allowed to throw. - - - - diff --git a/lib/IronPython.xml b/lib/IronPython.xml deleted file mode 100644 index f6d8783841..0000000000 --- a/lib/IronPython.xml +++ /dev/null @@ -1,7020 +0,0 @@ - - - - IronPython - - - - - Creates a method frame for tracking purposes and enforces recursion - - - - - Removes the frames from generated code for when we're compiling the tracing delegate - which will track the frames it's self. - - - - - Returns true if the node can throw, false otherwise. Used to determine - whether or not we need to update the current dynamic stack info. - - - - - A temporary variable to track if the current line number has been emitted via the fault update block. - - For example consider: - - try: - raise Exception() - except Exception, e: - # do something here - raise - - At "do something here" we need to have already emitted the line number, when we re-raise we shouldn't add it - again. If we handled the exception then we should have set the bool back to false. - - We also sometimes directly check _lineNoUpdated to avoid creating this unless we have nested exceptions. - - - - - A temporary variable to track the current line number - - - - - Fake ScopeStatement for FunctionCode's to hold on to after we have deserialized pre-compiled code. - - - - - Gets or creates the FunctionCode object for this FunctionDefinition. - - - - - Gets the expression for updating the dynamic stack trace at runtime when an - exception is thrown. - - - - - Gets the expression for the actual updating of the line number for stack traces to be available - - - - - Wraps the body of a statement which should result in a frame being available during - exception handling. This ensures the line number is updated as the stack is unwound. - - - - - The variable used to hold out parents closure tuple in our local scope. - - - - - Gets the expression associated with the local CodeContext. If the function - doesn't have a local CodeContext then this is the global context. - - - - - True if this scope accesses a variable from an outer scope. - - - - - True if an inner scope is accessing a variable defined in this scope. - - - - - True if we are forcing the creation of a dictionary for storing locals. - - This occurs for calls to locals(), dir(), vars(), unqualified exec, and - from ... import *. - - - - - True if variables can be set in a late bound fashion that we don't - know about at code gen time - for example via from foo import *. - - This is tracked independently of the ContainsUnqualifiedExec/NeedsLocalsDictionary - - - - - Variables that are bound in an outer scope - but not a global scope - - - - - Variables that are bound to the global scope - - - - - Variables that are referred to from a nested scope and need to be - promoted to cells. - - - - - Provides a place holder for the expression which represents - a FunctionCode. For functions/classes this gets updated after - the AST has been generated because the FunctionCode needs to - know about the tree which gets generated. For modules we - immediately have the value because it always comes in as a parameter. - - - - - Reducible node so that re-writing for profiling does not occur until - after the script code has been completed and is ready to be compiled. - - Without this extra node profiling would force reduction of the node - and we wouldn't have setup our constant access correctly yet. - - - - - A global allocator that puts all of the globals into an array access. The array is an - array of PythonGlobal objects. We then just close over the array for any inner functions. - - Once compiled a RuntimeScriptCode is produced which is closed over the entire execution - environment. - - - - - Specifies the compilation mode which will be used during the AST transformation - - - - - Compilation will proceed in a manner in which the resulting AST can be serialized to disk. - - - - - Compilation will use a type and declare static fields for globals. The resulting type - is uncollectible and therefore extended use of this will cause memory leaks. - - - - - Compilation will use an array for globals. The resulting code will be fully collectible - and once all references are released will be collected. - - - - - Compilation will force all global accesses to do a full lookup. This will also happen for - any unbound local references. This is the slowest form of code generation and is only - used for exec/eval code where we can run against an arbitrary dictionary. - - - - - Implements globals which are backed by a static type, followed by an array if the static types' slots become full. The global - variables are stored in static fields on a type for fast access. The type also includes fields for constants and call sites - so they can be accessed much fasetr. - - We don't generate any code into the type though - DynamicMethod's are much faster for code gen then normal ref emit. - - - Implements globals which are backed by a static type, followed by an array if the static types' slots become full. The global - variables are stored in static fields on a type for fast access. The type also includes fields for constants and call sites - so they can be accessed much fasetr. - - We don't generate any code into the type though - DynamicMethod's are much faster for code gen then normal ref emit. - - - - Ensures the underlying array is long enough to accomodate the given index - The context storage type corresponding to the given index - - - Ensures the underlying array is long enough to accomodate the given index - The constant storage type corresponding to the given index - - - Ensures the underlying array is long enough to accomodate the given index - The global storage type corresponding to the given index - - - Ensures the underlying array is long enough to accomodate the given index - The site storage type corresponding to the given index - - - - Provides more specific type information for Python dictionaries which are not strongly typed. - - This attribute can be applied to fields, parameters, proeprties, and return values. It can be - inspected to get type information about the types of the keys and values of the expected - dictionary or the returned dictionary. - - - - - Abstract base class for all PythonDictionary storage. - - Defined as a class instead of an interface for performance reasons. Also not - using IDictionary* for keeping a simple interface. - - Full locking is defined as being on the DictionaryStorage object it's self, - not an internal member. This enables subclasses to provide their own locking - aruond large operations and call lock free functions. - - - - - Adds items from this dictionary into the other dictionary - - - - - Provides fast access to the __path__ attribute if the dictionary storage supports caching it. - - - - - Provides fast access to the __package__ attribute if the dictionary storage supports caching it. - - - - - Provides fast access to the __builtins__ attribute if the dictionary storage supports caching it. - - - - - Provides fast access to the __name__ attribute if the dictionary storage supports caching it. - - - - - Provides fast access to the __import__ attribute if the dictionary storage supports caching it. - - - - - An interface that is implemented on DynamicMetaObjects. - - This allows objects to opt-into custom conversions when calling - COM APIs. The IronPython binders all call this interface before - doing any COM binding. - - - - - Captures and flows the state of executing code from the generated - Python code into the IronPython runtime. - - - - - Creates a new CodeContext which is backed by the specified Python dictionary. - - - - - Attempts to lookup the provided name in this scope or any outer scope. - - - - - Looks up a global variable. If the variable is not defined in the - global scope then built-ins is consulted. - - - - - Attempts to lookup the variable in the local scope. - - - - - Removes a variable from the local scope. - - - - - Sets a variable in the local scope. - - - - - Gets a variable from the global scope. - - - - - Sets a variable in the global scope. - - - - - Removes a variable from the global scope. - - - - - Returns the dictionary associated with __builtins__ if one is - set or null if it's not available. If __builtins__ is a module - the module's dictionary is returned. - - - - - Gets the module state for top-level code. - - - - - Gets the DLR scope object that corresponds to the global variables of this context. - - - - - Gets the PythonContext which created the CodeContext. - - - - - Gets the dictionary for the global variables from the ModuleContext. - - - - - True if this global context should display CLR members on shared types (for example .ToString on int/bool/etc...) - - False if these attributes should be hidden. - - - - - Gets the dictionary used for storage of local variables. - - - - - Marks a type so that IronPython will not expose the IEnumerable interface out as - __iter__ - - - - - ArgBuilder which provides the CodeContext parameter to a method. - - - - - Provides a way for the binder to provide a custom error message when lookup fails. Just - doing this for the time being until we get a more robust error return mechanism. - - - - - Provides a way for the binder to provide a custom error message when lookup fails. Just - doing this for the time being until we get a more robust error return mechanism. - - - - - Gets the PythonBinder associated with tihs CodeContext - - - - - Performs .NET member resolution. This looks within the given type and also - includes any extension members. Base classes and their extension members are - not searched. - - - - - Performs .NET member resolution. This looks within the given type and also - includes any extension members. Base classes and their extension members are - not searched. - - This version allows PythonType's for protected member resolution. It shouldn't - be called externally for other purposes. - - - - - Performs .NET member resolution. This looks the type and any base types - for members. It also searches for extension members in the type and any base types. - - - - - Gets the member names which are defined in this type and any extension members. - - This search does not include members in any subtypes or their extension members. - - - - - Gets the member names which are defined in the type and any subtypes. - - This search includes members in the type and any subtypes as well as extension - types of the type and its subtypes. - - - - - Creates the initial table of extension types. These are standard extension that we apply - to well known .NET types to make working with them better. Being added to this table does - not make a type a Python type though so that it's members are generally accessible w/o an - import clr and their type is not re-named. - - - - - Creates a table of standard .NET types which are also standard Python types. These types have a standard - set of extension types which are shared between all runtimes. - - - - - Event handler for when our domain manager has an assembly loaded by the user hosting the script - runtime. Here we can gather any information regarding extension methods. - - Currently DLR-style extension methods become immediately available w/o an explicit import step. - - - - - Provides a cache from Type/name -> PythonTypeSlot and also allows access to - all members (and remembering whether all members are cached). - - - - - Writes to a cache the result of a type lookup. Null values are allowed for the slots and they indicate that - the value does not exist. - - - - - Looks up a cached type slot for the specified member and type. This may return true and return a null slot - that indicates - that a cached result for a member which doesn't exist has been stored. Otherwise it returns true if a slot is found or - false if it is not. - - - - - Looks up a cached member group for the specified member and type. This may return true and return a null group - that indicates - that a cached result for a member which doesn't exist has been stored. Otherwise it returns true if a group is found or - false if it is not. - - - - - Checks to see if all members have been populated for the provided type. - - - - - Populates the type with all the provided members and marks the type - as being fully cached. - - The dictionary is used for the internal storage and should not be modified after - providing it to the cache. - - - - - Returns an enumerable object which provides access to all the members of the provided type. - - The caller must check that the type is fully cached and populate the cache if it isn't before - calling this method. - - - - - Small reducable node which just fetches the value from a ClosureCell - object. Like w/ global variables the compiler recognizes these on - sets and turns them into assignments on the python global object. - - - - - Creates the storage for the closure cell. If this is a closure over a parameter it - captures the initial incoming parameter value. - - - - - Reduces the closure cell to a read of the value stored in the cell. - - - - - Assigns a value to the closure cell. - - - - - Removes the current value from the closure cell. - - - - - Gets the expression which points at the closure cell. - - - - - The original expression for the incoming parameter if this is a parameter closure. Otherwise - the value is null. - - - - - Gets the PythonVariable for which this closure expression was created. - - - - - Tracking for variables lifted into closure objects. Used to store information in a function - about the outer variables it accesses. - - - - - When finding a yield return or yield break, this rewriter flattens out - containing blocks, scopes, and expressions with stack state. All - scopes encountered have their variables promoted to the generator's - closure, so they survive yields. - - - - - Spills the right side into a temp, and replaces it with its temp. - Returns the expression that initializes the temp. - - - - - Makes an assignment to this variable. Pushes the assignment as far - into the right side as possible, to allow jumps into it. - - - - - Accesses the property of a tuple. The node can be created first and then the tuple and index - type can be filled in before the tree is actually generated. This enables creation of these - nodes before the tuple type is actually known. - - - - - Represents code which can be lazily compiled. - - The code is created in an AST which provides the Expression of T and - whether or not the code should be interpreted. For non-pre compiled - scenarios the code will not be compiled until the 1st time it is run. - - For pre-compiled scenarios the code is IExpressionSerializable and will - turn into a normal pre-compiled method. - - - - - Marks a type so that IronPython will not expose types which have GetMemberNames - as having a __dir__ method. - - Also suppresses __dir__ on something which implements IDynamicMetaObjectProvider - but is not an IPythonObject. - - - - - Marks a type so that IronPython will not expose the ICollection interface out as - __len__. - - - - - Marks a type so that IronPython will not expose the IDisposable interface out as - __enter__ and __exit__ methods of a context manager. - - - - - Marks a type so that IronPython will not expose the IEnumerable interface out as - __contains__ - - - - - Provides more specific type information for Python lists which are not strongly typed. - - This attribute can be applied to fields, parameters, proeprties, and return values. It can be - inspected to get type information about the types of the values of the expected - list or the returned list. - - - - - Captures the globals and other state of module code. - - - - - Creates a new ModuleContext which is backed by the specified dictionary. - - - - - Creates a new ModuleContext for the specified module. - - - - - Initializes __builtins__ for the module scope. - - - - - Gets the dictionary used for the global variables in the module - - - - - Gets the language context which created this module. - - - - - Gets the DLR Scope object which is associated with the modules dictionary. - - - - - Gets the global CodeContext object which is used for execution of top-level code. - - - - - Gets the module object which this code is executing in. - - This module may or may not be published in sys.modules. For user defined - code typically the module gets published at the start of execution. But if - this ModuleContext is attached to a Scope, or if we've just created a new - module context for executing code it will not be in sys.modules. - - - - - Gets the features that code has been compiled with in the module. - - - - - Gets or sets whether code running in this context should display - CLR members (for example .ToString on objects). - - - - - Cached global value. Created and maintained on a per-language basis. Default - implementation returns a singleton which indicates caching is not occuring. - - - - - Creates a new ModuleGlobalCache with the specified value. - - - - - Event handler for when the value has changed. Language implementors should call this when - the cached value is invalidated. - - - - - True if the ModuleGlobalCache is participating in a caching strategy. - - - - - True if there is currently a value associated with this global variable. False if - it is currently unassigned. - - - - - Gets or sets the current cached value - - - - - Enable true division (1/2 == .5) - - - - - Indicates that .NET methods such as .ToString should be available on Python objects. - - - - - Indicates that the module should be generated in an optimal form which will result - in it being uncollectable. - - - - - Indicates when the module should be executed immedatiately upon creation. - - - - - Enable usage of the with statement - - - - - Enable absolute imports - - - - - Indiciates that __builtins__ should not be set in the module - - - - - Indiciates that when the module is initialized it should set __builtins__ to the __builtin__ module - instead of the __builtin__ dictionary. - - - - - Marks code as being created for exec, eval. Code generated this way will - be capable of running against different scopes and will do lookups at runtime - for free global variables. - - - - - Indiciates that the first line of code should be skipped. - - - - - Enable usage of print as a function for better compatibility with Python 3.0. - - - - - Forces the code to be interpreted rather than compiled - - - - - String Literals should be parsed as Unicode strings - - - - - Include comments in the parse tree - - - - - Manages the acquisition of profiling data for a single ScriptRuntime - - - - - Get the unique Profiler instance for this ScriptRuntime - - - - - Given a MethodBase, return an index into the array of perf data. Treat each - CLR method as unique. - - - - - Given the unique name of something we're profiling, return an index into the array of perf data. - - - - - Add a new profiler entry. Not all names are unique. - - - - - Gets the current summary of profile data - - - - - Resets the current summary of profile data back to zero - - - - - Adds profiling calls to a Python method. - Calculates both the time spent only in this method - - - - - Wraps a call to a MethodInfo with profiling capture for that MethodInfo - - - - - Wraps a call to a MethodInfo with profiling capture for that MethodInfo - - - - - Encapsulates profiler data to return to clients - - - - - Marks that this built-in method should be treated as external by the profiler. - When placed on a call emitted into a Python method, all the time spent in this - call will still show up in its parent's inclusive time, but will not be - part of its exclusive time. - - - - - Gets the closure tuple from our parent context. - - - - - PythonWalker class - The Python AST Walker (default result is true) - - - - - PythonWalkerNonRecursive class - The Python AST Walker (default result is false) - - - - - Pulls the closure tuple from our function/generator which is flowed into each function call. - - - - - Returns an expression which creates the function object. - - - - - Creates the LambdaExpression which is the actual function body. - - - - - Creates the LambdaExpression which implements the body of the function. - - The functions signature is either "object Function(PythonFunction, ...)" - where there is one object parameter for each user defined parameter or - object Function(PythonFunction, object[]) for functions which take more - than PythonCallTargets.MaxArgs arguments. - - - - - Determines delegate type for the Python function - - - - - Provides globals for when we need to lookup into a dictionary for each global access. - - This is the slowest form of globals and is only used when we need to run against an - arbitrary dictionary given to us by a user. - - - - - Provides a wrapper around "dynamic" expressions which we've opened coded (for optimized code generation). - - This lets us recognize both normal Dynamic and our own Dynamic expressions and apply the combo binder on them. - - - - - A ScriptCode which can be saved to disk. We only create this when called via - the clr.CompileModules API. This ScriptCode does not support running. - - - - - Parameter base class - - - - - Position of the parameter: 0-based index - - - - - Parameter name - - - - - Top-level ast for all Python code. Typically represents a module but could also - be exec or eval code. - - - - - Binds an AST and makes it capable of being reduced and compiled. Before calling Bind an AST cannot successfully - be reduced. - - - - - Creates a variable at the global level. Called for known globals (e.g. __name__), - for variables explicitly declared global by the user, and names accessed - but not defined in the lexical scope. - - - - - Reduces the PythonAst to a LambdaExpression of type Type. - - - - - Returns a ScriptCode object for this PythonAst. The ScriptCode object - can then be used to execute the code against it's closed over scope or - to execute it against a different scope. - - - - - Rewrites the tree for performing lookups against globals instead of being bound - against the optimized scope. This is used if the user compiles optimied code and then - runs it against a different scope. - - - - - True division is enabled in this AST. - - - - - True if the with statement is enabled in this AST. - - - - - True if absolute imports are enabled - - - - - Represents a reference to a name. A PythonReference is created for each name - referred to in a scope (global, class, or function). - - - - - True if the user provided a step parameter (either providing an explicit parameter - or providing an empty step parameter) false if only start and stop were provided. - - - - - The statements under the try-block. - - - - - Array of except (catch) blocks associated with this try. NULL if there are no except blocks. - - - - - The body of the optional Else block for this try. NULL if there is no Else block. - - - - - The body of the optional finally associated with this try. NULL if there is no finally block. - - - - - Transform multiple python except handlers for a try block into a single catch body. - - The variable for the exception in the catch block. - Null if there are no except handlers. Else the statement to go inside the catch handler - - - - Surrounds the body of an except block w/ the appropriate code for maintaining the traceback. - - - - - True iff there is a path in control flow graph on which the variable is used before initialized (assigned or deleted). - - - - - True iff the variable is referred to from the inner scope. - - - - - Local variable. - - Local variables can be referenced from nested lambdas - - - - - Parameter to a LambdaExpression - - Like locals, they can be referenced from nested lambdas - - - - - Global variable - - Should only appear in global (top level) lambda. - - - - - WithStatement is translated to the DLR AST equivalent to - the following Python code snippet (from with statement spec): - - mgr = (EXPR) - exit = mgr.__exit__ # Not calling it yet - value = mgr.__enter__() - exc = True - try: - VAR = value # Only if "as VAR" is present - BLOCK - except: - # The exceptional case is handled here - exc = False - if not exit(*sys.exc_info()): - raise - # The exception is swallowed if exit() returns true - finally: - # The normal and non-local-goto cases are handled here - if exc: - exit(None, None, None) - - - - - - A ScriptCode which has been loaded from an assembly which is saved on disk. - - - - - Creates a fake PythonAst object which is represenative of the on-disk script code. - - - - - Base class for all of our fast get delegates. This holds onto the - delegate and provides the Update function. - - - - - Updates the call site when the current rule is no longer applicable. - - - - - Base class for all of our fast set delegates. This holds onto the - delegate and provides the Update and Optimize functions. - - - - - Updates the call site when the current rule is no longer applicable. - - - - - Enables lazy initialization of module dictionaries. - - - - - Gets all of the extra names and values stored in the dictionary. - - - - - Attemps to sets a value in the extra keys. Returns true if the value is set, false if - the value is not an extra key. - - - - - Attempts to get a value from the extra keys. Returns true if the value is an extra - key and has a value. False if it is not an extra key or doesn't have a value. - - - - - Attempts to remove the key. Returns true if the key is removed, false - if the key was not removed, or null if the key is not an extra key. - - - - - Provides cached global variable for modules to enable optimized access to - module globals. Both the module global value and the cached value can be held - onto and the cached value can be invalidated by the providing LanguageContext. - - The cached value is provided by the LanguageContext.GetModuleCache API. - - - - - Small reducable node which just fetches the value from a PythonGlobal - object. The compiler recognizes these on sets and turns them into - assignments on the python global object. - - - - - Represents a script code which can be dynamically bound to execute against - arbitrary Scope objects. This is used for code when the user runs against - a particular scope as well as for exec and eval code as well. It is also - used when tracing is enabled. - - - - - Represents a script code which can be consumed at runtime as-is. This code has - no external dependencies and is closed over its scope. - - - - - Helper class for implementing the Python class. - - This is exposed as a service through PythonEngine and the helper class - uses this service to get the correct remoting semantics. - - - - - Marks that the return value of a function might include NotImplemented. - - This is added to an operator method to ensure that all necessary methods are called - if one cannot guarantee that it can perform the comparison. - - - - - Provides support for emitting warnings when built in methods are invoked at runtime. - - - - - Backwards compatible Convert for the old sites that need to flow CodeContext - - - - - Creates a new InvokeBinder which will call with positional splatting. - - The signature of the target site should be object(function), object[], retType - - - - - - - Creates a new InvokeBinder which will call with positional and keyword splatting. - - The signature of the target site should be object(function), object[], dictionary, retType - - - - - Fallback action for performing an invoke from Python. We translate the - CallSignature which supports splatting position and keyword args into - their expanded form. - - - - - Gets the PythonContext which the CallSiteBinder is associated with. - - - - - Fallback action for performing a new() on a foreign IDynamicMetaObjectProvider. used - when call falls back. - - - - - Python's Invoke is a non-standard action. Here we first try to bind through a Python - internal interface (IPythonInvokable) which supports CallSigantures. If that fails - and we have an IDO then we translate to the DLR protocol through a nested dynamic site - - this includes unsplatting any keyword / position arguments. Finally if it's just a plain - old .NET type we use the default binder which supports CallSignatures. - - - - - Interface used to mark objects as being invokable from Python. These objects support - calling with splatted positional and keyword arguments. - - - - - Provides binding logic which is implemented to follow various Python protocols. This includes - things such as calling __call__ to perform calls, calling __nonzero__/__len__ to convert to - bool, calling __add__/__radd__ to do addition, etc... - - This logic gets shared between both the IDynamicMetaObjectProvider implementation for Python objects as well - as the Python sites. This ensures the logic we follow for our builtin types and user defined - types is identical and properly conforming to the various protocols. - - - - - Gets a MetaObject which converts the provided object to a bool using __nonzero__ or __len__ - protocol methods. This code is shared between both our fallback for a site and our MetaObject - for user defined objects. - - - - - Used for conversions to bool - - - - - Creates a rule for the contains operator. This is exposed via "x in y" in - IronPython. It is implemented by calling the __contains__ method on x and - passing in y. - - If a type doesn't define __contains__ but does define __getitem__ then __getitem__ is - called repeatedly in order to see if the object is there. - - For normal .NET enumerables we'll walk the iterator and see if it's present. - - - - - Helper to handle a comparison operator call. Checks to see if the call can - return NotImplemented and allows the caller to modify the expression that - is ultimately returned (e.g. to turn __cmp__ into a bool after a comparison) - - - - - calls __coerce__ for old-style classes and performs the operation if the coercion is successful. - - - - - Makes the comparison rule which returns an int (-1, 0, 1). TODO: Better name? - - - - - Python has three protocols for slicing: - Simple Slicing x[i:j] - Extended slicing x[i,j,k,...] - Long Slice x[start:stop:step] - - The first maps to __*slice__ (get, set, and del). - This takes indexes - i, j - which specify the range of elements to be - returned. In the slice variants both i, j must be numeric data types. - The 2nd and 3rd are both __*item__. - This receives a single index which is either a Tuple or a Slice object (which - encapsulates the start, stop, and step values) - - This is in addition to a simple indexing x[y]. - - For simple slicing and long slicing Python generates Operators.*Slice. For - the extended slicing and simple indexing Python generates a Operators.*Item - action. - - Extended slicing maps to the normal .NET multi-parameter input. - - So our job here is to first determine if we're to call a __*slice__ method or - a __*item__ method. - - - - - Helper to convert all of the arguments to their known types. - - - - - Gets the arguments that need to be provided to __*item__ when we need to pass a slice object. - - - - - Helper to get the symbols for __*item__ and __*slice__ based upon if we're doing - a get/set/delete and the minimum number of arguments required for each of those. - - - - - Checks if a coercion check should be performed. We perform coercion under the following - situations: - 1. Old instances performing a binary operator (excluding rich comparisons) - 2. User-defined new instances calling __cmp__ but only if we wouldn't dispatch to a built-in __coerce__ on the parent type - - This matches the behavior of CPython. - - - - - - Produces an error message for the provided message and type names. The error message should contain - string formatting characters ({0}, {1}, etc...) for each of the type names. - - - - - Delegate for finishing the comparison. This takes in a condition and a return value and needs to update the ConditionalBuilder - with the appropriate resulting body. The condition may be null. - - - - - Base class for calling indexers. We have two subclasses that target built-in functions and user defined callable objects. - - The Callable objects get handed off to ItemBuilder's which then call them with the appropriate arguments. - - - - - Creates a new CallableObject. If BuiltinFunction is available we'll create a BuiltinCallable otherwise - we create a SlotCallable. - - - - - Gets the arguments in a form that should be used for extended slicing. - - Python defines that multiple tuple arguments received (x[1,2,3]) get - packed into a Tuple. For most .NET methods we just want to expand - this into the multiple index arguments. For slots and old-instances - we want to pass in the tuple - - - - - Adds the target of the call to the rule. - - - - - Subclass of Callable for a built-in function. This calls a .NET method performing - the appropriate bindings. - - - - - Callable to a user-defined callable object. This could be a Python function, - a class defining __call__, etc... - - - - - Base class for building a __*item__ or __*slice__ call. - - - - - Derived IndexBuilder for calling __*slice__ methods - - - - - Derived IndexBuilder for calling __*item__ methods. - - - - - Common helpers used by the various binding logic. - - - - - Tries to get the BuiltinFunction for the given name on the type of the provided MetaObject. - - Succeeds if the MetaObject is a BuiltinFunction or BuiltinMethodDescriptor. - - - - - Gets the best CallSignature from a MetaAction. - - The MetaAction should be either a Python InvokeBinder, or a DLR InvokeAction or - CreateAction. For Python we can use a full-fidelity - - - - - - - Transforms an invoke member into a Python GetMember/Invoke. The caller should - verify that the given attribute is not resolved against a normal .NET class - before calling this. If it is a normal .NET member then a fallback InvokeMember - is preferred. - - - - - Determines if the type associated with the first MetaObject is a subclass of the - type associated with the second MetaObject. - - - - - Adds a try/finally which enforces recursion limits around the target method. - - - - - Helper to do fallback for Invoke's so we can handle both StandardAction and Python's - InvokeBinder. - - - - - Converts arguments into a form which can be used for COM interop. - - The argument is only converted if we have an IronPython specific - conversion when calling COM methods. - - - - - Converts a single argument into a form which can be used for COM - interop. - - The argument is only converted if we have an IronPython specific - conversion when calling COM methods. - - - - - Builds up a series of conditionals when the False clause isn't yet known. We can - keep appending conditions and if true's. Each subsequent true branch becomes the - false branch of the previous condition and body. Finally a non-conditional terminating - branch must be added. - - - - - Adds a new conditional and body. The first call this becomes the top-level - conditional, subsequent calls will have it added as false statement of the - previous conditional. - - - - - Adds a new condition to the last added body / condition. - - - - - Adds the non-conditional terminating node. - - - - - Gets the resulting meta object for the full body. FinishCondition - must have been called. - - - - - Adds a variable which will be scoped at the level of the final expression. - - - - - Returns true if no conditions have been added - - - - - Returns true if a final, non-conditional, body has been added. - - - - - Creates a target which creates a new dynamic method which contains a single - dynamic site that invokes the callable object. - - TODO: This should be specialized for each callable object - - - - - Various helpers related to calling Python __*__ conversion methods - - - - - Helper for falling back - if we have a base object fallback to it first (which can - then fallback to the calling site), otherwise fallback to the calling site. - - - - - Helper for falling back - if we have a base object fallback to it first (which can - then fallback to the calling site), otherwise fallback to the calling site. - - - - - Checks to see if this type has __getattribute__ that overrides all other attribute lookup. - - This is more complex then it needs to be. The problem is that when we have a - mixed new-style/old-style class we have a weird __getattribute__ defined. When - we always dispatch through rules instead of PythonTypes it should be easy to remove - this. - - - - - Looks up the associated PythonTypeSlot from the object. Indicates if the result - came from a standard .NET type in which case we will fallback to the sites binder. - - - - - Helper for falling back - if we have a base object fallback to it first (which can - then fallback to the calling site), otherwise fallback to the calling site. - - - - - Helper for falling back - if we have a base object fallback to it first (which can - then fallback to the calling site), otherwise fallback to the calling site. - - - - - Provides the lookup logic for resolving a Python object. Subclasses - provide the actual logic for producing the binding result. Currently - there are two forms of the binding result: one is the DynamicMetaObject - form used for non-optimized bindings. The other is the Func of CallSite, - object, CodeContext, object form which is used for fast binding and - pre-compiled rules. - - - - - GetBinder which produces a DynamicMetaObject. This binder always - successfully produces a DynamicMetaObject which can perform the requested get. - - - - - Makes a rule which calls a user-defined __getattribute__ function and falls back to __getattr__ if that - raises an AttributeError. - - slot is the __getattribute__ method to be called. - - - - - Checks a range of the MRO to perform old-style class lookups if any old-style classes - are present. We will call this twice to produce a search before a slot and after - a slot. - - - - - Helper for falling back - if we have a base object fallback to it first (which can - then fallback to the calling site), otherwise fallback to the calling site. - - - - - Custom dynamic site kinds for simple sites that just take a fixed set of parameters. - - - - - Unary operator. - - Gets various documentation about the object returned as a string - - - - - Unary operator. - - Gets information about the type of parameters, returned as a string. - - - - - Unary operator. - - Checks whether the object is callable or not, returns true if it is. - - - - - Binary operator. - - Checks to see if the instance contains another object. Returns true or false. - - - - - Unary operator. - - Returns the number of items stored in the object. - - - - - Binary operator. - - Compares two instances returning an integer indicating the relationship between them. May - throw if the object types are uncomparable. - - - - - Binary operator. - - Returns both the dividend and quotioent of x / y. - - - - - Unary operator. - - Get the absolute value of the instance. - - - - - Unary operator. - - Gets the positive value of the instance. - - - - - Unary operator. - - Negates the instance and return the new value. - - - - - Unary operator. - - Returns the ones complement of the instance. - - - - - Unary operator. - - Boolean negation - - - - - Unary operator. - - Negation, returns object - - - - - Get enumerator for iteration binder. Returns a KeyValuePair<IEnumerator, IDisposable> - - The IEnumerator is used for iteration. The IDisposable is provided if the object was an - IEnumerable or IEnumerable<T> and is a disposable object. - - - - Operator for performing add - - - Operator for performing sub - - - Operator for performing pow - - - Operator for performing mul - - - Operator for performing floordiv - - - Operator for performing div - - - Operator for performing truediv - - - Operator for performing mod - - - Operator for performing lshift - - - Operator for performing rshift - - - Operator for performing and - - - Operator for performing or - - - Operator for performing xor - - - Operator for performing lt - - - Operator for performing gt - - - Operator for performing le - - - Operator for performing ge - - - Operator for performing eq - - - Operator for performing ne - - - Operator for performing lg - - - Operator for performing in-place add - - - Operator for performing in-place sub - - - Operator for performing in-place pow - - - Operator for performing in-place mul - - - Operator for performing in-place floordiv - - - Operator for performing in-place div - - - Operator for performing in-place truediv - - - Operator for performing in-place mod - - - Operator for performing in-place lshift - - - Operator for performing in-place rshift - - - Operator for performing in-place and - - - Operator for performing in-place or - - - Operator for performing in-place xor - - - Operator for performing reverse add - - - Operator for performing reverse sub - - - Operator for performing reverse pow - - - Operator for performing reverse mul - - - Operator for performing reverse floordiv - - - Operator for performing reverse div - - - Operator for performing reverse truediv - - - Operator for performing reverse mod - - - Operator for performing reverse lshift - - - Operator for performing reverse rshift - - - Operator for performing reverse and - - - Operator for performing reverse or - - - Operator for performing reverse xor - - - Operator for performing reverse divmod - - - - Provides an abstraction for calling something which might be a builtin function or - might be some arbitrary user defined slot. If the object is a builtin function the - call will go directly to the underlying .NET method. If the object is an arbitrary - callable object we will setup a nested dynamic site for performing the additional - dispatch. - - TODO: We could probably do a specific binding to the object if it's another IDyanmicObject. - - - - - Combines two methods, which came from two different binary types, selecting the method which has the best - set of conversions (the conversions which result in the least narrowing). - - - - - Tries to get a MethodBinder associated with the slot for the specified type. - - If a method is found the binder is set and true is returned. - If nothing is found binder is null and true is returned. - If something other than a method is found false is returned. - - TODO: Remove rop - - - - - bytearray(string, encoding[, errors]) -> bytearray - bytearray(iterable) -> bytearray - - Construct a mutable bytearray object from: - - an iterable yielding values in range(256), including: - + a list of integer values - + a bytes, bytearray, buffer, or array object - - a text string encoded using the specified encoding - - bytearray([int]) -> bytearray - - Construct a zero-ititialized bytearray of the specified length. - (default=0) - - - - - return true if self is a titlecased string and there is at least one - character in self; also, uppercase characters may only follow uncased - characters (e.g. whitespace) and lowercase characters only cased ones. - return false otherwise. - - - - - Return a string which is the concatenation of the strings - in the sequence seq. The separator between elements is the - string providing this method - - - - - return true if self is a titlecased string and there is at least one - character in self; also, uppercase characters may only follow uncased - characters (e.g. whitespace) and lowercase characters only cased ones. - return false otherwise. - - - - - Return a string which is the concatenation of the strings - in the sequence seq. The separator between elements is the - string providing this method - - - - - Marks a method as being a class method. The PythonType which was used to access - the method will then be passed as the first argument. - - - - - this class contains objecs and static methods used for - .NET/CLS interop with Python. - - - - - Gets the current ScriptDomainManager that IronPython is loaded into. The - ScriptDomainManager can then be used to work with the language portion of the - DLR hosting APIs. - - - - - LoadTypeLibrary(rcw) -> type lib desc - - Gets an ITypeLib object from OLE Automation compatible RCW , - reads definitions of CoClass'es and Enum's from this library - and creates an object that allows to instantiate coclasses - and get actual values for the enums. - - - - - LoadTypeLibrary(guid) -> type lib desc - - Reads the latest registered type library for the corresponding GUID, - reads definitions of CoClass'es and Enum's from this library - and creates a IDynamicMetaObjectProvider that allows to instantiate coclasses - and get actual values for the enums. - - - - - AddReferenceToTypeLibrary(rcw) -> None - - Makes the type lib desc available for importing. See also LoadTypeLibrary. - - - - - AddReferenceToTypeLibrary(guid) -> None - - Makes the type lib desc available for importing. See also LoadTypeLibrary. - - - - - Use(name) -> module - - Attempts to load the specified module searching all languages in the loaded ScriptRuntime. - - - - - Use(path, language) -> module - - Attempts to load the specified module belonging to a specific language loaded into the - current ScriptRuntime. - - - - - SetCommandDispatcher(commandDispatcher) - - Sets the current command dispatcher for the Python command line. - - The command dispatcher will be called with a delegate to be executed. The command dispatcher - should invoke the target delegate in the desired context. - - A common use for this is to enable running all REPL commands on the UI thread while the REPL - continues to run on a non-UI thread. - - - - - Gets the CLR Type object from a given Python type object. - - - - - Gets the Python type object from a given CLR Type object. - - - - - OBSOLETE: Gets the Python type object from a given CLR Type object. - - Use clr.GetPythonType instead. - - - - - accepts(*types) -> ArgChecker - - Decorator that returns a new callable object which will validate the arguments are of the specified types. - - - - - - - returns(type) -> ReturnChecker - - Returns a new callable object which will validate the return type is of the specified type. - - - - - returns the result of dir(o) as-if "import clr" has not been performed. - - - - - Returns the result of dir(o) as-if "import clr" has been performed. - - - - - Attempts to convert the provided object to the specified type. Conversions that - will be attempted include standard Python conversions as well as .NET implicit - and explicit conversions. - - If the conversion cannot be performed a TypeError will be raised. - - - - - Provides a helper for compiling a group of modules into a single assembly. The assembly can later be - reloaded using the clr.AddReference API. - - - - - clr.CompileSubclassTypes(assemblyName, *typeDescription) - - Provides a helper for creating an assembly which contains pre-generated .NET - base types for new-style types. - - This assembly can then be AddReferenced or put sys.prefix\DLLs and the cached - types will be used instead of generating the types at runtime. - - This function takes the name of the assembly to save to and then an arbitrary - number of parameters describing the types to be created. Each of those - parameter can either be a plain type or a sequence of base types. - - clr.CompileSubclassTypes(object) -> create a base type for object - clr.CompileSubclassTypes(object, str, System.Collections.ArrayList) -> create - base types for both object and ArrayList. - - clr.CompileSubclassTypes(object, (object, IComparable)) -> create base types for - object and an object which implements IComparable. - - - - - - clr.GetSubclassedTypes() -> tuple - - Returns a tuple of information about the types which have been subclassed. - - This tuple can be passed to clr.CompileSubclassTypes to cache these - types on disk such as: - - clr.CompileSubclassTypes('assembly', *clr.GetSubclassedTypes()) - - - - - Goes through the list of files identifying the relationship between packages - and subpackages. Returns a dictionary with all of the package filenames (minus __init__.py) - mapping to their full name. For example given a structure: - - C:\ - someDir\ - package\ - __init__.py - a.py - b\ - __init.py - c.py - - Returns: - {r'C:\somedir\package' : 'package', r'C:\somedir\package\b', 'package.b'} - - This can then be used for calculating the full module name of individual files - and packages. For example a's full name is "package.a" and c's full name is - "package.b.c". - - - - - Returns a list of profile data. The values are tuples of Profiler.Data objects - - All times are expressed in the same unit of measure as DateTime.Ticks - - - - - Resets all profiler counters back to zero - - - - - Enable or disable profiling for the current ScriptEngine. This will only affect code - that is compiled after the setting is changed; previously-compiled code will retain - whatever setting was active when the code was originally compiled. - - The easiest way to recompile a module is to reload() it. - - - - - Serializes data using the .NET serialization formatter for complex - types. Returns a tuple identifying the serialization format and the serialized - data which can be fed back into clr.Deserialize. - - Current serialization formats include custom formats for primitive .NET - types which aren't already recognized as tuples. None is used to indicate - that the Binary .NET formatter is used. - - - - - Deserializes the result of a Serialize call. This can be used to perform serialization - for .NET types which are serializable. This method is the callable object provided - from __reduce_ex__ for .serializable .NET types. - - The first parameter indicates the serialization format and is the first tuple element - returned from the Serialize call. - - The second parameter is the serialized data. - - - - - Decorator for verifying the arguments to a function are of a specified type. - - - - - Returned value when using clr.accepts/ArgChecker. Validates the argument types and - then calls the original function. - - - - - A TypeSlot is an item that gets stored in a type's dictionary. Slots provide an - opportunity to customize access at runtime when a value is get or set from a dictionary. - - - - - Gets the value stored in the slot for the given instance binding it to an instance if one is provided and - the slot binds to instances. - - - - - Sets the value of the slot for the given instance. - - true if the value was set, false if it can't be set - - - - Deletes the value stored in the slot from the instance. - - true if the value was deleted, false if it can't be deleted - - - - Gets an expression which is used for accessing this slot. If the slot lookup fails the error expression - is used again. - - The default implementation just calls the TryGetValue method. Subtypes of PythonTypeSlot can override - this and provide a more optimal implementation. - - - - - True if generating code for gets can result in more optimal accesses. - - - - - True if TryGetValue will always succeed, false if it may fail. - - This is used to optimize away error generation code. - - - - - Decorator for verifying the return type of functions. - - - - - Returned value when using clr.returns/ReturnChecker. Calls the original function and - validates the return type is of a specified type. - - - - - Provides a StreamContentProvider for a stream of content backed by a file on disk. - - - - - Wrapper class used when a user defined type (new-style or old-style) - defines __index__. We provide a conversion from all user defined - types to the Index type so they can be used for determing and method bind - time the most appropriate method to dispatch to. - - - - - New string formatter for 'str'.format(...) calls and support for the Formatter - library via the _formatter_parser / _formatter_field_name_split - methods. - - We parse this format: - - replacement_field = "{" field_name ["!" conversion] [":" format_spec] "}" - field_name = (identifier | integer) ("." attribute_name | "[" element_index "]")* - attribute_name = identifier - element_index = identifier - conversion = "r" | "s" - format_spec = any char, { must be balanced (for computed values), passed to __format__ method on object - - - - - Runs the formatting operation on the given format and keyword arguments - - - - - Gets the formatting information for the given format. This is a list of tuples. The tuples - include: - - text, field name, format spec, conversion - - - - - Parses a field name returning the argument name and an iterable - object which can be used to access the individual attribute - or element accesses. The iterator yields tuples of: - - bool (true if attribute, false if element index), attribute/index value - - - - - Parses the field name including attribute access or element indexing. - - - - - Parses the field name including attribute access or element indexing. - - - - - Converts accessors from our internal structure into a PythonTuple matching how CPython - exposes these - - - - - Parses an identifier and returns it - - - - - Base class used for parsing the format. Subclasss override Text/ReplacementField methods. Those - methods get called when they call Parse and then they can do the appropriate actions for the - format. - - - - - Gets an enumerable object for walking the parsed format. - - TODO: object array? struct? - - - - - Provides an enumerable of the parsed format. The elements of the tuple are: - the text proceeding the format information - the field name - the format spec - the conversion - - - - - Handles {{ and }} within the string. Returns true if a double bracket - is found and yields the text - - - - - Parses the conversion character and returns it - - - - - Checks to see if we're at the end of the format. If there's no more characters left we report - the error, otherwise if we hit a } we return true to indicate parsing should stop. - - - - - Parses the format spec string and returns it. - - - - - Parses the field name and returns it. - - - - - Handles parsing the field name and the format spec and returns it. At the parse - level these are basically the same - field names just have more terminating characters. - - The most complex part of parsing them is they both allow nested braces and require - the braces are matched. Strangely though the braces need to be matched across the - combined field and format spec - not within each format. - - - - - Provides the built-in string formatter which is exposed to Python via the str.format API. - - - - - Inspects a format spec to see if it contains nested format specs which - we need to compute. If so runs another string formatter on the format - spec to compute those values. - - - - - Given the field name gets the object from our arguments running - any of the member/index accessors. - - - - - Applies the known built-in conversions to the object if a conversion is - specified. - - - - - Gets the initial object represented by the field name - e.g. the 0 or - keyword name. - - - - - Given the object value runs the accessors in the field name (if any) against the object. - - - - - Encodes all the information about the field name. - - - - - Encodes a single field accessor (.b or [number] or [str]) - - - - - For IList arguments: Marks that the argument is typed to accept a bytes or - bytearray object. This attribute disallows passing a Python list object and - auto-applying our generic conversion. It also enables conversion of a string to - a IList of byte in IronPython 2.6. - - For string arguments: Marks that the argument is typed to accept a bytes object - as well. (2.6 only) - - - - stored for copy_reg module, used for reduce protocol - - - stored for copy_reg module, used for reduce protocol - - - - Creates a new PythonContext not bound to Engine. - - - - - Checks to see if module state has the current value stored already. - - - - - Gets per-runtime state used by a module. The module should have a unique key for - each piece of state it needs to store. - - - - - Sets per-runtime state used by a module. The module should have a unique key for - each piece of state it needs to store. - - - - - Sets per-runtime state used by a module and returns the previous value. The module - should have a unique key for each piece of state it needs to store. - - - - - Sets per-runtime state used by a module and returns the previous value. The module - should have a unique key for each piece of state it needs to store. - - - - - Initializes the sys module on startup. Called both to load and reload sys - - - - - Reads one line keeping track of the # of bytes read - - - - - We use Assembly.LoadFile to load assemblies from a path specified by the script (in LoadAssemblyFromFileWithPath). - However, when the CLR loader tries to resolve any of assembly references, it will not be able to - find the dependencies, unless we can hook into the CLR loader. - - - - - Returns (and creates if necessary) the PythonService that is associated with this PythonContext. - - The PythonService is used for providing remoted convenience helpers for the DLR hosting APIs. - - - - - Gets the member names associated with the object - TODO: Move "GetMemberNames" functionality into MetaObject implementations - - - - - Gets a SiteLocalStorage when no call site is available. - - - - - Invokes the specified operation on the provided arguments and returns the new resulting value. - - operation is usually a value from StandardOperators (standard CLR/DLR operator) or - OperatorStrings (a Python specific operator) - - - - - Gets a function which can be used for comparing two values. If cmp is not null - then the comparison will use the provided comparison function. Otherwise - it will use the normal Python semantics. - - If type is null then a generic comparison function is returned. If type is - not null a comparison function is returned that's used for just that type. - - - - - Performs a GC collection including the possibility of freeing weak data structures held onto by the Python runtime. - - - - - - Gets a PythonContext given a DynamicMetaObjectBinder. - - - - - Gets or sets the maximum depth of function calls. Equivalent to sys.getrecursionlimit - and sys.setrecursionlimit. - - - - - Gets or sets the default encoding for this system state / engine. - - - - - Dictionary from name to type of all known built-in module names. - - - - - Dictionary from type to name of all built-in modules. - - - - - TODO: Remove me, or stop caching built-ins. This is broken if the user changes __builtin__ - - - - Dictionary of error handlers for string codecs. - - - Table of functions used for looking for additional codecs. - - - - Returns a shared code context for the current PythonContext. This shared - context can be used for performing general operations which usually - require a CodeContext. - - - - - Returns an overload resolver for the current PythonContext. The overload - resolver will flow the shared context through as it's CodeContext. - - - - - Returns a shared code context for the current PythonContext. This shared - context can be used for doing lookups which need to occur as if they - happened in a module which has done "import clr". - - - - - A DynamicStackFrame which has Python specific data. Currently this - includes the code context which may provide access to locals and the - function code object which is needed to build frame objects from. - - - - - Gets the code context of the function. - - If the function included a call to locals() or the FullFrames - option is enabled then the code context includes all local variables. - - - - - Gets the code object for this frame. This is used in creating - the trace back. - - - - - Created for a user-defined function. - - - - - Defines the internal interface used for accessing weak references and adding finalizers - to user-defined types. - - - - - Gets the current WeakRefTracker for an object that can be used to - append additional weak references. - - - - - Attempts to set the WeakRefTracker for an object. Used on the first - addition of a weak ref tracker to an object. If the object doesn't - support adding weak references then it returns false. - - - - - Sets a WeakRefTracker on an object for the purposes of supporting finalization. - All user types (new-style and old-style) support finalization even if they don't - support weak-references, and therefore this function always succeeds. Note the - slot used to store the WeakRefTracker is still shared between SetWeakRef and - SetFinalizer if a type supports both. - - - - - - Provides a list of all the members of an instance. ie. all the keys in the - dictionary of the object. Note that it can contain objects that are not strings. - - Such keys can be added in IronPython using syntax like: - obj.__dict__[100] = someOtherObject - - This Python specific version also supports filtering based upon the show cls - flag by flowing in the code context. - - - - - Python ctor - maps to function.__new__ - - y = func(x.__code__, globals(), 'foo', None, (a, )) - - - - - Calculates the _compat value which is used for call-compatibility checks - for simple calls. Whenver any of the dependent values are updated this - must be called again. - - The dependent values include: - _nparams - this is readonly, and never requies an update - _defaults - the user can mutate this (func_defaults) and that forces - an update - expand dict/list - based on nparams and flags, both read-only - - Bits are allocated as: - 00003fff - Normal argument count - 0fffb000 - Default count - 10000000 - unused - 20000000 - expand list - 40000000 - expand dict - 80000000 - unused - - Enforce recursion is added at runtime. - - - - - The parent CodeContext in which this function was declared. - - - - - Captures the # of args and whether we have kw / arg lists. This - enables us to share sites for simple calls (calls that don't directly - provide named arguments or the list/dict params). - - - - - Generators w/ exception handling need to have some data stored - on them so that we appropriately set/restore the exception state. - - - - - Returns an ID for the function if one has been assigned, or zero if the - function has not yet required the use of an ID. - - - - - Gets the position for the expand list argument or -1 if the function doesn't have an expand list parameter. - - - - - Gets the position for the expand dictionary argument or -1 if the function doesn't have an expand dictionary parameter. - - - - - Gets the number of normal (not params or kw-params) parameters. - - - - - Gets the number of extra arguments (params or kw-params) - - - - - Gets the collection of command line arguments. - - - - - Should we strip out all doc strings (the -O command line option). - - - - - Should we strip out all doc strings (the -OO command line option). - - - - - List of -W (warning filter) options collected from the command line. - - - - - Enables warnings related to Python 3.0 features. - - - - - Enables 3.0 features that are implemented in IronPython. - - - - - Enables debugging support. When enabled a .NET debugger can be attached - to the process to step through Python code. - - - - - Enables inspect mode. After running the main module the REPL will be started - within that modules context. - - - - - Suppresses addition of the user site directory. This is ignored by IronPython - except for updating sys.flags. - - - - - Disables import site on startup. - - - - - Ignore environment variables that configure the IronPython context. - - - - - Enables the verbose option which traces import statements. This is ignored by IronPython - except for setting sys.flags. - - - - - Sets the maximum recursion depth. Setting to Int32.MaxValue will disable recursion - enforcement. - - - - - Makes available sys._getframe. Local variables will not be available in frames unless the - function calls locals(), dir(), vars(), etc... For ensuring locals are always available use - the FullFrames option. - - - - - Makes available sys._getframe. All locals variables will live on the heap (for a considerable - performance cost) enabling introspection of all code. - - - - - Tracing is always available. Without this option tracing is only enabled when sys.settrace - is called. This means code that was already running before sys.settrace will not be debuggable. - - With this option pdb.set_trace and pdb.post_mortem will always work properly. - - - - - Severity of a warning that indentation is formatted inconsistently. - - - - - The division options (old, new, warn, warnall) - - - - - Forces all code to be compiled in a mode in which the code can be reliably collected by the CLR. - - - - - Enable profiling code - - - - - Gets the CPython version which IronPython will emulate. Currently limited - to either 2.6 or 3.0. - - - - - Marks a member as being hidden from Python code. - - - - - This assembly-level attribute specifies which types in the engine represent built-in Python modules. - - Members of a built-in module type should all be static as an instance is never created. - - - - - Creates a new PythonModuleAttribute that can be used to specify a built-in module that exists - within an assembly. - - The built-in module name - The type that implements the built-in module. - - - - The built-in module name - - - - - The type that implements the built-in module - - - - - Marks a type as being a PythonType for purposes of member lookup, creating instances, etc... - - If defined a PythonType will use __new__ / __init__ when creating instances. This allows the - object to match the native Python behavior such as returning cached values from __new__ or - supporting initialization to run multiple times via __init__. - - The attribute also allows you to specify an alternate type name. This allows the .NET name to - be different from the Python name so they can follow .NET naming conventions. - - Types defining this attribute also don't show CLR methods such as Equals, GetHashCode, etc... until - the user has done an import clr. - - - - - Provides storage which is flowed into a callers site. The same storage object is - flowed for multiple calls enabling the callee to cache data that can be re-used - across multiple calls. - - Data is a public field so that this works properly with DynamicSite's as the reference - type (and EnsureInitialize) - - - - - Provides a representation and parsing for the default formatting specification. This is used - by object.__format__, int.__format__, long.__format__, and float.__format__ to do the common - format spec parsing. - - The default specification is: - - format_spec = [[fill]align][sign][#][0][width][.precision][type] - fill = a character other than } - align = "<" | ">" | "=" | "^" - sign = "+" | "-" | " " - width = integer - precision = integer - type = "b" | "c" | "d" | "e" | "E" | "f" | "F" | "g" | "G" | "n" | "o" | "x" | "X" | "%" - - - - - Parses a format spec and returns a new StringFormatSpec object. - - - - - BuiltinFunction represents any standard CLR function exposed to Python. - This is used for both methods on standard Python types such as list or tuple - and for methods from arbitrary .NET assemblies. - - All calls are made through the optimizedTarget which is created lazily. - - TODO: Back BuiltinFunction's by MethodGroup's. - - - - - Interface used for things which can convert to delegates w/o code gen. Currently - this is just non-overloaded builtin functions and bound builtin functions. Avoiding - the code gen is not only nice for compilation but it also enables delegates to be added - in C# and removed in Python. - - - - - Creates a new builtin function for a static .NET function. This is used for module methods - and well-known __new__ methods. - - - - - Creates a built-in function for a .NET method declared on a type. - - - - - Creates a bound built-in function. The instance may be null for built-in functions - accessed for None. - - - - - Returns a BuiltinFunction bound to the provided type arguments. Returns null if the binding - cannot be performed. - - - - - Returns a descriptor for the built-in function if one is - neededed - - - - - Makes a test for the built-in function against the private _data - which is unique per built-in function. - - - - - Helper for generating the call to a builtin function. This is used for calls from built-in method - descriptors and built-in functions w/ and w/o a bound instance. - - This provides all sorts of common checks on top of the call while the caller provides a delegate - to do the actual call. The common checks include: - check for generic-only methods - reversed operator support - transforming arguments so the default binder can understand them (currently user defined mapping types to PythonDictionary) - returning NotImplemented from binary operators - Warning when calling certain built-in functions - - - The call binder we're doing the call for - An expression which points to the code context - the meta object for the built in function - true if we're calling with an instance - The arguments being passed to the function - A restriction for the built-in function, method desc, etc... - A delegate to perform the actual call to the method. - - - - Gets the target methods that we'll be calling. - - - - - True if the method should be visible to non-CLS opt-in callers - - - - - Provides (for reflected methods) a mapping from a signature to the exact target - which takes this signature. - signature with syntax like the following: - someClass.SomeMethod.Overloads[str, int]("Foo", 123) - - - - - Gets the overload dictionary for the logical function. These overloads - are never bound to an instance. - - - - - Marks a type as being a suitable type to be used for user-defined classes. - - The requirements for this are that a type has to follow the patterns - that NewTypeMaker derived types follow. This includes: - The type's constructors must all take PythonType as the 1st parameter - which sets the underlying type for the actual object - The type needs to implement IPythonObject - Dictionary-based storage needs to be provided for setting individual members - Virtual methods exposed to Python need to support checking the types dictionary for invocations - - - - - Base class for helper which creates instances. We have two derived types: One for user - defined types which prepends the type before calling, and one for .NET types which - doesn't prepend the type. - - - - - Contains helper methods for converting C# names into Python names. - - - - - TypeInfo captures the minimal CLI information required by NewTypeMaker for a Python object - that inherits from a CLI type. - - - - - "bases" contains a set of PythonTypes. These can include types defined in Python (say cpy1, cpy2), - CLI types (say cCLI1, cCLI2), and CLI interfaces (say iCLI1, iCLI2). Here are some - examples of how this works: - - (bases) => baseType, {interfaceTypes} - - (cpy1) => System.Object, {} - (cpy1, cpy2) => System.Object, {} - (cpy1, cCLI1, iCLI1, iCLI2) => cCLI1, {iCLI1, iCLI2} - [some type that satisfies the line above] => - cCLI1, {iCLI1, iCLI2} - (cCLI1, cCLI2) => error - - - - - Filters out old-classes and throws if any non-types are included, returning a - yielding the remaining PythonType objects. - - - - - Python class hierarchy is represented using the __class__ field in the object. It does not - use the CLI type system for pure Python types. However, Python types which inherit from a - CLI type, or from a builtin Python type which is implemented in the engine by a CLI type, - do have to use the CLI type system to interoperate with the CLI world. This means that - objects of different Python types, but with the same CLI base type, can use the same CLI type - - they will just have different values for the __class__ field. - - The easiest way to inspect the functionality implemented by NewTypeMaker is to persist the - generated IL using "ipy.exe -X:SaveAssemblies", and then inspect the - persisted IL using ildasm. - - - - - Loads any available new types from the provided assembly and makes them - available via the GetNewType API. - - - - - Is this a type used for instances Python types (and not for the types themselves)? - - - - - Gets the position for the parameter which we are overriding. - - - - - - - - - Defines an interface on the type that forwards all calls - to a helper method in UserType. The method names all will - have Helper appended to them to get the name for UserType. The - UserType version should take 1 extra parameter (self). - - - - - Overrides methods - this includes all accessible virtual methods as well as protected non-virtual members - including statics and non-statics. - - - - - Loads all the incoming arguments and forwards them to mi which - has the same signature and then returns the result - - - - - Emits code to check if the class has overridden this specific - function. For example: - - MyDerivedType.SomeVirtualFunction = ... - or - - class MyDerivedType(MyBaseType): - def SomeVirtualFunction(self, ...): - - - - - - Emit code to convert object to a given type. This code is semantically equivalent - to PythonBinder.EmitConvertFromObject, except this version accepts ILGen whereas - PythonBinder accepts Compiler. The Binder will chagne soon and the two will merge. - - - - - Emits code to check if the class has overridden this specific - function. For example: - - MyDerivedType.SomeVirtualFunction = ... - or - - class MyDerivedType(MyBaseType): - def SomeVirtualFunction(self, ...): - - - - - - Emits the call to lookup a member defined in the user's type. Returns - the local which stores the resulting value and leaves a value on the - stack indicating the success of the lookup. - - - - - Creates a method for doing a base method dispatch. This is used to support - super(type, obj) calls. - - - - - Generates stub to receive the CLR call and then call the dynamic language code. - This code is same as StubGenerator.cs in the Microsoft.Scripting, except it - accepts ILGen instead of Compiler. - - - - - Called from PythonTypeOps - the BuiltinFunction._function lock must be held. - - - - - Same as the DLR ReturnFixer, but accepts lower level constructs, - such as LocalBuilder, ParameterInfos and ILGen. - - - - - Creates a new PythonCompilerOptions with the default language features enabled. - - - - - Creates a new PythonCompilerOptions with the specified language features enabled. - - - - - Creates a new PythonCompilerOptions and enables or disables true division. - - This overload is obsolete, instead you should use the overload which takes a - ModuleOptions. - - - - - Gets or sets the initial indentation. This can be set to allow parsing - partial blocks of code that are already indented. - - For each element of the array there is an additional level of indentation. - Each integer value represents the number of spaces used for the indentation. - - If this value is null then no indentation level is specified. - - - - - Language features initialized on parser construction and possibly updated during parsing. - The code can set the language features (e.g. "from __future__ import division"). - - - - - Parse one or more lines of interactive input - - null if input is not yet valid but could be with more lines - - - - Given the interactive text input for a compound statement, calculate what the - indentation level of the next line should be - - - - - Peek if the next token is a 'yield' and parse a yield expression. Else return null. - - Called w/ yield already eaten. - - A yield expression if present, else null. - - - - Maybe eats a new line token returning true if the token was - eaten. - - Python always tokenizes to have only 1 new line character in a - row. But we also craete NLToken's and ignore them except for - error reporting purposes. This gives us the same errors as - CPython and also matches the behavior of the standard library - tokenize module. This function eats any present NL tokens and throws - them away. - - - - - Eats a new line token throwing if the next token isn't a new line. - - Python always tokenizes to have only 1 new line character in a - row. But we also craete NLToken's and ignore them except for - error reporting purposes. This gives us the same errors as - CPython and also matches the behavior of the standard library - tokenize module. This function eats any present NL tokens and throws - them away. - - - - - Summary description for Token. - - - - - True if the quotation is written using ', false if written using " - - - - - True if the string is a raw-string (preceeded w/ r character) - - - - - True if the string is Unicode string (preceeded w/ a u character) - - - - - True if the string is triple quoted (''' or """) - - - - - IronPython tokenizer - - - - - Used to support legacy CreateParser API. - - - - - Returns whether the - - - - - True if the last characters in the buffer are a backslash followed by a new line indicating - that their is an incompletement statement which needs further input to complete. - - - - - A simple Python command-line should mimic the standard python.exe - - - - - Returns the display look for IronPython. - - The returned string uses This \n instead of Environment.NewLine for it's line seperator - because it is intended to be outputted through the Python I/O system. - - - - - Loads any extension DLLs present in sys.prefix\DLLs directory and adds references to them. - - This provides an easy drop-in location for .NET assemblies which should be automatically referenced - (exposed via import), COM libraries, and pre-compiled Python code. - - - - - Attempts to run a single interaction and handle any language-specific - exceptions. Base classes can override this and call the base implementation - surrounded with their own exception handling. - - Returns null if successful and execution should continue, or an exit code. - - - - - Parses a single interactive command and executes it. - - Returns null if successful and execution should continue, or the appropiate exit code. - - - - - Skip the first line of the code to execute. This is useful for executing Unix scripts which - have the command to execute specified in the first line. - This only apply to the script code executed by the ScriptEngine APIs, but not for other script code - that happens to get called as a result of the execution. - - - - On error. - - - - Provides helpers for interacting with IronPython. - - - - - Creates a new ScriptRuntime with the IronPython scipting engine pre-configured. - - - - - - Creates a new ScriptRuntime with the IronPython scipting engine pre-configured and - additional options. - - - - - Creates a new ScriptRuntime with the IronPython scripting engine pre-configured - in the specified AppDomain. The remote ScriptRuntime may be manipulated from - the local domain but all code will run in the remote domain. - - - - - Creates a new ScriptRuntime with the IronPython scripting engine pre-configured - in the specified AppDomain with additional options. The remote ScriptRuntime may - be manipulated from the local domain but all code will run in the remote domain. - - - - - Creates a new ScriptRuntime and returns the ScriptEngine for IronPython. If - the ScriptRuntime is requierd it can be acquired from the Runtime property - on the engine. - - - - - Creates a new ScriptRuntime with the specified options and returns the - ScriptEngine for IronPython. If the ScriptRuntime is requierd it can be - acquired from the Runtime property on the engine. - - - - - Creates a new ScriptRuntime and returns the ScriptEngine for IronPython. If - the ScriptRuntime is requierd it can be acquired from the Runtime property - on the engine. - - The remote ScriptRuntime may be manipulated from the local domain but - all code will run in the remote domain. - - - - - Creates a new ScriptRuntime with the specified options and returns the - ScriptEngine for IronPython. If the ScriptRuntime is requierd it can be - acquired from the Runtime property on the engine. - - The remote ScriptRuntime may be manipulated from the local domain but - all code will run in the remote domain. - - - - - Given a ScriptRuntime gets the ScriptEngine for IronPython. - - - - - Gets a ScriptScope which is the Python sys module for the provided ScriptRuntime. - - - - - Gets a ScriptScope which is the Python sys module for the provided ScriptEngine. - - - - - Gets a ScriptScope which is the Python __builtin__ module for the provided ScriptRuntime. - - - - - Gets a ScriptScope which is the Python __builtin__ module for the provided ScriptEngine. - - - - - Gets a ScriptScope which is the Python clr module for the provided ScriptRuntime. - - - - - Gets a ScriptScope which is the Python clr module for the provided ScriptEngine. - - - - - Imports the Python module by the given name and returns its ScriptSCope. If the - module does not exist an exception is raised. - - - - - Imports the Python module by the given name and returns its ScriptSCope. If the - module does not exist an exception is raised. - - - - - Sets sys.exec_prefix, sys.executable and sys.version and adds the prefix to sys.path - - - - - Sets sys.exec_prefix, sys.executable and sys.version and adds the prefix to sys.path - - - - - Enables call tracing for the current thread in this ScriptEngine. - - TracebackDelegate will be called back for each function entry, exit, exception, and line change. - - - - - Enables call tracing for the current thread for the Python engine in this ScriptRuntime. - - TracebackDelegate will be called back for each function entry, exit, exception, and line change. - - - - - Provides nested level debugging support when SetTrace or SetProfile are used. - - This saves the current tracing information and then calls the provided object. - - - - - Provides nested level debugging support when SetTrace or SetProfile are used. - - This saves the current tracing information and then calls the provided object. - - - - - Creates a ScriptRuntimeSetup object which includes the Python script engine with the specified options. - - The ScriptRuntimeSetup object can then be additional configured and used to create a ScriptRuntime. - - - - - Creates a LanguageSetup object which includes the Python script engine with the specified options. - - The LanguageSetup object can be used with other LanguageSetup objects from other languages to - configure a ScriptRuntimeSetup object. - - - - - Creates a new PythonModule with the specified name and published it in sys.modules. - - Returns the ScriptScope associated with the module. - - - - - Creates a new PythonModule with the specified name and filename published it - in sys.modules. - - Returns the ScriptScope associated with the module. - - - - - Creates a new PythonModule with the specified name, filename, and doc string and - published it in sys.modules. - - Returns the ScriptScope associated with the module. - - - - - 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 couldn't find member {0}. - - - - - Looks up a localized string similar to default value must be specified here. - - - - - Looks up a localized string similar to duplicate argument '{0}' in function definition. - - - - - Looks up a localized string similar to duplicate keyword argument. - - - - - Looks up a localized string similar to <eof> while reading string. - - - - - Looks up a localized string similar to EOF while scanning triple-quoted string. - - - - - Looks up a localized string similar to EOL while scanning single-quoted string. - - - - - Looks up a localized string similar to expected an indented block. - - - - - Looks up a localized string similar to expected name. - - - - - Looks up a localized string similar to Expecting identifier:. - - - - - Looks up a localized string similar to inconsistent use of tabs and spaces in indentation. - - - - - Looks up a localized string similar to unindent does not match any outer indentation level. - - - - - Looks up a localized string similar to Invalid argument value.. - - - - - Looks up a localized string similar to MakeGenericType on non-generic type. - - - - - Looks up a localized string similar to Invalid parameter collection for the function.. - - - - - Looks up a localized string similar to invalid syntax. - - - - - Looks up a localized string similar to object ({0}) is not creatable w/ keyword arguments. - - - - - Looks up a localized string similar to keywords must come before * args. - - - - - Looks up a localized string similar to type does not have {0} field. - - - - - Looks up a localized string similar to from __future__ imports must occur at the beginning of the file. - - - - - Looks up a localized string similar to 'return' outside function. - - - - - Looks up a localized string similar to 'yield' outside function. - - - - - Looks up a localized string similar to NEWLINE in double-quoted string. - - - - - Looks up a localized string similar to NEWLINE in single-quoted string. - - - - - Looks up a localized string similar to future statement does not support import *. - - - - - Looks up a localized string similar to non-keyword arg after keyword arg. - - - - - Looks up a localized string similar to not a chance. - - - - - Looks up a localized string similar to The method or operation is not implemented.. - - - - - Looks up a localized string similar to only one ** allowed. - - - - - Looks up a localized string similar to only one * allowed. - - - - - Looks up a localized string similar to Context must be PythonCompilerContext. - - - - - Looks up a localized string similar to cannot delete slot. - - - - - Looks up a localized string similar to cannot get slot. - - - - - Looks up a localized string similar to cannot set slot. - - - - - Looks up a localized string similar to static property '{0}' of '{1}' can only be read through a type, not an instance. - - - - - Looks up a localized string similar to static property '{0}' of '{1}' can only be assigned to through a type, not an instance. - - - - - Looks up a localized string similar to no value for this token. - - - - - Looks up a localized string similar to too many versions. - - - - - Looks up a localized string similar to unexpected token '{0}'. - - - - - Looks up a localized string similar to future feature is not defined:. - - - - - The Action used for Python call sites. This supports both splatting of position and keyword arguments. - - When a foreign object is encountered the arguments are expanded into normal position/keyword arguments. - - - - - Python's Invoke is a non-standard action. Here we first try to bind through a Python - internal interface (IPythonInvokable) which supports CallSigantures. If that fails - and we have an IDO then we translate to the DLR protocol through a nested dynamic site - - this includes unsplatting any keyword / position arguments. Finally if it's just a plain - old .NET type we use the default binder which supports CallSignatures. - - - - - Fallback - performs the default binding operation if the object isn't recognized - as being invokable. - - - - - Creates a nested dynamic site which uses the unpacked arguments. - - - - - Translates our CallSignature into a DLR Argument list and gives the simple MetaObject's which are extracted - from the tuple or dictionary parameters being splatted. - - - - - Gets the CallSignature for this invocation which describes how the MetaObject array - is to be mapped. - - - - - General purpose storage used for most PythonDictionarys. - - This dictionary storage is thread safe for multiple readers or writers. - - Mutations to the dictionary involves a simple locking strategy of - locking on the DictionaryStorage object to ensure that only one - mutation happens at a time. - - Reads against the dictionary happen lock free. When the dictionary is mutated - it is either adding or removing buckets in a thread-safe manner so that the readers - will either see a consistent picture as if the read occured before or after the mutation. - - When resizing the dictionary the buckets are replaced atomically so that the reader - sees the new buckets or the old buckets. When reading the reader first reads - the buckets and then calls a static helper function to do the read from the bucket - array to ensure that readers are not seeing multiple bucket arrays. - - - - - Creates a new dictionary storage with no buckets - - - - - Creates a new dictionary storage with no buckets - - - - - Creates a new dictionary geting values/keys from the - items arary - - - - - Creates a new dictionary storage with the given set of buckets - and size. Used when cloning the dictionary storage. - - - - - Adds a new item to the dictionary, replacing an existing one if it already exists. - - - - - Initializes the buckets to their initial capacity, the caller - must check if the buckets are empty first. - - - - - Static add helper that works over a single set of buckets. Used for - both the normal add case as well as the resize case. - - - - - Removes an entry from the dictionary and returns true if the - entry was removed or false. - - - - - Removes an entry from the dictionary and returns true if the - entry was removed or false. The key will always be hashed - so if it is unhashable an exception will be thrown - even - if the dictionary has no buckets. - - - - - Checks to see if the key exists in the dictionary. - - - - - Static helper to see if the key exists in the provided bucket array. - - Used so the contains check can run against a buckets while a writer - replaces the buckets. - - - - - Trys to get the value associated with the given key and returns true - if it's found or false if it's not present. - - - - - Static helper to try and get the value from the dictionary. - - Used so the value lookup can run against a buckets while a writer - replaces the buckets. - - - - - Clears the contents of the dictionary. - - - - - Clones the storage returning a new DictionaryStorage object. - - - - - Helper to hash the given key w/ support for null. - - - - - Returns the number of key/value pairs currently in the dictionary. - - - - - Used to store a single hashed key/value and a linked list of - collisions. - - Bucket is not serializable because it stores the computed hash - code which could change between serialization and deserialization. - - - - - Special marker bucket used during deserialization to not add - an extra field to the dictionary storage type. - - - - - The error involved an incomplete statement due to an unexpected EOF. - - - - - The error involved an incomplete token. - - - - - The mask for the actual error values - - - - - The error was a general syntax error - - - - - The error was an indentation error. - - - - - The error was a tab error. - - - - - syntax error shouldn't include a caret (no column offset should be included) - - - - - GeneratorExitException is a standard exception raised by Generator.Close() to allow a caller - to close out a generator. - - GeneratorExit is introduced in Pep342 for Python2.5. - - - - .NET exception thrown when a Python syntax error is related to incorrect indentation. - - - - - Implementation of the Python exceptions module and the IronPython/CLR exception mapping - mechanism. The exception module is the parent module for all Python exception classes - and therefore is built-in to IronPython.dll instead of IronPython.Modules.dll. - - The exception mapping mechanism is exposed as internal surface area available to only - IronPython / IronPython.Modules.dll. The actual exceptions themselves are all public. - - Because the oddity of the built-in exception types all sharing the same physical layout - (see also PythonExceptions.BaseException) some classes are defined as classes w/ their - proper name and some classes are defined as PythonType fields. When a class is defined - for convenience their's also an _TypeName version which is the PythonType. - - - - - Creates a new throwable exception of type type where the type is an new-style exception. - - Used at runtime when creating the exception from a user provided type via the raise statement. - - - - - Creates a throwable exception of type type where the type is an OldClass. - - Used at runtime when creating the exception form a user provided type that's an old class (via the raise statement). - - - - - Returns the CLR exception associated with a Python exception - creating a new exception if necessary - - - - - Given a CLR exception returns the Python exception which most closely maps to the CLR exception. - - - - - Creates a new style Python exception from the .NET exception - - - - - Internal helper to associate a .NET exception and a Python exception. - - - - - Internal helper to get the associated Python exception from a .NET exception. - - - - - Converts the DLR SyntaxErrorException into a Python new-style SyntaxError instance. - - - - - Creates a PythonType for a built-in module. These types are mutable like - normal user types. - - - - - Creates a new type for a built-in exception which derives from another Python - type. . These types are built-in and immutable like any other normal type. For - example StandardError.x = 3 is illegal. This isn't for module exceptions which - are like user defined types. thread.error.x = 3 is legal. - - - - - Creates a new type for a built-in exception which is the root concrete type. - - - - - Base class for all Python exception objects. - - When users throw exceptions they typically throw an exception which is - a subtype of this. A mapping is maintained between Python exceptions - and .NET exceptions and a corresponding .NET exception is thrown which - is associated with the Python exception. This class represents the - base class for the Python exception hierarchy. - - Users can catch exceptions rooted in either hierarchy. The hierarchy - determines whether the user catches the .NET exception object or the - Python exception object. - - Most built-in Python exception classes are actually instances of the BaseException - class here. This is important because in CPython the exceptions do not - add new members and therefore their layouts are compatible for multiple - inheritance. The exceptions to this rule are the classes which define - their own fields within their type, therefore altering their layout: - EnvironmentError - SyntaxError - IndentationError (same layout as SyntaxError) - TabError (same layout as SyntaxError) - SystemExit - UnicodeDecodeError - UnicodeEncodeError - UnicodeTranslateError - - These exceptions cannot be combined in multiple inheritance, e.g.: - class foo(EnvironmentError, IndentationError): pass - - fails but they can be combined with anything which is just a BaseException: - class foo(UnicodeDecodeError, SystemError): pass - - Therefore the majority of the classes are just BaseException instances with a - custom PythonType object. The specialized ones have their own .NET class - which inherits from BaseException. User defined exceptions likewise inherit - from this and have their own .NET class. - - - - - This interface is used for implementing parts of the IronPython type system. It - is not intended for consumption from user programs. - - - - - Thread-safe dictionary set. Returns the dictionary set or the previous value if already set or - null if the dictionary set isn't supported. - - - - - - - Dictionary replacement. Returns true if replaced, false if the dictionary set isn't supported. - - - - - - - Initializes the Exception object with an unlimited number of arguments - - - - - Returns a tuple of (type, (arg0, ..., argN)) for implementing pickling/copying - - - - - Returns a tuple of (type, (arg0, ..., argN)) for implementing pickling/copying - - - - - Updates the exception's state (dictionary) with the new values - - - - - Provides custom member lookup access that fallbacks to the dictionary - - - - - Provides custom member assignment which stores values in the dictionary - - - - - Provides custom member deletion which deletes values from the dictionary - or allows clearing 'message'. - - - - - Implements __repr__ which returns the type name + the args - tuple code formatted. - - - - - Creates a CLR Exception for this Python exception - - - - - Initializes the Python exception from a .NET exception - - - - - - Helper to get the CLR exception associated w/ this Python exception - creating it if one has not already been created. - - - - - Returns the exception 'message' if only a single argument was provided - during creation or an empty string. - - - - - Gets or sets the arguments used for creating the exception - - - - - Gets the nth member of the args property - - - - - Gets or sets the dictionary which is used for storing members not declared to have space reserved - within the exception object. - - - - - Gets the CLR exception associated w/ this Python exception. Not visible - until a .NET namespace is imported. - - - - - .NET exception that is thrown to signal the end of iteration in Python - - - - - .NET exception that is thrown to shutdown the interpretter and exit the system. - - - - - Result of sys.exit(n) - - - null if the script exited using "sys.exit(int_value)" - null if the script exited using "sys.exit(None)" - x if the script exited using "sys.exit(x)" where isinstance(x, int) == False - - - int_value if the script exited using "sys.exit(int_value)" - 1 otherwise - - - - - .NET Exception thrown when a Python syntax error is related to incorrect tabs. - - - - - Represents a sequence which may have been provided as a set of parameters to an indexer. - - TODO: This should be removed, and all uses of this should go to [SpecialName]object GetItem(..., params object[] keys) - and [SpecialName]void SetItem(..., params object [] keys) or this[params object[]xyz] which is also legal. - - currently this exists for backwards compatibility w/ IronPython's "expandable tuples". - - - - - Provides a MetaObject for instances of Python's old-style classes. - - TODO: Lots of CodeConetxt references, need to move CodeContext onto OldClass and pull it from there. - - - - - Performs the actual work of binding to the function. - - Overall this works by going through the arguments and attempting to bind all the outstanding known - arguments - position arguments and named arguments which map to parameters are easy and handled - in the 1st pass for GetArgumentsForRule. We also pick up any extra named or position arguments which - will need to be passed off to a kw argument or a params array. - - After all the normal args have been assigned to do a 2nd pass in FinishArguments. Here we assign - a value to either a value from the params list, kw-dict, or defaults. If there is ambiguity between - this (e.g. we have a splatted params list, kw-dict, and defaults) we call a helper which extracts them - in the proper order (first try the list, then the dict, then the defaults). - - - - - Makes the test for our rule. - - - - - Makes the test when we just have simple positional arguments. - - - - - Makes the test when we have a keyword argument call or splatting. - - - - - - Gets the array of expressions which correspond to each argument for the function. These - correspond with the function as it's defined in Python and must be transformed for our - delegate type before being used. - - - - - Binds any missing arguments to values from params array, kw dictionary, or default values. - - - - - Creates the argument for the list expansion parameter. - - - - - Adds extra positional arguments to the start of the expanded list. - - - - - Creates the argument for the dictionary expansion parameter. - - - - - Adds an unbound keyword argument into the dictionary. - - - - - - Adds a check to the last parameter (so it's evaluated after we've extracted - all the parameters) to ensure that we don't have any extra params or kw-params - when we don't have a params array or params dict to expand them into. - - - - - Helper function to validate that a named arg isn't duplicated with by - a params list or the dictionary (or both). - - - - - Helper function to get a value (which has no default) from either the - params list or the dictionary (or both). - - - - - Helper function to get the specified variable from the dictionary. - - - - - Helper function to extract the variable from defaults, or to call a helper - to check params / kw-dict / defaults to see which one contains the actual value. - - - - - Helper function to extract from the params list or dictionary depending upon - which one has an available value. - - - - - Helper function to extract the next argument from the params list. - - - - - Fixes up the argument list for the appropriate target delegate type. - - - - - Helper function to get the function argument strongly typed. - - - - - Called when the user is expanding a dictionary - we copy the user - dictionary and verify that it contains only valid string names. - - - - - Called when the user is expanding a params argument - - - - - Called when the user hasn't supplied a dictionary to be expanded but the - function takes a dictionary to be expanded. - - - - - Helper function to create the expression for creating the actual tuple passed through. - - - - - Creates the code to invoke the target delegate function w/ the specified arguments. - - - - - Appends the initialization code for the call to the function if any exists. - - - - - Creating a standard .NET type is easy - we just call it's constructor with the provided - arguments. - - - - - Creating a Python type involves calling __new__ and __init__. We resolve them - and generate calls to either the builtin funcions directly or embed sites which - call the slots at runtime. - - - - - Checks if we have a default new and init - in this case if we have any - arguments we don't allow the call. - - - - - Creates a test which tests the specific version of the type. - - - - - Base class for performing member binding. Derived classes override Add methods - to produce the actual final result based upon what the GetBinderHelper resolves. - - - - - - Provides the normal meta binder binding. - - - - - Provides delegate based fast binding. - - - - - The result type of the operation. - - - - - Looks up __init__ avoiding calls to __getattribute__ and handling both - new-style and old-style classes in the MRO. - - - - - Gets a builtin function for the given declaring type and member infos. - - Given the same inputs this always returns the same object ensuring there's only 1 builtinfunction - for each .NET method. - - This method takes both a cacheName and a pythonName. The cache name is the real method name. The pythonName - is the name of the method as exposed to Python. - - - - - Checks to see if the provided members are always visible for the given type. - - This filters out methods such as GetHashCode and Equals on standard .NET - types that we expose directly as Python types (e.g. object, string, etc...). - - It also filters out the base helper overrides that are added for supporting - super calls on user defined types. - - - - - a function is static if it's a static .NET method and it's defined on the type or is an extension method - with StaticExtensionMethod decoration. - - - - - If we have only interfaces, we'll need to insert object's base - - - - - Simple implementation of ASCII encoding/decoding. The default instance (PythonAsciiEncoding.Instance) is - setup to always convert even values outside of the ASCII range. The EncoderFallback/DecoderFallbacks can - be replaced with versions that will throw exceptions instead though. - - - - - Specialized version because enumerating tuples by Python's definition - doesn't call __getitem__, but filter does! - - - - - Opens a file and returns a new file object. - - name -> the name of the file to open. - mode -> the mode to open the file (r for reading, w for writing, a for appending, default is r). - bufsize -> the size of the buffer to be used (<= 0 indicates to use the default size) - - - - - Creates a new Python file object from a .NET stream object. - - stream -> the stream to wrap in a file object. - - - - - float overload of range - reports TypeError if the float is outside the range of normal integers. - - The method binder would usally report an OverflowError in this case. - - - - - float overload of range - reports TypeError if the float is outside the range of normal integers. - - The method binder would usally report an OverflowError in this case. - - - - - Gets the appropriate LanguageContext to be used for code compiled with Python's compile, eval, execfile, etc... - - - - Returns true if we should inherit our callers context (true division, etc...), false otherwise - - - Returns the default compiler flags or the flags the user specified. - - - - Gets a scope used for executing new code in optionally replacing the globals and locals dictionaries. - - - - - Set if the function includes a *args argument list. - - - - - Set if the function includes a **kwargs argument dictionary. - - - - - Set if the function is a generator. - - - - - Set if the function was compiled with future division. - - - - - IronPython specific: Set if the function includes nested exception handling and therefore can alter - sys.exc_info(). - - - - - IronPython specific: Set if the function includes a try/finally block. - - - - - Represents a piece of code. This can reference either a CompiledCode - object or a Function. The user can explicitly call FunctionCode by - passing it into exec or eval. - - - - - This is both the lock that is held while enumerating the threads or updating the thread accounting - information. It's also a marker CodeList which is put in place when we are enumerating the thread - list and all additions need to block. - - This lock is also acquired whenever we need to calculate how a function's delegate should be created - so that we don't race against sys.settrace/sys.setprofile. - - - - - Constructor used to create a FunctionCode for code that's been serialized to disk. - - Code constructed this way cannot be interpreted or debugged using sys.settrace/sys.setprofile. - - Function codes created this way do support recursion enforcement and are therefore registered in the global function code registry. - - - - - Constructor to create a FunctionCode at runtime. - - Code constructed this way supports both being interpreted and debugged. When necessary the code will - be re-compiled or re-interpreted for that specific purpose. - - Function codes created this way do support recursion enforcement and are therefore registered in the global function code registry. - - the initial delegate provided here should NOT be the actual code. It should always be a delegate which updates our Target lazily. - - - - - Registers the current function code in our global weak list of all function codes. - - The weak list can be enumerated with GetAllCode(). - - Ultimately there are 3 types of threads we care about races with: - 1. Other threads which are registering function codes - 2. Threads calling sys.settrace which require the world to stop and get updated - 3. Threads running cleanup (thread pool thread, or call to gc.collect). - - The 1st two must have perfect synchronization. We cannot have a thread registering - a new function which another thread is trying to update all of the functions in the world. Doing - so would mean we could miss adding tracing to a thread. - - But the cleanup thread can run in parallel to either registrying or sys.settrace. The only - thing it needs to take a lock for is updating our accounting information about the - number of code objects are alive. - - - - - Enumerates all function codes for updating the current type of targets we generate. - - While enumerating we hold a lock so that users cannot change sys.settrace/sys.setprofile - until the lock is released. - - - - - Creates a FunctionCode object for exec/eval/execfile'd/compile'd code. - - The code is then executed in a specific CodeContext by calling the .Call method. - - - - - Called the 1st time a function is invoked by our OriginalCallTarget* methods - over in PythonCallTargets. This computes the real delegate which needs to be - created for the function. Usually this means starting off interpretering. It - also involves adding the wrapper function for recursion enforcement. - - Because this can race against sys.settrace/setprofile we need to take our - _ThreadIsEnumeratingAndAccountingLock to ensure no one is actively changing all - of the live functions. - - - - - Updates the delegate based upon current Python context settings for recursion enforcement - and for tracing. - - - - - Called to set the initial target delegate when the user has passed -X:Debug to enable - .NET style debugging. - - - - - Gets the LambdaExpression for tracing. - - If this is a generator function code then the lambda gets tranformed into the correct generator code. - - - - - Gets the correct final LambdaExpression for this piece of code. - - This is either just _lambda or _lambda re-written to be a generator expression. - - - - - Returns a list of variable names which are accessed from nested functions. - - - - - Returns the byte code. IronPython does not implement this and always - returns an empty string for byte code. - - - - - Returns a list of constants used by the function. - - The first constant is the doc string, or None if no doc string is provided. - - IronPython currently does not include any other constants than the doc string. - - - - - Returns the filename that the code object was defined in. - - - - - Returns the 1st line number of the code object. - - - - - Returns a set of flags for the function. - - 0x04 is set if the function used *args - 0x08 is set if the function used **args - 0x20 is set if the function is a generator - - - - - Returns a list of free variables (variables accessed - from an outer scope). This does not include variables - accessed in the global scope. - - - - - Returns a mapping between byte code and line numbers. IronPython does - not implement this because byte code is not available. - - - - - Returns the name of the code (function name, class name, or <module>). - - - - - Returns a list of global variable names accessed by the code. - - - - - Returns the number of local varaibles defined in the function. - - - - - Returns the stack size. IronPython does not implement this - because byte code is not supported. - - - - - Extremely light weight linked list of weak references used for tracking - all of the FunctionCode objects which get created and need to be updated - for purposes of recursion enforcement or tracing. - - - - - Validates that the current self object is usable for this method. - - - - - General conversion routine TryConvert - tries to convert the object to the desired type. - Try to avoid using this method, the goal is to ultimately remove it! - - - - - This function tries to convert an object to IEnumerator, or wraps it into an adapter - Do not use this function directly. It is only meant to be used by Ops.GetEnumerator. - - - - - This function tries to convert an object to IEnumerator, or wraps it into an adapter - Do not use this function directly. It is only meant to be used by Ops.GetEnumerator. - - - - - Attempts to convert value into a index usable for slicing and return the integer - value. If the conversion fails false is returned. - - If throwOverflowError is true then BigInteger's outside the normal range of integers will - result in an OverflowError. - - - - - Converts a value to int ignoring floats - - - - - Note: - IEnumerator innerEnum = Dictionary<K,V>.KeysCollections.GetEnumerator(); - innerEnum.MoveNext() will throw InvalidOperation even if the values get changed, - which is supported in python - - - - - Note: - IEnumerator innerEnum = Dictionary<K,V>.KeysCollections.GetEnumerator(); - innerEnum.MoveNext() will throw InvalidOperation even if the values get changed, - which is supported in python - - - - - Note: - IEnumerator innerEnum = Dictionary<K,V>.KeysCollections.GetEnumerator(); - innerEnum.MoveNext() will throw InvalidOperation even if the values get changed, - which is supported in python - - - - - Provides both helpers for implementing Python dictionaries as well - as providing public methods that should be exposed on all dictionary types. - - Currently these are published on IDictionary<object, object> - - - - - Creates a DLR OverloadDoc object which describes information about this overload. - - The method to document - The name of the method if it should override the name in the MethodBase - Parameters to skip at the end - used for removing the value on a setter method - true to include self on instance methods - - - - Converts a Type object into a string suitable for lookup in the help file. All generic types are - converted down to their generic type definition. - - - - - Gets the XPathDocument for the specified assembly, or null if one is not available. - - - - - Gets the Xml documentation for the specified MethodBase. - - - - - Gets the Xml documentation for the specified Type. - - - - - Gets the Xml documentation for the specified Field. - - - - - Gets the Xml documentation for the specified Field. - - - - - Converts the XML as stored in the config file into a human readable string. - - - - - True iff the thread is currently inside the generator (ie, invoking the _next delegate). - This can be used to enforce that a generator does not call back into itself. - Pep255 says that a generator should throw a ValueError if called reentrantly. - - - - - We cache the GeneratorFinalizer of generators that were closed on the user - thread, and did not get finalized on the finalizer thread. We can then reuse - the object. Reusing objects with a finalizer is good because it reduces - the load on the GC's finalizer queue. - - - - - Fields set by Throw() to communicate an exception to the yield point. - These are plumbed through the generator to become parameters to Raise(...) invoked - at the yield suspenion point in the generator. - - - - - Value sent by generator.send(). - Since send() could send an exception, we need to keep this different from throwable's value. - - - - - See PEP 342 (http://python.org/dev/peps/pep-0342/) for details of new methods on Generator. - Full signature including default params for throw is: - throw(type, value=None, traceback=None) - Use multiple overloads to resolve the default parameters. - - - - - Throw(...) is like Raise(...) being called from the yield point within the generator. - Note it must come from inside the generator so that the traceback matches, and so that it can - properly cooperate with any try/catch/finallys inside the generator body. - - If the generator catches the exception and yields another value, that is the return value of g.throw(). - - - - - send() was added in Pep342. It sends a result back into the generator, and the expression becomes - the result of yield when used as an expression. - - - - - Close introduced in Pep 342. - - - - - Core implementation of IEnumerator.MoveNext() - - - - - Core implementation of Python's next() method. - - - - - Helper called from PythonOps after the yield statement - Keepin this in a helper method: - - reduces generated code size - - allows better coupling with PythonGenerator.Throw() - - avoids throws from emitted code (which can be harder to debug). - - - - - - Called to throw an exception set by Throw(). - - - - - Gets the name of the function that produced this generator object. - - - - - True if the generator has finished (is "closed"), else false. - Python language spec mandates that calling Next on a closed generator gracefully throws a StopIterationException. - This can never be reset. - - - - - True if the generator can set sys exc info and therefore needs exception save/restore. - - - - - Importer class - used for importing modules. Used by Ops and __builtin__ - Singleton living on Python engine. - - - - - Gateway into importing ... called from Ops. Performs the initial import of - a module and returns the module. - - - - - Gateway into importing ... called from Ops. This is called after - importing the module and is used to return individual items from - the module. The outer modules dictionary is then updated with the - result. - - - - - Called by the __builtin__.__import__ functions (general importing) and ScriptEngine (for site.py) - - level indiciates whether to perform absolute or relative imports. - -1 indicates both should be performed - 0 indicates only absolute imports should be performed - Positive numbers indicate the # of parent directories to search relative to the calling module - - - - - Interrogates the importing module for __name__ and __path__, which determine - whether the imported module (whose name is 'name') is being imported as nested - module (__path__ is present) or as sibling. - - For sibling import, the full name of the imported module is parent.sibling - For nested import, the full name of the imported module is parent.module.nested - where parent.module is the mod.__name__ - - - the globals dictionary - Name of the module to be imported - Output - full name of the module being imported - Path to use to search for "full" - the import level for relaive imports - the parent module - the global __package__ value - - - - - Given the parent module name looks up the __path__ property. - - - - - Trys to get an existing module and if that fails fall backs to searching - - - - - Attempts to load a module from sys.meta_path as defined in PEP 302. - - The meta_path provides a list of importer objects which can be used to load modules before - searching sys.path but after searching built-in modules. - - - - - Given a user defined importer object as defined in PEP 302 tries to load a module. - - First the find_module(fullName, path) is invoked to get a loader, then load_module(fullName) is invoked - - - - - Finds a user defined importer for the given path or returns null if no importer - handles this path. - - - - - Creates a new list with the data in the array and a size - the same as the length of the array. The array is held - onto and may be mutated in the future by the list. - - params array to use for lists storage - - - - Gets a reasonable size for the addition of two arrays. We round - to a power of two so that we usually have some extra space if - the resulting array gets added to. - - - - - Non-thread safe adder, should only be used by internal callers that - haven't yet exposed their list. - - - - - Compares the two specified keys - - - - - Supports __index__ on arbitrary types, also prevents __float__ - - - - - we need to lock both objects (or copy all of one's data w/ it's lock held, and - then compare, which is bad). Therefore we have a strong order for locking on - the two objects based upon the hash code or object identity in case of a collision - - - - - Summary description for ConstantValue. - - - - - Multiply two object[] arrays - slow version, we need to get the type, etc... - - - - - Multiply two object[] arrays - internal version used for objects backed by arrays - - - - - Add two arrays - internal versions for objects backed by arrays - - - - - - - - - - We override the behavior of equals, compare and hashcode to make - chars seem as much like strings as possible. In Python there is no - difference between these types. - - - - - Helper class that all custom type descriptor implementations call for - the bulk of their implementation. - - - - - Returns the digits for the format spec, no sign is included. - - - - - InstanceOps contains methods that get added to CLS types depending on what - methods and constructors they define. These have not been added directly to - PythonType since they need to be added conditionally. - - Possibilities include: - - __new__, one of 3 __new__ sets can be added: - DefaultNew - This is the __new__ used for a PythonType (list, dict, object, etc...) that - has only 1 default public constructor that takes no parameters. These types are - mutable types, and __new__ returns a new instance of the type, and __init__ can be used - to re-initialize the types. This __new__ allows an unlimited number of arguments to - be passed if a non-default __init__ is also defined. - - NonDefaultNew - This is used when a type has more than one constructor, or only has one - that takes more than zero parameters. This __new__ does not allow an arbitrary # of - extra arguments. - - DefaultNewCls - This is the default new used for CLS types that have only a single ctor - w/ an arbitray number of arguments. This constructor allows setting of properties - based upon an extra set of kw-args, e.g.: System.Windows.Forms.Button(Text='abc'). It - is only used on non-Python types. - - __init__: - For types that do not define __init__ we have an __init__ function that takes an - unlimited number of arguments and does nothing. All types share the same reference - to 1 instance of this. - - next: Defined when a type is an enumerator to expose the Python iter protocol. - - - repr: Added for types that override ToString - - get: added for types that implement IDescriptor - - - - - __dir__(self) -> Returns the list of members defined on a foreign IDynamicMetaObjectProvider. - - - - - Provides the implementation of __enter__ for objects which implement IDisposable. - - - - - Provides the implementation of __exit__ for objects which implement IDisposable. - - - - - Determines if a type member can be imported. This is used to treat static types like modules. - - - - - Implements __contains__ for types implementing IEnumerable of T. - - - - - Implements __contains__ for types implementing IEnumerable - - - - - Implements __contains__ for types implementing IEnumerable of T. - - - - - Implements __contains__ for types implementing IEnumerable - - - - - Implements __reduce_ex__ for .NET types which are serializable. This uses the .NET - serializer to get a string of raw data which can be serialized. - - - - - Contains Python extension methods that are added to object - - - - Types for which the pickle module has built-in support (from PEP 307 case 2) - - - - __class__, a custom slot so that it works for both objects and types. - - - - - Removes an attribute from the provided member - - - - - Returns the hash code of the given object - - - - - Gets the specified attribute from the object without running any custom lookup behavior - (__getattr__ and __getattribute__) - - - - - Initializes the object. The base class does nothing. - - - - - Initializes the object. The base class does nothing. - - - - - Initializes the object. The base class does nothing. - - - - - Creates a new instance of the type - - - - - Creates a new instance of the type - - - - - Creates a new instance of the type - - - - - Runs the pickle protocol - - - - - Runs the pickle protocol - - - - - Runs the pickle protocol - - - - - Returns the code representation of the object. The default implementation returns - a string which consists of the type and a unique numerical identifier. - - - - - Sets an attribute on the object without running any custom object defined behavior. - - - - - Returns the number of bytes of memory required to allocate the object. - - - - - Returns a friendly string representation of the object. - - - - - Return a dict that maps slot names to slot values, but only include slots that have been assigned to. - Looks up slots in base types as well as the current type. - - Sort-of Python equivalent (doesn't look up base slots, while the real code does): - return dict([(slot, getattr(self, slot)) for slot in type(self).__slots__ if hasattr(self, slot)]) - - Return null if the object has no __slots__, or empty dict if it has __slots__ but none are initialized. - - - - - Implements the default __reduce_ex__ method as specified by PEP 307 case 2 (new-style instance, protocol 0 or 1) - - - - - Returns the closest base class (in terms of MRO) that isn't defined in Python code - - - - - Implements the default __reduce_ex__ method as specified by PEP 307 case 3 (new-style instance, protocol 2) - - - - - Contains functions that are called directly from - generated code to perform low-level runtime functionality. - - - - - Creates a new dictionary extracting the keys and values from the - provided data array. Keys/values are adjacent in the array with - the value coming first. - - - - - Creates a new dictionary extracting the keys and values from the - provided data array. Keys/values are adjacent in the array with - the value coming first. - - - - - Wraps up all the semantics of multiplying sequences so that all of our sequences - don't duplicate the same logic. When multiplying sequences we need to deal with - only multiplying by valid sequence types (ints, not floats), support coercion - to integers if the type supports it, not multiplying by None, and getting the - right semantics for multiplying by negative numbers and 1 (w/ and w/o subclasses). - - This function assumes that it is only called for case where count is not implicitly - coercible to int so that check is skipped. - - - - - Supports calling of functions that require an explicit 'this' - Currently, we check if the function object implements the interface - that supports calling with 'this'. If not, the 'this' object is dropped - and a normal call is made. - - - - - Called from generated code emitted by NewTypeMaker. - - - - - Handles the descriptor protocol for user-defined objects that may implement __get__ - - - - - Handles the descriptor protocol for user-defined objects that may implement __set__ - - - - - Handles the descriptor protocol for user-defined objects that may implement __delete__ - - - - - Python runtime helper for raising assertions. Used by AssertStatement. - - Object representing the assertion message - - - - Python runtime helper to create instance of Python List object. - - New instance of List - - - - Python runtime helper to create a populated instance of Python List object. - - - - - Python runtime helper to create a populated instance of Python List object w/o - copying the array contents. - - - - - Python runtime helper to create a populated instance of Python List object. - - List is populated by arbitrary user defined object. - - - - - Python runtime helper to create an instance of Python List object. - - List has the initial provided capacity. - - - - - Python runtime helper to create an instance of Tuple - - - - - - - Python runtime helper to create an instance of Tuple - - - - - - Python Runtime Helper for enumerator unpacking (tuple assignments, ...) - Creates enumerator from the input parameter e, and then extracts - expected number of values, returning them as array - - If the input is a Python tuple returns the tuples underlying data array. Callers - should not mutate the resulting tuple. - - The code context of the AST getting enumerator values. - object to enumerate - expected number of objects to extract from the enumerator - - array of objects (.Lengh == expected) if exactly expected objects are in the enumerator. - Otherwise throws exception - - - - - Python runtime helper to create instance of Slice object - - Start of the slice. - End of the slice. - Step of the slice. - Slice - - - - Prints newline into default standard output - - - - - Prints newline into specified destination. Sets softspace property to false. - - - - - Prints value into default standard output with Python comma semantics. - - - - - Prints value into specified destination with Python comma semantics. - - - - - Called from generated code when we are supposed to print an expression value - - - - - Called from generated code for: - - import spam.eggs - - - - - Python helper method called from generated code for: - - import spam.eggs as ham - - - - - Called from generated code for: - - from spam import eggs1, eggs2 - - - - - Imports one element from the module in the context of: - - from module import a, b, c, d - - Called repeatedly for all elements being imported (a, b, c, d above) - - - - - Called from generated code for: - - from spam import * - - - - - Unqualified exec statement support. - A Python helper which will be called for the statement: - - exec code - - - - - Qualified exec statement support, - Python helper which will be called for the statement: - - exec code in globals [, locals ] - - - - - Get an exception tuple for the "current" exception. This is used for sys.exc_info() - - - - - Get an exception tuple for a given exception. This is like the inverse of MakeException. - - the code context - the exception to create a tuple for. - a tuple of (type, value, traceback) - This is called directly by the With statement so that it can get an exception tuple - in its own private except handler without disturbing the thread-wide sys.exc_info(). - - - - helper function for re-raised exceptions. - - - - - helper function for non-re-raise exceptions. - - type is the type of exception to throw or an instance. If it - is an instance then value should be null. - - If type is a type then value can either be an instance of type, - a Tuple, or a single value. This case is handled by EC.CreateThrowable. - - - - - Extracts an argument from either the dictionary or params - - - - - Creates a new array the values set to Uninitialized.Instance. The array - is large enough to hold for all of the slots allocated for the type and - its sub types. - - - - - Helper to determine if the value is a simple numeric type (int or big int or bool) - used for OldInstance - deprecated form of slicing. - - - - - Helper to determine if the type is a simple numeric type (int or big int or bool) - used for OldInstance - deprecated form of slicing. - - - - - Helper to determine if the type is a simple numeric type (int or big int or bool) but not a subclass - - - - - For slicing. Fixes up a BigInteger and returns an integer w/ the length of the - object added if the value is negative. - - - - - For slicing. Gets the length of the object, used to only get the length once. - - - - - Helper method for DynamicSite rules that check the version of their dynamic object - TODO - Remove this method for more direct field accesses - - - - - - - - Called from generated code. Gets a builtin function and the BuiltinFunctionData associated - with the object. Tests to see if the function is bound and has the same data for the generated - rule. - - - - - Convert object to a given type. This code is equivalent to NewTypeMaker.EmitConvertFromObject - except that it happens at runtime instead of compile time. - - - - - Provides access to AppDomain.DefineDynamicAssembly which cannot be called from a DynamicMethod - - - - - Generates a new delegate type. The last type in the array is the return type. - - - - - Generates a new delegate type. The last type in the array is the return type. - - - - - Provides the entry point for a compiled module. The stub exe calls into InitializeModule which - does the actual work of adding references and importing the main module. Upon completion it returns - the exit code that the program reported via SystemExit or 0. - - - - - Called from generated code, helper to remove a name - - - - - Called from generated code, helper to do name lookup - - - - - Called from generated code, helper to do name assignment - - - - - Returns an IntPtr in the proper way to CPython - an int or a Python long - - - - - Create at TypeError exception for when Raise() can't create the exception requested. - - original type of exception requested - a TypeEror exception - - - - Helper clas for calls to unicode(...). We generate code which checks if unicode - is str and if it is we redirect those calls to the unicode function defined on this - class. - - - - - ExtensibleString is the base class that is used for types the user defines - that derive from string. It carries along with it the string's value and - our converter recognizes it as a string. - - - - - StringOps is the static class that contains the methods defined on strings, i.e. 'abc' - - Here we define all of the methods that a Python user would see when doing dir('abc'). - If the user is running in a CLS aware context they will also see all of the methods - defined in the CLS System.String type. - - - - - Returns a copy of this string converted to uppercase - - - - - return true if self is a titlecased string and there is at least one - character in self; also, uppercase characters may only follow uncased - characters (e.g. whitespace) and lowercase characters only cased ones. - return false otherwise. - - - - - Return a string which is the concatenation of the strings - in the sequence seq. The separator between elements is the - string providing this method - - - - - Replaces each replacement field in the string with the provided arguments. - - replacement_field = "{" field_name ["!" conversion] [":" format_spec] "}" - field_name = (identifier | integer) ("." identifier | "[" element_index "]")* - - format_spec: [[fill]align][sign][#][0][width][.precision][type] - - Conversion can be 'r' for repr or 's' for string. - - - - - Replaces each replacement field in the string with the provided arguments. - - replacement_field = "{" field_name ["!" conversion] [":" format_spec] "}" - field_name = (identifier | integer) ("." identifier | "[" element_index "]")* - - format_spec: [[fill]align][sign][#][0][width][.precision][type] - - Conversion can be 'r' for repr or 's' for string. - - - - - Gets the starting offset checking to see if the incoming bytes already include a preamble. - - - - When encoding or decoding strings if an error occurs CPython supports several different - behaviors, in addition it supports user-extensible behaviors as well. For the default - behavior we're ok - both of us support throwing and replacing. For custom behaviors - we define a single fallback for decoding and encoding that calls the python function to do - the replacement. - - When we do the replacement we call the provided handler w/ a UnicodeEncodeError or UnicodeDecodeError - object which contains: - encoding (string, the encoding the user requested) - end (the end of the invalid characters) - object (the original string being decoded) - reason (the error, e.g. 'unexpected byte code', not sure of others) - start (the start of the invalid sequence) - - The decoder returns a tuple of (unicode, int) where unicode is the replacement string - and int is an index where encoding should continue. - - - - Indexer for generic parameter resolution. We bind to one of the generic versions - available in this type collision. A user can also do someType[()] to force to - bind to the non-generic version, but we will always present the non-generic version - when no bindings are available. - - - - - Object.ToString() displays the CLI type name. But we want to display the class name (e.g. - '<foo object at 0x000000000000002C>' unless we've overridden __repr__ but not __str__ in - which case we'll display the result of __repr__. - - - - - Provides a debug view for user defined types. This class is declared as public - because it is referred to from generated code. You should not use this class. - - - - - A DynamicMetaObject which is just used to support custom conversions to COM. - - - - - A marker interface so we can recognize and access sequence members on our array objects. - - - - - List of unary operators which we have sites for to enable fast dispatch that - doesn't collide with other operators. - - - - - Truncates the file to the current length as indicated by tell(). - - - - - Truncates the file to the specified length. - - - - - - Provides storage of IronPython specific data in the DLR Scope ScopeExtension. - - This enables IronPython to track code compilation flags such as from __future__ - flags and import clr flags across multiple executions of user-provided scopes. - - - - - Provides human readable names for how Python maps the various DLR NarrowingLevel's. - - - - - No narrowing conversions are performed - - - - - Double/Single to Decimal - PythonTuple to Array - Generic conversions - BigInteger to Int64 - - - - - Numeric conversions excluding from floating point values - Boolean conversions - Delegate conversions - Enumeration conversions - - - - - Enables Python protocol conversions (__int__, etc...) - - - - - Provides dictionary based storage which is backed by a Scope object. - - - - - Common interface shared by both Set and FrozenSet - - - - - Contains common set functionality between set and frozenSet - - - - - Creates a set that can be hashable. If the set is currently a FrozenSet the - set is returned. If the set is a normal Set then a FrozenSet is returned - with its contents. - - - - - - - Mutable set class - - - - - Appends one IEnumerable to an existing set - - - - - - Appends one or more IEnumerables to an existing set - - - - - Immutable set class - - - - - Iterator over sets - - - - - Gets the indices for the deprecated __getslice__, __setslice__, __delslice__ functions - - This form is deprecated in favor of using __getitem__ w/ a slice object as an index. This - form also has subtly different mechanisms for fixing the slice index before calling the function. - - If an index is negative and __len__ is not defined on the object than an AttributeError - is raised. - - - - - StringFormatter provides Python's % style string formatting services. - - - - - Read a possible mapping key for %(key)s. - - The key name enclosed between the '%(key)s', - or null if there are no paranthesis such as '%s'. - - - - AppendBase appends an integer at the specified radix doing all the - special forms for Python. We have a copy and paste version of this - for BigInteger below that should be kept in sync. - - - - - BigInteger version of AppendBase. Should be kept in sync w/ AppendBase - - - - - Return a copy of this tuple's data array. - - - - - public class to get optimized - - - - - Returns detailed call statistics. Not implemented in IronPython and always returns None. - - - - - Handles output of the expression statement. - Prints the value and sets the __builtin__._ - - - - - Provides a CustomTracker which handles special fields which have custom - behavior on get/set. - - - - - Provides custom, versioned, dictionary access for instances. Used for both - new-style and old-style instances. - - Each class can allocate a version for instance storage using the - CustomInstanceDictionaryStorage.AllocateInstance method. The version allocated - is dependent upon the names which are likely to appear in the instance - dictionary. Currently these names are calculated by collecting the names - that are assigned to during the __init__ method and combining these with - all such names in the types MRO. - - When creating the dictionary for storing instance values the class can then create - a PythonDictionary backed by a CustomInstanceDictionaryStorage with it's - version. When doing a get/set optimized code can then be produced that - verifies we have CustomInstanceDictionaryStorage and it has the - correct version. If we have a matching dictionary then gets/sets can turn - into simple array accesses rather than dictionary gets/sets. For programs - which access a large number of instance variables this can dramatically - speed up the program. - - TODO: Should we attempt to unify all versions which share the same keys? - - - - - Represents a set of attributes that different functions can have. - - - - No flags have been set - - - This is a function w/ no instance pointer - - - This is a method that requires an instance - - - Built-in functions can encapsulate both methods and functions, in which case both bits are set - - - True is the function/method should be visible from pure-Python code - - - True if this is a __r*__ method for a CLS overloaded operator method - - - - This method represents a binary operator method for a CLS overloaded operator method. - - Being a binary operator causes the following special behaviors to kick in: - A failed binding at call time returns NotImplemented instead of raising an exception - A reversed operator will automatically be created if: - 1. The parameters are both of the instance type - 2. The parameters are in reversed order (other, this) - - This enables simple .NET operator methods to be mapped into the Python semantics. - - - - - OperatorMapping provides a mapping from DLR operators to their associated .NET methods. - - - - - Given an operator returns the OperatorMapping associated with the operator or null - - - - - The operator the OperatorMapping provides info for. - - - - - The primary method name associated with the method. This method name is - usally in the form of op_Operator (e.g. op_Addition). - - - - - The secondary method name associated with the method. This method name is - usually a standard .NET method name with pascal casing (e.g. Add). - - - - - The return type that must match for the alternate operator to be valid. - - This is available alternate operators don't have special names and therefore - could be confused for a normal method which isn't fulfilling the contract. - - - - - This helper type lets us build a fake ParameterInfo object with a specific type and name - to pass along to methods that expect ParameterInfos. This is currently found useful - for the NewTypeMaker code and may be useful in other situations as well. - - - - - Cached CallSites. User types are cached on the PythonType and System types are cached on the - PythonContext to avoid cross-runtime contamination due to the binder on the site. - - - - - Represents a PythonType. Instances of PythonType are created via PythonTypeBuilder. - - - - - Used in copy_reg which is the only consumer of __flags__ in the standard library. - - Set if the type is user defined - - - - - Implements fast binding for user defined types. This ensures that common highly dynamic - scenarios will run fast (for instance creating new types repeatedly and only creating a limited - number of instances of them). It also gives better code sharing amongst different subclasses - of the same types and improved startup time due to reduced code generation. - - - - - Provides delegates that will invoke a parameterless type ctor. The first key provides - the dictionary for a specific type, the 2nd key provides the delegate for a specific - call site type used in conjunction w/ our IFastInvokable implementation. - - - - - Shared built-in functions for creating instances of user defined types. Because all - types w/ the same UnderlyingSystemType share the same constructors these can be - shared across multiple types. - - - - - Creates a new type for a user defined type. The name, base classes (a tuple of type - objects), and a dictionary of members is provided. - - - - - Creates a new type for a user defined type. The name, base classes (a tuple of type - objects), and a dictionary of members is provided. - - - - - Creates a new PythonType object which is backed by the specified .NET type for - storage. The type is considered a system type which can not be modified - by the user. - - - - - - Creates a new PythonType which is a subclass of the specified PythonType. - - Used for runtime defined new-style classes which require multiple inheritance. The - primary example of this is the exception system. - - - - - Creates a new PythonType which is a subclass of the specified PythonType. - - Used for runtime defined new-style classes which require multiple inheritance. The - primary example of this is the exception system. - - - - - Creates a new PythonType object which represents an Old-style class. - - - - - Returns true if the specified object is an instance of this type. - - - - - Gets the dynamic type that corresponds with the provided static type. - - Returns null if no type is available. TODO: In the future this will - always return a PythonType created by the DLR. - - - - - - - Sets the python type that corresponds with the provided static type. - - This is used for built-in types which have a metaclass. Currently - only used by ctypes. - - - - - Allocates the storage for the instance running the .NET constructor. This provides - the creation functionality for __new__ implementations. - - - - - Allocates the storage for the instance running the .NET constructor. This provides - the creation functionality for __new__ implementations. - - - - - Allocates the storage for the instance running the .NET constructor. This provides - the creation functionality for __new__ implementations. - - - - - Allocates the storage for the instance running the .NET constructor. This provides - the creation functionality for __new__ implementations. - - - - - Allocates the storage for the instance running the .NET constructor. This provides - the creation functionality for __new__ implementations. - - - - - Allocates the storage for the instance running the .NET constructor. This provides - the creation functionality for __new__ implementations. - - - - - Returns true if this type is a subclass of other - - - - - Looks up a slot on the dynamic type - - - - - Searches the resolution order for a slot matching by name - - - - - Searches the resolution order for a slot matching by name. - - Includes searching for methods in old-style classes - - - - - Internal helper to add a new slot to the type - - - - - - - Gets a value from a dynamic type and any sub-types. Values are stored in slots (which serve as a level of - indirection). This searches the types resolution order and returns the first slot that - contains the value. - - - - - Attempts to lookup a member w/o using the customizer. Equivelent to object.__getattribute__ - but it doens't throw an exception. - - - - - - Gets a value from a dynamic type and any sub-types. Values are stored in slots (which serve as a level of - indirection). This searches the types resolution order and returns the first slot that - contains the value. - - - - - Attempts to lookup a member w/o using the customizer. - - - - - - Sets a value on an instance. If a slot is available in the most derived type the slot - is set there, otherwise the value is stored directly in the instance. - - - - - Attempst to set a value w/o going through the customizer. - - This enables languages to provide the "base" implementation for setting attributes - so that the customizer can call back here. - - - - - Returns a list of all slot names for the type and any subtypes. - - The context that is doing the inquiry of InvariantContext.Instance. - - - - Returns a list of all slot names for the type, any subtypes, and the instance. - - The context that is doing the inquiry of InvariantContext.Instance. - the instance to get instance members from, or null. - - - - Adds members from a user defined type. - - - - - Adds members from a user defined type instance - - - - - Gets the .NET type which is used for instances of the Python type. - - When overridden by a metaclass enables a customization of the .NET type which - is used for instances of the Python type. Meta-classes can construct custom - types at runtime which include new .NET methods, fields, custom attributes or - other features to better interoperate with .NET. - - - - - Initializes a PythonType that represents a standard .NET type. The same .NET type - can be shared with the Python type system. For example object, string, int, - etc... are all the same types. - - - - - Creates a __new__ method for the type. If the type defines interesting constructors - then the __new__ method will call that. Otherwise if it has only a single argless - - - - - This will return a unique integer for every version of every type in the system. - This means that DynamicSite code can generate a check to see if it has the correct - PythonType and version with a single integer compare. - - TODO - This method and related code should fail gracefully on overflow. - - - - - Internal helper function to add a subtype - - - - - Returns a CLR WeakReference object to this PythonType that can be shared - between anyone who needs a weak reference to the type. - - - - - Gets the name of the dynamic type - - - - - Gets the resolution order used for attribute lookup - - - - - Gets the underlying system type that is backing this type. All instances of this - type are an instance of the underlying system type. - - - - - Gets the extension type for this type. The extension type provides - a .NET type which can be inherited from to extend sealed classes - or value types which Python allows inheritance from. - - - - - Gets the base types from which this type inherits. - - - - - True if the type is a system type. A system type is a type which represents an - underlying .NET type and not a subtype of one of these types. - - - - - Gets a list of weak references to all the subtypes of this class. May return null - if there are no subtypes of the class. - - - - - Base class for doing fast type invoke binding. Subclasses are created using - reflection once during the binding. The subclasses can then proceed to do - the binding w/o using reflection. Otherwise we'd have lots more reflection - calls which would slow the binding up. - - - - - Gets or creates delegate for calling the constructor function. - - - - - The type has a ctor which does not accept PythonTypes. This is used - for user defined types which implement __clrtype__ - - - - - Used when a type overrides __new__ with a Python function or other object - that can return an arbitrary value. If the return value is not the same type - as the type which had __new__ then we need to lookup __init__ on the type - and invoke it. Also handles initialization for finalization when __del__ - is defined for the same reasons. - - - - - target is the newly initialized value. - args are the arguments to be passed to __init__ - - - - - Couples a MemberGroup and the name which produces the member group together - - - - - Represents an ops-extension which adds a new slot. The slot can have arbitrary - get/set behavior above and beyond normal .NET methods or properties. This is - typically in regards to how it processes access from instances or subtypes. - - - - - Provides a slot object for the dictionary to allow setting of the dictionary. - - - - - Calculates the method resolution order for a Python class - the rules are: - If A is a subtype of B, then A has precedence (A >B) - If C appears before D in the list of bases then C > D - If E > F in one __mro__ then E > F in all __mro__'s for our subtype - - class A(object): pass - class B(object): pass - class C(B): pass - class N(A,B,C): pass # illegal - - This is because: - C.__mro__ == (C, B, object) - N.__mro__ == (N, A, B, C, object) - which would conflict, but: - - N(B,A) is ok (N, B, a, object) - N(C, B, A) is ok (N, C, B, A, object) - - Calculates a C3 MRO as described in "The Python 2.3 Method Resolution Order" - plus support for old-style classes. - - We build up a list of our base classes MRO's plus our base classes themselves. - We go through the list in order. Look at the 1st class in the current list, and - if it's not the non-first class in any other list then remove it from all the lists - and append it to the mro. Otherwise continue to the next list. If all the classes at - the start are no-good then the MRO is bad and we throw. - - For old-style classes if the old-style class is the only one in the list of bases add - it as a depth-first old-style MRO, otherwise compute a new-style mro for all the classes - and use that. - - - - - - - - - Returns the dictionary used to store state for this object - - - - - Python module. Stores classes, functions, and data. Usually a module - is created by importing a file or package from disk. But a module can also - be directly created by calling the module type and providing a name or - optionally a documentation string. - - - - - Creates a new module backed by a Scope. Used for creating modules for foreign Scope's. - - - - - Creates a new module backed by a Scope. Used for creating modules for Python code. - - - - - Creates a new PythonModule with the specified dictionary. - - Used for creating modules for builtin modules which don't have any code associated with them. - - - - - Represents a member of a user-defined type which defines __slots__. The names listed in - __slots__ have storage allocated for them with the type and provide fast get/set access. - - - - - Gets the index into the object array to be used for the slot storage. - - - - - Helpers for interacting w/ .NET types. This includes: - - Member resolution via GetMember/GetMembers. This performs a member lookup which includes the registered - extension types in the PythonBinder. Internally the class has many MemberResolver's which provide - the various resolution behaviors. - - Cached member access - this is via static classes such as Object and provides various MemberInfo's so we're - not constantly looking up via reflection. - - - - list of resolvers which we run to resolve items - - - - Gets the statically known member from the type with the specific name. Searches the entire type hierarchy to find the specified member. - - - - - Gets all the statically known members from the specified type. Searches the entire type hierarchy to get all possible members. - - The result may include multiple resolution. It is the callers responsibility to only treat the 1st one by name as existing. - - - - - Gets the statically known member from the type with the specific name. Searches only the specified type to find the member. - - - - - Gets all the statically known members from the specified type. Searches only the specified type to find the members. - - The result may include multiple resolution. It is the callers responsibility to only treat the 1st one by name as existing. - - - - - Creates the resolver table which includes all the possible resolutions. - - - - - - Provides a resolution for __str__. - - - - - Provides a resolution for __repr__ - - - - - Helper to see if the type explicitly overrides the method. This ignores members - defined on object. - - - - - Provides a resolution for __hash__, first looking for IStructuralEquatable.GetHashCode, - then IValueEquality.GetValueHashCode. - - - - - Provides a resolution for __new__. For standard .NET types __new__ resolves to their - constructor. For Python types they inherit __new__ from their base class. - - TODO: Can we just always fallback to object.__new__? If not why not? - - - - - Provides a resolution for next - - - - - Provides a resolution for __len__ - - - - - Provides a resolution for __iter__ - - - - - Looks for an Equals overload defined on the type and if one is present binds __ne__ to an - InstanceOps helper. - - - - - Provides an implementation of __contains__. We can pull contains from: - ICollection of T which defines Contains directly - IList which defines Contains directly - IDictionary which defines Contains directly - IDictionary of K,V which defines Contains directly - IEnumerable of K which we have an InstaceOps helper for - IEnumerable which we have an instance ops helper for - IEnumerator of K which we have an InstanceOps helper for - IEnumerator which we have an instance ops helper for - - String is ignored here because it defines __contains__ via extension methods already. - - The lookup is well ordered and not dependent upon the order of values returned by reflection. - - - - - Helper for IEnumerable/IEnumerator __contains__ - - - - - Primary worker for getting the member(s) associated with a single name. Can be called with different MemberBinder's to alter the - scope of the search. - - - - - Primary worker for returning a list of all members in a type. Can be called with different MemberBinder's to alter the scope - of the search. - - - - - Helper to get a MemberGroup for methods declared on InstanceOps - - - - - Helper to get the proper typecasting method, according to the following precedence rules: - - 1. Strongest (most specific) declaring type - 2. Strongest (most specific) parameter type - 3. Type of conversion - i. Implicit - ii. Explicit - 4. Return type (order specified in toTypes) - - - - - Helper for creating a typecast resolver - - - - - Helper for creating __getitem__/__setitem__ resolvers - - false for a getter, true for a setter - - - - Filters out methods which are present on standard .NET types but shouldn't be there in Python - - - - - When private binding is enabled we can have a collision between the private Event - and private field backing the event. We filter this out and favor the event. - - This matches the v1.0 behavior of private binding. - - - - - Filters down to include only protected methods - - - - - If an operator is a reverisble operator (e.g. addition) then we need to filter down to just the forward/reverse - versions of the .NET method. For example consider: - - String.op_Multiplication(int, string) - String.op_Multiplication(string, int) - - If this method were defined on string it defines that you can do: - 2 * 'abc' - or: - 'abc' * 2 - - either of which will produce 'abcabc'. The 1st form is considered the reverse form because it is declared on string - but takes a non-string for the 1st argument. The 2nd is considered the forward form because it takes a string as the - 1st argument. - - When dynamically dispatching for 2 * 'abc' we'll first try __mul__ on int, which will fail with a string argument. Then we'll try - __rmul__ on a string which will succeed and dispatch to the (int, string) overload. - - For multiplication in this case it's not too interesting because it's commutative. For addition this might be more interesting - if, for example, we had unicode and ASCII strings. In that case Unicode strings would define addition taking both unicode and - ASCII strings in both forms. - - - - - Checks to see if the parameter type and the declaring type are compatible to determine - if an operator is forward or reverse. - - - - - Checks to see if this is an operator method which Python recognizes. For example - op_Comma is not recognized by Python and therefore should exposed to the user as - a method that is callable by name. - - - - - Provides a resolution for __complex__ - - - - - Provides a resolution for __float__ - - - - - Provides a resolution for __int__ - - - - - Provides a resolution for __long__ - - - - - Provides a resolution for __getitem__ - - - - - Provides a resolution for __setitem__ - - - - - Abstract class used for resolving members. This provides two methods of member look. The first is looking - up a single member by name. The other is getting all of the members. - - There are various subclasses of this which have different methods of resolving the members. The primary - function of the resolvers are to provide the name->value lookup. They also need to provide a simple name - enumerator. The enumerator is kept simple because it's allowed to return duplicate names as well as return - names of members that don't exist. The base MemberResolver will then verify their existance as well as - filter duplicates. - - - - - Looks up an individual member and returns a MemberGroup with the given members. - - - - - Returns a list of members that exist on the type. The ResolvedMember structure indicates both - the name and provides the MemberGroup. - - - - - Returns a list of possible members which could exist. ResolveMember needs to be called to verify their existance. Duplicate - names can also be returned. - - - - - One off resolver for various special methods which are known by name. A delegate is provided to provide the actual member which - will be resolved. - - - - - Standard resolver for looking up .NET members. Uses reflection to get the members by name. - - - - - Resolves methods mapped to __eq__ and __ne__ from: - 1. IStructuralEquatable.Equals - 2. IValueEquality.Equals (CLR2 only) - - - - - Resolves methods mapped to __gt__, __lt__, __ge__, __le__, as well as providing an alternate resolution - for __eq__ and __ne__, from the comparable type's CompareTo method. - - This should be run after the EqualityResolver. - - - - - Resolves methods mapped to __*__ methods automatically from the .NET operator. - - - - - Filters alternative methods out that don't match the expected signature and therefore - are just sharing a common method name. - - - - - Removes Object.Equals methods as we never return these for PythonOperationKind. - - - - - Provides bindings to private members when that global option is enabled. - - - - - Provides resolutions for protected members that haven't yet been - subclassed by NewTypeMaker. - - - - - Base class used for resolving a name into a member on the type. - - - - - Gets an instance op method for the given type and name. - - Instance ops methods appaer on the base most class that's required to expose it. So - if we have: Array[int], Array, object we'd only add an instance op method to Array and - Array[int] inherits it. It's obviously not on object because if it was there we'd just - put the method in ObjectOps. - - Therefore the different binders expose this at the appropriate times. - - - - - MemberBinder which searches the entire type hierarchy and their extension types to find a member. - - - - - MemberBinder which searches only the current type and it's extension types to find a member. - - - - - A custom built-in function which supports indexing - - - - - Use indexing on generic methods to provide a new reflected method with targets bound with - the supplied type arguments. - - - - - The unbound representation of an event property - - - - - BoundEvent is the object that gets returned when the user gets an event object. An - BoundEvent tracks where the event was received from and is used to verify we get - a proper add when dealing w/ statics events. - - - - - Represents a ReflectedProperty created for an extension method. Logically the property is an - instance property but the method implementing it is static. - - - - - Base class for properties backed by methods. These include our slot properties, - indexers, and normal properties. This class provides the storage of these as well - as the storage of our optimized getter/setter methods, documentation for the property, - etc... - - - - - Convenience function for users to call directly - - - - - This function can be used to set a field on a value type without emitting a warning. Otherwise it is provided only to have symmetry with properties which have GetValue/SetValue for supporting explicitly implemented interfaces. - - Setting fields on value types usually warns because it can silently fail to update the value you expect. For example consider this example where Point is a value type with the public fields X and Y: - - arr = System.Array.CreateInstance(Point, 10) - arr[0].X = 42 - print arr[0].X - - prints 0. This is because reading the value from the array creates a copy of the value. Setting the value then mutates the copy and the array does not get updated. The same problem exists when accessing members of a class. - - - - - Provides access to non-default .NET indexers (aka properties w/ parameters). - - C# doesn't support these, but both COM and VB.NET do. The types dictionary - gets populated w/a ReflectedGetterSetter indexer which is a descriptor. Getting - the descriptor returns a bound indexer. The bound indexer supports indexing. - We support multiple indexer parameters via expandable tuples. - - - - - Convenience function for users to call directly - - - - - Convenience function for users to call directly - - - - - single finalizable instance used to track and deliver all the - callbacks for a single object that has been weakly referenced by - one or more references and proxies. The reference to this object - is held in objects that implement IWeakReferenceable. - - - - - Finalizable object used to hook up finalization calls for OldInstances. - - We create one of these each time an object w/ a finalizer gets created. The - only reference to this object is the instance so when that goes out of context - this does as well and this will get finalized. - - - - - Marks a method/field/property as being a wrapper descriptor. A wrapper desriptor - is a member defined on PythonType but is available both for type and other - instances of type. For example type.__bases__. - - - - diff --git a/lib/LEGACY/AjaxControlToolkit.dll b/lib/LEGACY/AjaxControlToolkit.dll deleted file mode 100644 index 1456df15ab..0000000000 Binary files a/lib/LEGACY/AjaxControlToolkit.dll and /dev/null differ diff --git a/lib/LEGACY/DotNetOpenMail.dll b/lib/LEGACY/DotNetOpenMail.dll deleted file mode 100644 index 2a9447cbed..0000000000 Binary files a/lib/LEGACY/DotNetOpenMail.dll and /dev/null differ diff --git a/lib/Lucene.Net.dll b/lib/Lucene.Net.dll deleted file mode 100644 index 28ce25acf0..0000000000 Binary files a/lib/Lucene.Net.dll and /dev/null differ diff --git a/lib/Microsoft.ApplicationBlocks.Data.dll b/lib/Microsoft.ApplicationBlocks.Data.dll deleted file mode 100644 index c431985632..0000000000 Binary files a/lib/Microsoft.ApplicationBlocks.Data.dll and /dev/null differ diff --git a/lib/MySql.Data.dll b/lib/MySql.Data.dll deleted file mode 100644 index 35235ef497..0000000000 Binary files a/lib/MySql.Data.dll and /dev/null differ diff --git a/lib/Our.Umbraco.uGoLive.47x.dll b/lib/Our.Umbraco.uGoLive.47x.dll deleted file mode 100644 index eeb3afec20..0000000000 Binary files a/lib/Our.Umbraco.uGoLive.47x.dll and /dev/null differ diff --git a/lib/Our.Umbraco.uGoLive.Checks.dll b/lib/Our.Umbraco.uGoLive.Checks.dll deleted file mode 100644 index ec4900edec..0000000000 Binary files a/lib/Our.Umbraco.uGoLive.Checks.dll and /dev/null differ diff --git a/lib/Our.Umbraco.uGoLive.dll b/lib/Our.Umbraco.uGoLive.dll deleted file mode 100644 index ecaaacb591..0000000000 Binary files a/lib/Our.Umbraco.uGoLive.dll and /dev/null differ diff --git a/lib/RazorEngine.Core.dll b/lib/RazorEngine.Core.dll deleted file mode 100644 index 9ab8171868..0000000000 Binary files a/lib/RazorEngine.Core.dll and /dev/null differ diff --git a/lib/RazorEngine.Templates.dll b/lib/RazorEngine.Templates.dll deleted file mode 100644 index b0d3f6c06a..0000000000 Binary files a/lib/RazorEngine.Templates.dll and /dev/null differ diff --git a/lib/SQLCE4/System.Data.SqlServerCe.Entity.dll b/lib/SQLCE4/System.Data.SqlServerCe.Entity.dll deleted file mode 100644 index 2579399e23..0000000000 Binary files a/lib/SQLCE4/System.Data.SqlServerCe.Entity.dll and /dev/null differ diff --git a/lib/SQLCE4/System.Data.SqlServerCe.dll b/lib/SQLCE4/System.Data.SqlServerCe.dll deleted file mode 100644 index 8d16c2a6db..0000000000 Binary files a/lib/SQLCE4/System.Data.SqlServerCe.dll and /dev/null differ diff --git a/lib/SQLCE4/amd64/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest b/lib/SQLCE4/amd64/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest deleted file mode 100644 index a7a7026c61..0000000000 --- a/lib/SQLCE4/amd64/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest +++ /dev/null @@ -1,6 +0,0 @@ - - - - - Vy8CgQgbu3qH5JHTK0op4kR8114= QTJu3Gttpt8hhCktGelNeXj4Yp8= 1ruqF7/L+m1tqnJVscaOtNRNHIE= - \ No newline at end of file diff --git a/lib/SQLCE4/amd64/Microsoft.VC90.CRT/README_ENU.txt b/lib/SQLCE4/amd64/Microsoft.VC90.CRT/README_ENU.txt deleted file mode 100644 index fc38b3684f..0000000000 Binary files a/lib/SQLCE4/amd64/Microsoft.VC90.CRT/README_ENU.txt and /dev/null differ diff --git a/lib/SQLCE4/amd64/Microsoft.VC90.CRT/msvcr90.dll b/lib/SQLCE4/amd64/Microsoft.VC90.CRT/msvcr90.dll deleted file mode 100644 index c95e1bf213..0000000000 Binary files a/lib/SQLCE4/amd64/Microsoft.VC90.CRT/msvcr90.dll and /dev/null differ diff --git a/lib/SQLCE4/amd64/sqlceca40.dll b/lib/SQLCE4/amd64/sqlceca40.dll deleted file mode 100644 index d5d4c20448..0000000000 Binary files a/lib/SQLCE4/amd64/sqlceca40.dll and /dev/null differ diff --git a/lib/SQLCE4/amd64/sqlcecompact40.dll b/lib/SQLCE4/amd64/sqlcecompact40.dll deleted file mode 100644 index ed061adee6..0000000000 Binary files a/lib/SQLCE4/amd64/sqlcecompact40.dll and /dev/null differ diff --git a/lib/SQLCE4/amd64/sqlceer40EN.dll b/lib/SQLCE4/amd64/sqlceer40EN.dll deleted file mode 100644 index e19eed9bda..0000000000 Binary files a/lib/SQLCE4/amd64/sqlceer40EN.dll and /dev/null differ diff --git a/lib/SQLCE4/amd64/sqlceme40.dll b/lib/SQLCE4/amd64/sqlceme40.dll deleted file mode 100644 index c67fc9e6a5..0000000000 Binary files a/lib/SQLCE4/amd64/sqlceme40.dll and /dev/null differ diff --git a/lib/SQLCE4/amd64/sqlceqp40.dll b/lib/SQLCE4/amd64/sqlceqp40.dll deleted file mode 100644 index df4440332d..0000000000 Binary files a/lib/SQLCE4/amd64/sqlceqp40.dll and /dev/null differ diff --git a/lib/SQLCE4/amd64/sqlcese40.dll b/lib/SQLCE4/amd64/sqlcese40.dll deleted file mode 100644 index af2de5ec90..0000000000 Binary files a/lib/SQLCE4/amd64/sqlcese40.dll and /dev/null differ diff --git a/lib/SQLCE4/x86/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest b/lib/SQLCE4/x86/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest deleted file mode 100644 index 9090f29582..0000000000 --- a/lib/SQLCE4/x86/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest +++ /dev/null @@ -1,6 +0,0 @@ - - - - - +CXED+6HzJlSphyMNOn27ujadC0= MyKED+9DyS+1XcMeaC0Zlw2vFZ0= EeyDE7og6WoPd2oBhYbMEnpFHhY= - \ No newline at end of file diff --git a/lib/SQLCE4/x86/Microsoft.VC90.CRT/README_ENU.txt b/lib/SQLCE4/x86/Microsoft.VC90.CRT/README_ENU.txt deleted file mode 100644 index fc38b3684f..0000000000 Binary files a/lib/SQLCE4/x86/Microsoft.VC90.CRT/README_ENU.txt and /dev/null differ diff --git a/lib/SQLCE4/x86/Microsoft.VC90.CRT/msvcr90.dll b/lib/SQLCE4/x86/Microsoft.VC90.CRT/msvcr90.dll deleted file mode 100644 index e2e66019c0..0000000000 Binary files a/lib/SQLCE4/x86/Microsoft.VC90.CRT/msvcr90.dll and /dev/null differ diff --git a/lib/SQLCE4/x86/sqlceca40.dll b/lib/SQLCE4/x86/sqlceca40.dll deleted file mode 100644 index 92596101eb..0000000000 Binary files a/lib/SQLCE4/x86/sqlceca40.dll and /dev/null differ diff --git a/lib/SQLCE4/x86/sqlcecompact40.dll b/lib/SQLCE4/x86/sqlcecompact40.dll deleted file mode 100644 index 41c69ecc51..0000000000 Binary files a/lib/SQLCE4/x86/sqlcecompact40.dll and /dev/null differ diff --git a/lib/SQLCE4/x86/sqlceer40EN.dll b/lib/SQLCE4/x86/sqlceer40EN.dll deleted file mode 100644 index a40154fd37..0000000000 Binary files a/lib/SQLCE4/x86/sqlceer40EN.dll and /dev/null differ diff --git a/lib/SQLCE4/x86/sqlceme40.dll b/lib/SQLCE4/x86/sqlceme40.dll deleted file mode 100644 index d737119fa3..0000000000 Binary files a/lib/SQLCE4/x86/sqlceme40.dll and /dev/null differ diff --git a/lib/SQLCE4/x86/sqlceqp40.dll b/lib/SQLCE4/x86/sqlceqp40.dll deleted file mode 100644 index dedfc9a3ce..0000000000 Binary files a/lib/SQLCE4/x86/sqlceqp40.dll and /dev/null differ diff --git a/lib/SQLCE4/x86/sqlcese40.dll b/lib/SQLCE4/x86/sqlcese40.dll deleted file mode 100644 index cc37e3b549..0000000000 Binary files a/lib/SQLCE4/x86/sqlcese40.dll and /dev/null differ diff --git a/lib/System.Web.Razor.dll b/lib/System.Web.Razor.dll deleted file mode 100644 index 4c8a126e2e..0000000000 Binary files a/lib/System.Web.Razor.dll and /dev/null differ diff --git a/lib/TidyNet.dll b/lib/TidyNet.dll deleted file mode 100644 index d31dcc3409..0000000000 Binary files a/lib/TidyNet.dll and /dev/null differ diff --git a/lib/UmbracoExamine.dll b/lib/UmbracoExamine.dll deleted file mode 100644 index 5c37c3316a..0000000000 Binary files a/lib/UmbracoExamine.dll and /dev/null differ diff --git a/lib/UrlRewritingNet.UrlRewriter.dll b/lib/UrlRewritingNet.UrlRewriter.dll deleted file mode 100644 index 0243091757..0000000000 Binary files a/lib/UrlRewritingNet.UrlRewriter.dll and /dev/null differ diff --git a/lib/VistaDB For Umbraco.dll b/lib/VistaDB For Umbraco.dll deleted file mode 100644 index d41774a410..0000000000 Binary files a/lib/VistaDB For Umbraco.dll and /dev/null differ diff --git a/lib/WebPages/Microsoft.Web.Helpers.dll b/lib/WebPages/Microsoft.Web.Helpers.dll deleted file mode 100644 index 7dda80f877..0000000000 Binary files a/lib/WebPages/Microsoft.Web.Helpers.dll and /dev/null differ diff --git a/lib/WebPages/Microsoft.Web.Infrastructure.dll b/lib/WebPages/Microsoft.Web.Infrastructure.dll deleted file mode 100644 index 85f1138c57..0000000000 Binary files a/lib/WebPages/Microsoft.Web.Infrastructure.dll and /dev/null differ diff --git a/lib/WebPages/System.Web.Helpers.dll b/lib/WebPages/System.Web.Helpers.dll deleted file mode 100644 index d24cea4eba..0000000000 Binary files a/lib/WebPages/System.Web.Helpers.dll and /dev/null differ diff --git a/lib/WebPages/System.Web.Helpers.xml b/lib/WebPages/System.Web.Helpers.xml deleted file mode 100644 index a0f9639fda..0000000000 --- a/lib/WebPages/System.Web.Helpers.xml +++ /dev/null @@ -1,636 +0,0 @@ - - - - System.Web.Helpers - - - - Displays data as a chart image. - - - Initializes a new instance of the class. - The width, in pixels, of the complete chart image. - The height, in pixels, of the complete chart image. - (Optional) The template (theme) to apply to the chart. - (Optional) The template (theme) path and file name to apply to the chart. - - - Adds a legend to the chart. - The chart. - The text of the legend title. - The unique name of the legend. - - - Provides data points and series attributes for the chart. - The chart. - The unique name of the series. - The chart type of a series. - The name of the chart area used to plot the data series. - The axis label text for the series. - The name of the series associated with the legend. - A value that determines the granularity to display data point markers. - The values to plot along the X-axis. - The name of the field for X-values. - The values to plot along the Y-axis. - A comma-separated list of name or names of the field or fields for Y-values. - - - Adds a title to the chart. - The chart. - The title text. - The unique name of the title. - - - Databinds a chart to a data table, with one series created per unique value in a column. - The chart. - The chart data source. - The name of the column used to group data into the series. - The name of the column for X-values. - A comma-separated list of names of the columns for Y-values. - Other data point properties that can be bound. - The order in which the series will be sorted. The default is "Ascending". - - - Creates and binds series data to the specified data table, and optionally populates multiple Y-values. - The chart. - The chart data source. - The name of the table column used for the series X-values. - - - Gets or sets the name of the file that contains the chart image. - The name of the file. - - - Returns a chart image as a byte array. - The chart. - The image format. The default is "jpeg". - - - Retrieves the specified chart from cache. - The chart. - The identifier of the cache item that contains the chart to retrieve. The key is set when you call the method. - - - Gets or sets the height of the chart image. - The chart height. - - - Saves a chart image to the specified path and file name. - The chart. - The location and name of the image file. - The image file format. - - - Saves a chart in the system cache. - Returns . - The identifier for the chart in the cache. - The number of minutes to keep the chart image in the cache. The default is 20. - true to indicate that the chart cache item's expiration is reset each time the item is accessed, or false to indicate that the expiration is based on an absolute interval since the time that the item was added to the cache. - - - Saves a chart as an XML file. - The chart. - The path and filename to save the XML file to. - - - Sets values for the horizontal axis. - The chart. - The title of the horizontal axis. - The minimum value for the horizontal axis. - The maximum value for the horizontal axis. - - - Sets values for the vertical axis. - The chart. - The title of the vertical axis. - The minimum value for the vertical axis. - The maximum value for the vertical axis. - - - Creates a object based on the current object. - The chart. - The format of the image to save the object as. The default is jpeg. - - - Gets or set the width of the chart image. - The chart width. - - - Renders the output of the object as an image. - The chart. - The format of the image. The default is "jpeg". - - - Renders the output of a object that has been cached as an image. - The chart. - The identifier for the chart in the cache. - The format of the image. The default is "jpeg". - - - - - - - - - Provides methods to encrypt passwords or other sensitive data. - - - - Returns a hash value for the specified byte array. - The hash value for . - The data to provide a hash value for. - The algorithm used to generate the hash value. The default is "sha256". - - - Returns a hash value for the specified string. - The hash value for . - The data to provide a hash value for. - The algorithm used to generate the hash value. The default is "sha256". - - - Returns a hash value for the specified password. - The hash value for . - The password to generate a hash value for. - - - - - - - - - - - - - - - - - - - - - - - - Provides methods for working with data in JavaScript Object Notation (JSON) format. - - - Converts data in JavaScript Object Notation (JSON) format into the specified strongly typed data list. - The JSON-encoded data converted to a strongly typed list. - The JSON-encoded string to convert. - The type of the strongly typed list to convert JSON data into. - - - Converts data in JavaScript Object Notation (JSON) format into a data object. - The JSON-encoded data converted to a data object. - The JSON-encoded string to convert. - - - Converts data in JavaScript Object Notation (JSON) format into a data object of a specified type. - The JSON-encoded data converted to the specified type. - The JSON-encoded string to convert. - The type that the data should be converted to. - - - Converts a data object to a string that is in the JavaScript Object Notation (JSON) format. - Returns a string of data converted to the JSON format. - The data object to convert. - - - Converts a data object to a string in JavaScript Object Notation (JSON) format and adds the string to the specified object. - The data object to convert. - The object that contains the converted JSON data. - - - Renders the property names and values of the specified object and any subobjects that it references. - - - Renders the property names and values of the specified object and any subobjects that it references. - For a simple variable, returns the type and the value. For an object that contains multiple items, returns the property name or key, and the value for each property. - The object to render information for. - Optional. Specifies the depth of nested subobjects to render information for. The default is 10. - Optional. Specifies the maximum number of characters that the method displays for object values. The default is 1000. - - is less than zero. - - is less than or equal to zero. - - - Displays information about the Web server environment that hosts the current Web page. - - - Displays information about the Web server environment. - A string of name-value pairs that contains information about the Web server. - - - Specifies the direction in which to sort a list of items. - - - Sort from smallest to largest. For example, from A to Z. - - - Sort from largest to smallest. For example, from Z to A. - - - Provides a cache to store frequently accessed data. - - - Retrieves the specified item from the object. - The item retrieved from the cache, or null if the item is not found. - The identifier for the cache item to retrieve. - - - Removes the specified item from the object. - The item removed from the object. If the item is not found, returns null. - The identifier for the cache item to remove. - - - Inserts an item into the object. - The identifier for the cache item. - The data to insert into the cache. - Optional. The number of minutes to keep an item in the cache. The default is 20. - Optional. true to indicate that the cache item expiration is reset each time the item is accessed, or false to indicate that the expiration is based on an absolute interval since the time that the item was added to the cache. The default is true, which means that, if you also use the default value for the parameter, a cached item expires 20 minutes after it was last accessed. - The value of is less than or equal to zero. - Sliding expiration is enabled and the value of is greater than a year. - - - Displays data using an HTML table. - - - Initializes a new instance of the class. - The data to display. - A collection of data source column names. By default, this value is auto-populated. - The column name that is used to sort the table by default. - The number of rows that are displayed when paging is displayed. The default is 10. - true to specify that the object can display paging; otherwise false. The default is true. - true to specify that the object can sort based on column; otherwise, false. The default is true. - The ID of the HTML element in the instance that is used for Ajax support in order in order to make partial page updates. - The JavaScript function to call after the HTML element specified by the property has been updated. - The prefix for query-string fields. This value is used in order to support multiple T:System.Web.Helpers.WebGrid objects on the same page. - The query-string field name for the page number. - The query-string field name for the selected row number. - The query-string field name for the sort column. - The query-string field name for the sort direction. - - - Gets the name of the JavaScript function to call after the HTML element specified by the property has been updated. - The element name. - - - Gets the ID of the HTML element in the object that is used for Ajax support in order to make partial-page updates. - The element ID. - - - Binds the specified data to the object. - The populated object. - The data to display. - The names of the columns to bind. - true to enable sorting and paging; otherwise, false. - The number of rows to display for each page of data. - - - Adds a column object to the object. - A column object. - The name of the column. - The header of the column. - A string that specifies the formatting of the column. - A string that specifies the style of the column. - true if the column can be sorted; otherwise, false. The default is true. - - - Gets a collection of column names from the data source. - The collection of column names. - - - Adds a collection of column objects to the object. - A set of columns. - The columns to add. - - - Gets the prefix for query-string fields of a page. - The prefix for query-string fields. - - - Converts a URL into a jQuery Ajax call. - A script used as a jQuery Ajax call. - The URL to convert. - - - Returns HTML that is used to render the instance. - The HTML that represents the populated object. - The CSS class to use to style the table. - The CSS class to use to style the header row of the table. - The CSS class to use to style the footer row of the table. - The CSS class to use to style each row of the table. - The CSS class to use to style the even rows of the table. - The CSS class to use to style the selected rows of the table. - The caption for the table. - true to specify that the header of the table is displayed; otherwise, false. The default is true. - true to specify that the table can add empty rows to ensure the row count is maintained; otherise, false. The default is false. - The text that is used to populate empty rows. The parameter must be set to true to display this value. - The column model for customizing column rendering. - The columns to exclude when auto-populating columns. - A value specifying the mode for rendering paging support. - The text for the link to the first page. - The text for the link to the previous page. - The text for the link to the next page. - The text for the link to the last page. - The number of numeric links to display. - An object that contains the HTML attributes to set for the element. - - - Returns the URL of the page that the object will display based on the specified page index. - The URL of the page that the object will display. - The index of the page to display. - - - Returns a URL used to display the sorted data in the object based on a column name. - The url used to display the sorted data. - The name of the column to sort the grid by. - - - Gets a value that determines whether any row in the object has been selected. - true if a row has been selected; otherwise, false. - - - Gets the number of pages that the object has available to display. - The page count. - - - Gets the query string field name for the page number of the WebGrid. - The column name. - - - Gets or sets the index of the current page to display. - The current page index. - - - Returns the HTML that is required to provide paging support. - A value that specifies paging support. - The text for the link to the first page. - The text for the link to the previous page. - The text for the link to the next page. - The test for the link to the last page. - The number of numeric links to display. - - - Gets a list of rows that are in the object. - The collection of rows. - - - Gets the number of rows to display on each page. - The row count for a page. - - - Gets or sets the index of the selected row. - The row index. - - - Gets the selected row of the object. - The selected row. - - - Gets the query string field name for the selected row number of the WebGrid. - The name of the selected column. - - - Gets or sets the name of the column that is used to sort the object. - The name of the sort column. - - - Gets or sets the direction that the object is sorted. - The sort direction. - - - Gets the query string field name for the sort direction of the WebGrid. - The column prefix and name. - - - Gets the query string field name for the sort column of the WebGrid. - The sort column name. - - - Returns the HTML that is used to render the instance that supports paging. - The HTML that represents the populated object. - The CSS class to use to style the table. - The CSS class to use to style the header row. - The CSS class to use to style the footer row. - The CSS class to use to style odd rows. - The CSS class to use to style even rows. - The CSS class used to use to style the selected row. - The caption for the table. - true to specify that the header of the table is displayed; otherwise, false. The default is true. - true to specify that the table can add empty rows to ensure the row count is maintained; otherise, false. The default is false. - The text that is used to populate empty rows. The parameter must be set to true to display this value. - The column model that is used to customize column rendering. - The columns to exclude when auto-populating columns. - The table footer template. - An object that contains the HTML attributes to set for the element. - - - Gets the total row count for the object. - The row count. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Represents an object that lets you display and manage images in in a Web page. - - - Initializes a new instance of the class using a byte array to represent the image. - The image. - - - Initializes a new instance of the class using a stream to represent the image. - The image. - - - Initializes a new instance of the class using a path to represent the image location. - The path of the file that contains the image. - - - Adds a watermark image to the image using the specified image file. - The image. - The path of a file that contains the image. - The width, in pixels, of the watermark image. - The height, in pixels, of the watermark image. - The horizontal alignment for watermark image. Values can be left, right, or center. - The vertical alignment for the watermark image. Values can be top, bottom, or middle. - The opacity for the watermark image, specified as a value between 0 and 100. - The size, in pixels, of the padding around the watermark image. - - - Adds a watermark image to the image using the specified object. - The image. - A object. - The width, in pixels, of the watermark image. - The height, in pixels, of the watermark image. - The horizontal alignment for watermark image. Values can be left, right, or center. - The vertical alignment for the watermark image. Values can be top, bottom, or middle. - The opacity for the watermark image specifies as a value between 0 and 100. - The size, in pixels, of the padding around the watermark image. - - - Adds watermark text to the image. - The image. - The text to use as a watermark. - The color of the watermark text. - The font size of the watermark text. - The font style of the watermark text. - The font type of the watermark text. - The horizontal alignment for watermark text. Values can be left, right, or center. - The vertical alignment for the watermark text. Values can be top, bottom, or middle. - The text opacity for the watermark text specified as a value between 0 and 100. - The size, in pixels, of the padding around the watermark text. - - - Copies the object. - The image. - - - Crops an image. - The cropped image. - The number of pixels to remove from the top. - The number of pixels to remove from the left. - The number of pixels to remove from the bottom. - The number of pixels to remove from the right. - - - Gets or sets the name of the file used by the object. - The file name - - - Flips an image horizontally. - The flipped image. - - - Flips an image vertically. - The flipped image. - - - Returns the image as a byte array. - The image. - The of the object. - - - Returns an image that has been uploaded using the browser. - The image. - (Optional) The name of the file that has been posted. - - - Gets the height, in pixels, of the image. - The height. - - - Gets the format of the image (for example, JPEG or PNG). - The format. - - - Resizes an image. - The resized image. - The width, in pixels, of the object. - The height, in pixels, of the object. - true to preserve the aspect ratio of the image; otherwise, false. - true to prevent the enlargement of the image; otherwise, false. - - - Rotates an image to the left. - The rotated image. - - - Rotates an image to the right. - The rotated image. - - - Saves the image using the specified file name. - The image. - The path to save the image to. - The format used when saving the image file. - true to force that the correct file extension is used for the format specified in ; otherwise, false. - - - Gets the width, in pixels, of the image. - The width. - - - Renders an image to the browser to be displayed. - The image. - (Optional) The file format. - - - Provides a way to construct and send an email message using Simple Mail Transfer Protocol (SMTP). - - - Gets or sets whether Secure Sockets Layer (SSL) is used to encrypt the connection when sending email. - true if SSL is used to encrypt the connection; otherwise, false. - - - Gets or sets the email address of the sender. - The email address of the sender. - - - Gets or sets the sender’s password based on the email account used. - The password of the sender. - - - Sends the specified message to an SMTP server for delivery. - The recipients of this email message. Multiple recipients can be specified by separating them using a semicolon (;). - The subject line for the email message. - The body of the email message. If is true, HTML in the body is interpreted as markup. - The email address of the message sender. - The carbon copy (CC) recipients for the email message, if any. - A collection of file names that specifies the files to attach to the email message. - true to specify that the email message body is in HTML format; false to indicate that the body is in plain-text format. - A collection of headers that are sent with this email message. - - - Gets or sets the port used for SMTP transactions. - The port used for SMTP transactions. - - - Gets or sets the SMTP server used to transmit the email message. - The SMTP server. - - - Gets or sets a value that indicates whether the default credentials are sent with the requests. - true if credentials are sent with the email message; otherwise, false. - - - Gets or sets the name of email account name used to send email. - The name of the user. - - - \ No newline at end of file diff --git a/lib/WebPages/System.Web.Razor.dll b/lib/WebPages/System.Web.Razor.dll deleted file mode 100644 index cd950e6d1c..0000000000 Binary files a/lib/WebPages/System.Web.Razor.dll and /dev/null differ diff --git a/lib/WebPages/System.Web.Razor.xml b/lib/WebPages/System.Web.Razor.xml deleted file mode 100644 index 707ba87922..0000000000 --- a/lib/WebPages/System.Web.Razor.xml +++ /dev/null @@ -1,866 +0,0 @@ - - - - System.Web.Razor - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/lib/WebPages/System.Web.WebPages.Deployment.dll b/lib/WebPages/System.Web.WebPages.Deployment.dll deleted file mode 100644 index 2e09c485e5..0000000000 Binary files a/lib/WebPages/System.Web.WebPages.Deployment.dll and /dev/null differ diff --git a/lib/WebPages/System.Web.WebPages.Deployment.xml b/lib/WebPages/System.Web.WebPages.Deployment.xml deleted file mode 100644 index 8d682f2efd..0000000000 --- a/lib/WebPages/System.Web.WebPages.Deployment.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - System.Web.WebPages.Deployment - - - - - - - - - - - - \ No newline at end of file diff --git a/lib/WebPages/System.Web.WebPages.Razor.dll b/lib/WebPages/System.Web.WebPages.Razor.dll deleted file mode 100644 index 9846dd3fc4..0000000000 Binary files a/lib/WebPages/System.Web.WebPages.Razor.dll and /dev/null differ diff --git a/lib/WebPages/System.Web.WebPages.Razor.xml b/lib/WebPages/System.Web.WebPages.Razor.xml deleted file mode 100644 index 5974aea7a7..0000000000 --- a/lib/WebPages/System.Web.WebPages.Razor.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - System.Web.WebPages.Razor - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/lib/WebPages/System.Web.WebPages.dll b/lib/WebPages/System.Web.WebPages.dll deleted file mode 100644 index 9fea012852..0000000000 Binary files a/lib/WebPages/System.Web.WebPages.dll and /dev/null differ diff --git a/lib/WebPages/System.Web.WebPages.xml b/lib/WebPages/System.Web.WebPages.xml deleted file mode 100644 index d06b354ae1..0000000000 --- a/lib/WebPages/System.Web.WebPages.xml +++ /dev/null @@ -1,884 +0,0 @@ - - - - System.Web.WebPages - - - - Helps prevent malicious scripts from submitting forged page requests. - - - Adds an authenticating token to a form to help protect against request forgery. - Returns a string that contains the encrypted token value in a hidden HTML field. - The current object is null. - - - Adds an authenticating token to a form to help protect against request forgery, allowing callers to specify added authentication details. - Returns the encrypted token value in a hidden HTML field. - The HTTP context data for a request. - An optional random string of characters (such as Z*7g1&p4) that is used to add complexity to the encryption for extra safety. The default is a null string. - The domain of a Web application that a request is submitted from. - The virtual root path of a Web application that a request is submitted from. - The supplied object is null. - - - Validates that input data from an HTML form field comes from the user who submitted the data. - The current value is null. - The HTTP cookie token that accompanies a valid request is missing-or-The form token is missing.-or-The form token value does not match the cookie token value.-or-The form token value does not match the cookie token value. - - - Validates that input data from an HTML form field comes from the user who submitted the data, allowing callers to specify additional custom details for the validation. - An optional random string of characters (such as Z*7g1&p4) used to decrypt an authentication token created by the class. The default is a null string. - The current value is null. - The HTTP cookie token that accompanies a valid request is missing-or-The form token is missing.-or-The form token value does not match the cookie token value.-or-The form token value does not match the cookie token value.-or-The value supplied does not match the value used to create the form token. - - - Provides access to unvalidated values in the object. - - - Gets a collection of unvalidated Web form values. - An unvalidated collection of Web form values. - - - Gets an unvalidated object from a collection in the object. - A member of a collection contained in the object. - The name of the collection member to get. - - - Gets a collection of unvalidated query-string values. - A collection of unvalidated query-string values. - - - Excludes fields of the Request object from being checked for potentially unsafe HTML markup. - - - Returns an unvalidated version of form values or query-string values. - An object that contains unvalidated versions of the form and query string values. - The object that contains values to exclude. - - - Returns an unvalidated value from the form or query string based on the field that has been requested. - A string that contains unvalidated text from the specified field or query-string value. - The object that contains values to exclude from validation s - The name of the field to exclude from validation. - - - Returns an unvalidated version of form values or query-string values. - An object that contains unvalidated versions of the form and query-string values. - The object that contains values to exclude from validation. - - - Returns an unvalidated value from the form or query string based on the field that has been requested. - A string that contains unvalidated text from the specified field or query-string value. - The object that contains values to exclude from validation. - The name of the field to exclude from validation. - - - This class and its members support the .NET Framework infrastructure and are not intended to be used directly from your code. - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - Details about the exception. - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - Details about the exception. - An exception that occurred before the current exception. - - - - - - - - - - - - - - - - - - - - - - - - - - Enumerates the modes that are available for rendering HTML tags. - - - Represents normal mode. - - - Represents the start-tag mode. - - - Represents end-tag mode. - - - Represents self-closing-tag mode. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Redirects to the root of the Web site if the host is not local. - The HTTP context of the HTTP request. - A locally hosted URL. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Provides utility methods for converting string values to other data types. - - - Converts a string to a strongly typed value of the specified data type. - The converted value. - The value to convert. - The data type to convert to. - - - Converts a string to the specified data type and specifies a default value. - The converted value. - The value to convert. - The value to return if is null. - The data type to convert to. - - - Converts a string to a Boolean (true/false) value. - The converted value. - The value to convert. - - - Converts a string to a Boolean (true/false) value and specifies a default value. - The converted value. - The value to convert. - The value to return if is null or an invalid value. The default is false. - - - Converts a string to a value. - The converted value. - The value to convert. - - - Converts a string to a value and specifies a default value. - The converted value. - The value to convert. - The value to return if is null or an invalid value. The default is the minimum time value on the system. - - - Converts a string to a number. - The converted value. - The value to convert. - - - Converts a string to a number and specifies a default value. - The converted value. - The value to convert. - The value to return if is null or invalid. - - - Converts a string to a number. - The converted value. - The value to convert. - - - Converts a string to a number and specifies a default value. - The converted value. - The value to convert. - The value to return if is null. - - - Converts a string to an integer. - The converted value. - The value to convert. - - - Converts a string to an integer and specifies a default value. - The converted value. - The value to convert. - The value to return if is null or is an invalid value. - - - Checks whether a string can be converted to the specified data type. - - if can be converted to the specified type; otherwise, . - The value to test. - The data type to convert to. - - - Checks whether a string can be converted to the Boolean (true/false) type. - - if can be converted to the specified type; otherwise, . - The string value to test. - - - Checks whether a string can be converted to the type. - - if can be converted to the specified type; otherwise, . - The string value to test. - - - Checks whether a string can be converted to the type. - - if can be converted to the specified type; otherwise, . - The string value to test. - - - Checks whether a string value is null or empty. - true if is null or is a zero-length string (""); otherwise, false. - The string value to test. - - - Checks whether a string can be converted to the type. - true if can be converted to the specified type; otherwise, false. - The string value to test. - - - Checks whether a string can be converted to an integer. - - if can be converted to the specified type; otherwise, . - The string value to test. - - - - - - - - - - - - Represents an ASP.NET Razor page. - - - Called from a derived class to create a new instance that is based on the class. - - - Gets or sets the object that is associated with a page. - An object that references HTTP data about the current context of a page. - - - Executes the code in a set of dependent Web pages. - - - Gets the object that is associated with a page. - An object that supports rendering HTML form controls in a page. - - - Initializes an object that inherits from the class. - - - Gets the model that is associated with a page. - An object that represents a model that is associated with the view data for a page. - - - Gets the state data for the model that is associated with a page. - The state of the model. - - - Adds a class to a list of classes that handle page execution and that implement custom features for pages. - The class to add. - - - - - - - Called by content pages to create named content sections. - The name of the section to create. - The type of action to take with the new section. - - - - - - - - Gets or sets the path of a layout page. - The path of the layout page. - - - - - Provides property-like access to page data that is shared between pages, layout pages, and partial pages. - An object that contains page data. - - - Provides array-like access to page data that is shared between pages, layout pages, and partial pages. - A dictionary that contains page data. - - - - - In layout pages, renders the portion of a content page that is not within a named section. - The HTML content to render. - - - Renders the content of one page within another page. - The HTML content to render. - The path of the page to render. - (Optional) An array of data to pass to the page being rendered. In the rendered page, these parameters can be accessed by using the property. - - - In layout pages, renders the content of a named section. - The HTML content to render. - The section to render. - - - In layout pages, renders the content of a named section and specifies whether the section is required. - The HTML content to render. - The section to render. - true to specify that the section is required; otherwise, false. The default is false. - - - - - - Contains data that is used by a object to reference details about the Web application, the current HTTP request context, the current execution context, and page data. - - - - - Gets a reference to the current object that is associated with a page. - The current page context object. - - - - Gets the object that is associated with a page. - The page rendering object. - - - Gets the page data that is shared between pages, layout pages, and partial pages. - A dictionary that contains page data. - - - Provides objects and methods that are used to execute and render all ASP.NET Razor pages. - - - - Gets the application state data cast as a object that callers can use to create and access custom application-scoped properties. - An object that references the application state data. - - - Gets a reference to global application state data that can be shared across sessions and requests in an ASP.NET application. - The application state data. - - - When overridden in a derived class, gets or sets the object that is associated with a page. - The current context data. - - - - - - - - - - - - - - - - - - - - - Provides methods and properties that are used to render pages that use the Razor view engine. - - - Initializes a new instance of the class. - - - When overridden in a derived class, gets the cache object for the current application domain. - The cache object. - - - Gets or sets the culture for the current thread. - The culture for the current thread. - - - When overridden in a derived class, calls the methods that are used to initialize the page. - - - When overridden in a derived class, builds a URL using the specified parameters. - A URL. - The path to include in the URL. - Additional path information. - - - When overridden in a derived class, get a value that indicates whether Ajax is being used during the request of the Web page. - true if Ajax is being used during the request; otherwise, false. - - - When overridden in a derived class, returns a value that indicates whether the HTTP data transfer method used by the client to request the Web page is POST. - true if the HTTP verb is "POST"; otherwise, false. - - - When overridden in a derived class, gets or sets the path of a layout page. - The path of a layout page. - - - When overridden in a derived class, provides property-like access to page data that is shared between pages, layout pages, and partial pages. - An object that contains page data. - - - Gets the HTTP context for the Web page. - The HTTP context for the Web page. - - - When overridden in a derived class, provides array-like access to page data that is shared between pages, layout pages, and partial pages. - An object that provides array-like access to page data. - - - When overridden in a derived class, renders a Web page. - The markup that represents the Web page. - The path of the page to render. - Additional data that is used to render the page. - - - When overridden in a derived class, gets the object for the current HTTP request. - A object that contains the HTTP values sent by a client during a Web request. - - - When overridden in a derived class, gets the object for the current HTTP response. - A object that contains the HTTP-response information from an ASP.NET operation. - - - When overridden in a derived class, gets the object that provides methods that can be used as part of Web-page processing. - The object. - - - When overridden in a derived class, gets the object for the current HTTP request. - Session data for the current request. - - - When overridden in a derived class, gets information about the currently executing file. - Information about the currently executing file. - - - Gets or sets the current culture used by the ResourceManager to look up culture-specific resources at run time. - The current culture used by the Resource Manager. - - - When overridden in a derived class, gets data related to the URL path. - Data related to the URL path. - - - When overridden in a derived class, gets a user value based on the HTTP context. - A user value based on the HTTP context. - - - Represents support for rendering HTML controls in a Web page. - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/LinqToUmbraco/dep/Imagery/umbraco.ico b/src/LinqToUmbraco/dep/Imagery/umbraco.ico deleted file mode 100644 index 402cf9594e..0000000000 Binary files a/src/LinqToUmbraco/dep/Imagery/umbraco.ico and /dev/null differ diff --git a/src/LinqToUmbraco/dep/Reference Assemblies/Mocking/Rhino.Mocks.dll b/src/LinqToUmbraco/dep/Reference Assemblies/Mocking/Rhino.Mocks.dll deleted file mode 100644 index 4b6904b6f8..0000000000 Binary files a/src/LinqToUmbraco/dep/Reference Assemblies/Mocking/Rhino.Mocks.dll and /dev/null differ diff --git a/src/LinqToUmbraco/dep/Reference Assemblies/Mocking/TypeMock.XML b/src/LinqToUmbraco/dep/Reference Assemblies/Mocking/TypeMock.XML deleted file mode 100644 index e7e8a49a4a..0000000000 --- a/src/LinqToUmbraco/dep/Reference Assemblies/Mocking/TypeMock.XML +++ /dev/null @@ -1,10587 +0,0 @@ - - - - TypeMock - - - - - Implement the logic which activate the decorating attributes. - - - - - holds the Decorated method (i.e. method which is tagged by the custom attribute) - - - - - stores the instance that the decorated method was called with - - - - - stores the original parameters to pass to the decorated method - - - - - holds all the attributes decorating the method - - - - - specify if the original method was called or not during the execution flow - - - - - specify if the original method can be ignored - - - - - default ctor. initialize the context,method,attributes,par - - The method to decorate(i.e. the method which is tagged by the attribute) - The instance that the decorated method was called through - the parameters to pass to the decorated method - - - - Returns all the custom attributes (i.e. sub classes of DecoratorAttribute) that surrounds the method - - The method - array of the decorating attributes - - - - Activate the execution flow of the decorating attributes - - The results from activating the original invoker on the test (unless overridden) - - - - Tell the decorator not to check if the decorated method was called from the - attributes. this means that if the attribute didnt call the decorated method - it wont be executed at all. - - - - - Retrieves the Original method info (the method which is tagged by the attribute) - - - - - Retrieves the instance that the original method was called with. - - - - - Retrieves the original parameters that were passed to the original method - - - - - Use this type when mocking global functions - - - This is an example of how to mock global functions in C++ - - - namespace TestWithCpp - { - int globalFunction(int a) {return a;} - } - - And the test - - [Test] - void Global() { - Mock* mock = MockManager::Mock(__typeof(GlobalType)); - mock->ExpectAndReturn("TestWithCpp.globalFunction",__box(5)); - Assert::AreEqual(__box(5), __box(globalFunction(4))); - } - - - - - - - Hold the Return value for mocked methods - - - - - Typemock Isolator can validates parameter values, collections and arrays. - To do so just pass the list of expected parameter values to the Args - method. - - - It is possible to check that a mocked method has been called with specific - argument values. - - - For example, if we need to check that an int parameter is 10 - we can write the following code - - [Test] - public void Test() - { - // Start mocking TestedClass - Mock mock = MockManager.Mock(typeof(TestedClass)); - // first time passInt will be called, arguments must be 10 - mock.ExpectCall("passInt").Args(10); - // second time 1 - mock.ExpectCall("passInt").Args(1); - TestedClass t = new TestedClass(); - // This will pass - t.passInt(10); - // This will fail - t.passInt(3); - MockManager.Verify(); - } - - - <Test()> _ - Public Sub Test() - ' Start mocking TestedClass - Dim mock As Mock = MockManager.Mock(GetType(TestedClass)) - ' first time passInt will be called, arguments must be 10 - mock.ExpectCall("passInt").Args(10) - ' second time 1 - mock.ExpectCall("passInt").Args(1) - Dim t As TestedClass = New TestedClass - ' This will pass - t.passInt(10) - ' This will fail - t.passInt(3) - MockManager.Verify() - End Sub - - - - Single Dimension Arrays and Collections are iterated and checked for match of all items - See for built in ParameterCheckers - See for details of user defined checks - - - BEWARE, Typemock Isolator normally check the type of return value with the existing - method, but it does not check the legitimacy of the returned value in case of - overloaded methods that have different return types, (as Typemock Isolator sees these - as one mocked method) if you return a value with the wrong type a - System.InvalidCastException will be thrown - - - Typemock Isolator supports checking methods with up to 30 parameters - - - This Interface is not to be implemented by client - - - - - - - - Set the list of expected parameters - - - - list of expected parameters and/or parameter checkers - Will be throw if more then 30 parameters are used - - - - Conditional mock, - Set the list of parameters, only if these parameters are passed, is the mocked invoked - *Enterprise version Only* - - - - list of condition parameters and/or parameter checkers - Will be throw if more then 30 parameters are used - - - - Parameter Checks for mocked Property set methods - - - See and - - - - - This Interface is not to be implemented by client - - - - - - Set expected set value - - - - - expected value - - - - Conditional mock, - Set the list of parameters, only if these parameters are passed, is the mocked invoked - *Enterprise version Only* - - - - - conditional value - - - - Parameter Checks for mocked Index set methods - - - See and - - - - - This Interface is not to be implemented by client - - - - - - Set expected index number - - - - - expected index - expected set value - - - - Conditional mock, - Set the list of parameters, only if these parameters are passed, is the mocked invoked - *Enterprise version Only* - - - - - conditional index - conditional set value - - - - Parameter Checks for mocked Index get methods - - - See and - - - - - This Interface is not to be implemented by client - - - - - - Set expected index number - - - - - expected index - - - - Conditional mock, - Set the list of parameters, only if these parameters are passed, is the mocked invoked - *Enterprise version Only* - - - - - conditional index - - - - set the number of times that the expectation should be repeated - - times to repeat - - - - this takes a regular/conditional expectation and turn it into a default regular/conditional - (repeated always) expectation. - - - - - this takes a default regular/conditional expectation and turn it into a normal one. - - - - - check that the actual arguments passed to the call match the expected, and assign new values - if needed. method will throw a VerifyException if arguments do not match. - - the real parameters passed to the call - the mocked type (needed for error messages) - - - - this just check if actual paramaters passed to the method match the expected ones - (needed to decide if the method should be mocked or not) - - actual parameters passed to the call - the mocked type (needed for error messages) - true if condition is satisfied - - - - - The reliability interface provides automatic (in case of a thread interrup as happens on see cref="IRunnable.Stop()") and manual dumping. - - - - Copy all data hold by the structure to the local dump container and clears the structure. - A structure is invalid and no longer usable after dumping. You should notify all the other threads/processes before dumping. - - - True if there's any data in the dump container. - - - The dump container data structure - - - - Summary description for About. - - - - - Clean up any resources being used. - - - - - Required method for Designer support - do not modify - the contents of this method with the code editor. - - - - - Change the default Behavior of Natural Mocks™ - - - The default Behavior of Natural Mocks is - - Repeat once (See ) - Ignore Arguments (See ) - - To change this use DefaultBehavior. - This is useful for chained natural mocks where we require the whole chain to be checked. - - - Example of using Natural Mocks™ repeat always, - we will always return 10 when GetSomething().DoSomething() is called from any TestedClass instance - - [Test] - public void Test() - { - // Start mocking - using (RecordExpectations recorder = RecorderManager.StartRecording()) - { - // CAUTION: ALL calls here are mocked!!! - // make all future instances mocked and all statements repeat - recorder.DefaultBehavior.RepeatAlways(); - // Mock (all) new instance of TestedClass - TestedClass mockedTestedClass = new TestedClass(); - // DoSomething to be mocked. - mockedTestedClass.GetSomething().DoSomething(); - // always return 10 - recorder.Return(10); - } - } - - - ' Visual Basic .NET 2.0 - <Test()> _ - Public Sub Test() - ' Start mocking - Using recorder As New RecordExpectations - ' CAUTION: ALL calls here are mocked!!! - ' make all future instances mocked and all statements repeat - recorder.DefaultBehavior.RepeatAlways() - ' Mock (all) new instance of TestedClass - Dim mockedTestedClass As TestedClass = New TestedClass - ' DoSomething to be mocked. - mockedTestedClass.GetSomething().DoSomething() - ' always return 10 - recorder.Return(10) - End Using - End Sub - - For VB .NET 1.1 see - - - - - - - - Check All Arguments of statements - - - Using CheckArguments will fail tests if the arguments actually passed are not those that where expected. - Special care must be taken when changing the default expectation, as the statement CheckArguments now - must include an item for all arguments passed. - - - Example of using Natural Mocks™ CheckArguments with multiple statements, - we will validate that GetSomething("TypeMock").DoSomething("magic") is called with "TypeMock" and "magic" - - [Test] - public void Test() - { - // Start mocking - using (RecordExpectations recorder = RecorderManager.StartRecording()) - { - // CAUTION: ALL calls here are mocked!!! - recorder.DefaultBehavior.CheckArguments(); - // Mock (all) new instance of TestedClass - TestedClass mockedTestedClass = new TestedClass(); - // DoSomething to be mocked. - mockedTestedClass.GetSomething("TypeMock").DoSomething("magic"); - } - } - - - ' Visual Basic .NET 2.0 - <Test()> _ - Public Sub Test() - ' Start mocking - Using recorder As New RecordExpectations - ' CAUTION: ALL calls here are mocked!!! - recorder.DefaultBehavior.CheckArguments() - ' Mock (all) new instance of TestedClass - Dim mockedTestedClass As TestedClass = New TestedClass - ' DoSomething to be mocked. - mockedTestedClass.GetSomething("TypeMock").DoSomething("magic") - End Using - End Sub - - For VB .NET 1.1 see - - - Example of using Natural Mocks™ CheckArguments with multiple statements, - we will validate the arguments with built-in checks - - [Test] - public void Test() - { - // Start mocking - using (RecordExpectations recorder = RecorderManager.StartRecording()) - { - // CAUTION: ALL calls here are mocked!!! - recorder.DefaultBehavior.CheckArguments(); - // Mock (all) new instance of TestedClass - TestedClass mockedTestedClass = new TestedClass(); - // DoSomething to be mocked. - mockedTestedClass.GetSomething(null).DoSomething(null); - recorder.CheckArguments(Check.IsIn("TypeMock", "NaturalMock"),Check.StartsWith("s")); - } - } - - - ' Visual Basic .NET 2.0 - <Test()> _ - Public Sub Test() - ' Start mocking - Using recorder As New RecordExpectations - ' CAUTION: ALL calls here are mocked!!! - recorder.DefaultBehavior.CheckArguments() - ' Mock (all) new instance of TestedClass - Dim mockedTestedClass As TestedClass = New TestedClass - ' DoSomething to be mocked. - mockedTestedClass.GetSomething(null).DoSomething(null); - recorder.CheckArguments(Check.IsIn("TypeMock","NaturalMock"),Check.StartsWith("s")) - End Using - End Sub - - For VB .NET 1.1 see - - - - - - - - Mock method only when arguments passed are as expected - - - See - Care should be taken when using this in a chained statement. - There is no backtracking and after one method is mocked a mock is returned even if the next statement - is not mocked. - - - - - - - Don't verify arguments, this is the default. - - - - - - - - Repeat each statement. - - See - - Amount of times to repeat the expectation - Use to change more Behavior - - - - Repeat each statement for every call. - - See - - Use to change more Behavior - - - - Flags that define the behavior of Arbitrary (not expected) calls. - The default is the Methods of Abstract and Interfaces are Strict and Arbitrary calls fail - while Arbitrary Methods of concrete classes are allowed. - - - When testing for mock interactions there are times when the default behavior needs to be changed, - the StrictFlags define which arbitrary methods we allow. - - When allowing arbitrary abstract methods (methods created dynamically by Typemock Isolator using or ), - Typemock Isolator create the following default behavior: - 1. All void calls just return - 2. Other Methods will return 0 or null depending on the return type - 3. Properties will behave like normal properties - - To set only one method to strict use: or - - - - - - Flags that define the behavior of Field handling calls. - By default internal fields are mocked according to the state of the appropriate - constructor(i.e. if the constructor is mocked then the field will be mocked as well), - which means that any uninitialized field (its value is null) will be replaced with a mocked - object during the recording phase. - values of static fields will be reverted back at the end of the test before any calls to - a method on the class. - - - only the immediate level of fields is automatically mocked. i.e. fields of fields are not mocked. - - - - - Flags that define the default behavior of static constructors mocking. - By default all static constructors of objects created inside a recording block will - not be mocked. - Setting this flag to true will cause static constructors of newly created object to be mocked. - (the real static constructor will be executed when needed after the test ends.) - - - - Used to clean up the defined expectations on MockManager at the end of - each test. This class cant be inherited. - Any method marks with this attribute will clean all set expectation - after the test is done. A marked class will do this for any test defined in - it. - - - [TestFixture] - [ClearMocks] // clear all mocks between tests - public TestClass - { - [Test] - public void MyTest1() - { - // the test code - } - } - - - < TestFixture >_ - < ClearMocks >_ ' clear all mocks between tests - Public class TestClass - < Test >_ - Public Sub MyTest1() - ' the test code - End Sub - End Class - - - VerifyMocksAttribute - - - - This is the base class for all decorator attributes. - In order to implement a custom attribute, need to subclass DecoratorAttribute and implement the - abstract method execute. - - - The custom attribute can control the flow of the call to the original method by - calling the CallOriginalMethod method during the execute method. - In any case even if the original method is not activated by the custom attribute it will be run by the decorator - framework - - - - - Referance to the decorator object which holds data of the original method - - - - - The method that is decorated by the attribute. - - - - - The propriety logic of the attribute should be implemented in the execute. The - custom attribute can control the flow of the call to the original method by calling - the CallOriginalMethod method during the execute method. In any case even if the - original method is not activated by the custom attribute it will be run by the - decorator framework, unless the attribute specifically asked that the original - method will not be called using the - DontCallDecoratedMethod Method - - The results from activating the original invoker on the test (unless overridden) - - - - Replace the call to the original method with the call to the attribute execute, storing all needed information - - The MethodDecorator instance which holds the original method data - The method that needs to be decorated - ExecutionDelegator representing the method after decoration - - - - Filter which methods to Execute the code, when the attribute is on a Class - - method being executed - true to wrap the code - Default action is to apply class decorators only on test methods - i.e. methods that are decorated with [Test] or [TestMethod] attribute on them as well - - - - Activate the original (decorated) method. - - The results from activating the original method - - - - Stops the decorator from calling the original method which is called automatically - even when Execute method fails to call - CallDecoratedMethod. - - If original method is decorated by another attribute and - explicitly called there. It will be - activated - - - - Retrieves the Original method info (the method which is tagged by the attribute) - - - - - Retrieves the instance that the original method was called with. - - - - - Retrieves the original parameters that were passed to the original method - - - - - Called by the framework instead of the original method. This will run the original method and - afterwards clear the Mock Manager. - - the result of the original method - - - - Typemock Isolator Natural Mocks™ RecorderManager class helps manage the mocks - - - - Typemock Isolator supports the innovative Natural Mocks™ way of defining expectations by recording the expectations. - Natural Mocks™ are Strongly Typed and thus supports Compile Time Checks and Refactoring. - Using Natural Mocks™ it is now much simpler to define and create tests that require isolating other parts of the code. Although the Natural Mocks™ is easier, it does not cover all the scenarios, and the normal TyepMock.NET way is required. The two way are compatible and can be used together. - - See for examples - - - - - - Start a new recording, CAUTION, as long as the recording object is alive ALL methods will be recorded and not called - - - See for usage - - CAUTION, as long as the recording object is alive ALL methods will be recorded and not called - - RecordExpectations object - - - - Stop the recording - - - - - Get the last recorded mock and use Reflective Typemock Isolator methods. - - The mock - - - - Returns the object of the last recorded mock or null if non exists - - a mocked object - - - - Returns the mock associated with a specific instance - - Type of the instance being mocked - The instance to get the mock of - If a Mock is associated with the provided instance, returns it. Otherwise, returns null - - Identify a specific mock when using Natural Mocks - - [Test] - public void GetMockOfSpecificInstance() - { - using(RecordExpectations rec = RecorderManager.StartRecording()) - { - TestClass instance1 = new TestClass(); - TestClass instance2 = new TestClass(); - TestClass instance3 = new TestClass(); - - Mock mock2 = RecorderManager.GetMockOf(instance2); - mock2.ExpectAndReturn("SomeMethod", null); - } - } - - - - - - Create a mocked object - - The type to mock - a mocked object of the type specified - - - - Example of using Natural Mocks™ Return - - [Test] - public void Test() - { - // Create Mock Object - ITestClass mockTestClass = RecorderManager.CreateMockedObject(typeof(ITestClass)) as ITestClass; - using (RecordExpectations recorder = RecorderManager.StartRecording()) - { - // CAUTION: ALL calls here are mocked!!! - // Set expectations on mocked object. - recorder.ExpectAndReturn(mockTestClass.MyMethod().MyProperty, 5); - } - } - - - ' Visual Basic .NET 2.0 - <Test()> _ - Public Sub Test() - ' Create Mock Object - Dim mockTestClass As ITestClass = RecorderManager.CreateMockedObject(GetType(ITestClass)) - ' Start mocking - Using recorder As New RecordExpectations - ' CAUTION: ALL calls here are mocked!!! - ' Set expectations on mocked object. - recorder.ExpectAndReturn(mockTestClass.MyMethod().MyProperty, 5) - End Using - End Sub - - For VB .NET 1.1 see - - - - - - - Create a mocked object and define constructor Behavior - - The type to mock - Define what constructors to mock - a mocked object of the type specified - - - - Create a mocked object and define constructor Behavior - - The type to mock - Define what constructors to mock - Define Arbitrary Call behavior - a mocked object of the type specified - - - - Create a mocked object, define constructor Behavior and pass arguments to constructor - - The type to mock - Define what constructors to mock - Arguments to pass to constructor - a mocked object of the type specified - - - - Create a mocked object, define constructor Behavior and pass arguments to constructor - - The type to mock - Define Arbitrary Call behavior - Arguments to pass to constructor - a mocked object of the type specified - - - - Create a mocked object, define constructor Behavior and pass arguments to constructor - - The type to mock - Define what constructors to mock - Define Arbitrary Call behavior - Arguments to pass to constructor - a mocked object of the type specified - - - - Create an instance of TMockedType and mock calls made on the instance - - The Type to Mock - The Mocked Instance - - The Constructor will be mocked!. - - Typemock Isolator will choose a constructor with the highest visibility and create default values for the - arguments, to send specific arguments use - - - - [Test] - public void MockTestedClass() - { - TestedClass mockedInstance = RecorderManager.CreateMockedObject<TestedClass>(); - // Start mocking - using (RecordExpectations recorder = RecorderManager.StartRecording()) - { - mockedInstance.SomeMethod(10); // SomeMethod will be mocked. - } - - mockedInstance.SomeMethod(); // the method is not called - - MockManager.Verify(); // Make sure that all expected calls where made - } - - - <Test()> _ - Public Sub MockTestedClass() - Dim mockedInstance As TestedClass = RecorderManager.CreateMockedObject(Of TestedClass) - ' Start mocking - Using recorder As New RecordExpectations - TestedClass.SomeMethod(10) ' SomeMethod will be mocked. - End Using - - mockedInstance.SomeMethod() ' the method is not called - - MockManager.Verify() ' Make sure that all expected calls where made - End Sub - - - - - - - - Create an instance of TMockedType and mock calls made on the instance, send Constructor behavior and optional arguments - - The Type to Mock - Scope of mocked constructors - Argument for constructor of concrete types, this is ignored for interfaces - The Mocked Instance - - For an example see - - - - - - Create an instance of TMockedType and mock calls made on the instance, send Constructor behavior Strictness and optional arguments - - The Type to Mock - Scope of mocked constructors - Define Arbitrary Call behavior - Argument for constructor of concrete types, this is ignored for interfaces - The Mocked Instance - - For an example see - - - - - - Create an instance of TMockedType and mock calls made on the instance, send Strictness and optional arguments - - The Type to Mock - Define Arbitrary Call behavior - Argument for constructor of concrete types, this is ignored for interfaces - The Mocked Instance - - The Constructor will not be mocked!. - For an example see - - - - - - Get or Set the VerifyMode of the next expectations - - - - - Retrieve the last Mocked Event - - - - - - Summary description for IsCloseCheck. - - - - - Helper for building failure messages - - - - - Create a Message Builder - - Custom message - Arguments for custom message - - - - Add message to prefix, remember current prefix - - Message to add - - - - Restore prefix to last known - - - - - Set message with one text - - Information about the checked argument - Error Message - - - - Set message with expected and actual objects - - Information about the checked argument - The expected argument - The actual argument - - - - Set message with prefix string and expected and actual objects - - Information about the checked argument - Prefix to add to message - The expected argument - The actual argument - - - - Get Message string - - The message string - - - - Default message prefix that can be added to the message - - - The message is: Call to [namespace.method] Parameter: [number] - - - - - Display an object as a string - - The object to display - String representation of object - - - - Quote a string - - Text to Quote - Quoted string - - - - Set/Get the CustomMessage - - - - - Set/Get Prefix to add before message - - - - - Get Message String - - - - - - - - - - - - - - - - - - - - - - - - - ProcessChannel is a queued Inter-Process message channel. - Only objects masked with the are allowed to be transfered through this channel. - - All members of this class are thread-safe. - - - - - - - - - - - - - - - - - - - - - Copy all data hold by the structure to the local dump container and clears the structure. - - A structure is invalid and no longer usable after dumping. You should notify all the other threads/processes before dumping. - - - - - - - - True if there's any data in the dump container. - - - - - The dump container data structure - - - - - - A channel is a queued but blocking message channel. - Channels are useful for Inter-Thread or Inter-Process communication, depending on the implementation. - Usually all interfaces members of this type are thread-safe. - - - - Send a message to the channel with unlimited timeout. - The object to send. There may be limitations on the kind of objects allowed - e.g. to be masked with the SerializedAttribute. - - - Send a message to the channel with limited timeout. - The object to send. There may be limitations on the kind of objects allowed - e.g. to be masked with the SerializedAttribute. - The maximum blocking time. Usually an Exceptions is thrown if a timeout exceeds. - - - Receive a message from the channel with unlimited timeout. - The received object. - - - Receive a message from the channel with limited timeout. - The maximum blocking time. Usually an Exceptions is thrown if a timeout exceeds. - The received object. - - - - Instanciates an Inter-Process message channel. - - The count of messages the channel can queue before it blocks. - The channel's name. Must be the same for all instances using this channel. - The maximum serialized message size in terms of bytes. Must be the same for all instances using this channel. - - - - Send a message to the channel with unlimited timeout. - - The object to send. Only objects masked with the are allowed to be transfered through this channel. - This member is thread-safe. - - - - Send a message to the channel with unlimited timeout. - - The object to send. Only objects masked with the are allowed to be transfered through this channel. - The maximum blocking time. A SemaphorFailedException is thrown if a timout exceeds. - This member is thread-safe. - - - - Receive a message from the channel with unlimited timeout. - - The received object. - This member is thread safe. - - - - Receive a message from the channel with limited timeout. - - The maximum blocking time. A SemaphorFailedException is thrown if a timout exceeds. - The received object. - This member is thread safe. - - - - - - - - - Don't forget to dispose this object before destruction. - - - - - MockObject is the Typemock Isolator dynamic mock object controller, this class is use for managing the - dynamic mocks - - - Mock object have 3 stages. - - - Set Up - This is the stage where you 'record' what the mocked type/object expects - to do and what to return - - - Run - Run the actual class under test - - - Verify - Make sure that the mocked object acted as expected - - - - These phases are managed by the Mock object. - - You cannot create a MockObject directly use MockManager. - - - You can create a mock object from abstract classes and interfaces. - Typemock Isolator will dynamically create a new concrete Type that implements the abstract methods and will - return an instance of the derived type when the is called. - When creating a mock object of a concrete type, Typemock Isolator will create an instance of that type, - and return the instance when the is called. - This way you can mock sealed classes too. - When mocking a method that is declared in a base class, Typemock Isolator will automatically create a mock for the base class - and the mock definitions are propagated to this mock (Strict and MockConstructors). - Note that if a base method is mocked all calls to the method are mocked even though they - are called from derived classes - - - - - - - - - - Mock is the Typemock Isolator mock type controller, this class is use for managing the - virtual mocks - - - Mock object have 3 stages. - - - Set Up - This is the stage where you 'record' what the mocked type/object expects - to do and what to return - - - Run - Run the actual class under test - - - Verify - Make sure that the mocked object acted as expected - - - - These phases are managed by the Mock object. - - You cannot create a Mock directly use MockManager. - - - You cannot mock Interfaces Classes, Use MockManager. - - When mocking a method that is declared in - When mocking a method that is declared in - a base class, Typemock Isolator will only mock that method when called from the mocked type. - When a base method is mocked and a derived class calls that method, it WON'T be mocked - - - - - - - - - - IMockControl is the Typemock Isolator mock type controller, this interface is use for managing the - virtual mocks - - - Mock object have 3 stages. - - - Set Up - This is the stage where you 'record' what the mocked type/object expects - to do and what to return - - - Run - Run the actual class under test - - - Verify - Make sure that the mocked object acted as expected - - - - These phases are managed by the IMockControl object. - - You cannot create an IMockControl directly use MockManager. or MockManager. - - - When mocking a method that is declared in - a base class, Typemock Isolator will only mock that method when called from the mocked type. - When a base method is mocked and a derived class calls that method, it WON'T be mocked - - - - - - - - - - Perform Behavior tweaking on methods rather then the whole mocked type - - - Currently you can set Strictness and CallEventHandler. Properties and - indexes can be tweaked using , - , - and - - - - - - Name of method - Interface to change method Behavior - - - - Perform Behavior tweaking on methods rather then the whole mocked type - - - Currently you can set Strictness and CallEventHandler - - Name of Property - - Interface to change method Behavior - - - - Perform Behavior tweaking on methods rather then the whole mocked type - - - Currently you can set Strictness and CallEventHandler - - Name of Property - - Interface to change method Behavior - - - - Perform Behavior tweaking on methods rather then the whole mocked type - - - Currently you can set Strictness and CallEventHandler - - - Interface to change method Behavior - - - - Perform Behavior tweaking on methods rather then the whole mocked type - - - Currently you can set Strictness and CallEventHandler - - - Interface to change method Behavior - - - - Mock Constructor - - - Using ExpectConstructor will enable verifying arguments passed - to the constructor - - Can Check Parameters, see - - - - Mock Constructor - - - Using ExpectConstructor will verify that a constructor has been called and can be used to validate the arguments passed - to the constructor - - Number of times to expect - Can Check Parameters, see - - - - Mock unlimited calls from Constructor - - Can Check Parameters, see - - - - Mock Constructor and throw exception when constructor is called - - - Using ExpectConstructorAndThrow will throw an exception when the constructor - is called - - Mocked Exception - Can Check Parameters, see - - - - Don't Mock Constructor but verify arguments - - - Using MockConstructor will enable verifying arguments passed - to the constructor - - Can Check Parameters, see - - - - Don't Mock Constructor but verify arguments - - - Using MockConstructor will enable verifying arguments passed - to the constructor - - Number of times to expect - Can Check Parameters, see - - - - Verify 1 call from method , continue with method as normal - - - - - Method Name - List of generic types, to mock bounded generic methods - Can Check Parameters, see - If method not found or is not void - - - - Verify a number of calls from method , continue with method as normal - - - - - Method Name - Number of times to expect - List of generic types, to mock bounded generic methods - Can Check Parameters, see - If method not found or is not void - - - - Expect 1 call from method - - - - - Method Name - List of generic types, to mock bounded generic methods - Can Check Parameters, see - If method not found or is not void - - - - Expect a number of calls from method - - - - - Method Name - Number of times to expect the call - List of generic types, to mock bounded generic methods - Can Check Parameters, see - If method not found or is not void - - - - Expect 1 call from method, and mock return value - - Method Name - Mocked return value - List of generic types, to mock bounded generic methods - Can Check Parameters, see - If method is not found or doesn't return the return value type - - - - - - - - Expect a number of calls from method, and mock return value - - Method Name - Mocked return value - Number of times to expect the call - List of generic types, to mock bounded generic methods - Can Check Parameters, see - If method is not found or doesn't return the return value type - - - - - - - - Expect 1 call from method, and mock throwing an exception - - - - - - Method Name - Mocked Exception - List of generic types, to mock bounded generic methods - Can Check Parameters, see - If method is not found - - - - Expect a number of calls from method, and mock throwing an exception - - - - - - Method Name - Mocked Exception - Number of times to expect the call - List of generic types, to mock bounded generic methods - Can Check Parameters, see - If method is not found - - - - Expect unlimited calls from method - - Method Name - List of generic types, to mock bounded generic methods - Can Check Parameters, see - If method is not found - - - - Expect unlimited calls from method, and always returns mock value - - - This is overridden with the limited call methods. ie. - when is used together with then the first value - returned will be the values then the value - - - Method Name - Mocked return value - List of generic types, to mock bounded generic methods - Can Check Parameters, see - If method is not found or doesn't return the return value type - - - - Expect unlimited calls from method, and always throws exception - - - This is overridden with the limited call methods. ie. - when is used together with then the first value - returned will be the values then the method will throw the value - - Method Name - Mocked exception - List of generic types, to mock bounded generic methods - Can Check Parameters, see - If method is not found - - - - Expect 1 set of a Property - - - - - Property Name - Can Check Property value, see - If property is not found - - - - Expect a number of sets of a Property - - - - - Property Name - Number of times to expect the set - Can Check Property value, see - If property is not found - - - - Expect unlimited set of a Property - - Property Name - Can Check Property value, see - If property is not found - - - - Expect 1 set of a Property and mock throwing an exception - - - - - Property Name - Mocked Exception - Can Check Property value, see - If property is not found - - - - Expect a number of sets of a Property and mock throwing an exception - - - - - Property Name - Mocked Exception - Number of times to expect the call - Can Check Property value, see - If property is not found - - - - Expect unlimited set of a Property and always mock throwing an exception - - Property Name - Mocked Exception - Can Check Property value, see - If property is not found - - - - Verify 1 set of a Property , continue with set method as normal - - - - - Property Name - Can Check Parameters, see - If method not found or is not void - - - - Verify a number of sets of a Property , continue with set method as normal - - - - - Property Name - Number of times to expect - Can Check Parameters, see - If method not found or is not void - - - - Expect 1 get of a Property and mock the Property's value - - - Property Name - Mocked value - If property is not found or is not the correct type - - - - Expect a number of gets of a Property and mock the Property's value - - - Property Name - Mocked value - Number of times to expect the gets - If property is not found or is not the correct type - - - - Expect unlimited get of a Property and always mock the Property's value - - - Property Name - Mocked value - If property is not found or is not correct value type - - - - Expect 1 get of a Property and mock throwing an exception - - Property Name - Mocked Exception - If property is not found - - - - Expect a number of gets of a Property and mock throwing an exception - - Property Name - Mocked Exception - Number of calls to expect - If property is not found - - - - Expect unlimited get of a Property and always mock throwing an exception - - Property Name - Mocked Exception - If property is not found - - - - Verify 1 get of a Property , continue with get method as normal - - - - - Property Name - Can Check Parameters, see - If method not found or is not void - - - - Verify a number of gets of a Property , continue with get method as normal - - - - - Property Name - Number of times to expect - Can Check Parameters, see - If method not found or is not void - - - - Expect 1 set of an Index - - - - - Can Check Property value, see - If index is not found - - - - Expect a number of sets of an Index - - - - - Number of sets to expect - Can Check Property value, see - If index is not found - - - - Expect unlimited set of an Index - - Can Check Property value, see - If index is not found - - - - Expect 1 set of an Index and mock throwing an exception - - - - - Mocked Exception - Can Check Property value, see - If index is not found - - - - Expect a number of sets of an Index and mock throwing an exception - - - - - Mocked Exception - Number of sets to expect - Can Check Property value, see - If index is not found - - - - Expect unlimited set of an Index and mock throwing an exception - - Mocked Exception - Can Check Property value, see - If index is not found - - - - Expect 1 get of an Index and mock the index value - - - - - - Mocked Index Value - Can Check Property value, see - If index is not found - - - - Expect a number of get of an Index and mock the index value - - - - - - Mocked Index Value - Number of sets to expect - Can Check Property value, see - If index is not found - - - - Expect unlimited set of an Index and mock throwing an exception - - Mocked Index Value - Can Check Property value, see - If index is not found - - - - Expect 1 get of an Index and mock throwing an exception - - - - - Mocked Exception - Can Check Property value, see - If index is not found - - - - Expect a number of gets of an Index and mock throwing an exception - - - - - Mocked Exception - Number of expected calls - Can Check Property value, see - If index is not found - - - - Expect unlimited set of an Index and mock throwing an exception - - Mocked Exception - Can Check Property value, see - If index is not found - - - - Expect 1 event listener to be added (event += new EventHandler()) - - Name of Event - A MockedEvent that can be used to the Event - - - - Expect a number of event listeners to be added (event += new EventHandler()) - - Name of Event - Number of times to expect - A MockedEvent that can be used to the Event - - - - Expect unlimited number of event listeners to be added (event += new EventHandler()) - - - When more than one instance of the event published is mocked, use the MockedEvent.[index] property - The first instance to register to the event will be in index 0, the next instance in 1 and so on. - - [Test] - public void SimulateFiringClickOnManyButtons() - { - // Mock all Click Events of the all Buttons - Mock buttonMock = MockManager.MockAll(typeof(Button)); - MockedEvent handle = buttonMock.ExpectAddEventAlways("Click"); - - // create 2 buttons and register to the Click Event - Button button1 = new Button(); - Button button2 = new Button(); - button1.Click += new EventHandler(button_Click); - button2.Click += new EventHandler(button_Click); - - // Simulate firing Click of button1 - handle.Instance[0].Fire(this, EventArgs.Empty); - // Simulate firing Click of button2 - handle.Instance[1].Fire(this, EventArgs.Empty); - // Check that system works... - - MockManager.Verify() - } - - - <Test()> _ - Public Sub SimulateFiringClickOnManyButtons() - 'Mock all Click Events of the all Buttons - Dim buttonMock As Mock = MockManager.MockAll(GetType(Button)) - Dim handle As MockedEvent = buttonMock.ExpectAddEventAlways("Click") - - ' create 2 buttons and register to the Click Event - Dim button1 As Button = New Button - Dim button2 As Button = New Button - - AddHandler button1.Click, AddressOf button_Click - AddHandler button2.Click, AddressOf button_Click - - ' Simulate firing Click of button1 - handle.Instance(0).Fire(Me, EventArgs.Empty) - ' Simulate firing Click of button2 - handle.Instance(1).Fire(Me, EventArgs.Empty) - ' Check that system works... - - MockManager.Verify() - End Sub - - Since Version 3.7 - - Name of Event - A MockedEvent that can be used to the Event - - - - Expect 1 event listener to be removed (event -= new EventHandler()) - - Name of Event - A MockedEvent that can be used to the Event - - - - Expect a number of event listeners to be removed (event -= new EventHandler()) - - Name of Event - Number of times to expect - A MockedEvent that can be used to the Event - - - - Use to mock all anonymous methods that are called from within a method - - Method from which the anonymous method is called - Anonymous Method Mock Name - - Assuming that we have this code - - public void DoSomething() - { - button1.Click += delegate - { - MessageBox.Show("Click!"); - }; - } - public void FireClick() - { - button1.PerformClick(); - } - - We can Mock the button1.Click Anonymous Method as follows: - - [Test] - public void AnonymousTest() - { - // Mock TestedClass - Mock mock = MockManager.Mock(typeof(TestedClass)); - // set up our expectations for anonymous method called in DoSomething - // check that the delegate will be called without displaying the message box - mock.ExpectCall(mock.AnonymousMethod("DoSomething")); - - // create the instances - TestedClass tested = new TestedClass(); - // Test the code - tested.DoSomething(); - tested.FireClick(); - // Verify that all calls were made (This can be done in the [Teardown]) - MockManager.Verify(); - } - - - - - - Clear expectation of a method - - - There are times when you want to clear all the expectations of the mock. - For example, if you setup expectations in the [SetUp] method, but want to clear a mocked - type in a specific test. - - You do not need to call this when using - - Name of method to remove expectations - - - - Clear all expectations - - - There are times when you want to clear all the expectations of the mock. - For example, if you setup expectations in the [SetUp] method, but want to clear a mocked - type in a specific test. - - You do not need to call this when using - - - - Create a Mock object and assign it to a given field. - The name of the field to be mocked - A mock object that is assigned to the field. - Show how to mock a call on a public field. - this works on private members as well - - [Test] - [VerifyMocks] - public void MockInstanceField() - { - // mock next instance creation of ClassWithField - Mock mock = MockManager.Mock(typeof(ClassWithField)); - // mock the "field" field and set the expectation on it - Mock mockedField = mock.MockField("field"); - mockedField.ExpectAndReturn("ReturnFive", 6); - - ClassWithField target = new ClassWithField(); - int actual = target.field.ReturnFive(); - // ReturnFive call is mocked and should return 6 - Assert.AreEqual(6, actual); - } - - - <Test(), VerifyMocks() > _ - Public Sub MockInstanceField() - ' mock next instance creation of ClassWithField - Dim mock As Mock = MockManager.Mock(GetType(ClassWithField)) - ' mock the "field" field and set the expectaion on it - Dim MockedField As Mock = mock.MockField("field") - MockedField.ExpectAndReturn("ReturnFive", 6) - - Dim target As New ClassWithField - Dim actual As Integer = target.field.ReturnFive - ' ReturnFive call is mocked and should return 6 - Assert.AreEqual(6, actual) - End Sub - - - AssignField - If constructor is not mocked, field is not - found or field can't be mocked - - - - Assign a new value to the given field. - - The name of the field to be assigned - The value to assign. - If field is not found or is static - - - Show how to assign values to private fields. - this can also be done to private static fields using the - AssignStaticField API. - - [Test] - [VerifyMocks] - public void AssignField() - { - // create the new value we will assign to the field - FieldClass replacement = new FieldClass(); - // create the mock object - Mock mock = MockManager.Mock<ClassWithField>(); - // if the field wont be assigned accessing it will yield a null reference exception - mock.AssignField("privateField", replacement); - - // verify that the replacement was assigned to the newly crated instance - ClassWithField target = new ClassWithField(); - int actual = target.GetPrivate().GetHashCode(); - Assert.AreEqual(replacement.GetHashCode(), actual); - } - - - //VB - <Test(), VerifyMocks() > _ - Public Sub AssignField() - ' create the new value we will assign to the field - Dim Replacement As New FieldClass - 'create the mock object - Dim mock As Mock = MockManager.Mock(GetType(ClassWithField)) - ' if the field wont be assigned accessing it will yield a null reference exception - mock.AssignField("privateField", Replacement) - - ' verify that the replacement was assigned to the newly crated instance - Dim field As New ClassWithField - Dim hashCode As Integer = field.GetPrivate().GetHashCode() - Assert.AreEqual(Replacement.GetHashCode, hashCode) - End Sub - - - - - - Allow mocking a method in a base class that is hidden by the mocked class - - - In most cases there is no need to use this method as Typemock Isolator will mock all methods in the hierarcy - of the mocked type. CallBase should be used when a method of a base class is overriden in the mocked type, - and there is a need to mock the base method only. - - - public class BaseClass - { - public virtual int SomeMethod() - { - return 1; - } - } - - public class DerivedClass() : BaseClass - { - public override int SomeMethod() - { - return base.SomeMethod() + 1; - } - } - - [Test] - public void Test() - { - Mock mock = MockManager.Mock(typeof(DerivedClass)) - // mock only BaseClass.SomeMethod when called from a DerivedClass Type. - mock.CallBase.ExpectAndReturn("SomeMethod", 100); - DerivedClass d = new DerivedClass(); - Assert.AreEqual(101, d.SomeMethod()); - } - - - Public Class BaseClass - Public Overridable Function SomeMethod() As Integer - Return 1 - End Function - End Class - - Public Class DerivedClass - Inherits BaseClass - Public Overrides Function SomeMethod() As Integer - Return 1 - End Function - End Class - - <Test()> _ - Public Sub Test() - Dim mock As Mock = MockManager.Mock(GetType(DerivedClass)) - ' mock only BaseClass.SomeMethod when called from a DerivedClass Type. - mock.CallBase.ExpectAndReturn("SomeMethod", 100) - Dim d As DerivedClass = New DerivedClass - Assert.AreEqual(101, d.SomeMethod()) - End Sub - - - - If a static method is mocked - - - - Obsolete. Argument validation is done both on calling the method and during Verify. - Postpone throwing validation errors till is called - - - Using ValidateArgsOnVerify, validation errors are thrown after Verify is called. - This is useful if the validation is done in another thread and you want the thread to continue. - When Verify is called all argument validations are shown too. - - - - - - Event that is set when all expectations have been made, used for verify with timeout - - - - used to store mocked fields objects which will be assigned upon object creation - - - Used to store fields which will be assigned to the field of the next object - - - Marks the mock as one sitting on a field (needed for license verification) - - - - Constructer, keep internal - - Link to mock for static methods - Type to be mocked - flag to mock constructors - - - - This mock is filled when a recorder is recording on this instance - but it has to register on the recorder mock future instance - - - - - Perform Behavior tweaking on methods rather then the whole mocked type - - - Currently you can set Strictness and CallEventHandler. Properties and - indexes can be tweaked using , - , - and - - - - - - Name of method - Interface to change method Behavior - - - - Perform Behavior tweaking on methods rather then the whole mocked type - - - Currently you can set Strictness and CallEventHandler - - Name of Property - - Interface to change method Behavior - - - - Perform Behavior tweaking on methods rather then the whole mocked type - - - Currently you can set Strictness and CallEventHandler - - Name of Property - - Interface to change method Behavior - - - - Perform Behavior tweaking on methods rather then the whole mocked type - - - Currently you can set Strictness and CallEventHandler - - - Interface to change method Behavior - - - - Perform Behavior tweaking on methods rather then the whole mocked type - - - Currently you can set Strictness and CallEventHandler - - - Interface to change method Behavior - - - - Check if method is in the expectation table - - - - - - - - - - Used by StaticMock to count references of Mocks so that the last - verify will verify the static too. - - - - - Mock Constructor - - - Using MockConstructor will enable verifying arguments passed - to the constructor - - Can Check Parameters, see - - - - Mock Constructor - - - Using ExpectConstructor will verify that a constructor has been called and can be used to validate the arguments passed - to the constructor - - Can Check Parameters, see - - - - Mock Constructor - - - Using ExpectConstructor will verify that a constructor has been called and can be used to validate the arguments passed - to the constructor - - Number of times to expect - Can Check Parameters, see - - - - Mock unlimited calls from Constructor - - Can Check Parameters, see - - - - Mock Constructor and throw exception when constructor is called - - - Using ExpectConstructorAndThrow will throw an exception when the constructor - is called - - Mocked Exception - Can Check Parameters, see - - - - Don't Mock Constructor but verify arguments - - - Using MockConstructor will enable verifying arguments passed - to the constructor - - Can Check Parameters, see - - - - Don't Mock Constructor but verify arguments - - - Using MockConstructor will enable verifying arguments passed - to the constructor - - Number of times to expect - Can Check Parameters, see - - - - Verify 1 call from method , continue with method as normal - - - - - Method Name - Can Check Parameters, see - If method not found or is not void - - - - Verify 1 call from method , continue with method as normal - - - - - Method Name - List of generic types, to mock bounded generic methods - Can Check Parameters, see - If method not found or is not void - - - - Verify a number of calls from method , continue with method as normal - - - - - Method Name - Number of times to expect - List of generic types, to mock bounded generic methods - Can Check Parameters, see - If method not found or is not void - - - - Expect 1 call from method - - - - - Method Name - List of generic types, to mock bounded generic methods - Can Check Parameters, see - If method not found or is not void - - - - Expect a number of calls from method - - - - - Method Name - Number of times to expect the call - List of generic types, to mock bounded generic methods - Can Check Parameters, see - If method not found or is not void - - - - Expect 1 call from method, and mock return value - - Method Name - Mocked return value - List of generic types, to mock bounded generic methods - Can Check Parameters, see - If method is not found or doesn't return the return value type - - - - - - - - Expect a number of calls from method, and mock return value - - Method Name - Mocked return value - Number of times to expect the call - List of generic types, to mock bounded generic methods - Can Check Parameters, see - If method is not found or doesn't return the return value type - - - - - - - - Expect 1 call from method, and mock throwing an exception - - - - - - Method Name - Mocked Exception - List of generic types, to mock bounded generic methods - Can Check Parameters, see - If method is not found - - - - Expect a number of calls from method, and mock throwing an exception - - - - - - Method Name - Mocked Exception - Number of times to expect the call - List of generic types, to mock bounded generic methods - Can Check Parameters, see - If method is not found - - - - Expect unlimited calls from method - - Method Name - List of generic types, to mock bounded generic methods - Can Check Parameters, see - If method is not found - - - - Expect unlimited calls from method, and always returns mock value - - - This is overridden with the limited call methods. ie. - when is used together with then the first value - returned will be the values then the value - - - Method Name - Mocked return value - List of generic types, to mock bounded generic methods - Can Check Parameters, see - If method is not found or doesn't return the return value type - - - - Expect unlimited calls from method, and always throws exception - - - This is overridden with the limited call methods. ie. - when is used together with then the first value - returned will be the values then the method will throw the value - - Method Name - Mocked exception - List of generic types, to mock bounded generic methods - Can Check Parameters, see - If method is not found - - - - Expect 1 set of a Property - - - - - Property Name - Can Check Property value, see - If property is not found - - - - Expect a number of sets of a Property - - - - - Property Name - Number of times to expect the set - Can Check Property value, see - If property is not found - - - - Expect unlimited set of a Property - - Property Name - Can Check Property value, see - If property is not found - - - - Expect 1 set of a Property and mock throwing an exception - - - - - Property Name - Mocked Exception - Can Check Property value, see - If property is not found - - - - Expect a number of sets of a Property and mock throwing an exception - - - - - Property Name - Mocked Exception - Number of times to expect the call - Can Check Property value, see - If property is not found - - - - Expect unlimited set of a Property and always mock throwing an exception - - Property Name - Mocked Exception - Can Check Property value, see - If property is not found - - - - Verify 1 set of a Property , continue with set method as normal - - - - - Property Name - Can Check Parameters, see - If method not found or is not void - - - - Verify a number of sets of a Property , continue with set method as normal - - - - - Property Name - Number of times to expect - Can Check Parameters, see - If method not found or is not void - - - - Expect 1 get of a Property and mock the Property's value - - - Property Name - Mocked value - If property is not found or is not the correct type - - - - Expect a number of gets of a Property and mock the Property's value - - - Property Name - Mocked value - Number of times to expect the gets - If property is not found or is not the correct type - - - - Expect unlimited get of a Property and always mock the Property's value - - - Property Name - Mocked value - If property is not found or is not correct value type - - - - Expect 1 get of a Property and mock throwing an exception - - Property Name - Mocked Exception - If property is not found - - - - Expect a number of gets of a Property and mock throwing an exception - - Property Name - Mocked Exception - Number of calls to expect - If property is not found - - - - Expect unlimited get of a Property and always mock throwing an exception - - Property Name - Mocked Exception - If property is not found - - - - Verify 1 get of a Property , continue with get method as normal - - - - - Property Name - Can Check Parameters, see - If method not found or is not void - - - - Verify a number of gets of a Property , continue with get method as normal - - - - - Property Name - Number of times to expect - Can Check Parameters, see - If method not found or is not void - - - - Expect 1 set of an Index - - - - - Can Check Property value, see - If index is not found - - - - Expect a number of sets of an Index - - - - - Number of sets to expect - Can Check Property value, see - If index is not found - - - - Expect unlimited set of an Index - - Can Check Property value, see - If index is not found - - - - Expect 1 set of an Index and mock throwing an exception - - - - - Mocked Exception - Can Check Property value, see - If index is not found - - - - Expect a number of sets of an Index and mock throwing an exception - - - - - Mocked Exception - Number of sets to expect - Can Check Property value, see - If index is not found - - - - Expect unlimited set of an Index and mock throwing an exception - - Mocked Exception - Can Check Property value, see - If index is not found - - - - Expect 1 get of an Index and mock the index value - - - - - - Mocked Index Value - Can Check Property value, see - If index is not found - - - - Expect a number of get of an Index and mock the index value - - - - - - Mocked Index Value - Number of sets to expect - Can Check Property value, see - If index is not found - - - - Expect unlimited set of an Index and mock throwing an exception - - Mocked Index Value - Can Check Property value, see - If index is not found - - - - Expect 1 get of an Index and mock throwing an exception - - - - - Mocked Exception - Can Check Property value, see - If index is not found - - - - Expect a number of gets of an Index and mock throwing an exception - - - - - Mocked Exception - Number of expected calls - Can Check Property value, see - If index is not found - - - - Expect unlimited set of an Index and mock throwing an exception - - Mocked Exception - Can Check Property value, see - If index is not found - - - Create a Mock object and assign it to a given field. - The name of the field to be mocked - A mock object that is assigned to the field. - Show how to mock a call on a public field. - this works on private members as well - - [Test] - [VerifyMocks] - public void MockInstanceField() - { - // mock next instance creation of ClassWithField - Mock mock = MockManager.Mock(typeof(ClassWithField)); - // mock the "member" field and set the expectation on it - Mock mockedField = mock.MockField("member"); - mockedField.ExpectAndReturn("ReturnFive", 6); - - ClassWithField target = new ClassWithField(); - int actual = target.member.ReturnFive(); - // ReturnFive call is mocked and should return 6 - Assert.AreEqual(6, actual); - } - - - //VB - <Test(), VerifyMocks() > _ - Public Sub MockInstanceField() - ' mock next instance creation of ClassWithField - Dim mock As Mock = MockManager.Mock(GetType(ClassWithField)) - ' mock the "member" field and set the expectaion on it - Dim MockedField As Mock = mock.MockField("member") - MockedField.ExpectAndReturn("ReturnFive", 6) - - Dim target As New ClassWithField - Dim actual As Integer = target.member.ReturnFive - ' ReturnFive call is mocked and should return 6 - Assert.AreEqual(6, actual) - End Sub - - - AssignField - If constructor is not mocked, field is not - found or field can't be mocked - - - - Assign a new value to the given field. - - The name of the field to be assigned - The value to assign. - If field is not found or is static, or if the class's constructor is not mocked - - - Show how to assign values to private fields. - this can also be done to private static fields using the - AssignStaticField API. - - [Test] - [VerifyMocks] - public void AssignField() - { - // create the new value we will assign to the field - FieldClass replacement = new FieldClass(); - // create the mock object - Mock mock = MockManager.Mock<ClassWithField>(); - // if the field wont be assigned accessing it will yield a null reference exception - mock.AssignField("privateMember", replacement); - - // verify that the replacement was assigned to the newly crated instance - ClassWithField target = new ClassWithField(); - int actual = target.GetPrivate().GetHashCode(); - Assert.AreEqual(replacement.GetHashCode(), actual); - } - - - //VB - <Test(), VerifyMocks() > _ - Public Sub AssignField() - ' create the new value we will assign to the field - Dim Replacement As New FieldClass - 'create the mock object - Dim mock As Mock = MockManager.Mock(GetType(ClassWithField)) - ' if the field wont be assigned accessing it will yield a null reference exception - mock.AssignField("privateMember", Replacement) - - ' verify that the replacement was assigned to the newly crated instance - Dim field As New ClassWithField - Dim hashCode As Integer = field.GetPrivate().GetHashCode() - Assert.AreEqual(Replacement.GetHashCode, hashCode) - End Sub - - - - - - Create a mock object on all the fields (which are classes) - done by default in natural mocks, when encountering a ctor recording - - - - - Create a mock object on all static fields of the class - done by default in natural mocks when encountering a cctor recording - - - - - gop over mocked field list and atatch the mocks to the created object - and then go over user assigned values and assign them to the fields - this is called when creating the real object - - the real object being created - - - - Expect unlimited number of event listeners to be added (event += new EventHandler()) - - - When more than one instance of the event published is mocked, use the MockedEvent.[index] property - The first instance to register to the event will be in index 0, the next instance in 1 and so on. - - [Test] - public void SimulateFiringClickOnManyButtons() - { - // Mock all Click Events of the all Buttons - Mock buttonMock = MockManager.MockAll(typeof(Button)); - MockedEvent handle = buttonMock.ExpectAddEventAlways("Click"); - - // create 2 buttons and register to the Click Event - Button button1 = new Button(); - Button button2 = new Button(); - button1.Click += new EventHandler(button_Click); - button2.Click += new EventHandler(button_Click); - - // Simulate firing Click of button1 - handle.Instance[0].Fire(this, EventArgs.Empty); - // Simulate firing Click of button2 - handle.Instance[1].Fire(this, EventArgs.Empty); - // Check that system works... - - MockManager.Verify() - } - - - <Test()> _ - Public Sub SimulateFiringClickOnManyButtons() - 'Mock all Click Events of the all Buttons - Dim buttonMock As Mock = MockManager.MockAll(GetType(Button)) - Dim handle As MockedEvent = buttonMock.ExpectAddEventAlways("Click") - - ' create 2 buttons and register to the Click Event - Dim button1 As Button = New Button - Dim button2 As Button = New Button - - AddHandler button1.Click, AddressOf button_Click - AddHandler button2.Click, AddressOf button_Click - - ' Simulate firing Click of button1 - handle.Instance(0).Fire(Me, EventArgs.Empty) - ' Simulate firing Click of button2 - handle.Instance(1).Fire(Me, EventArgs.Empty) - ' Check that system works... - - MockManager.Verify() - End Sub - - Since Version 3.7 - - Name of Event - A MockedEvent that can be used to the Event - - - - Expect 1 event listener to be added (event += new EventHandler()) - - Name of Event - A MockedEvent that can be used to the Event - - - - Expect a number of event listeners to be added (event += new EventHandler()) - - Name of Event - Number of times to expect - A MockedEvent that can be used to the Event - - - - Expect 1 event listener to be removed (event -= new EventHandler()) - - Name of Event - A MockedEvent that can be used to the Event - - - - Expect a number of event listeners to be removed (event -= new EventHandler()) - - Name of Event - Number of times to expect - A MockedEvent that can be used to the Event - - - - Use to mock all anonymous methods that are called from within a method - - Method from which the anonymous method is called - Anonymous Method Mock Name - - Assuming that we have this code - - public void DoSomething() - { - button1.Click += delegate - { - MessageBox.Show("Click!"); - }; - } - public void FireClick() - { - button1.PerformClick(); - } - - We can Mock the button1.Click Anonymous Method as follows: - - [Test] - public void AnonymousTest() - { - // Mock TestedClass - Mock mock = MockManager.Mock(typeof(TestedClass)); - // set up our expectations for anonymous method called in DoSomething - // check that the delegate will be called without displaying the message box - mock.ExpectCall(mock.AnonymousMethod("DoSomething")); - - // create the instances - TestedClass tested = new TestedClass(); - // Test the code - tested.DoSomething(); - tested.FireClick(); - // Verify that all calls were made (This can be done in the [Teardown]) - MockManager.Verify(); - } - - - - - - Verify mocked type - - - Part of Test Driven Development and Mock Methodology is being sure that ALL our - expected calls where actually called. This should always be the final part of the test - If some methods that we expected to be called where not called this will fail the test. - - This is automatically called when using MockManager.Verify() see - - For an example see - - - Using we can also define, that calls to methods that where - not expected, will fail the test too. - - - - - - Wait with timeout (5 seconds) for all expected methods to be called - - - VerifyWithTimeout will wait for all expectations to be called. If the Timeout is triggered - the test will fail. - Part of Test Driver Development and Mock Methodology is being sure that ALL our - expected calls where actually called. There are cases when mocks are called in a-synchronic - code or are encapsulated in a try catch block and errors are not thrown to testing method. - In these cases using VerifyWithTimeout will enable us to validate our code and return as soon as - the expected methods are called without needing to add Pause statements - - This is automatically called when using MockManager.VerifyWithTimeout() see - - - [Test] - public void TestCallsInOtherThread () - { - // Let mock the product - it will not mock constructors; - Mock productMock = MockManager.Mock(typeof(Product),Constructor.NotMocked); - // CalculatePrice will return 10 - expect 10 as argument - productMock.ExpectAndReturn("CalculatePrice",10F).Args(10); - // our method will be called in a new thread - Thread theThread = new Thread(new ThreadStart(RunWithWait)); - theThread.Start(); - // If we use Verify we dont know when the thread will actually be called - // Here we WAIT for the mocked methods to be called, or the timeout. - // Default timeout is 5000 milliseconds - productMock.VerifyWithTimeout(); - } - - - <Test()> _ - Public Sub TestCallsInOtherThread() - ' Let mock the product - this will mock the next invocation of Product, - ' it will mock constructors too so our price will be 0 - Dim productMock As Mock = MockManager.Mock(GetType(Product), Constructor.NotMocked) - ' CalculatePrice will return 10 - expect 10 as argument - productMock.ExpectAndReturn("CalculatePrice", 10.0F).Args(10) - ' our method will be called in a new thread - Dim theThread As Thread = New Thread(AddressOf RunWithWait) - theThread.Start() - ' If we use Verify we dont know when the thread will actually be called - ' Here we WAIT for the mocked methods to be called, or the timeout. - ' Default timeout is 5000 milliseconds - productMock.VerifyWithTimeout() - End Sub - - - - - - - Wait with timeout (im milliseconds) for all expected methods to be called - - - VerifyWithTimeout will wait for all expectations to be called. If the Timeout is triggered - the test will fail. - Part of Test Driver Development and Mock Methodology is being sure that ALL our - expected calls where actually called. There are cases when mocks are called in a-synchronic - code or are encapsulated in a try catch block and errors are not thrown to testing method. - In these cases using VerifyWithTimeout will enable us to validate our code and return as soon as - the expected methods are called without needing to add Pause statements - - This is automatically called when using MockManager.VerifyWithTimeout() see - - - [Test] - public void TestCallsInOtherThread () - { - // Let mock the product - it will not mock constructors; - Mock productMock = MockManager.Mock(typeof(Product),Constructor.NotMocked); - // CalculatePrice will return 10 - expect 10 as argument - productMock.ExpectAndReturn("CalculatePrice",10F).Args(10); - // our method will be called in a new thread - Thread theThread = new Thread(new ThreadStart(RunWithWait)); - theThread.Start(); - // If we use Verify we dont know when the thread will actually be called - // Here we WAIT 1000 milliseconds for the mocked methods to be called, or the timeout. - productMock.VerifyWithTimeout(1000); - } - - <Test()> _ - Public Sub TestCallsInOtherThread() - ' Let mock the product - this will mock the next invocation of Product, - ' it will mock constructors too so our price will be 0 - Dim productMock As Mock = MockManager.Mock(GetType(Product), Constructor.NotMocked) - ' CalculatePrice will return 10 - expect 10 as argument - productMock.ExpectAndReturn("CalculatePrice", 10.0F).Args(10) - ' our method will be called in a new thread - Dim theThread As Thread = New Thread(AddressOf RunWithWait) - theThread.Start() - ' If we use Verify we dont know when the thread will actually be called - ' Here we WAIT 1000 milliseconds for the mocked methods to be called, or the timeout. - productMock.VerifyWithTimeout(1000) - End Sub - - - - Time to wait for all expected methods to be called - - - - Clear expectation of a method - - - There are times when you want to clear all the expectations of the mock. - For example, if you setup expectations in the [SetUp] method, but want to clear a mocked - type in a specific test. - - You do not need to call this when using - - Name of method to remove expectations - - - - Clear all expectations - - - There are times when you want to clear all the expectations of the mock. - For example, if you setup expectations in the [SetUp] method, but want to clear a mocked - type in a specific test. - - You do not need to call this when using - - - - - Clear expectation of an expectation block - - - There are times when you want to clear expectations of the mock. - For example, if you use a utility class that contains an expectation block that - is not needed in a specific test. - - You do not need to call this when using - - - The Block to Clear - - - - Return the amount of times a method has been called - - - Can be used as part of a validation. - - In the following example we validate that the doSomething() Method has been called 3 times, - while keeping the original functionality (not mocked) - - - [Test] - public void Test() - { - Mock mock = MockManager.Mock(typeof(TestedClass)); - TestedClass t = new TestedClass(); - t.doSomething(); - t.doSomething(); - t.doSomething(); - Assert.AreEqual(3,mock.GetCallCount("doSomething")); - } - - - <Test()> _ - Public Sub Test() - Dim mock As Mock = MockManager.Mock(GetType(TestedClass)) - Dim t As TestedClass = New TestedClass() - t.doSomething() - t.doSomething() - t.doSomething() - Assert.AreEqual(3,mock.GetCallCount("doSomething")) - End Sub - - For Properties and Indexers see , - and - - mock.GetCallCount("doSomething") is equivalent to - MockManager.CalledCounter("TestClassLibrary.TestedClass","doSomething") - See - - - String representation of Method - Number of times the method has been called - - - - Return the amount of times a method has been called - - String representation of Method - Generic parameters list of the method - Number of times the method has been called - - - - Return the amount of times a property has been called - - - See - - String representation of the Property - Number of times the property has been called - - - - Return the amount of times a property has been set - - - See - - String representation of the Property - Number of times the property has been set - - - - Return the amount of times an indexer has been called - - - See - - Number of times the indexer has been called - - - - Start an expectation block - - - - Group a number of expectation. When grouping expectations in a block you can control - The expectation dynamically. This is very useful when setting up a mock infrastructure. - After defining a block it is possible to: - - Remove the block using . - - - Add expectations before the block using . - - - Blocks can be labeled and can be later on referred to by . - - Blocks can have different s. - - The following example shows a utility method that sets up expectations - for an AccessController - - private Mock SetupExpectations() - { - //Mock all invocation of AccessController, - Mock mock = MockManager.MockAll(typeof(AccessController)); - - // start a block called loginLabel, this will be verified normally - mock.StartBlock("loginLabel",VerifyMode.Normal); - // We expect that the login method will be called and we will return - // AccessStatus.INVALID_USER the first time and AccessStatus.VALIDATED the - // second time - mock.ExpectAndReturn("Login", AccessStatus.INVALID_USER); - mock.ExpectAndReturn("Login", AccessStatus.VALIDATED); - mock.EndBlock(); - - // expect another call and return validated. - mock.ExpectAndReturn("Login", AccessStatus.VALIDATED); - return mock; - } - [Test] - public void TestSomething() - { - Mock mock = SetupExpectations(); - - // In this test we need to add an expectation before our block - mock.StartBlockBefore(mock.GetBlock("loginLabel")); - mock.ExpectAndReturn("Login", AccessStatus.VALIDATED); - mock.EndBlock(); - - // continue with test - } - [Test] - public void TestSomething2() - { - Mock mock = SetupExpectations(); - - // In this test we need to remove the expectation our block - mock.Clear(mock.GetBlock("loginLabel")); - - // continue with test - } - - - Private Function SetupExpectations() As Mock - 'Mock all invocation of AccessController, - Dim mock As Mock = MockManager.Mock(GetType(AccessController)) - - ' start a block called loginLabel, this will be verified normally - mock.StartBlock("loginLabel",VerifyMode.Normal) - ' We expect that the login method will be called and we will return - ' AccessStatus.INVALID_USER the first time and AccessStatus.VALIDATED the - ' second time - mock.ExpectAndReturn("Login", AccessStatus.INVALID_USER) - mock.ExpectAndReturn("Login", AccessStatus.VALIDATED) - mock.EndBlock() - - ' expect another call and return validated. - mock.ExpectAndReturn("Login", AccessStatus.VALIDATED) - SetupExpectations = mock - End Function - <Test()> _ - Public Sub TestSomething() - Dim mock As Mock = SetupExpectations() - - ' In this test we need to add an expectation before our block - mock.StartBlockBefore(mock.GetBlock("loginLabel")) - mock.ExpectAndReturn("Login", AccessStatus.VALIDATED) - mock.EndBlock() - - ' continue with test - End Sub - <Test()> _ - Public Sub TestSomething2() - Dim mock As Mock = SetupExpectations() - - ' In this test we need to remove the expectation our block - mock.Clear(mock.GetBlock("loginLabel")) - - ' continue with test - End Sub - - - - - - - - The Expectation Block - - - - Start an expectation block with a label name - - - - - - - - The label given to the block, can then be retrieved using - The Expectation Block - Will be throw if a block with the same label name exists already - - - - - Start an expectation block with a verify mode - - - - - - - - The verify mode of the block - The Expectation Block - - - - Start an expectation block with a label and a verify mode - - - - - - - - The label given to the block, can then be retrieved using - The verify mode of the block - The Expectation Block - Will be throw if a block with the same label name exists already - - - - - Retrieve Expectation Block, by its label name - - The Expectation blocks label - The Expectation block - Will be throw if a block doesn't exist - - - - - - Start an expectation block and adds the expectations before another expectation - block - - - Add expectations before another expectation block. This is very useful when setting up a mock infrastructure. - - Blocks can be labeled and can be later on referred to by . - - Blocks can have different s. - - The following example shows a utility method that sets up expectations - for an AccessController - - private Mock SetupExpectations() - { - //Mock all invocation of AccessController, - Mock mock = MockManager.MockAll(typeof(AccessController)); - - // start a block called loginLabel, this will be verified normally - mock.StartBlock("loginLabel",VerifyMode.Normal); - // We expect that the login method will be called and we will return - // AccessStatus.INVALID_USER the first time and AccessStatus.VALIDATED the - // second time - mock.ExpectAndReturn("Login", AccessStatus.INVALID_USER); - mock.ExpectAndReturn("Login", AccessStatus.VALIDATED); - mock.EndBlock(); - - // expect another call and return validated. - mock.ExpectAndReturn("Login", AccessStatus.VALIDATED); - return mock; - } - [Test] - public void TestSomething() - { - Mock mock = SetupExpectations(); - - // In this test we need to add an expectation before our block - mock.StartBlockBefore(mock.GetBlock("loginLabel")); - mock.ExpectAndReturn("Login", AccessStatus.VALIDATED); - mock.EndBlock(); - - // continue with test - } - [Test] - public void TestSomething2() - { - Mock mock = SetupExpectations(); - - // In this test we need to remove the expectation our block - mock.Clear(mock.GetBlock("loginLabel")); - - // continue with test - } - - - Private Function SetupExpectations() As Mock - 'Mock all invocation of AccessController, - Dim mock As Mock = MockManager.Mock(GetType(AccessController)) - - ' start a block called loginLabel, this will be verified normally - mock.StartBlock("loginLabel",VerifyMode.Normal) - ' We expect that the login method will be called and we will return - ' AccessStatus.INVALID_USER the first time and AccessStatus.VALIDATED the - ' second time - mock.ExpectAndReturn("Login", AccessStatus.INVALID_USER) - mock.ExpectAndReturn("Login", AccessStatus.VALIDATED) - mock.EndBlock() - - ' expect another call and return validated. - mock.ExpectAndReturn("Login", AccessStatus.VALIDATED) - SetupExpectations = mock - End Function - <Test()> _ - Public Sub TestSomething() - Dim mock As Mock = SetupExpectations() - - ' In this test we need to add an expectation before our block - mock.StartBlockBefore(mock.GetBlock("loginLabel")) - mock.ExpectAndReturn("Login", AccessStatus.VALIDATED) - mock.EndBlock() - - ' continue with test - End Sub - <Test()> _ - Public Sub TestSomething2() - Dim mock As Mock = SetupExpectations() - - ' In this test we need to remove the expectation our block - mock.Clear(mock.GetBlock("loginLabel")) - - ' continue with test - End Sub - - - - - - - The Expectations block to add expectations before - The Expectation Block - - - - Start an expectation block with a label and adds the expectations before another expectation - block - - - - - - - The Expectation block to add expectations before - The label given to the block, can then be retrieved using - The Expectation Block - Will be throw if a block with the same label name exists already - - - - - Start an expectation block with a verify mode and adds the expectations before another expectation - block - - - - - - - The Expectation block to add expectations before - The verify mode of the block - The Expectation Block - - - - Start an expectation block with a label and a verify mode, and adds the expectations before another expectation - block - - - - - - - The Expectation block to add expectations before - The label given to the block, can then be retrieved using - The verify mode of the block - The Expectation Block - Will be throw if a block with the same label name exists already - - - - - End an expectation block - - - - - - - - - - Can set the mock to be Strict - The default is the Methods of Abstract and Interfaces are Strict and Arbitrary calls fail - while Arbitrary Methods of concrete classes are allowed. - - - By default Mocked Concrete Types are NOT strict this mean that if a call to a mocked - method was not expected the normal code is executed. - Mocked Types can be made strict and fail if an unexpected call is made - - [Test] - public void Test() - { - // Start mocking TestedClass - Mock mock = MockManager.Mock(typeof(TestedClass)); - TestedClass t = new TestedClass(); - // No expectations, the following will run normal passInt if Strict=false - // and will fail if Strict=true - t.passInt(10); - MockManager.Verify(); - } - - - <Test()> _ - Public Sub Test() - { - ' Start mocking TestedClass - Dim mock As Mock = MockManager.Mock(GetType(TestedClass)) - Dim t As TestedClass = New TestedClass - ' No expectations, the following will run normal passInt if Strict=false - ' and will fail if Strict=true - t.passInt(10) - MockManager.Verify() - End Sub - - - To set only one method to strict use: - - - When allowing arbitrary abstract methods (methods created dynamically by Typemock Isolator using or ), - Typemock Isolator create the following default behavior: - 1. All void calls just return - 2. Other Methods will return 0 or null depending on the return type - 3. Properties will behave like normal properties - - - - - - - - Can set the static methods of a mocked type to be Strict - - - By default Mocked Types are NOT strict this mean that if a call to a mocked - method was not expected the normal code is executed. - Mocked Types Static Members can be made strict and fail if an unexpected call is made - To set only one method to strict use: - - - - - - - - Get the actual instance that is being mocked and controlled. This - enables tracking instance mocks to the actual instance - - - When using instance mocks (Mock and MockObject) this property returns the instance mocked - - - MockObject will return the same result although has a different usage - - - MockAll mocks and Mocks that haven't been created yet (new not called) will return null (Nothing in Visual Basic) - - - Being able to reference the mocked instance enables testing fields of future object. - Example of using Typemock Isolator to test a field of a future object - - - public static void CreateAnObject() - { - TestClass theClass = new TestClass(); - theClass.field = 5; - ... - } - [Test] - public void VerifyFutureObject() - { - //Create new Mock for a future Object, no expectations - Mock mock = MockManager.Mock(typeof(TestClass)); - - // Call our code - TheClass.CreateAnObject(); - - // get the mocked object and test the field - TestClass theClass = mock.MockedInstance as TestClass; - Assert.AreEqual(5, theClass.field); - - // Verify that all the expected calls have actually been called. - MockManager.Verify(); - } - - - Public Shared Sub CreateAnObject() - Dim theClass As TestClass = New TestClass() - theClass.field = 5 - ... - End Sub - - <Test()> _ - Public Sub ValidateValidUser() - ' Create new Mock for a future Object, no expectations - Dim mock As Mock = MockManager.Mock(GetType(TestClass)) - - ' call our code - TheClass.CreateAnObject() - ' Get the mocked object and test the field - Dim theClass As TestClass = mock.MockedInstance - Assert.AreEqual(5, theClass.field) - - ' Verify that all the expected calls have actually been called. - MockManager.Verify() - End Sub - - - - Mock Instance - - - - used to specifiy that this is a mock created for a field inside an object - - - - - Allow mocking a method in a base class that is hidden by the mocked class - - - In most cases there is no need to use this method as Typemock Isolator will mock all methods in the hierarcy - of the mocked type. CallBase should be used when a method of a base class is overriden in the mocked type, - and there is a need to mock the base method only. - - - public class BaseClass - { - public virtual int SomeMethod() - { - return 1; - } - } - - public class DerivedClass : BaseClass - { - public override int SomeMethod() - { - return base.SomeMethod() + 1; - } - } - - [Test] - public void Test() - { - Mock mock = MockManager.Mock(typeof(DerivedClass)) - // mock only BaseClass.SomeMethod when called from a DerivedClass Type. - mock.CallBase.ExpectAndReturn("SomeMethod", 100); - DerivedClass d = new DerivedClass(); - Assert.AreEqual(101, d.SomeMethod()); - } - - - Public Class BaseClass - Public Overridable Function SomeMethod() As Integer - Return 1 - End Function - End Class - - Public Class DerivedClass - Inherits BaseClass - Public Overrides Function SomeMethod() As Integer - Return 1 - End Function - End Class - - <Test()> _ - Public Sub Test() - Dim mock As Mock = MockManager.Mock(GetType(DerivedClass)) - ' mock only BaseClass.SomeMethod when called from a DerivedClass Type. - mock.CallBase.ExpectAndReturn("SomeMethod", 100) - Dim d As DerivedClass = New DerivedClass - Assert.AreEqual(101, d.SomeMethod()) - End Sub - - - - If a static method is mocked - - - - Allow mocking a static method when that method is overloaded with an instance method - - In most cases there is no need to use this method as Typemock Isolator will mock all static methods - of the mocked type. CallStatic should be used when an instance method and a static method have the same name - By default the instance methods are returned. - - If instance methods are mocked - - - - - Obslolete. Argument validation is done both on calling the method and during Verify. - - - Using ValidateArgsOnVerify, validation errors are thrown after Verify is called. - This is useful if the validation is done in another thread and you want the thread to continue. - When Verify is called all argument validations are shown too. - - The flag will be deleted in future - - - - Get the type that is mocked and controlled. - - - - - Event that is fired after a mocked method is called and after argument validation is performed - - - - To set an event per method see - When static methods are called events from ALL mocks of that type are triggered. So if a type is mocked for - two instances, and both have AfterMock Events, both will be triggered after a static member of that type is called. This - is because static methods are not associated with an instance. - - - - - - Do not create this type, use MockManager. - - Link to mock for static methods - Type to be mocked - flag to mock constructors - - - - Get the Mocked Object - - - - - Create an instance of TMockedType and Control the behavior of that instance. - - The Type to Mock - - is the Typemock Isolator mock type controller, this class is use for managing the - virtual mocks, using generic code sugar, to ease the mock creation. - - There are 3 types of mocks - - - MockManager. - Will mock the next 'new' instance of the mocked Type (and all static methods) - - - MockManager. - Will mock ALL (future and past) instances of the mocked Type - - - MockManager. - Will create ONE instance of the Type. This instance is mocked - - - - - MockManager. methods are used to create a mocked instance and return a controller to defined expectations - on the mocked instance mock. After creating a mocked object the actual instance is in . - - - RecorderManager. methods are used to create a mocked instance and return the actual instance. - This is useful for Natural Mocks - - - To mock create any object (including Interfaces) Use MockManager."/> - When creating a mock object Typemock Isolator will choose a constructor with the highest visibility and create default values for the - arguments, to send specific arguments use MockManager. - - - After creating a mocked object the actual instance is in . - - - - - - - - - is the Typemock Isolator mock type controller, this class is use for managing the - virtual mocks, using generic code sugar, to ease the mock creation. - - The Type to Mock - - There are 3 types of mocks - - - MockManager. - Will mock the next 'new' instance of the mocked Type (and all static methods) - - - MockManager. - Will mock ALL (future and past) instances of the mocked Type - - - MockManager. - Will create ONE instance of the Type. This instance is mocked - - - - - To mock Interfaces, Use MockManager. - - - - - - - - - Get the mocked instance. - - - - - Summary description for About. - - - - - Clean up any resources being used. - - - - - Required method for Designer support - do not modify - the contents of this method with the code editor. - - - - - Typemock Natural Mocks can validates parameter values, collections and arrays, - as well as repeat expectation. - - - To change to mock Behavior use IMockBehavior returned from methods - You can validate that parameters passed are as you expected and repeat the expectations. - - This Interface is not to be implemented by client - - - - - - Validate that the arguments passed are as expected - - - - list of expected parameters and/or parameter checkers - Will be throw if more then 30 parameters are used per method - It is possible to check that a mocked method has been called with specific parameter - values. - - - - For example, if we need to check that an int parameter is 10 - we can write the following code - - [Test] - public void Test() - { - // Start mocking - using (RecordExpectations recorder = RecorderManager.StartRecording()) - { - // CAUTION: ALL calls here are mocked!!! - // Mock new instance of TestedClass - TestedClass mockedTestedClass = new TestedClass(); - // First time PassInt to be called. - mockedTestedClass.PassInt(10); - // check that 10 has been passed - recorder.CheckArguments(); - - // Second time PassInt to be called. - mockedTestedClass.PassInt(10); - // check that 1 or 2 is passed - recorder.CheckArguments(Check.IsIn(1,2))); - } - - // run our code - TestedClass t = new TestedClass(); - // This will pass - t.passInt(10); - // This will fail - t.passInt(3); - MockManager.Verify(); - } - - - ' Visual Basic .NET 2.0 - <Test()> _ - Public Sub Test() - ' Start mocking - Using recorder As New RecordExpectations - ' CAUTION: ALL calls here are mocked!!! - ' Mock new instance of TestedClass - Dim mockedTestedClass As TestedClass = New TestedClass - ' First time PassInt to be called. - mockedTestedClass.PassInt(10) - ' check that 10 has been passed - recorder.CheckArguments() - - ' Second time PassInt to be called. - mockedTestedClass.PassInt(10); - ' check that 1 or 2 is passed - recorder.CheckArguments(Check.IsIn(1,2))) - End Using - - ' run our code - Dim t As TestedClass = New TestedClass - ' This will pass - t.passInt(10) - ' This will fail - t.passInt(3) - MockManager.Verify() - End Sub - - For VB .NET 1.1 see - - - Single Dimension Arrays and Collections are iterated and checked for match of all items - See for built in ParameterCheckers - See for details of user defined checks - - - BEWARE, Typemock Isolator normally checks the type of return value with the existing - method, but it does not check the legitimacy of the returned value in case of - overloaded methods that have different return types, (as Typemock Isolator sees these - as one mocked method) if you return a value with the wrong type a - System.InvalidCastException will be thrown - - - Typemock Isolator supports checking methods with up to 30 parameters - - - - - - - - Mock method only when arguments passed are as expected - - - - list of expected parameters and/or parameter checkers - Will be throw if more then 30 parameters are used per method - It is possible to check that a mocked method has been called with specific parameter - values and to return mocked values when this is true. - *Enterprise Edition Only* - - - - For example, we have a method PassInt, that returns a string, and has an int parameter. - We need to return "one" whenever the argument is 1 - we can write the following code - - [Test] - public void Test() - { - // Start mocking - using (RecordExpectations recorder = RecorderManager.StartRecording()) - { - // CAUTION: ALL calls here are mocked!!! - // Mock new instance of TestedClass - TestedClass mockedTestedClass = new TestedClass(); - // always return "one" when 1 was passed - mockedTestedClass.PassInt(1); - recorder.Return("one").RepeatAlways().WhenArgumentsMatch(); - - // always return "two" when 2 or 3 is passed - mockedTestedClass.PassInt(2); - recorder.Return("two").RepeatAlways().WhenArgumentsMatch(Check.IsIn(1,2)); - } - - // run our code - TestedClass t = new TestedClass(); - // This will pass - Assert.AreEqual("one",t.passInt(1)); - Assert.AreEqual("two",t.passInt(3)); - MockManager.Verify(); - } - - - ' Visual Basic .NET 2.0 - <Test()> _ - Public Sub Test() - ' Start mocking - Using recorder As New RecordExpectations - ' CAUTION: ALL calls here are mocked!!! - ' Mock new instance of TestedClass - Dim mockedTestedClass As TestedClass = New TestedClass - ' always return "one" when 1 was passed - mockedTestedClass.PassInt(1) - recorder.Return("one").RepeatAlways().WhenArgumentsMatch() - - ' always return "two" when 2 or 3 is passed - mockedTestedClass.PassInt(2); - recorder.Return("two").RepeatAlways().WhenArgumentsMatch(Check.IsIn(1,2)) - End Using - - ' run our code - Dim t As TestedClass = New TestedClass - ' This will pass - Assert.AreEqual("one",t.passInt(1)) - Assert.AreEqual("two",t.passInt(3)) - MockManager.Verify() - End Sub - - For VB .NET 1.1 see - - - Single Dimension Arrays and Collections are iterated and checked for match of all items - See for built in ParameterCheckers - See for details of user defined checks - - - BEWARE, Typemock Isolator normally checks the type of return value with the existing - method, but it does not check the legitimacy of the returned value in case of - overloaded methods that have different return types, (as Typemock Isolator sees these - as one mocked method) if you return a value with the wrong type a - System.InvalidCastException will be thrown - - - Typemock Isolator supports checking methods with up to 30 parameters - - - - - - - - Don't Validate that the arguments passed are as expected. This is the default Behavior - - - - - - For example, if we want to ignore the parameters passed we can write the following code - - [Test] - public void Test() - { - // Start mocking - using (RecordExpectations recorder = RecorderManager.StartRecording()) - { - // CAUTION: ALL calls here are mocked!!! - // Mock new instance of TestedClass - TestedClass mockedTestedClass = new TestedClass(); - // First time PassInt to be called. - mockedTestedClass.PassInt(10); - // don't check that 10 has been passed - recorder.IgnoreArguments(); - - // Second time PassInt to be called. - mockedTestedClass.PassInt(10); - // check that 1 or 2 is passed - recorder.CheckArguments(Check.IsIn(1,2))); - } - - // run our code - TestedClass t = new TestedClass(); - // This will pass (ignored) - t.passInt(1); - // This will fail - t.passInt(3); - MockManager.Verify(); - } - - - ' Visual Basic .NET 2.0 - <Test()> _ - Public Sub Test() - ' Start mocking - Using recorder As New RecordExpectations] - ' CAUTION: ALL calls here are mocked!!! - ' Mock new instance of TestedClass - Dim mockedTestedClass As TestedClass = New TestedClass - ' First time PassInt to be called. - mockedTestedClass.PassInt(10) - ' don't check that 10 has been passed - recorder.IgnoreArguments() - - ' Second time PassInt to be called. - mockedTestedClass.PassInt(10); - ' check that 1 or 2 is passed - recorder.CheckArguments(Check.IsIn(1,2))) - End Using - - ' run our code - Dim t As TestedClass = New TestedClass - ' This will pass (ignored) - t.passInt(1) - ' This will fail - t.passInt(3) - MockManager.Verify() - End Sub - - - For VB .NET 1.1 see - - - - - - Repeat the last expectation and mocked return values - - - - - For example, lets repeat the expectation for DoSomething 3 times - - [Test] - public void Test() - { - // Start mocking - using (RecordExpectations recorder = RecorderManager.StartRecording()) - { - // CAUTION: ALL calls here are mocked!!! - // Mock new instance of TestedClass - TestedClass mockedTestedClass = new TestedClass(); - // DoSomething to be called. - mockedTestedClass.DoSomething(); - // return 10, 3 times - recorder.Return(10).Repeat(3); - } - - // run our code - TestedClass t = new TestedClass(); - int actual = t.DoSomething(); - Assert.AreEqual(10,actual); - int actual = t.DoSomething(); - Assert.AreEqual(10,actual); - // This will fail as we have one more expectation - MockManager.Verify(); - } - - - ' Visual Basic .NET 2.0 - <Test()> _ - Public Sub Test() - ' Start mocking - Using recorder As New RecordExpectations - ' CAUTION: ALL calls here are mocked!!! - ' Mock new instance of TestedClass - Dim mockedTestedClass As TestedClass = New TestedClass - ' DoSomething to be called. - mockedTestedClass.DoSomething() - ' return 10, 3 times - recorder.Return(10).Repeat(3) - End Using - - ' run our code - Dim t As TestedClass = New TestedClass - Dim actual As Integer = t.DoSomething() - Assert.AreEqual(10,actual); - actual = t.DoSomething() - Assert.AreEqual(10,actual); - ' This will fail as we have one more expectation - MockManager.Verify() - End Sub - - For VB .NET 1.1 see - - - When using Chained expectations the repeat will repeat ALL the calls in the chain - - Amount of times to repeat the expectation - Use to change more Behavior - - - - Repeat the last expectation and mocked return values for every call - - - - - For example, lets repeat the expectation for DoSomething - - [Test] - public void Test() - { - // Start mocking - using (RecordExpectations recorder = RecorderManager.StartRecording()) - { - // CAUTION: ALL calls here are mocked!!! - // Mock new instance of TestedClass - TestedClass mockedTestedClass = new TestedClass(); - // DoSomething to be called. - mockedTestedClass.DoSomething(); - // always return 10 - recorder.Return(10).RepeatAlways(); - } - - // run our code - TestedClass t = new TestedClass(); - int actual = t.DoSomething(); - Assert.AreEqual(10,actual); - int actual = t.DoSomething(); - Assert.AreEqual(10,actual); - MockManager.Verify(); - } - - - ' Visual Basic .NET 2.0 - <Test()> _ - Public Sub Test() - ' Start mocking - Using recorder As New RecordExpectations - ' CAUTION: ALL calls here are mocked!!! - ' Mock new instance of TestedClass - Dim mockedTestedClass As TestedClass = New TestedClass - ' DoSomething to be called. - mockedTestedClass.DoSomething() - ' always return 10 - recorder.Return(10).RepeatAlways() - End Using - - ' run our code - Dim t As TestedClass = New TestedClass - Dim actual As Integer = t.DoSomething() - Assert.AreEqual(10,actual); - actual = t.DoSomething() - Assert.AreEqual(10,actual); - MockManager.Verify() - End Sub - - For VB .NET 1.1 see - - - When using Chained expectations the repeat will repeat ALL the calls in the chain - - Use to change more Behavior - - - - - - - Create a virtual memory mapped file located in the system page file. - - The name of the file. Prefix it with "Global\" or "Local\" to control its scope between NT services and user applications in Terminal Server scenarios. - Whether you need write access to the file. - The preferred size of the file in terms of bytes. - A MemoryMappedFile instance representing the file. - - - - Create a view of the memory mapped file, allowing to read/write bytes. - - An optional offset to the file. - The size of the view in terms of bytes. - Whether you need write access to the view. - A MemoryMappedFileView instance representing the view. - - - - - Scope of Mock - - - - - - - - - - - - - - - - - - - - - Summary description for TraceData. - - - - - Base Trace Object - - - - - Deserialization constructor. - - - - - - - Serialization function. - - - - - - - - - - - - - - - - - - - - - - Serialization function. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Serialization function. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Serialization function. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Serialization function. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Serialization function. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Serialization function. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Serialization function. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Serialization function. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Summary description for CompoundCheck. - - - - - TypeMockException is throw when illegal arguments are received by - - For example when trying to return an incorrect type - - - - - - TypeMockException is throw when illegal arguments are received by - - Reason of exception - - - - TypeMockException is throw when illegal arguments are received by - - - - - TypeMockException is throw when illegal arguments are received by - - Reason of exception - Inner Exception - - - - Initializes a new instance of the TypeMockException class with serialized data. - - The SerializationInfo that holds the serialized object data about the exception being thrown. - The StreamingContext that contains contextual information about the source or destination. - - - - Initializes a new instance of the CannotEvaluateWhileRecordingException class with serialized data. - - The SerializationInfo that holds the serialized object data about the exception being thrown. - The StreamingContext that contains contextual information about the source or destination. - - - Used to initiate verification at the end of each test. This class cant - be inherited. - Any method marks with this attribute will call MockManager.Verify after - the test is done. A marked class will do this for any test defined in - it. - - - [TestFixture] - [ClearMocks] // clear all mocks between tests - public TestClass - { - [Test] - [VerifyMocks] // verify the mocks after this tests - void test1() - { - // Set Expectations - - // the test code - } - } - - < TestFixture >_ - < ClearMocks >_ ' clear all mocks between tests - Public class TestClass - < Test >_ - < VerifyMocks >_ ' verify the mocks after this tests - Public Sub test1() - ' Set expectations - - ' the test code - End Sub - End Class - ClearMocksAttribute - MockManager.Verify - - - - Create an instance of the attribute. - when this attribute is specified the mock verification process will be initiated automatically - at the end of the test method (when specified on a class it will be done for each test method) - - - - - Create an instance of the attribute, initializing it with the given timeout. - When a timeout is specified the auto verify will call the verification with timeout process. - - the given timeout (in milliseconds) - - - Called by the framework instead of the original method. This will run the original method and - afterwards will initiate the verification process. - If the test has failed on its own, verification will not be called but all expectations will be cleared - anyway. - The results from activating the original invoker on the test - if verify fails - - - - Get and Set the timeout (in milliseconds) for all expectations to complete - - - - - - ProcessSemaphore is an Inter-Process counting semaphore using Win32 Semaphores. - Semaphores are useful for Inter-Process synchronization and communication. - - All members of this class are thread-safe. - - - - - A counting semaphore is a thread or process synchronization primitive. - Semaphores are useful for Inter-Thread or Inter-Process synchronization and communication, depending on the implementation. - Usually all interfaces members of this type are thread-safe. - - - - - Blocks if no release is signaled or removes a release signal. Enter a critical section. - In theory, this method is often called P() [Dijkstra, dutch: passeeren] - - - - - Blocks if no release is signaled or removes a release signal. Enter a critical section. - In theory, this method is often called P() [Dijkstra, dutch: passeeren] - - The maximum blocking time. Usually an Exceptions is thrown if a timeout exceeds. - - - - Signals a release and allows a blocked thread to continue. Leave a critical section. - In theory, this method is often called V() [Dijkstra, dutch: vrijgeven] - - - - - Instanciate a new Inter-Process semaphore. - - The semaphore's name. - - - - Instanciate a new Inter-Process semaphore. - - The semaphore's name. - The initial count of releases signaled. - - - - Instanciate a new Inter-Process semaphore. - - The semaphore's name. - The initial count of releases signaled. - The maximum count of release signaled. - The maximum time [ms] needed to react to interrupts. - - - - Blocks if no release is signaled or removes a release signal. Enter a critical section. - In theory, this method is often called P() [Dijkstra, dutch: passeeren] - - This member is thread-safe. - - - - Blocks if no release is signaled or removes a release signal. Enter a critical section. - In theory, this method is often called P() [Dijkstra, dutch: passeeren] - - The maximum blocking time. Usually an Exceptions is thrown if a timeout exceeds. - This member is thread-safe. - - - - Signals a release and allows a blocked thread to continue. Leave a critical section. - In theory, this method is often called V() [Dijkstra, dutch: vrijgeven] - - This member is thread-safe. - - - - Don't forget to dispose this object before destruction. - - - - - Typemock Isolator Natural Mocks™ RecordExpectations class helps define the mocked expectations - - - - Typemock Isolator supports the innovative Natural Mocks™ way of defining expectations by recording the expectations. - Natural Mocks™ are Strongly Typed and thus supports Compile Time Checks and Refactoring. - Using Natural Mocks™ it is now much simpler to define and create tests that require isolating other parts of the code. - Although the Natural Mocks™ is easier, it does not cover all the scenarios, and the normal TyepMock.NET way is required. - The two way are compatible and can be used together. - - - - Example of using Natural Mocks™ - - [Test] - public void Test() - { - // Start mocking - using (RecordExpectations recorder = RecorderManager.StartRecording()) - { - // CAUTION: ALL calls here are mocked!!! - // MyMethod will be mocked. - TestedClass.MyMethod(10); - } - - // run our code, This will be mocked - TestedClass.MyMethod(10); - MockManager.Verify(); - } - - - ' Visual Basic .NET 2.0 - <Test()> _ - Public Sub Test() - ' Start mocking - Using recorder As New RecordExpectations - ' CAUTION: ALL calls here are mocked!!! - ' MyMethod will be mocked. - TestedClass.MyMethod(10) - End Using - - ' run our code, This will be mocked - TestedClass.MyMethod(10) - MockManager.Verify() - End Sub - - - ' Visual Basic .NET 1.1 - <Test()> _ - Public Sub Test() - ' Start mocking - Dim recorder As New RecordExpectations - ' CAUTION: ALL calls here are mocked!!! - Try - ' MyMethod will be mocked. - TestedClass.MyMethod(10) - Finally - recorder.Dispose() - End Try - - ' run our code, This will be mocked - TestedClass.MyMethod(10) - MockManager.Verify() - End Sub - - - - See and to return different values - - - - - - Start a new recording, CAUTION, as long as the recording object is alive ALL methods will be recorded and not called - - - - CAUTION, as long as the recording object is alive ALL methods will be recorded and not called - - - - - Mock a return value - - The mocked return value - Ability to modify mock Behavior - - - - Example of using Natural Mocks™ Return - - [Test] - public void Test() - { - // Start mocking - using (RecordExpectations recorder = RecorderManager.StartRecording()) - { - // CAUTION: ALL calls here are mocked!!! - // MyMethod will be mocked. - TestedClass.MyMethod(); - recorder.Return(5); - } - - // run our code, This will be mocked - int actual = TestedClass.MyMethod(); - Assert.AreEqual(5,actual); - MockManager.Verify(); - } - - - ' Visual Basic .NET 2.0 - <Test()> _ - Public Sub Test() - ' Start mocking - Using recorder As New RecordExpectations - ' CAUTION: ALL calls here are mocked!!! - ' MyMethod will be mocked. - TestedClass.MyMethod() - recorder.Return(5) - End Using - - ' run our code, This will be mocked - Dim actual as Integer = TestedClass.MyMethod() - Assert.AreEqual(5,actual) - MockManager.Verify() - End Sub - - For VB .NET 1.1 see - - - - - - - Set the mocked method to return a mock object with default behavior - - Ability to modify mock Behavior - - The default behavior is: - - All void calls just return - Other Methods will return a default value (0 or null depending on the return type) - Properties will behave like simple properties. - - - - Example of using Natural Mocks™ Return - - [Test] - public void Test() - { - // Start mocking - using (RecordExpectations recorder = RecorderManager.StartRecording()) - { - // CAUTION: ALL calls here are mocked!!! - // MyMethod will be mocked. - TestedClass.MyMethod(); - recorder.ReturnDefaultImplementation(); - } - - // run our code, This will be mocked - int actual = TestedClass.MyMethod(); - Assert.AreEqual(0,actual); - MockManager.Verify(); - } - - - ' Visual Basic .NET 2.0 - <Test()> _ - Public Sub Test() - ' Start mocking - Using recorder As New RecordExpectations - ' CAUTION: ALL calls here are mocked!!! - ' MyMethod will be mocked. - TestedClass.MyMethod() - recorder.ReturnDefaultImplementation() - End Using - - ' run our code, This will be mocked - Dim actual as Integer = TestedClass.MyMethod() - Assert.AreEqual(0,actual) - MockManager.Verify() - End Sub - - For VB .NET 1.1 see - - - - - - - Mock a return value - - Function to perform - Ability to modify mock Behavior - - - - Example of using Natural Mocks™ Do - - [Test] - public void Test() - { - // Start mocking - using (RecordExpectations recorder = RecorderManager.StartRecording()) - { - // CAUTION: ALL calls here are mocked!!! - // MyMethod will be mocked. - TestedClass.MyMethod(); - recorder.Do(delegate(object[] parameters, object context) - { - return 5; - }); - } - - // run our code, This will be mocked - int actual = TestedClass.MyMethod(); - Assert.AreEqual(5,actual); - MockManager.Verify(); - } - - - ' Visual Basic .NET 2.0 - Public Function ReturnValue(ByVal parameters() As Object, ByVal context As Object) As Object - ReturnValue = 5 - End function - End Class - <Test()> _ - Public Sub Test() - ' Start mocking - Using recorder As New RecordExpectations - ' CAUTION: ALL calls here are mocked!!! - ' MyMethod will be mocked. - TestedClass.MyMethod() - recorder.Do(AddressOf ReturnValue) - End Using - - ' run our code, This will be mocked - Dim actual as Integer = TestedClass.MyMethod() - Assert.AreEqual(5,actual) - MockManager.Verify() - End Sub - - For VB .NET 1.1 see - - - - - - - Expect a call and Mock a return value - - The call(s) to be mocked - The mocked return value - Ability to modify mock Behavior - - - - Example of using Natural Mocks™ ExpectAndReturn - - [Test] - public void Test() - { - // Start mocking - using (RecordExpectations recorder = RecorderManager.StartRecording()) - { - // CAUTION: ALL calls here are mocked!!! - // MyMethod will be mocked. - recorder.ExpectAndReturn(TestedClass.MyMethod(),5); - } - - // run our code, This will be mocked - int actual = TestedClass.MyMethod(); - Assert.AreEqual(5,actual); - MockManager.Verify(); - } - - - ' Visual Basic .NET 2.0 - <Test()> _ - Public Sub Test() - ' Start mocking - Using recorder As New RecordExpectations - ' CAUTION: ALL calls here are mocked!!! - ' MyMethod will be mocked. - recorder.ExpectAndReturn(TestedClass.MyMethod(),5) - End Using - - ' run our code, This will be mocked - Dim actual as Integer = TestedClass.MyMethod() - Assert.AreEqual(5,actual) - MockManager.Verify() - End Sub - - For VB .NET 1.1 see - - - - - - - Mock throwing an exception - - The exception to throw when the method has been called - See for an example - Ability to modify mock Behavior - - - - Expect a call and mock throwing an exception - - The call(s) to be mocked - The exception to throw when the method has been called - See for an example - Ability to modify mock Behavior - - - - Expect a call but call the original method - - Ability to modify mock Behavior - - - - Example of using Natural Mocks™ CallOriginal - - [Test] - public void Test() - { - // Start mocking - using (RecordExpectations recorder = RecorderManager.StartRecording()) - { - // CAUTION: ALL calls here are mocked!!! - // MyMethod will be mocked. - TestedClass.MyMethod(); - recorder.CallOriginal(); - } - - // run our code, This will not be mocked but we verify that it was called - TestedClass.MyMethod(); - MockManager.Verify(); - } - - - ' Visual Basic .NET 2.0 - <Test()> _ - Public Sub Test() - ' Start mocking - Using recorder As New RecordExpectations - ' CAUTION: ALL calls here are mocked!!! - ' MyMethod will be mocked. - TestedClass.MyMethod() - recorder.CallOriginal() - End Using - - ' run our code, This will not be mocked but we verify that it was called - TestedClass.MyMethod() - MockManager.Verify() - End Sub - - For VB .NET 1.1 see - - - - - - - Expect a call but call the original method - - The call(s) to be mocked - Ability to modify mock Behavior - - - - Example of using Natural Mocks™ ExpectAndCallOriginal - - [Test] - public void Test() - { - // Start mocking - using (RecordExpectations recorder = RecorderManager.StartRecording()) - { - // CAUTION: ALL calls here are mocked!!! - // MyMethod will be mocked. - recorder.ExpectAndCallOriginal(TestedClass.MyMethod()); - } - - // run our code, This will not be mocked but we verify that it was called - TestedClass.MyMethod(); - MockManager.Verify(); - } - - - ' Visual Basic .NET 2.0 - <Test()> _ - Public Sub Test() - ' Start mocking - Using recorder As New RecordExpectations - ' CAUTION: ALL calls here are mocked!!! - ' MyMethod will be mocked. - recorder.ExpectAndCallOriginal(TestedClass.MyMethod()) - End Using - - ' run our code, This will not be mocked but we verify that it was called - TestedClass.MyMethod() - MockManager.Verify() - End Sub - - For VB .NET 1.1 see - - - - - - - Fail if the call is made - - The call to be mocked - Ability to modify mock Behavior - - - - Example of using Natural Mocks™ FailWhenCalled - - [Test] - public void Test() - { - // Start mocking - using (RecordExpectations recorder = RecorderManager.StartRecording()) - { - // CAUTION: ALL calls here are mocked!!! - // MyMethod cannot be called. - recorder.FailWhenCalled(TestedClass.MyMethod()); - } - - // run our code, This will fail - int actual = TestedClass.MyMethod(); - MockManager.Verify(); - } - - - ' Visual Basic .NET 2.0 - <Test()> _ - Public Sub Test() - ' Start mocking - Using recorder As New RecordExpectations - ' CAUTION: ALL calls here are mocked!!! - ' MyMethod cannot be called. - recorder.FailWhenCalled(TestedClass.MyMethod()) - End Using - - ' run our code, This will fail - Dim actual as Integer = TestedClass.MyMethod() - MockManager.Verify() - End Sub - - For VB .NET 1.1 see - - - - - - - Fail when the last call is made - - Ability to modify mock Behavior - - - - Example of using Natural Mocks™ FailWhenCalled - - [Test] - public void Test() - { - // Start mocking - using (RecordExpectations recorder = RecorderManager.StartRecording()) - { - // CAUTION: ALL calls here are mocked!!! - // MyMethod cannot be called. - TestedClass.MyMethod() - recorder.FailWhenCalled(); - } - - // run our code, This will fail - int actual = TestedClass.MyMethod(); - MockManager.Verify(); - } - - - ' Visual Basic .NET 2.0 - <Test()> _ - Public Sub Test() - ' Start mocking - Using recorder As New RecordExpectations - ' CAUTION: ALL calls here are mocked!!! - ' MyMethod cannot be called. - TestedClass.MyMethod() - recorder.FailWhenCalled() - End Using - - ' run our code, This will fail - Dim actual as Integer = TestedClass.MyMethod() - MockManager.Verify() - End Sub - - For VB .NET 1.1 see - - - - - - - Mock the static constructors of the previously created instance - - - By default, Typemock Isolator automatically mocks the static constructors - of instances created inside recording blocks. - These static constructors are activated either when an un-mocked call - is made on the type in another test, or when a new - un-mocked instance from the type is created. - - - - - Instruct the framework to not mock the static constructor of the previously created instance. - In order to stop mocking of all static constructors, us the DefaultBehavior.MockStaticConstructors - - - - - Assign a new value to the given field on the future created object. - - Referance to the field to be assigned. - The value to assign. - - Show how to assign values to a field during the recording mode and how the value is - reflected on the new object created during the test. - - [Test] - [VerifyMocks] - public void FieldAssignmentNatural() - { - FieldClass replacement = new FieldClass(); - using (RecordExpectations recorder = new RecordExpectations()) - { - //create a mock and assign a future value to the intMember - TestedClass mock = new TestedClass(); - recorder.AssignField(ref mock.classField, replacement); - } - //verify that the replaced value was assigned to the newly created instance - TestedClass target = new TestedClass(); - int actual = target.classField.GetHashCode(); - Assert.AreEqual(replacement.GetHashCode(), actual); - } - - - //VB - <Test(), VerifyMocks() > _ - Public Sub FieldAssignmentNatural() - Dim replacement As new FieldClass - Using recorder As New RecordExpectations - ' CAUTION: ALL calls here are mocked!!! - ' make all future instances mocked - Dim mockedTestedClass As TestedClass = New TestedClass - ' DoSomething to be mocked. - ' always return 10 - recorder.AssignField(ref mock.classField, replacement) - End Using - ' verify that the replaced value was assigned to the newly crated instance - Dim target As New TestedClass - Dim actual As Integer = target.classField.GetHashCode() - Assert.AreEqual(Replacement.GetHashCode, actual) - End Sub - - - - - - Assign a new value to the given field on the future created object. - - Referance to the field to be assigned. - The value to assign. - - Show how to assign values to a field during the recording mode and how the value is - reflected on the new object created during the test. - - [Test] - [VerifyMocks] - public void FieldAssignmentNatural() - { - using (RecordExpectations recorder = new RecordExpectations()) - { - //create a mock and assign a future value to the intMember - TestedClass mock = new TestedClass(); - recorder.AssignField(ref mock.intMember, 7); - } - //verify that the replaced value was assigned to the newly created instance - TestedClass target = new TestedClass(); - Assert.AreEqual(7, target.intMember); - } - - - <Test(), VerifyMocks() > _ - Public Sub FieldAssignmentNatural() - Using recorder As New RecordExpectations - ' CAUTION: ALL calls here are mocked!!! - ' make all future instances mocked - Dim mockedTestedClass As TestedClass = New TestedClass - ' DoSomething to be mocked. - mockedTestedClass.DoSomething() - ' always return 10 - recorder.AssignField(ref mock.intMember, 7) - End Using - ' verify that the replaced value was assigned to the newly crated instance - Dim target As New TestedClass - Assert.AreEqual(7, target.intMember) - End Sub - - - - - - Stop RecordExpectations, all methods will be called or mocked - - - - - See - - - - - See - - list of expected parameters and/or parameter checkers - - - - See - - list of expected parameters and/or parameter checkers - - - - See - - Amount of times to repeat the expectation - Use to change mock Behavior - - - - See - - Use to change mock Behavior - - - - Mock all future instances of the type mocked - - - - - Example of using Natural Mocks™ MockAllInstances, - we will always return 10 when DoSomething is called from any TestedClass instance - - [Test] - public void Test() - { - // Start mocking - using (RecordExpectations recorder = RecorderManager.StartRecording()) - { - // CAUTION: ALL calls here are mocked!!! - // make all future instances mocked - recorder.MockAllInstances = true; - // Mock (all) new instance of TestedClass - TestedClass mockedTestedClass = new TestedClass(); - // DoSomething to be mocked. - mockedTestedClass.DoSomething(); - // always return 10 - recorder.Return(10).RepeatAlways(); - } - } - - - ' Visual Basic .NET 2.0 - <Test()> _ - Public Sub Test() - ' Start mocking - Using recorder As New RecordExpectations - ' CAUTION: ALL calls here are mocked!!! - ' make all future instances mocked - recorder.MockAllInstances = True - ' Mock (all) new instance of TestedClass - Dim mockedTestedClass As TestedClass = New TestedClass - ' DoSomething to be mocked. - mockedTestedClass.DoSomething() - ' always return 10 - recorder.Return(10).RepeatAlways() - End Using - End Sub - - For VB .NET 1.1 see - - - - - - - Change the verify mode of the next expectations - - - - - Change the default Behavior of Natural Mocks™ - - - The default Behavior of Natural Mocks is - - Repeat once (See ) - Ignore Arguments (See ) - - To change this use DefaultBehavior. - This is useful for chained natural mocks where we require the whole chain to be checked. - - - Example of using Natural Mocks™ repeat always, - we will always return 10 when GetSomething().DoSomething() is called from any TestedClass instance - - [Test] - public void Test() - { - // Start mocking - using (RecordExpectations recorder = RecorderManager.StartRecording()) - { - // CAUTION: ALL calls here are mocked!!! - // make all future instances mocked and all statements repeat - recorder.DefaultBehavior.RepeatAlways(); - // Mock (all) new instance of TestedClass - TestedClass mockedTestedClass = new TestedClass(); - // DoSomething to be mocked. - mockedTestedClass.GetSomething().DoSomething(); - // always return 10 - recorder.Return(10); - } - } - - - ' Visual Basic .NET 2.0 - <Test()> _ - Public Sub Test() - ' Start mocking - Using recorder As New RecordExpectations - ' CAUTION: ALL calls here are mocked!!! - ' make all future instances mocked and all statements repeat - recorder.DefaultBehavior.RepeatAlways() - ' Mock (all) new instance of TestedClass - Dim mockedTestedClass As TestedClass = New TestedClass - ' DoSomething to be mocked. - mockedTestedClass.GetSomething().DoSomething() - ' always return 10 - recorder.Return(10) - End Using - End Sub - - For VB .NET 1.1 see - - - - - - - List of mocked events. - - When more than one instance of the event published is mocked, use the MockedEvent.[index] property. - The first instance to register to the event will be in index 0, the next instance in 1 and so on. - - - - - Since Version 3.7 - - - - - Return the number of mocked events in the list - - - - - Get an that was previously registers. - - The first instance to register to the event will be in index 0, the next instance in 1 and so on. - - The index of the to retrieve - The - - - - IMockedEvent is the Typemock Isolator Event Mocking mechanism, used to fire events to test Event driven applications. - - - - When one instance of the event publisher is mocked, use MockedEvent. - to fire the event. - - [Test] - public void SimulateFiringClick() - { - // Mock the Click Event of the next Button - Mock mockButton = MockManager.Mock(typeof(Button)); - MockedEvent handler = mockButton.ExpectAddEvent("Click"); - - // Create the button and register to the Event - Button button = new(Button); - button.Click += new EventHandler(button_Click); - - // Simulate firing the event - handler.Fire(this, EventArgs.Empty); - // Check that system works... - - MockManager.Verify() - } - - - <Test()> _ - Public Sub SimulateFiringClick() - 'Mock all Click Events of the next Button - Dim buttonMock As Mock = MockManager.Mock(GetType(Button)) - Dim handle As MockedEvent = buttonMock.ExpectAddEvent("Click") - - ' Create the button and register to the Event - Dim button As Button = New Button - AddHandler button.Click, AddressOf button_Click - - ' Simulate firing the event - handle.Fire(Me, EventArgs.Empty) - ' Check that system works... - - MockManager.Verify() - End Sub - /// - When more than one instance of the event published is mocked, use the MockedEvent.[index] property - The first instance to register to the event will be in index 0, the next instance in 1 and so on. - - [Test] - public void SimulateFiringClickOnManyButtons() - { - // Mock all Click Events of the all Buttons - Mock buttonMock = MockManager.MockAll(typeof(Button)); - MockedEvent handle = buttonMock.ExpectAddEventAlways("Click"); - - // create 2 buttons and register to the Click Event - Button button1 = new Button(); - Button button2 = new Button(); - button1.Click += new EventHandler(button_Click); - button2.Click += new EventHandler(button_Click); - - // Simulate firing Click of button1 - handle.Instance[0].Fire(this, EventArgs.Empty); - // Simulate firing Click of button2 - handle.Instance[1].Fire(this, EventArgs.Empty); - // Check that system works... - - MockManager.Verify() - } - - - <Test()> _ - Public Sub SimulateFiringClickOnManyButtons() - 'Mock all Click Events of the all Buttons - Dim buttonMock As Mock = MockManager.MockAll(GetType(Button)) - Dim handle As MockedEvent = buttonMock.ExpectAddEventAlways("Click") - - ' create 2 buttons and register to the Click Event - Dim button1 As Button = New Button - Dim button2 As Button = New Button - - AddHandler button1.Click, AddressOf button_Click - AddHandler button2.Click, AddressOf button_Click - - ' Simulate firing Click of button1 - handle.Instance(0).Fire(Me, EventArgs.Empty) - ' Simulate firing Click of button2 - handle.Instance(1).Fire(Me, EventArgs.Empty) - ' Check that system works... - - MockManager.Verify() - End Sub - - - Since Version 3.7 - - - - - Fire a mocked event. See - - Arguments to pass to the mocked event - The return value of the event - - - - Retrieve the EventHandle - - - Using GetEventHandle can help write type-safe tests by casting the EventHandle to the correct Event Type - Example - - EventHandler fire = handle.GetEventHandle() as EventHandler; - fire(this, EventArgs.Empty); - - - Dim fire As EventHandler = handle.GetEventHandle() - fire(Me, EventArgs.Empty) - - - The Event - - - - Create a presentable name from generic types - also replace the name of types we dynamically create with the original type name - - - the clean name - - - - chek to see if type can be assigned a null value - - the given type - true if type can be assigned a null value, false if not - - - - check if there is a method of the given name on this type - (for now will also check for static methods) - - - - true if there is at least one method by that name - - - - check to see if there is a STATIC method on the given type - - the type - the method name - true if there is at least one method method - - - - locate a method with the given name on the type - (for now consider static method as well) - - the given type - the method name - a MethodBase object representing the first found method - if no matching method is found - - - - locate a STATIC method with the given name on the type - - the given type - the method name - a MethodBase object representing the first found method - if no matching method is found - - - - search for a method answering all the given criteria: - name - generic method signature (e.g. SomemMthod[X,Y]) - Matching return type (can be void also) - For now will incldue static method in its search. - - the given type - the method name - the supplied return type - the generic signature list - a MethodBase for a method answering all of the above conditions - if no matching method is found - - - - search for a STATIC method answering all the given criteria: - name - generic method signature (e.g. SomemMthod[X,Y]) - Matching return type (can be void also) - - the given type - the method name - the supplied return type - the generic signature list - a MethodBase for a method answering all of the above conditions - if no matching method is found - - - - Constructs a completely bounded type. - - he given type we need to constructs - the generic arguments from the associated call - the generic arguments from the associated class - a fully binded type - - - - This will return the bounded generic type in which the method is declared - this can either be the type of the context instance, or one of his ancestors types - - the instance on which the call was made - the method call data - The vounded type on which the call was made - - - - This returns the generic arguments of the type associated with the call. - i.e. the bounded type on which the call was issued - - this either contains the instance on which the call was made, - the TypeParams of the class in cases of generic static calls or null (regular static calls) - the call method - - - - - Filter out the methods with matching return types - - - - - Filter out the methods with matching generic signature - - - - - Filter out static methods returning only instance methods - - - - - Filter out instance methods returning only instance methods - - - - - will find the m ethod return type in the generic signature - - - - - return true if the types matches according to our logic: - 1) DynamicReturnValue always match - 2) if user gave a null value we match if the method return type can be assigne da null value - 3) do a smart generic matching bound generic types - 4) unbound generic types always match - - - - - do smart match of for a generic type by comparing the generic type definition - to the generic type definiton of the other class along with his entire class hirarchy or implemented interfaces - - - - - collect all methods on the type any of his base class or implemented interfaces with the given name - - - - - convert the type list into a nice presentable string - - - - - build a smart exception string based on the scenario - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Summary description for AutoUpdater. - - - - - Set next check date - - - - - Run the process - - - - - - Run the process - - - - - - Run the process - - - - - - Start Auto Updater process - - - - - - gets typemock key from registry - 32/64 bit - - - - - - Perform Behavior tweaking on methods rather then the whole mocked type - - - - - - - - Can set one method of the mock to be Strict - - - By default Mocked Types are NOT strict this mean that if a call to a mocked - method was not expected the normal code is executed. - Mocked Types can be made strict and fail if an unexpected call is made - - [Test] - public void Test() - { - // Start mocking TestedClass - Mock mock = MockManager.Mock(typeof(TestedClass)); - TestedClass t = new TestedClass(); - // No expectations, the following will fail because passInt() is - // set to Strict - mock.MethodSettings("passInt").IsStrict = true; - t.passInt(10); - MockManager.Verify(); - } - - - <Test()> _ - Public Sub Test() - { - ' Start mocking TestedClass - Dim mock As Mock = MockManager.Mock(GetType(TestedClass)) - Dim t As TestedClass = New TestedClass - ' No expectations, the following will fail because passInt() is - ' set to Strict - mock.MethodSettings("passInt").IsStrict = True - t.passInt(10) - MockManager.Verify() - End Sub - - - - - - - - Event that is fired after a mocked method is called and after validation is performed - - - - To set an event for all calls see Mock. - - - // This will be called when a mocked method is called - private void SuccessEvent(object sender,MockMethodCallEventArgs e) - { - Assert.AreEqual(typeof(TestedClass),e.CalledType); - Assert.AreEqual("getVar",e.CalledMethodName); - Assert.AreEqual(0,e.SentArguments.Length); - Assert.AreEqual(0,e.ExpectedArguments.Length); - Assert.AreEqual(false,e.WillThrowException); - Assert.AreEqual(null,e.Exception); - Assert.AreEqual(5,e.ReturnValue); - Assert.AreEqual(true,e.HasPassedValidation); - } - [Test] - public void SimpleEventSuccess() - { - Mock mock = MockManager.Mock(typeof(TestedClass),false); - TestedClass t = new TestedClass(); - - mock.ExpectAndReturn("getVar",5); - // set event listener - mock.MethodSettings("getVar").MockMethodCalled += new MockMethodCalledEventHandler(SuccessEvent); - // the event will be called - Assert.AreEqual(5,t.getVar()); - mock.Verify(); - } - - - ' This will be called when a mocked method is called - Public Shared Sub SuccessEvent(ByVal sender As Object, ByVal e As MockMethodCallEventArgs) - Assert.AreEqual(GetType(TestedClass),e.CalledType) - Assert.AreEqual("getVar",e.CalledMethodName) - Assert.AreEqual(0,e.SentArguments.Length) - Assert.AreEqual(0,e.ExpectedArguments.Length) - Assert.AreEqual(False,e.WillThrowException) - Assert.AreEqual(Nothing,e.Exception) - Assert.AreEqual(5,e.ReturnValue) - Assert.AreEqual(True,e.HasPassedValidation) - End Sub - - <Test()> _ - Public Sub SimpleEventSuccess() - Dim t As TestedClass = new TestedClass - Dim mock As Mock = MockManager.Mock(GetType(TestedClass)) - - mock.ExpectAndReturn("getVar",5) - ' set event listener - AddHandler mock.MethodSettings("getVar").MockMethodCalled, AddressOf SuccessEvent - - ' the event will be called - Assert.AreEqual(5,t.getVar()) - mock.Verify() - End Sub - - - - - - - VerifyException is throw when set expectations are not met (see ). - - For example when parameters passed are not the ones we expect. When a method is not called or is called - too often (in Strict mode) - - - - - - VerifyException is throw when a Mocked call is not as expected - - - - - VerifyException is throw when a Mocked call is not as expected - - Reason of exception - - - - VerifyException is throw when a Mocked call is not as expected - - Reason of exception - Inner Exception - - - - For serialization - - The SerializationInfo that holds the serialized object data about the exception being thrown. - The StreamingContext that contains contextual information about the source or destination. - - - - Get only base message - - - - Some Constants used to communicate with weaver. - The name under which we store global types - - - stores all the types that has been mocked. - - - - Adds the type with all its base classes to the mocked list - - The new type that is being mocked - - - - Clear The list from all mocked types - - - - - Determines whether a specific type has been mocked. - - the name of the type - true if the type has been mocked - - - - Determines whether a specific type has been mocked. - - the type to look for - true if the type has been mocked - - - - - TypeParams is a utility class to handle generics - - - - - Internal class to handle constructors - - - - - - Get the System.Type from RuntimeTypeHandle array - - Type[] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - contain the list of all types that their cctor was encountered during - the recording phase and therefore was not activated. - - - - - This class helps strongly type generic method types when using Reflective Mocks - - - Following is an example of using Generic - - - [Test] - public void MockGenericMethod() - { - Mock mock = Mock<MockedClass>.MockNextInstance(); - mock.AlwaysReturn("Method", 11, Generic.Method<int>()); - MockedClass test = new MockedClass(); - Assert.AreEqual(11, test.Method<int>(1)); - } - - - <Test()> _ - Public Sub MockGenericMethod() - Dim mock As Mock = Mock(Of MockedClass).MockNextInstance() - mock.AlwaysReturn("Method", 11, Generic.Method(Of Integer)()); - Assert.AreEqual(11, test.Method(Of Integer)(1)); - End Sub - - - - - - - Define Expectations of Generic Methods with 1 generic parameter - - Method Generic Parameter - Types of generic parameters - - See for an example - - - - - Define Expectations of Generic Methods with 2 generic parameter - - Method Generic Parameter 1 - Method Generic Parameter 2 - Types of generic parameters - - See for an example - - - - - Define Expectations of Generic Methods with 3 generic parameter - - Method Generic Parameter 1 - Method Generic Parameter 2 - Method Generic Parameter 3 - Types of generic parameters - - See for an example - - - - - Define Expectations of Generic Methods with 4 generic parameter - - Method Generic Parameter 1 - Method Generic Parameter 2 - Method Generic Parameter 3 - Method Generic Parameter 4 - Types of generic parameters - - See for an example - - - - - Summary description for StringCheck. - - - - - clear all expectations from table. - - - - - Find if type has expectations. - - The type to look for - true if type has expectations, false otherwise - - - - If type is abstract insert "Mock" at the start of type name. - - - - - - - - Returns the Expectation for the given type. - - The type - The expectation for the type - - - - Returns the Expectation for the given type. - - the name of the type to look for - - - - - Create expectations for the given type - - The type - - - - returns all types that has expectations. - - type array containing list of types that has expectations. - - - - Verify that all expectations in table has been met - - String describing the verify problem, an empty string if all expectations has been met - - - - Verify that all expectations in table has been met - - the timeout in Millisecond - String describing the verify problem, an empty string if all expectations has been met - - - - checks if type has any expectations on it (used to decide if cctor should be invoked) - - the type to check - true if user set an explicit expecation on any of the methods - - - - Initializes a new instance of the ChainManager class. - - - - - Class that contains information about the called instance - - - - - Reference to the mocked object instance, or null if the method is static - - The instance. - - - - Array of parameters passed to mocked method - - The parameters. - - - - Summary description for InternalCheck. - - - - Create a new instance of the MockScope that will activate the mock - verification process on its dispose. - - - - [Test] - void TestMethod1() - { - using (new MockScope()) - { - //The Test code - } - } - - <Test()> _ - Public Sub TestMethod1() - Using Scope As New MockScope - ' The Test code - End Using - End Sub - - - - - - - stores the timeout to pass to verify - - - - Create a new instance of the MockScope that will activate the mock - verification process on its dispose. - - - - [Test] - void TestMethod1() - { - using (new MockScope()) - { - //The Test code - } - } - - <Test()> _ - Public Sub TestMethod1() - Using Scope As New MockScope - ' The Test code - End Using - End Sub - - - - - - - Initializes a new instance of the class, that will call - the VerifyWithTimeout with the given timeout. - - The millisecond timeout. - Create a new instance of the MockScope that will activate the mock - verification process on its dispose. - - - - [Test] - void TestMethod1() - { - using (new MockScope(1000)) - { - //The Test code - } - } - - <Test()> _ - Public Sub TestMethod1() - Using Scope As New MockScope(1000) - ' The Test code - End Using - End Sub - - - - - - Activate the verification process - - - - - Thrown when call was made to a mock object but wasn't registered - see: - - - - - Flags that define the behavior of Arbitrary (not expected) calls. - The default is the Methods of Abstract and Interfaces are Strict and Arbitrary calls fail - while Arbitrary Methods of concrete classes are allowed. - - - When testing for mock interactions there are times when the default behavior needs to be changed, - the StrictFlags define which arbitrary methods we allow. - - When allowing arbitrary abstract methods (methods created dynamically by Typemock Isolator using or ), - Typemock Isolator create the following default behavior: - 1. All void calls just return - 2. Other Methods will return 0 or null depending on the return type - 3. Properties will behave like normal properties - - To set only one method to strict use: or - - - - - - All methods are strict and if an arbitrary method is called the test will fail - This is equivalent to : StrictFlags.InstanceMethods | StrictFlags.StaticMethods - - - - - Instance methods are strict and if an arbitrary instance method is called the test will fail - - - - - Static methods are strict and if an arbitrary static method is called the test will fail - - - - - This is the default. Methods of Abstract classes and Interfaces are Strict and Arbitrary calls fail - while Arbitrary Methods of concrete classes are allowed. - - - - - Methods are not strict and arbitrary methods are allowed - - - - - Scope of Constructors to Mock. see MockManager. - - - .NET code has support for two constructors the first is the normal constructor that is run - every time a new instance is created and the other is the static constructor that is run the - first time the object is referenced too. This constructor sets up all the static fields. - - - - - Both regular constructor and static constructors should be mocked out - - - - - Only regular constructors should be mocked out - - - - - Both Constructors will run as normal and wont be mocked - - - - - MockManager is the Typemock Isolator manager class, this class is the entry point - for creating type mocks - - - - Mock object tests replace domain dependencies with mock implementations used only - for testing. This strategy does, however, present a technical challenge in certain - situations, as the Mock objects can only mock interfaces, and these mocks have to - be passed to the function, so no internal instantiation of classes can be mocked - - - Typemock Isolator to provide "type" mock objects. No concrete mock objects are - actually created, but rather Typemock Isolator is used to weave interceptions into - all code that is not part of the class under test. In this way, every method call - is intercepted. If the method call is one for which mock data has been declared, - then that mock data is returned in place of the actual method being run. - - For example a LoginView (the class being tested) which as properties of userID and - password that are set prior to calling a validate method. Following that call, the - status attribute will be set to a string value that is ultimately displayed to the - user. The LoginView is responsible for interpreting the status code - (USER_VALID, NO_PASSWORD, NO_USERID, INVALID_USER) that is returned from an - AccessController, to determine the status message to display. - - - - public string Validate() - { - AccessController controller = new AccessController(); - AccessStatus status = controller.Login(m_UserID,m_Password); - switch (status) - { - case USER_VALID: - ... - } - return returnStatus; - } - - - Public Function Validate() As String - Dim controller As AccessController = New AccessController - Dim status As AccessStatus = controller.Login(m_UserID,m_Password) - Select Case status - Case USER_VALID - ... - End Select - Validate = returnStatus - } - { - - - However, the LoginView class makes use of the login service provided by the - AccessController class. The AccessController will probably itself - use other components to authenticate the user. For the tests to work it would - be necessary to create some test users in the system. The tests that were written - to test the behavior of LoginView would in fact also be testing the - AccessController, which should of course have its own suite of tests. - - - The behavior we are trying to test here is to determine that the user gets the - correct status message for the different cases of invalid or missing user - credentials returned by the AccessController and not the actual validation of - those credentials. - - - Using Typemock Isolator We can intercept the AccessController and - return our own value - - - [Test] - public void ValidateValidUser() - { - //Mock all invocation of AccessController, all calls to this class, are - //intercepted. - Mock mock = MockManager.Mock(typeof(AccessController)); - - //We expect that the login method will be called (once) and we will return - //AccessStatus.INVALID_USER. - mock.ExpectAndReturn("Login", AccessStatus.INVALID_USER); - - LoginView view = new LoginView(); - view.setUserID("jane"); - view.setPassword("passAugust"); - // run the method being tested - view.Validate(); - Assert.AreEqual("login successful", view.Status); - - // Verify that all the expected calls have actually been called. - MockManager.Verify(); - } - - - <Test()> _ - Public Sub ValidateValidUser() - ' Mock all invocation of AccessController, all calls to this class, are - ' intercepted. - Dim mock As Mock = MockManager.Mock(GetType(AccessController)) - - ' We expect that the login method will be called (once) and we will return - ' AccessStatus.INVALID_USER. - mock.ExpectAndReturn("Login", AccessStatus.INVALID_USER) - - Dim view As LoginView = New LoginView - view.setUserID("jane") - view.setPassword("passAugust") - ' run the method being tested - view.Validate() - Assert.AreEqual("login successful", view.Status) - - ' Verify that all the expected calls have actually been called. - MockManager.Verify() - End Sub - - - - - To enable mock manager do one of the following - - - Run mocking_on.bat - - - Run Typemock Isolator [application] - - - Enable Visual Studio Plugin - - - - - - - - Strong Name for Typemock Isolator Dynamic Objects can be used when mocking internal interfaces - Use for [assembly: InternalsVisibleTo(MockManager.DynamicMocksAssembly)] - This will work for both regular and signed assemblies - When you don't want to reference TypeMock.dll use the following: - [assembly: InternalsVisibleTo("DynamicMockAssembly,PublicKey=0024000004800000940000000602000000240000525341310004000001000100ab8e3015b99a732d20ecb2a29fb3f54288a8a614896e7c5091d7b9045368fe6b8bfcc72dce4f01b71281eb4e380dcb709c83a5042a54c684a4711248c078fefb01bcdb09a6ce252e0304ed08c6e4ddf69212e3d0a770d953572e3c474fc08fe3bdbb2fad97b32c6045c08f34466dc8e07bd255d3dbc72408dce6859edb4b04bf")] - - - - mean that we are in the implementation of the decoration code - - - - - Disallow creation on instance - - - - - Stores all classes (with all inheriteance hirarchy) that user has requested to mock. - - - - - Stores counters for all method calls - - - - - Stores counter for all method calls in the form of MethodBase - - - - - Stores All expectations - - - - - - Initialize the MockManager - This is called automatically - - Defaults to collect call information ONLY for mocked classes - - - - - Defaults to collect call information ONLY for mocked classes and - not verbose - - - - - Manually set Call Collection and verbose behaviors - - if set, Typemock Isolator collects call information - for all classes, this can later be verified using - - - - Clears all expectations and mocks - - - There are times when you want to clear all the expectations of all the mocks. - For example, if you call in the [TearDown] method, but a - test failed and you don't want to Verify to cause more test failures. - - This is called automatically after . - (unless is DontClear - - - - - - Create a new Mock to intercept and mock calls made on the next instance of a type. - - - The Type needed to be mocked - New Mock Controller to register expectations - Will be throw if an Interface or Abstract Class is - being Mocked, and if a type is being Mocked twice - - Automatically mock constructors as well, i.e. constructer code will NOT be called - - - - - Create a new Type Mock to intercept and mock calls made on the next instance of a type, - with ability to decide if Constructors should be mocked or not (default is to mock constructors) - - The Type needed to be mocked - Should constructors be mocked - New Mock Object to control expectations - Will be throw if an Interface or Abstract Class is - being Mocked, if a type is being Mocked twice, or if mocking restricted types (NUnit,TypeMock) - Will be throw if MockManager is not Initialized - - - - - Create a new Type Mock to intercept and mock calls made on the next instance of a type, - with ability to define the scope of mocked Constructors (default is to mock all constructors) - - The Type needed to be mocked - Scope of constructors to be mocked - New Mock Controller to register expectations - Will be throw if an Interface or Abstract Class is - being Mocked, if a type is being Mocked twice, or if mocking restricted types (NUnit,TypeMock) - - - - - Create a new Mock to intercept and mock all calls made on all instances of the mocked type. - - - Each Type can be mocked only once. There is actually no need to mock a type more than once, - all new objects are mocked as well. - - - The Type needed to be mocked - New Mock Controller to register expectations - Will be throw if an Interface or Abstract Class is - being Mocked, and if a type is being Mocked twice - - Automatically mock constructors as well, i.e. constructer code will NOT be called - - - - - Create a new Type Mock for all instances of the type, with ability to decide if Constructors should be mocked or not - - The Type needed to be mocked - Should constructors be mocked - New Mock Object - Will be throw if an Interface or Abstract Class is - being Mocked, if a type is being Mocked twice, or if mocking restricted types (NUnit,TypeMock) - - - - Create a new Type Mock for all instances of the type, with ability to to define the scope of mocked Constructors (default is to mock all constructors) - - The Type needed to be mocked - Scope of mocked constructors - New Mock Controller to register expectations - Will be throw if an Interface or Abstract Class is - being Mocked, if a type is being Mocked twice, or if mocking restricted types (NUnit,TypeMock) - - - - Intercept and mock calls made on the next new instance of TMockedType. - - Mock Controller to define behavior - - The Constructor will be mocked!. - - - [Test] - public void MockTestedClass() - { - Mock mock = MockManager.Mock<TestedClass>(); - mock.ExpectCall("SomeMethod"); - - TestedClass test = new TestedClass(); // This instance is mocked - test.SomeMethod(); // the method is not called - - MockManager.Verify(); // Make sure that all expected calls where made - } - - - <Test()> _ - Public Sub MockTestedClass() - Dim mock As Mock = MockManager.Mock(Of TestedClass)() - mock.ExpectCall("SomeMethod") - - Dim test As TestedClass = New TestedClass ' This instance is mocked - test.SomeMethod() ' the method is not called - - MockManager.Verify() ' Make sure that all expected calls where made - End Sub - - - - - - - - Intercept and mock calls made on the next new instance of TMockedType, with constructor behavior control - - Scope of constructors to be mocked - Mock Controller to define behavior - - - - - - - Intercept and mock calls made on the all instance of TMockedType. - - Mock Controller to define behavior - - The Constructor will be mocked! - - - [Test] - public void MockTestedClass() - { - Mock mock = MockManager.MockAll<TestedClass>(); - mock.AlwaysExpect("SomeMethod"); - - TestedClass test = new TestedClass(); // all instances are mocked - test.SomeMethod(); // the method is not really called - - MockManager.Verify(); // Make sure that all expected calls where made - } - - - <Test()> _ - Public Sub MockTestedClass() - Dim mock As Mock = MockManager.MockAll(Of TestedClass)() - mock.AlwaysExpect("SomeMethod") - - Dim test As TestedClass = New TestedClass ' all instances are mocked - test.SomeMethod() ' the method is not really called - - MockManager.Verify() ' Make sure that all expected calls where made - End Sub - - - - - - - - Intercept and mock calls made on the all instance of TMockedType, with constructor behavior control - - Scope of constructors to be mocked - Mock Controller to define behavior - - - - - - - Check if a type is mocked (with MockAll or instance mocks) - - Type to check - true when the type is mocked - - - - - - - - - - Check if a type is mocked for all instances - - Type to check - true when the type is mocked for all instances - - - - - - - - - - - Returns the mock for all instances of a type, or null if it is not mocked - - Type to return the mock - The mock - - - - - - - - - - - - Returns all mocks for TMockedType - - Type being mocked - The Mocks - - - - - Returns the mock associated with a specific instance - - Type of the instance being mocked - The instance to get the mock of - If a Mock is associated with the provided instance, returns it. Otherwise, returns null - - Identify a specific mock when using Natural Mocks - - [Test] - public void GetMockOfSpecificInstance() - { - using(RecordExpectations rec = RecorderManager.StartRecording()) - { - TestClass instance1 = new TestClass(); - TestClass instance2 = new TestClass(); - TestClass instance3 = new TestClass(); - - Mock mock2 = MockManager.GetMockOf(instance2); - mock2.ExpectAndReturn("SomeMethod", null); - } - } - - - - - - Returns all instance mocks for TMockedType - - Type being mocked - The Mocks - - - - - Returns all instances mock of TMockedType - - Type being mocked - The Mock - - - - - Check if a type is mocked (with MockAll or instance mocks) - - Type being mocked - true when the type is mocked - - - - - Check if a type is mocked for all instances - - Type being mocked - true when the type is mocked for all instances - - - - - Returns all mocks for a type - - Type to return the mock - The mock - - - - - - - - - - - - Returns all mocks - - All the mocks - - You can use Mock. to analyse what type is being mocked - - - - - - - - - - - Returns all types that are mocked - - List of mocked types - - - - - - - - - - - Returns a list of instance mocks of a type - - Type to return the instance mocks - Array of mocks - - - - - - - - - - - Create a new Dynamic Mock Object and mock all future calls made on the mocked type. - - - When mocking Interfaces and Abstract classes a new class is created, for concrete classes, a class is instantiated - - - Mocked Objects are Strict by default, unless they are concrete classes - - - Example of using Typemock Isolator to create a mock object for IList - - - [Test] - public void ValidateValidUser() - { - //Create new Mock Object for IList, all calls to this class, are - //intercepted. - MockObject mock = MockManager.MockObject(typeof(IList)); - - // We expect that the Count parameter will be called (once) and we will return 4 - mock.ExpectGet("Count", 4); - // Get our mocked OBJECT - IList list = mock.Object as IList; - - // lets just run it, normally the Object will be passes as a parameter to a tested class - Assert.AreEqual(4, list.Count); - - // Verify that all the expected calls have actually been called. - MockManager.Verify(); - } - - - <Test()> _ - Public Sub ValidateValidUser() - ' Create new Mock Object for IList, all calls to this class, are - ' intercepted. - Dim mock As MockObject = MockManager.MockObject(GetType(IList)) - - ' We expect that the Count parameter will be called (once) and we will return 4 - mock.ExpectGet("Count", 4) - ' Get our mocked OBJECT - Dim list As IList = mock.Object - - ' lets just run it, normally the Object will be passes as a parameter to a tested class - Assert.AreEqual(4, list.Count) - - ' Verify that all the expected calls have actually been called. - MockManager.Verify() - End Sub - - - - - The Type needed to be mocked - Argument for constructor of concrete types, this is ignored for interfaces - New MockObject Object - - Automatically mock constructors as well, i.e. constructer code will NOT be called - - - - - Create a new Dynamic Mock Object with ability to decide if Constructors should be mocked or not - - The Type needed to be mocked - Should constructors be mocked - New MockObject Object - Will be throw if a Generic Type Class is - being Mocked - - - - - Create a new Dynamic Mock Object with ability to define the scope of mocked Constructors (default is to mock all constructors) - - The Type needed to be mocked - Scope of mocked constructors - Argument for constructor of concrete types, this is ignored for interfaces - New MockObject Object - Will be throw if a Generic Type Class is - being Mocked - - - - Create an instance of TMockedType and mock calls made on the instance. - - Mock Controller to define behavior - - The Constructor will be mocked!. - - To activate the constructor and send specific arguments use - - - - [Test] - public void MockTestedClass() - { - MockObject<TestedClass> mockControl = MockManager.MockObject<TestedClass>.Create(); - mockControl.ExpectCall("SomeMethod"); - - TestedClass mockedInstance = mockControl.Object; // grab actual instance - mockedInstance.SomeMethod(); // the method is not called - - MockManager.Verify(); // Make sure that all expected calls where made - } - - - <Test()> _ - Public Sub MockTestedClass() - Dim mockControl As MockObject(Of TestedClass) = MockManager.MockObject(Of TestedClass)() - mockControl.ExpectCall("SomeMethod") - - Dim mockedInstance As TestedClass = mockControl.Object ' grab actual instance - mockedInstance.SomeMethod() ' the method is not called - - MockManager.Verify() ' Make sure that all expected calls where made - End Sub - - - - - - - - Create an instance of TMockedType and mock calls made on the instance, while controlling the constructor - - Scope of mocked constructors - Mock Controller to define behavior - - For an example see - - - - - - Create an instance of TMockedType and mock calls made on the instance, while sending constructor arguments - - Argument for constructor of concrete types, this is ignored for interfaces - Mock Controller to define behavior - - For an example see - - - - - - Create an instance of TMockedType and mock calls made on the instance, while controlling the constructor and sending constructor arguments - - Scope of mocked constructors - Argument for constructor of concrete types, this is ignored for interfaces - Mock Controller to define behavior - - For an example see - - - - - - Same as MockObject but doesn't check for mocked while locked - - - - - - - - - Use this type when mocking global functions - - - This is an example of how to mock global functions in C++ - - - // Managed C++ - namespace TestWithCpp - { - int globalFunction(int a) {return a;} - } - - And the test - - // Managed C++ - [Test] - void Global() { - Mock* mock = MockManager::MockGlobalFunctions(); - // Notice the '.' and NOT '::' !!! - mock->ExpectAndReturn("TestWithCpp.globalFunction",__box(5)); - Assert::AreEqual(__box(5), __box(globalFunction(4))); - } - - - - New Mock Object - - - - Verify all mocked types - - - Part of Test Driver Development and Mock Methodology is being sure that ALL our - expected calls where actually called. This should always be the final part of the test - If some methods that we expected to be called where not called this will fail the test. - - Using we can also define, that calls to methods that where - not expected, will fail the test too. - - - Mocked static members are verified only when the last instance of a type is Verified. - - - - - - Wait with timeout (5 seconds) for all expected methods to be called - - - VerifyWithTimeout will wait for all expectations to be called. If the Timeout is triggered - the test will fail. - Part of Test Driver Development and Mock Methodology is being sure that ALL our - expected calls where actually called. There are cases when mocks are called in a-synchronic - code or are encapsulated in a try catch block and errors are not thrown to testing method. - In these cases using VerifyWithTimeout will enable us to validate our code and return as soon as - the expected methods are called without needing to add Pause statements - - - - [Test] - public void TestCallsInOtherThread () - { - // Let mock the product - it will not mock constructors; - Mock productMock = MockManager.Mock(typeof(Product),Constructor.NotMocked); - // CalculatePrice will return 10 - expect 10 as argument - productMock.ExpectAndReturn("CalculatePrice",10F).Args(10); - // our method will be called in a new thread - Thread theThread = new Thread(new ThreadStart(RunWithWait)); - theThread.Start(); - // If we use Verify we dont know when the thread will actually be called - // Here we WAIT for the mocked methods to be called, or the timeout. - // Default timeout is 5000 milliseconds - MockManager.VerifyWithTimeout(); - } - - - <Test()> _ - Public Sub TestCallsInOtherThread() - ' Let mock the product - this will mock the next invocation of Product, - ' it will mock constructors too so our price will be 0 - Dim productMock As Mock = MockManager.Mock(GetType(Product), Constructor.NotMocked) - ' CalculatePrice will return 10 - expect 10 as argument - productMock.ExpectAndReturn("CalculatePrice", 10.0F).Args(10) - ' our method will be called in a new thread - Dim theThread As Thread = New Thread(AddressOf RunWithWait) - theThread.Start() - ' If we use Verify we dont know when the thread will actually be called - ' Here we WAIT for the mocked methods to be called, or the timeout. - ' Default timeout is 5000 milliseconds - MockManager.VerifyWithTimeout() - End Sub - - - - - - - Wait with timeout (im milliseconds) for all expected methods to be called - - - VerifyWithTimeout will wait for all expectations to be called. If the Timeout is triggered - the test will fail. - Part of Test Driver Development and Mock Methodology is being sure that ALL our - expected calls where actually called. There are cases when mocks are called in a-synchronic - code or are encapsulated in a try catch block and errors are not thrown to testing method. - In these cases using VerifyWithTimeout will enable us to validate our code and return as soon as - the expected methods are called without needing to add Pause statements - - - - [Test] - public void TestCallsInOtherThread () - { - // Let mock the product - it will not mock constructors; - Mock productMock = MockManager.Mock(typeof(Product),Constructor.NotMocked); - // CalculatePrice will return 10 - expect 10 as argument - productMock.ExpectAndReturn("CalculatePrice",10F).Args(10); - // our method will be called in a new thread - Thread theThread = new Thread(new ThreadStart(RunWithWait)); - theThread.Start(); - // If we use Verify we dont know when the thread will actually be called - // Here we WAIT 1000 milliseconds for the mocked methods to be called, or the timeout. - MockManager.VerifyWithTimeout(1000); - } - - - <Test()> _ - Public Sub TestCallsInOtherThread() - ' Let mock the product - this will mock the next invocation of Product, - ' it will mock constructors too so our price will be 0 - Dim productMock As Mock = MockManager.Mock(GetType(Product), Constructor.NotMocked) - ' CalculatePrice will return 10 - expect 10 as argument - productMock.ExpectAndReturn("CalculatePrice", 10.0F).Args(10) - ' our method will be called in a new thread - Dim theThread As Thread = New Thread(AddressOf RunWithWait) - theThread.Start() - ' If we use Verify we dont know when the thread will actually be called - ' Here we WAIT 1000 milliseconds for the mocked methods to be called, or the timeout. - MockManager.VerifyWithTimeout(1000) - End Sub - - - - Time to wait for all expected methods to be called - - - - Stops Type Mock Insertion, this is called from - - - - - Return the amount of times a method has been called - - - Can be used as part of a validation. - - In the following example we validate that the doSomething() Method has been called 3 times, - while keeping the original functionality (not mocked) - - - [Test] - public void Test() - { - // init collecting on - MockManager.Init(true); - TestedClass t = new TestedClass(); - t.doSomething(); - t.doSomething(); - t.doSomething(); - Assert.AreEqual(3,MockManager.CalledCounter("TestClassLibrary.TestedClass","doSomething")); - } - - - <Test()> _ - Public Sub Test() - ' init collecting on - MockManager.Init(true) - Dim t As TestedClass = New TestedClass - t.doSomething() - t.doSomething() - t.doSomething() - Assert.AreEqual(3,MockManager.CalledCounter("TestClassLibrary.TestedClass","doSomething")) - End Sub - - For Properties and Indexers see , - and - - Calls from Types of the System.* namespace will not be collected until the type is mocked - - - String representation of Type - String representation of Method - Number of times the method has been called - - - - Return the amount of times a method has been called - - The type we want count one of its methods - String representation of Method - Number of times the method has been called - - - - Return the amount of times a method has been called - - The type we want count one of its methods - String representation of Method - Generic parameters list of the method - Number of times the method has been called - - - - Return the amount of times a method has been called - - - String representation of Method - Number of times the method has been called - - - - Return the amount of times a method has been called - - - String representation of Method - Generic parameters list of the method - Number of times the method has been called - - - - Return the amount of times a property has been called - - - See - - String representation of Type - String representation of the Property - Number of times the property has been called - - - - Return the amount of times a property has been set - - - See - - String representation of Type - String representation of the Property - Number of times the property has been set - - - - Return the amount of times an indexer has been called - - - See - - String representation of Type - Number of times the indexer has been called - - - - Part of Message and message will concatenated in "About" in order - to show user exact message - - - - - - - Part of Message and message will concatenated in "About" in order - to show user exact message - - - - - - - - Part of Message and message will concatenated in "About" in order - to show user exact message - - - - - - - Return Typemock Isolator version - - - - - Obsolete, use running options instead, - When set Typemock Isolator creates a log-file - - - Creates a log-file called TypeMock.out in the application directory - This is mainly for debugging Typemock Isolator itself, it is also possible to set the TMOCK_VERIFY environment - variable to 1, before running the executable - The log-file logs the code weaving process - - - - - When set Typemock Isolator collects data on ALL method entries, this can then be verified - using - - - - - Check if Typemock Isolator is initialized - - - - - Obsolete. Argument validation is now done both on calling the method and during Verify automatically. - Postpone throwing validation errors till is called - - - Using ValidateArgsOnVerify, validation errors are thrown after Verify is called. - This is useful if the validation is done in another thread and you want the thread to continue. - When Verify is called all argument validations are shown too. - - The flag will be deleted in future - - - - Obsolete, use Check. instead, - Provided for backward compatibility - - - - - - If CONTINUE_WITH_METHOD is returned the mocked method will continue with - normal execution. This is an un-mocked expectation that will verify that a method is called only - without mocking the method. - - Using handling ref and out parameters in un-mocked mode is tricky as the method is run as normal. See - - - - - Connect to Tracer. These API's might change do not use. - - - - - Internal Tracer Class that communicates with the Tracer GUI. - - - - - Return id Trace client is running - this is used internally and might change without notice - - - - - - Internal use only. - Used as a remotable tracer object. The tracer will create this object and we will send - our data through it. - - - - - Send data to the server. - - - - - - This event must be setup to work. - - - - - Has Server Loaded. - - - - - Used to hook Tracer (Server) - - - - - - - This is to wrap all classes and use our own Hash code. - Or else it might lead to stack overflow - - - - - returns the mocked object instance - - - - - This is to wrap all classes and use our own Hash code. - Or else it might lead to stack overflow - - - - - returns the mocked object instance - - - - - Expectations handles the instance and static and mock all - This is really a TypeExpectations - - - - - Check if method is in the expectation table - - - - - for static constructors - - - - - - Check Parameters and return mocked value - - - - - Verify mocked type - - - - - Find the mock object that was created during the recording of the given mock object - - - - - - - should be true only if MockAll behavior has been set for a struct through AAA - - - - - This delegate is called when a method call is detected. Its implementation can be a filter that - decides whether the method call will be intercepted, not intercepted, or analyzed by Isolator - - - - - This delegate is called after a method has been intercepted. Its implementation can be a filter - that decides how to handle the call: return a custom value, throw an exception, skip the method - altogether, or let Isolator decide - - - - - Summary description for About. - - - - - Clean up any resources being used. - - - - - Required method for Designer support - do not modify - the contents of this method with the code editor. - - - - - Arguments received in custom parameter checker see ( - - - - - - Value of the argument passed to method - - - - - Position of the argument in the called method - - - - - The Message to display if check fails - - - - - Type in which the method was called from - - - - - Name of method that was called - - - - - Expected value - set only when is used - - - This property is set when is used. - - - - - - Default message prefix that can be added to the - - - The message is: Call to [namespace.method] Parameter: [number] - - - - - Delegate to implement a custom parameter checker - - - Typemock Isolator validates parameter values, collections and arrays automatically - there are some cases where this is not enough and a custom checker is needed, - to do so create a check delegation and pass it as a parameter - to Args see and - - - For example, if we need to check that an int parameter is larger then 10 - we can write the following code - - public static bool CheckRange(ParameterCheckerEventArgs data) - { - return (int)data.ArgumentValue > 10; - } - - - Public Shared Function CheckRange(ByVal data As ParameterCheckerEventArgs) As Boolean - CheckRange = data.ArgumentValue > 10; - End Function - - We can then use it in out test - - [Test] - public void Test() - { - TestedClass t = new TestedClass(); - // Start mocking TestedClass - Mock mock = MockManager.Mock(typeof(TestedClass)); - // passInt will be called, arguments must agree with MyChecker - mock.ExpectAlways("passInt").Args(new ParameterCheckerEx(CheckRange)); - // This will pass - t.passInt(16); - // This will fail - t.passInt(3); - MockManager.Verify(); - } - - - <Test()> _ - Public Sub Test() - Dim t As TestedClass = new TestedClass - ' Start mocking TestedClass - Dim mock As Mock = MockManager.Mock(GetType(TestedClass)) - ' passInt will be called, arguments must agree with MyChecker - mock.ExpectAlways("passInt").Args(New ParameterCheckerEx(AddressOf CheckRange)) - // This will pass - t.passInt(16) - // This will fail - t.passInt(3) - MockManager.Verify() - } - - - - See for built in ParameterCheckers - See Check. to pass an object to the delegate - - - - Data of real parameter value that was passed to the mocked method - True for parameter values that are expected - - - - This might become Obsolete, please use ParameterCheckerEx. Delegate to implement a custom parameter checker - - - Typemock Isolator validates parameter values, collections and arrays automatically - there are some cases where this is not enough and a custom checker is needed, - to do so create a check delegation and pass it as a parameter - to Args see and - - - For example, if we need to check that an int parameter is larger then 10 - we can write the following code - - public static bool CheckRange(object parameter) - { - return (int)parameter > 10; - } - - - Public Shared Function CheckRange(ByVal parameter As Object) As Boolean - CheckRange = parameter > 10; - End Function - - We can then use it in out test - - [Test] - public void Test() - { - TestedClass t = new TestedClass(); - // Start mocking TestedClass - Mock mock = MockManager.Mock(typeof(TestedClass)); - // passInt will be called, arguments must agree with MyChecker - mock.ExpectAlways("passInt").Args(new ParameterChecker(CheckRange)); - // This will pass - t.passInt(16); - // This will fail - t.passInt(3); - MockManager.Verify(); - } - - - <Test()> _ - Public Sub Test() - Dim t As TestedClass = new TestedClass - ' Start mocking TestedClass - Dim mock As Mock = MockManager.Mock(GetType(TestedClass)) - ' passInt will be called, arguments must agree with MyChecker - mock.ExpectAlways("passInt").Args(New ParameterChecker(AddressOf CheckRange)) - // This will pass - t.passInt(16) - // This will fail - t.passInt(3) - MockManager.Verify() - End Sub - - - - See for built in ParameterCheckers - - - - The real parameter value that was passed to the mocked method - True for parameter values that are expected - - - - - - - - - - - - - - - Delegate to implement a custom return value - - - Typemock Isolator allows you to specify mocked return values for mocked methods. - These values are normally hard coded, but - there are some cases where this is not enough and a custom return value is needed, - to do so create a delegation method and pass it as the return value to - one of the setup methods - - - For example, if we need to return the first int parameter of a mocked method, but throw an exception - if the value is 0, we can write the following code - - public static object MyReturnValue(object[] parameters, object context) - { - if ((int)parameters[0]==0) - { - throw new Exception(); - } - return parameters[0]; - } - - - Public Shared Function MyReturnValue(ByVal parameters() As Object, ByVal that As Object) As Object - If parameters(0)=0 Then - Throw New Exception - End If - MyReturnValue = parameters(0) - End Function - - We can then use it in our test - - [Test] - public void Test() - { - // Start mocking TestedClass - Mock mock = MockManager.Mock(typeof(TestedClass)); - // getInt will be called, it will return our dynamic values - mock.AlwaysReturn("getInt",new DynamicReturnValue(MyReturnValue)); - TestedClass t = new TestedClass(); - // This will pass - Assert.AreEqual(10,t.getVar(10)); - // so will this - Assert.AreEqual(1,t.getVar(1)); - // this will throw an exception - t.getVar(0); - MockManager.Verify(); - } - - - <Test()> _ - Public Sub Test() - ' Start mocking TestedClass - Dim mock As Mock = MockManager.Mock(GetType(TestedClass)) - ' getInt will be called, it will return our dynamic values - mock.AlwaysReturn("getInt",New DynamicReturnValue(AddressOf MyReturnValue)) - Dim t As TestedClass = New TestedClass() - ' This will pass - Assert.AreEqual(10,t.getVar(10)) - ' so will this - Assert.AreEqual(1,t.getVar(1)) - ' this will throw an exception - t.getVar(0) - MockManager.Verify() - End Sub - - - - - BEWARE, Typemock Isolator does not check the legitimacy of the returned value, if you - return a value with the wrong type a System.InvalidCastException will be - thrown - - - BEWARE, All code that is run inside the delegate is NOT mocked. - thrown - - - To continue with the original method without mocking, return - - - You can use DynamicReturnValue to change ref and out parameters - Just change the values of the parameters array and if the parameter is referenced it will change its - value. Again Typemock Isolator does not check the legitimacy of the value. - - - array of parameters passed to mocked method - a reference to the mocked object instance, or null if the method is static - custom return value - If return a value of the wrong type - - - - Event that is fired after a mocked method is called and after validation is performed - - The Mocked Object or null is the method called is static - Event Method - - The following example will setup Typemock Isolator to call SuccessEvent after each call to a mocked - method. - - - // This will be called when a mocked method is called - private void SuccessEvent(object sender,MockMethodCallEventArgs e) - { - Assert.AreEqual(typeof(TestedClass),e.CalledType); - Assert.AreEqual("getVar",e.CalledMethodName); - Assert.AreEqual(0,e.SentArguments.Length); - Assert.AreEqual(0,e.ExpectedArguments.Length); - Assert.AreEqual(false,e.WillThrowException); - Assert.AreEqual(null,e.Exception); - Assert.AreEqual(5,e.ReturnValue); - Assert.AreEqual(true,e.HasPassedValidation); - } - [Test] - public void SimpleEventSuccess() - { - Mock mock = MockManager.Mock(typeof(TestedClass),false); - TestedClass t = new TestedClass(); - - mock.ExpectAndReturn("getVar",5); - // set event listener - mock.MockMethodCalled += new MockMethodCalledEventHandler(SuccessEvent); - // the event will be called - Assert.AreEqual(5,t.getVar()); - mock.Verify(); - } - - - - ' This will be called when a mocked method is called - Public Shared Sub SuccessEvent(ByVal sender As Object, ByVal e As MockMethodCallEventArgs) - Assert.AreEqual(GetType(TestedClass),e.CalledType) - Assert.AreEqual("getVar",e.CalledMethodName) - Assert.AreEqual(0,e.SentArguments.Length) - Assert.AreEqual(0,e.ExpectedArguments.Length) - Assert.AreEqual(False,e.WillThrowException) - Assert.AreEqual(Nothing,e.Exception) - Assert.AreEqual(5,e.ReturnValue) - Assert.AreEqual(True,e.HasPassedValidation) - End Sub - - <Test()> _ - Public Sub SimpleEventSuccess() - Dim t As TestedClass = new TestedClass - Dim mock As Mock = MockManager.Mock(GetType(TestedClass)) - - mock.ExpectAndReturn("getVar",5) - ' set event listener - AddHandler mock.MockMethodCalled, AddressOf SuccessEvent - ' the event will be called - Assert.AreEqual(5,t.getVar()) - mock.Verify() - End Sub - - - To set an event per method see and Mock. - To set a global event for a mocked type see Mock. - When static methods are called events from ALL mocks of that type are triggered. So if a type is mocked for - two instances, and both have AfterMock Events, both will be triggered after a static member of that type is called. This - is because static methods are not associated with an instance. - - - - - - - - Verify Mode is the way that Typemock Isolator verifies uncalled expected methods - - - - - - - Fail if an expected method is not called - - - - - Pass even if an expected method is not called - - - - - Expectations will not fail if some calls are still expected and expectations are not cleared. - To Clear use or - - - - - Summary description for About. - - - - - Clean up any resources being used. - - - - - Required method for Designer support - do not modify - the contents of this method with the code editor. - - - - - Summary description for StateFullDelegate. - - - - - This class provides built in Parameter Checkers. See - and - - - Following is an example of using the build in IsNull Check - - - [Test] - public void CheckParameters() - { - Mock mock = MockManager.Mock(typeof(TestedClass)); - TestedClass t = new TestedClass(); - mock.ExpectCall("SomeMethod").Args(Check.IsNull(),null); - t.SomeMethod(null,null); - MockManager.Verify(); - } - - - <Test()> _ - Public Sub CheckParameters() - Dim mock As Mock = MockManager.Mock(GetType(TestedClass)) - Dim t As TestedClass = New TestedClass - mock.ExpectCall("SomeMethod").Args(Check.IsNull(),Nothing) - t.SomeMethod(Nothing,Nothing) - MockManager.Verify() - End Sub - - - - - - - - Check that parameter is null, this is equivalent to passing null - - - - Here is an example of how to use IsNull - - [Test] - public void CheckParameters() - { - Mock mock = MockManager.Mock(typeof(TestedClass)); - TestedClass t = new TestedClass(); - mock.ExpectCall("SomeMethod").Args(Check.IsNull(),null); - t.SomeMethod(null,null); - MockManager.Verify(); - } - - - <Test()> _ - Public Sub CheckParameters() - Dim mock As Mock = MockManager.Mock(GetType(TestedClass)) - Dim t As TestedClass = New TestedClass - mock.ExpectCall("SomeMethod").Args(Check.IsNull(),Nothing) - t.SomeMethod(Nothing,Nothing) - MockManager.Verify() - End Sub - - - - - IsNull ParameterChecker - - - - Check that parameter is null, with custom error message (see ) - - Custom Error Message - IsNull ParameterChecker - - - - Check that parameter is null, with custom error message and arguments for message (see ) - - Custom Error Message - Arguments for error message - IsNull ParameterChecker - - - - Allow any parameter value (Doesn't check parameter) - - - Here is an example of how to use IsAny - - - [Test] - public void CheckParameters() - { - Mock mock = MockManager.Mock(typeof(TestedClass)); - TestedClass t = new TestedClass(); - mock.ExpectCall("SomeMethod").Args(Check.IsAny()); - t.SomeMethod("Anything"); - MockManager.Verify(); - } - - - <Test()> _ - Public Sub CheckParameters() - Dim mock As Mock MockManager.Mock(GetType(TestedClass)) - Dim t As TestedClass = New TestedClass - mock.ExpectCall("SomeMethod").Args(Check.IsAny()) - t.SomeMethod("Anything") - MockManager.Verify() - End Sub - - - - - IsAny ParameterChecker - - - - Check that parameter is of the passed type - - - Check that parameter is the passed type, extends the passed type, or implements the passed type - - Here is an example of how to use IsTypeOf - - [Test] - public void CheckParameters() - { - Mock mock = MockManager.Mock(typeof(TestedClass)); - TestedClass t = new TestedClass(); - mock.ExpectCall("SomeMethod").Args(Check.IsTypeOf(typeof(string))); - t.SomeMethod("Anything"); - MockManager.Verify(); - } - - - <Test()> _ - Public Sub CheckParameters() - Dim mock As Mock MockManager.Mock(GetType(TestedClass)) - Dim t As TestedClass = New TestedClass - mock.ExpectCall("SomeMethod").Args(Check.IsTypeOf(GetType(String))) - t.SomeMethod("Anything") - MockManager.Verify() - End Sub - - - - - The type that we expect to be passed - IsTypeOf ParameterChecker - - - - Check that parameter is of the passed type, with custom error message and arguments for message (see ) - - The type that we expect to be passed - Custom Error Message - IsTypeOf ParameterChecker - - - - Check that parameter is of the passed type, with custom error message and arguments for message (see ) - - The type that we expect to be passed - Custom Error Message - Arguments for error message - IsTypeOf ParameterChecker - - - - Check that parameter is of the passed type. - - AreSameType ParameterChecker - - This is code sugar and is equivalent to - - - [Test] - public void CheckParameters() - { - Mock mock = Mock<TestedClass>.MockNextInstance(); - mock.ExpectCall("SomeMethod").Args(Check<int>.AreSameType()); - - TestedClass test = new TestedClass(); - test.SomeMethod(5); - MockManager.Verify(); - } - - - <Test()> _ - Public Sub CheckParameters() - Dim mock As Mock = Mock(Of TestedClass).MockNextInstance() - mock.ExpectCall("SomeMethod").Args(Check(Of Integer)).AreSameType()) - - Dim test As TestedClass = New TestedClass - test.SomeMethod(5) - MockManager.Verify() - End Sub - - - - - - - Check that parameter is of the passed type with custom error message and arguments for message (see ) - - Custom Error Message - Arguments for error message - AreSameType ParameterChecker - - - - Check that parameter is equal to expected value, this is equivalent to calling the expected object Equals method. - - - Single Dimension Arrays and Collections are iterated and checked for match of all items - - Here is an example of how to use IsEqual - - [Test] - public void CheckParameters() - { - Mock mock = MockManager.Mock(typeof(TestedClass)); - TestedClass t = new TestedClass(); - mock.ExpectCall("SomeMethod").Args(Check.IsEqual("String"),"Another")); - t.SomeMethod("String","Another"); - MockManager.Verify(); - } - - - <Test()> _ - Public Sub CheckParameters() - Dim mock As Mock MockManager.Mock(GetType(TestedClass)) - Dim t As TestedClass = New TestedClass - mock.ExpectCall("SomeMethod").Args(Check.IsEqual("String"),"Another"))) - t.SomeMethod("String","Another") - MockManager.Verify() - End Sub - - - - - The value that we expect to be passed - IsEqual ParameterChecker - - - - Check that parameter is equal to expected value, this is equivalent to calling the expected object Equals method, with custom error message (see ) - - The value that we expect to be passed - Custom Error Message - IsEqual ParameterChecker - - - - Check that parameter is equal to expected value, this is equivalent to calling the expected object Equals method, with custom error message and arguments for message (see ) - - The value that we expect to be passed - Custom Error Message - Arguments for error message - IsEqual ParameterChecker - - - - Call Custom Parameter Checker and send the expected value to the delegate - This will set - - - - Here is an example of how to use CustomChecker - - public static bool CheckParameter(ParameterCheckerEventArgs data) - { - return data.ArgumentValue == data.ExpectedValue; - } - - [Test] - public void CheckParameters() - { - Mock mock = MockManager.Mock(typeof(TestedClass)); - TestedClass t = new TestedClass(); - // setup expectation, test first argument by calling our CheckParameter - // with ExpectedValue set - mock.ExpectCall("SomeMethod").Args(Check.CustomChecker(new ParameterCheckerEx(CheckParameter),"String"))); - t.SomeMethod("String"); - MockManager.Verify(); - } - - - Public Shared Function CheckParameter(ByVal data As ParameterCheckerEventArgs) As Boolean - CheckParameter = data.ArgumentValue = data.ExpectedValue; - End Function - - <Test()> _ - Public Sub CheckParameters() - Dim mock As Mock MockManager.Mock(GetType(TestedClass)) - Dim t As TestedClass = New TestedClass - ' setup expectation, test first argument by calling our CheckParameter - ' with ExpectedValue set - mock.ExpectCall("SomeMethod").Args(Check.CustomChecker(New ParameterCheckerEx(AddressOf CheckParameter),"String")) - t.SomeMethod("String") - MockManager.Verify() - End Sub - - - - - - The custom parameter checker - The value that we expect to be passed - CustomChecker ParameterCheckerEx - - - - Call Custom Parameter Checker and send the expected value to the delegate, with custom error message (see ) - This will set - - - The custom parameter checker - The value that we expect to be passed - Custom Error Message - IsEqual ParameterChecker - - - - Call Custom Parameter Checker and send the expected value to the delegate, with custom error message and arguments for message (see ) - This will set - - - The custom parameter checker - The value that we expect to be passed - Custom Error Message - Arguments for error message - IsEqual ParameterChecker - - - - Check that parameter is referencing the same object as the expected object. - - - - Here is an example of how to use IsSame - - [Test] - public void CheckParameters() - { - Mock mock = MockManager.Mock(typeof(TestedClass)); - TestedClass t = new TestedClass(); - object pass = new object(); - mock.ExpectCall("SomeMethod").Args(Check.IsSame(pass),"Another")); - t.SomeMethod(pass,"Another"); - MockManager.Verify(); - } - - - <Test()> _ - Public Sub CheckParameters() - Dim mock As Mock MockManager.Mock(GetType(TestedClass)) - Dim t As TestedClass = New TestedClass - Dim pass As Object = New Object - mock.ExpectCall("SomeMethod").Args(Check.IsSame(pass),"Another"))) - t.SomeMethod(pass,"Another") - MockManager.Verify() - End Sub - - - - - The object that we expect to be passed - IsSame ParameterChecker - - - - Check that parameter is referencing the same object as the expected object, with custom error message (see ) - - The object that we expect to be passed - Custom Error Message - IsSame ParameterChecker - - - - Check that parameter is referencing the same object as the expected object, with custom error message and arguments for message (see ) - - The object that we expect to be passed - Custom Error Message - Arguments for error message - IsSame ParameterChecker - - - - Check that parameter is equal to one of the items expected - - - - Here is an example of how to use IsIn - - [Test] - public void CheckParameters() - { - Mock mock = MockManager.Mock(typeof(TestedClass)); - TestedClass t = new TestedClass(); - mock.ExpectCall("SomeMethod").Args(Check.IsIn("String","Another")); - t.SomeMethod("String"); - MockManager.Verify(); - } - - - <Test()> _ - Public Sub CheckParameters() - Dim mock As Mock MockManager.Mock(GetType(TestedClass)) - Dim t As TestedClass = New TestedClass - Dim pass As Object = New Object - mock.ExpectCall("SomeMethod").Args(Check.IsIn("String","Another")) - t.SomeMethod("String") - MockManager.Verify() - End Sub - - - - - The values that we expect to be passed - IsIn ParameterChecker - - - - Reverse argument checks - - - - Here is an example of how to use Not - - [Test] - public void CheckParameters() - { - Mock mock = MockManager.Mock(typeof(TestedClass)); - TestedClass t = new TestedClass(); - mock.ExpectCall("SomeMethod").Args(Check.Not("Another")); - t.SomeMethod("String"); - MockManager.Verify(); - } - - - <Test()> _ - Public Sub CheckParameters() - Dim mock As Mock MockManager.Mock(GetType(TestedClass)) - Dim t As TestedClass = New TestedClass - Dim pass As Object = New Object - mock.ExpectCall("SomeMethod").Args(Check.Not("Another")) - t.SomeMethod("String") - MockManager.Verify() - End Sub - - - - - The values/Parameter checkers that we expect not to be passed - Not ParameterChecker - - - - Reverse argument checks, with custom error message (see ) - - The values/Parameter checkers that we expect not to be passed - Custom Error Message - Not ParameterChecker - - - - Reverse argument checks, with custom error message and arguments for message (see ) - - The values/Parameter checkers that we expect not to be passed - Custom Error Message - Arguments for error message - Not ParameterChecker - - - - Check that argument is one of the given values/checks - - - - Here is an example of how to use Or - - [Test] - public void CheckParameters() - { - Mock mock = MockManager.Mock(typeof(TestedClass)); - TestedClass t = new TestedClass(); - mock.ExpectCall("SomeMethod").Args(Check.Or("Another",Checks.Equal("String"))); - t.SomeMethod("String"); - MockManager.Verify(); - } - - - <Test()> _ - Public Sub CheckParameters() - Dim mock As Mock MockManager.Mock(GetType(TestedClass)) - Dim t As TestedClass = New TestedClass - Dim pass As Object = New Object - mock.ExpectCall("SomeMethod").Args(Check.Or("Another"),Checks.Equal("String"))) - t.SomeMethod("String") - MockManager.Verify() - End Sub - - - - - values/Parameter checkers that we expect to be passed - values/Parameter checkers that we expect to be passed - Or ParameterChecker - - - - Check that argument is one of the given values/checks, with custom error message (see ) - - values/Parameter checkers that we expect to be passed - values/Parameter checkers that we expect to be passed - Custom Error Message - Or ParameterChecker - - - - Check that argument is one of the given values/checks, with custom error message and arguments for message (see ) - - values/Parameter checkers that we expect to be passed - values/Parameter checkers that we expect to be passed - Custom Error Message - Arguments for error message - Or ParameterChecker - - - - Check that argument is both of the given values/checks - - - - Here is an example of how to use And - - [Test] - public void CheckParameters() - { - Mock mock = MockManager.Mock(typeof(TestedClass)); - TestedClass t = new TestedClass(); - mock.ExpectCall("SomeMethod").Args(Check.And("String",Checks.IsTypeOf(typeof(String)))); - t.SomeMethod("String"); - MockManager.Verify(); - } - - - <Test()> _ - Public Sub CheckParameters() - Dim mock As Mock MockManager.Mock(GetType(TestedClass)) - Dim t As TestedClass = New TestedClass - Dim pass As Object = New Object - mock.ExpectCall("SomeMethod").Args(Check.And("String"),Checks.IsTypeOf(GetType(String)))) - t.SomeMethod("String") - MockManager.Verify() - End Sub - - - - - values/Parameter checkers that we expect to be passed - values/Parameter checkers that we expect to be passed - And ParameterChecker - - - - Check that argument is both of the given values/checks, with custom error message (see ) - - values/Parameter checkers that we expect to be passed - values/Parameter checkers that we expect to be passed - Custom Error Message - And ParameterChecker - - - - Check that argument is both of the given values/checks, with custom error message and arguments for message (see ) - - values/Parameter checkers that we expect to be passed - values/Parameter checkers that we expect to be passed - Custom Error Message - Arguments for error message - And ParameterChecker - - - - Check that argument not equal to the given value, this is the same as Not(IsEqual(expected)) - - - Value that we expect not to be passed - NotEqual ParameterChecker - - - - Check that argument not equal to the given value, with custom error message (see ) - - Value that we expect not to be passed - Custom Error Message - NotEqual ParameterChecker - - - - Check that argument not equal to the given value, with custom error message and arguments for message (see ) - - Value that we expect not to be passed - Custom Error Message - Arguments for error message - NotEqual ParameterChecker - - - - Check that argument is not null, this is the same as Not(IsNull()) - - - NotNull ParameterChecker - - - - Check that argument not null, with custom error message (see ) - - Custom Error Message - NotNull ParameterChecker - - - - Check that argument not null, with custom error message and arguments for message (see ) - - Custom Error Message - Arguments for error message - NotNull ParameterChecker - - - - Check that argument is not in the provided list, this is the same as Not(IsIn(expected)) - - - The values that we expect not to be passed - NotNull ParameterChecker - - - - Check that argument is equal to expected string, ignoring case - - - The value that we expect to be passed - IsEqualIgnoreCase ParameterChecker - - - - Check that argument is equal to expected string, ignoring case, with custom error message with (see ) - - The value that we expect to be passed - Custom Error Message - IsEqualIgnoreCase ParameterChecker - - - - Check that argument is equal to expected string, ignoring case, with custom error message and arguments for message (see ) - - The value that we expect to be passed - Custom Error Message - Arguments for error message - IsEqualIgnoreCase ParameterChecker - - - - Check that argument is equal to expected string, ignoring white spaces - - - The value that we expect to be passed - IsEqualIgnoreWhiteSpace ParameterChecker - - - - Check that argument is equal to expected string, ignoring white spaces, with custom error message (see ) - - The value that we expect to be passed - Custom Error Message - IsEqualIgnoreWhiteSpace ParameterChecker - - - - Check that argument is equal to expected string, ignoring white spaces, with custom error message and arguments for message (see ) - - The value that we expect to be passed - Custom Error Message - Arguments for error message - IsEqualIgnoreWhiteSpace ParameterChecker - - - - Check that argument starts with expected string, - - - The start of the value that we expect to be passed - StartsWith ParameterChecker - - - - Check that argument starts with expected string, with custom error message (see ) - - The start of the value that we expect to be passed - Custom Error Message - StartsWith ParameterChecker - - - - Check that argument starts with expected string, with custom error message and arguments for message (see ) - - The start of the value that we expect to be passed - Custom Error Message - Arguments for error message - StartsWith ParameterChecker - - - - Check that argument ends with expected string, - - - The end of the string that we expect to be passed - EndsWith ParameterChecker - - - - Check that argument ends with expected string, with custom error message (see ) - - The end of the string that we expect to be passed - Custom Error Message - EndsWith ParameterChecker - - - - Check that argument ends with expected string, with custom error message and arguments for message (see ) - - The end of the string that we expect to be passed - Custom Error Message - Arguments for error message - EndsWith ParameterChecker - - - - Check that argument matches the expected regular expression, - - - The regular expression the we expect the passed string to match - IsMatch ParameterChecker - - - - Check that argument matches the expected regular expression, with custom error message (see ) - - The regular expression the we expect the passed string to match - Custom Error Message - IsMatch ParameterChecker - - - - Check that argument matches the expected regular expression, with custom error message and arguments for message (see ) - - The regular expression the we expect the passed string to match - Custom Error Message - Arguments for error message - IsMatch ParameterChecker - - - - Check that argument is equal to the expected value with a fault tolerance provided - - The value will be checked to be in between expected +/- tolerance - - The expected value - A tolerance that we will pass - IsCloseTo ParameterChecker - - - - Check that argument is equal to the expected value with a fault tolerance provided, with custom error message (see ) - - The expected value - A tolerance that we will pass - Custom Error Message - IsCloseTo ParameterChecker - - - - Check that argument is equal to the expected value with a fault tolerance provided, with custom error message and arguments for message (see ) - - The expected value - A tolerance that we will pass - Custom Error Message - Arguments for error message - IsCloseTo ParameterChecker - - - - Check that argument is a mocked types that is controlled by mock - - - - Here is an example of how to use And - - [Test] - public void CheckParameters() - { - Mock passedMock = MockManager.Mock(typeof(ArgumentClass)); - Mock mock = MockManager.Mock(typeof(TestedClass)); - TestedClass t = new TestedClass(); - mock.ExpectCall("PassArgument").Args(Check.IsMock(passedMock)); - t.PassArgument(new ArgumentClass()); - MockManager.Verify(); - } - - - <Test()> _ - Public Sub CheckParameters() - Dim passedMock As Mock = MockManager.Mock(GetType(ArgumentClass)) - Dim mock As Mock = MockManager.Mock(GetType(TestedClass)) - Dim t As TestedClass = New TestedClass - Dim pass As Object = New Object - mock.ExpectCall("PassArgument").Args(Check.IsMock(passedMock)) - t.PassArgument(new ArgumentClass) - MockManager.Verify() - End Sub - - - - - The mock that the expected parameter is controlling - IsMock ParameterChecker - - - - Check that argument is a mocked types that is controlled by mock - - The mock that the expected parameter is controlling - Custom Error Message - IsCloseTo ParameterChecker - - - - Check that argument is a mocked types that is controlled by mock - - The mock that the expected parameter is controlling - Custom Error Message - Arguments for error message - IsCloseTo ParameterChecker - - - - - - - Summary description for About. - - - - - Clean up any resources being used. - - - - - Required method for Designer support - do not modify - the contents of this method with the code editor. - - - - - Summary description for AboutMessage. - - - - - All members are neither thread-safe nor process-safe! It's up to you to synchronize access. - - - - Instanciate a new memory mapped array for inter-process access. - - The memory mapped file view. - The count of entries of the array. - The (maximal) count of bytes per entry. - - If true, it accepts other length and bytesPerEntry if the array already exists. - If falls it throws an exception if the array already exists but with other length or bytesPerEntry. - - An optional initial positive offset before the array starts. - - - - - - - Serializes the data and writes it to the file. - - The data to serialize. - - - - Serializes the data and writes it to the file. - - The data to serialize. - The position in the file to start. - - - - Serializes the data and writes it to the file. - - The data to serialize. - The position in the file to start. - The buffer size in bytes. - - - - MockedEvent is used to validate firing of events. - - To use this an event must be mocked first, and then the test can fire that event to test that the correct methods are actually called. - - - - - When more than one instance of the event published is mocked, use the MockedEvent.[index] property - The first instance to register to the event will be in index 0, the next instance in 1 and so on. - - - - Example of one instance of Button having the Click event mocked. We will fire the event to test that our TestedClass - event handler is called - - // Part of tested class - public void Init() - { - Button button = new Button(); - button.Click += new EventHandler(button_Click); - } - - - Public Sub Init() - Dim button As Button = New Button - AddHandler button.Click, AddressOf button_Click - End Sub - - Here is the test - - [Test] - public void Test() - { - // we will mock the Click event and save the MockedEvent - Mock buttonMock = MockManager.Mock(typeof(Button)); - MockedEvent buttonHandle = buttonMock.ExpectAddEvent("Click"); - - // we expect button_Click to be called once (when the button is clicked) - Mock testedMock = MockManager.Mock(typeof(TestedClass)); - testedMock.ExpectCall("button_Click"); - - // call our code - TestedClass test = new TestedClass(); - test.Init(); - - // emulate click. - buttonHandle.Fire(this, EventArgs.Empty); - - // verify that all calls where made - MockManager.Verify(); - } - // Natural Mocks - [Test] - public void Test() - { - MockedEvent buttonHandle; - // Start mocking - using (RecordExpectations recorder = RecorderManager.StartRecording()) - { - // we will mock the Click event and save the MockedEvent - Button buttonMock = new Button(); - buttonMock.Click += null; - buttonHandle = RecorderManager.LastMockedEvent; - - // we expect button_Click to be called once (when the button is clicked) - TestedClass testMock = new TestedClass(); - testMock.button_Click(null,null); // use Reflective Mocks if this is private - } - - // call our code - TestedClass test = new TestedClass(); - test.Init(); - - // emulate click. - buttonHandle.Fire(this, EventArgs.Empty); - - // verify that all calls where made - MockManager.Verify(); - } - - - <Test()> _ - Public Sub Test() - ' we will mock the Click event and save the MockedEvent - Dim buttonMock As Mock = MockManager.Mock(GetType(Button)) - Dim buttonHandle As MockedEvent = buttonMock.ExpectAddEvent("Click") - - ' we expect button_Click to be called once (when the button is clicked) - Dim testedMock As Mock = MockManager.Mock(GetType(TestedClass)) - testedMock.ExpectCall("button_Click") - - ' call our code - Dim test As New TestedClass - test.Init() - - ' emulate click. - buttonHandle.Fire(Me, EventArgs.Empty) - ' Verify that all calls were made - MockManager.Verify() - End Sub - - ' .NET 2.0 Natural Mocks - <Test()> _ - Public Sub Test() - Dim buttonHandle As MockedEvent - Dim test As New TestedClass - Using recorder As New RecordExpectations - ' mock the Click event and save the MockedEvent - Dim buttonMock As Button = New Button() - AddHandler buttonMock.Click, AddressOf test.button_Click - buttonHandle = RecorderManager.LastMockedEvent - - ' we expect button_Click to be called once (when the button is clicked) - testMock.button_Click(Nothing, Nothing) ' use Reflective Mocks if this is private - End Using - - ' call our code - test.Init() - - ' emulate click. - buttonHandle.Fire(Me, EventArgs.Empty) - ' Verify that all calls were made - MockManager.Verify() - End Sub - - For VB .NET 1.1 see - - - Since Version 3.6 - - - - - Used to get return values for NaturalMocks, so that we can do recorder.Repeat - - - - - Fire a mocked event - - Arguments to pass to the mocked event - The return value of the event - - - - Retrieve the EventHandle - - - Using GetEventHandle can help write type-safe tests by casting the EventHandle to the correct Event Type - Example - - EventHandler fire = handle.GetEventHandle() as EventHandler; - fire(this, EventArgs.Empty); - - - Dim fire As EventHandler = handle.GetEventHandle() - fire(Me, EventArgs.Empty) - - - The Event - - - - Retrieve the when more than one instance of the event published is mocked - - The first instance to register to the event will be in index 0, the next instance in 1 and so on. - This is used to simulate firing the event. - - - - - Following is an example of 2 Buttons whose Click event is mocked. The test will fire both Buttons one after - the other. - - [Test] - public void SimulateFiringClickOnManyButtons() - { - // Mock all Click Events of the all Buttons - Mock buttonMock = MockManager.MockAll(typeof(Button)); - MockedEvent handle = buttonMock.ExpectAddEventAlways("Click"); - - // create 2 buttons and register to the Click Event - Button button1 = new Button(); - Button button2 = new Button(); - button1.Click += new EventHandler(button_Click); - button2.Click += new EventHandler(button_Click); - - // Simulate firing Click of button1 - handle.Instance[0].Fire(this, EventArgs.Empty); - // Simulate firing Click of button2 - handle.Instance[1].Fire(this, EventArgs.Empty); - // Check that system works... - - MockManager.Verify() - } - - - <Test()> _ - Public Sub SimulateFiringClickOnManyButtons() - 'Mock all Click Events of the all Buttons - Dim buttonMock As Mock = MockManager.MockAll(GetType(Button)) - Dim handle As MockedEvent = buttonMock.ExpectAddEventAlways("Click") - - ' create 2 buttons and register to the Click Event - Dim button1 As Button = New Button - Dim button2 As Button = New Button - - AddHandler button1.Click, AddressOf button_Click - AddHandler button2.Click, AddressOf button_Click - - ' Simulate firing Click of button1 - handle.Instance(0).Fire(Me, EventArgs.Empty) - ' Simulate firing Click of button2 - handle.Instance(1).Fire(Me, EventArgs.Empty) - ' Check that system works... - - MockManager.Verify() - End Sub - - - Since Version 3.7 - - - - - Return the number of instances registered to this mocked event. See - - - Since version 3.7 - - - - - Holds all the created mocks - - - - - Manage all expectations set on a specific method - - - There are two kinds of call expectations values - Default and sequenced. - The Default is used to Always return the same value, and the sequence - return according to call sequence, there are also two corresponding types for conditional - and default conditional - - - Create a new default call expectation. - Note - this will replace the previous default - - - Add a new regular call expectation - - - - this is the main api used during the test execution, when a method is mocked we will call this - to "activate" the behavior which was dictated during the expectation setup phase. - - the value to return to the user - - - search mechanism is: - 1: Conditional - 1.1: specific calls - 1.2: Default - 2: Regular - 2.1: specific calls - 2.2: Default - if not found any returns null! - - - this search the actual return value according to condition (playback time) - - - - Count the number of unfulfilled expectations. - - number of calls left (Negative can happen with default returns) - - - - this will count the number of calls which were not made. - (only calls with normal verification mode are counted) - - - - - Clear all expectations of a mock (clears static members made by an instance mock) - - if no expectations are left - - - - this return true if we have unfulfiled conditional returns - - - - - Checks if we are in Break Mode according to the Mutex. - If we are, result is true, and we need to release the lock. - - - - - - In Run mode, functions need to be run, thus setting expectations in Typemock Isolator - But in Break mode, we don't want to evaluate functions that will set the expecation, - and this way we can block them. - If we are in Break mode, we know this by acquiring the mutex, and so we need to release it - - - - - Enterprise: perpetual fully featured - Timed: time limited fully featured. Update-timebomed. - Temp: temporary fully featured, used for the period between purchase order and actual purchase. 30 day Usage-timebombed. - Evaluation: fully featured 21 day usage-timebombed - Extended: fully featured 14 day usage-timebombed - - - - - Summary description for Core. - - - - - returns path for system files for 32/64 bit machines - - - - - gets typemock key from registry - 32/64 bit - - - - - - In Isolator: Major version is .NET Version [Major].[Minor] - - - - - - - - - - - Instanciate a new memory mapped array for inter-process access. - - The memory mapped file view. - The count of entries of the array. - The (maximal) count of bytes per entry. - - If true, it accepts other length and bytesPerEntry if the array already exists. - If falls it throws an exception if the array already exists but with other length or bytesPerEntry. - - An optional initial positive offset before the array starts. - All members are neither thread-safe nor process-safe! It's up to you to synchronize access. - - - - Event arguments that are received for the MockMethodCalled. - - - To set an event per method see and Mock. - To set a global event for a mocked type see Mock. - - - - - - - - Type in which the method was called from - - - - - Name of method that was called - - - - - Array of the Argument that where went - - - The arguments are read only, setting these to other values will not change the arguments. - To assign other values see - - - - - Array of the expected arguments sent to the Args method (see ) - - - - - This is true if the mocked method will throw an exception, - Either because the exception was mocked (see or - because of a validation exception. - - - - - This is the exception that will be throw (null unless - is true. - - - - - The mocked return value (null if is true) - - - - - This is true if the method has passed all validations - - - - - This is true if the method is static - - - - - This class will holds all the calls counters for all the types. - FIXME Lior - this class is uses strings in order to match method signatures, need to consider working with real - signatures. - - - - - The counter tables: hash from type,MethodName,methodParams->counter - - - - - default ctor - - - - - retrieve the counter of the given method. - - the name of the class. - the name of the method - if the method is generic needs generic types - the number of times the method got called. 0 if not found - - - - retrieve the number of times the given method has been called. - - the type of the class. - the name of the method - if the method is generic needs generic types - the number of times the method has been called, 0 if method not found. - - - - Increase the counter of the given method - - the name of the class. - the name of the method - if the method is generic needs generic types - - - - clear all stored counters - - - - - - Static methods called by instrumented code, This class delegated to - who holds all the data. It is used to hide the runtime methods from nUnit users - - - - getReturn is overloaded many times to make the instrumented code easier to implement, - if we would have used param object[] we would have to use a local variable and - recalculate the local variable table, this way we just have to find the token for the - correct overloaded method. See CProfilerCallback::JITCompilationStarted - - - - - - Internal use only Get a parameter if changed - - number of parameter - - - Value of changed parameter - - - - Internal use only Reset the ref parameters. Required to be called after each mock - - - - - - - Internal use only Assign parameter - - number of parameter - - - Value of changed parameter - - - - Internal use only - - - - - - true if the current method mocked - - - - Internal use only Get our return value - - Mocked Return Value - - - - Internal use only Get our return value - - Mocked Return Value - - - - Internal use only Get our return value - - Mocked Return Value - - - - Internal use only Get our return value - - Mocked Return Value - - - - Internal use only Get our return value - - Mocked Return Value - - - - Internal use only Get our return value - - Mocked Return Value - - - - Internal use only Get our return value - - Mocked Return Value - - - - Internal use only Get our return value - - Mocked Return Value - - - - Internal use only Get our return value - - Mocked Return Value - - - - Internal use only Get our return value - - Mocked Return Value - - - - Internal use only Get our return value - - Mocked Return Value - - - - Internal use only Get our return value - - Mocked Return Value - - - - Internal use only Get our return value - - Mocked Return Value - - - - Internal use only Get our return value - - Mocked Return Value - - - - Internal use only Get our return value - - Mocked Return Value - - - - Internal use only Get our return value - - Mocked Return Value - - - - Internal use only Get our return value - - Mocked Return Value - - - - Internal use only Get our return value - - Mocked Return Value - - - - Internal use only Get our return value - - Mocked Return Value - - - - Internal use only Get our return value - - Mocked Return Value - - - - Internal use only Get our return value - - Mocked Return Value - - - - Internal use only Get our return value - - Mocked Return Value - - - - Internal use only Get our return value - - Mocked Return Value - - - - Internal use only Get our return value - - Mocked Return Value - - - - Internal use only Get our return value - - Mocked Return Value - - - - Internal use only Get our return value - - Mocked Return Value - - - - Internal use only Get our return value - - Mocked Return Value - - - - Internal use only Get our return value - - Mocked Return Value - - - - Internal use only Get our return value - - Mocked Return Value - - - - Internal use only Get our return value - - Mocked Return Value - - - - Internal use only Get our return value - - Mocked Return Value - - - - Set locked when inside Typemock Isolator code to disable infinite recurse - - - - - If CONTINUE is returned the mocked method will continue with - normal execution - - - - - Placeholder - - - - - An expectation block (Enterprise Edition Only) - - - - Group a number of expectation. Define an expectation block using Mock. and Mock.. - When grouping expectations in a block you can control - The expectation dynamically. This is very useful when setting up a mock infrastructure. - After defining a block it is possible to: - - Remove the block using Mock.. - - - Add expectations before the block using Mock.. - - - - Blocks can be labeled and can be later on referred to by Mock.. - - Blocks can have different s. - - The following example shows a utility method that sets up expectations - for an AccessController - - private Mock SetupExpectations() - { - //Mock all invocation of AccessController, - Mock mock = MockManager.MockAll(typeof(AccessController)); - - // start a block called loginLabel, this will be verified normally - mock.StartBlock("loginLabel",VerifyMode.Normal); - // We expect that the login method will be called and we will return - // AccessStatus.INVALID_USER the first time and AccessStatus.VALIDATED the - // second time - mock.ExpectAndReturn("Login", AccessStatus.INVALID_USER); - mock.ExpectAndReturn("Login", AccessStatus.VALIDATED); - mock.EndBlock(); - - // expect another call and return validated. - mock.ExpectAndReturn("Login", AccessStatus.VALIDATED); - return mock; - } - [Test] - public void TestSomething() - { - Mock mock = SetupExpectations(); - - // In this test we need to add an expectation before our block - mock.StartBlockBefore(mock.GetBlock("loginLabel")); - mock.ExpectAndReturn("Login", AccessStatus.VALIDATED); - mock.EndBlock(); - - // continue with test - } - [Test] - public void TestSomething2() - { - Mock mock = SetupExpectations(); - - // In this test we need to remove the expectation our block - mock.Clear(mock.GetBlock("loginLabel")); - - // continue with test - } - - - Private Function SetupExpectations() As Mock - 'Mock all invocation of AccessController, - Dim mock As Mock = MockManager.Mock(GetType(AccessController)) - - ' start a block called loginLabel, this will be verified normally - mock.StartBlock("loginLabel",VerifyMode.Normal) - ' We expect that the login method will be called and we will return - ' AccessStatus.INVALID_USER the first time and AccessStatus.VALIDATED the - ' second time - mock.ExpectAndReturn("Login", AccessStatus.INVALID_USER) - mock.ExpectAndReturn("Login", AccessStatus.VALIDATED) - mock.EndBlock() - - ' expect another call and return validated. - mock.ExpectAndReturn("Login", AccessStatus.VALIDATED) - SetupExpectations = mock - End Function - <Test()> _ - Public Sub TestSomething() - Dim mock As Mock = SetupExpectations() - - ' In this test we need to add an expectation before our block - mock.StartBlockBefore(mock.GetBlock("loginLabel")) - mock.ExpectAndReturn("Login", AccessStatus.VALIDATED) - mock.EndBlock() - - ' continue with test - End Sub - <Test()> _ - Public Sub TestSomething2() - Dim mock As Mock = SetupExpectations() - - ' In this test we need to remove the expectation our block - mock.Clear(mock.GetBlock("loginLabel")) - - ' continue with test - End Sub - - - - - - - - The Expectation Block - - - - first two ids are reserved for firstBlock and lastBlock. - - - - - Return the default expectation block - - - The Name or Label of the Block - - - - - Saves state of object - - - - - Utility Class that takes a snapshot of all the fields of an object or the static fields of a type - , in order to reset all the fields back to the saved state. - - - The ObjectState assists testing classes with hidden field, by resetting these field - when required - - The following example we want to test a class that has a static counter. - - public class StatefulClass - { - static private int count = 0; - public int Count {get { return count++ ;}} - } - - [Test] - public void Stateful() - { - StatefulClass stateful = new StatefulClass(); - // Save our state - ObjectState objState = new ObjectState(state); - // Do something to change the state - Assert.AreEqual(0,stateful.Count); - // lets reset our code for next test - objState.ResetState(); - Assert.AreEqual(0,stateful.Count); - } - - - Public Class StatefulClass - Private Shared count As Integer = 0 - Public ReadOnly Property Count() As Integer - Get - Return _defaultName - End Get - End Property - End Class - - <Test()> _ - Public Sub Stateful() - Dim stateful As StatefulClass = New StatefulClass - ' Save our state - Dim objState As ObjectState = New ObjectState(state) - ' Do something to change the state - Assert.AreEqual(0,stateful.Count) - ' lets reset our code for next test - objState.ResetState() - Assert.AreEqual(0,stateful.Count) - End Sub - - - - - - - Take a snapshot of all the fields of an object, in order to reset - all the fields back to the saved state. - - The object to save the state - - - - Take a snapshot of all the static fields of a type, in order to reset - all the fields back to the saved state. - - The type to save the state - - - - Reset the fields back to their original state - - - - - Sets the value of a non-public field (member variable) of the managed type. - - The name of the non-public field to modify. - value whose type is specific to the field. - - - - Sets the value of a non-public field (member variable) of an instance. - - The instance to modify - The name of the non-public field to modify. - value whose type is specific to the field. - - - - Sets the value of a non-public static field (member variable) of a type. - - The type to modify - The name of the non-public static field to modify. - value whose type is specific to the field. - - - - Gets the value of a non-public field (member variable) of the managed type. - - The name of the non-public field to modify. - value whose type is specific to the field. - - - - Gets the value of a non-public field (member variable) of an instance. - - The instance to read - The name of the non-public field to modify. - value whose type is specific to the field. - - - - Gets the value of a non-public static field (member variable) of a type. - - The type to read - The name of the non-public static field to modify. - value whose type is specific to the field. - - - - CallCounter counts the calls to all registered methods - - - - - - Passing this class as to Args as a Parameter Checker to mock ref and out parameters. Enterprise - Edition users can swap normal argument too. - See - - - Use this class to mock ref and out parameters. Enterprise Edition Users can use the Assign - class to replace arguments of a method at run time. This is useful in conjunction with - Mock. and complex types, where it is easier to change - an argument then to mock all the methods. - - Here is an example of using Assign - - [Test] - public void CheckRefAndOut() - { - Mock mock = MockManager.Mock(typeof(TestedClass)); - TestedClass t = new TestedClass(); - // Check that first arg is "rr" and assign it with "changed" - // Assign the second arg with 3, don't check (same as Check.IsAny()) - mock.ExpectCall("SomeMethod").Args(new Assign("changed").AndCheck("rr"), new Assign(3)); - int a ; - string s = "rr"; - t.SomeMethod(ref s,out a); - Assert.AreEqual(3,a); - Assert.AreEqual("changed",s); - MockManager.Verify(); - } - - - - <Test()> _ - Public Sub CheckRefAndOut() - Dim mock As Mock = MockManager.Mock(GetType(TestedClass)) - Dim t As TestedClass = New TestedClass - ' Check that first arg is "rr" and assign it with "changed" - ' Assign the second arg with 3, don't check (same as Check.IsAny()) - mock.ExpectCall("SomeMethod").Args(New Assign("changed").AndCheck("rr"), New Assign(3)) - Dim a As Integer - Dim s As String = "rr" - t.SomeMethod(s,a) - Assert.AreEqual(3,a) - Assert.AreEqual("changed",s) - MockManager.Verify() - End Sub - - - - Another way to assign ref and out parameter is by using the - Typemock Isolator doesn't check that the parameter is actually passed by ref - Assign will might work correctly for un-mocked expectations. See - Assigning arrays is currently not supported - - - - - Create a new Assign object that will mock ref and out arguments - - - Use in conjunction with - - The value to assign the parameter - - - - Validate the parameter before assigning it a value. - - Expected value or parameter checker - The parameter assigner - - - diff --git a/src/LinqToUmbraco/dep/Reference Assemblies/Mocking/TypeMock.dll b/src/LinqToUmbraco/dep/Reference Assemblies/Mocking/TypeMock.dll deleted file mode 100644 index 66602117f0..0000000000 Binary files a/src/LinqToUmbraco/dep/Reference Assemblies/Mocking/TypeMock.dll and /dev/null differ diff --git a/src/LinqToUmbraco/dep/Reference Assemblies/Mocking/Typemock.ArrangeActAssert.Dll b/src/LinqToUmbraco/dep/Reference Assemblies/Mocking/Typemock.ArrangeActAssert.Dll deleted file mode 100644 index eb514c1abb..0000000000 Binary files a/src/LinqToUmbraco/dep/Reference Assemblies/Mocking/Typemock.ArrangeActAssert.Dll and /dev/null differ diff --git a/src/LinqToUmbraco/dep/Reference Assemblies/Mocking/Typemock.ArrangeActAssert.Xml b/src/LinqToUmbraco/dep/Reference Assemblies/Mocking/Typemock.ArrangeActAssert.Xml deleted file mode 100644 index 542ead3051..0000000000 --- a/src/LinqToUmbraco/dep/Reference Assemblies/Mocking/Typemock.ArrangeActAssert.Xml +++ /dev/null @@ -1,3571 +0,0 @@ - - - - Typemock.ArrangeActAssert - - - - - Returned by Isolate.NonPublic., and - Isolate.NonPublic.WhenCalled().. this interface - contains methods for defining behavior for non public methods, as will as a modifier for applying behavior for - generic methods - - - - - Interface for specifying behavior for a void returning intercepted calls. The interface is returned by method. - - - This interface allow tweaking the behavior of methods which return void. - - - - - Interface for specifying behavior for a method call. The interface is extended by and . - - - This interface allow tweaking the behavior of any method by calling its original implementation or throwing an exception from it. - - - - - For internal use only. - - - - - Specify that an intercepted call will try to execute the real logic of the intercepted instance. - - - This interface is returned by method. - - Before using this directive make sure that the intercepted method has a real implementation that can be executed. - - - - This test shows faking an object to return null values, and overriding one of its methods to call its original - implementation: - - [TestMethod] - [Isolated] - public void CallOriginalOnFakeInstance() - { - RealLogger fake = Isolate.Fake.Instance<RealLogger>(Members.ReturnNulls); - - // Override the Increment() method to call its original implementation - Isolate.WhenCalled(() => fake.Increment()).CallOriginal(); - - // Make sure Count is reset - fake.Count = 0; - - // This call now redirects to its original implementation - the count should increment - fake.Increment(); - Assert.AreEqual(1, fake.Count); - - // even though we called the original implementation, we can still verify the call happened - Isolate.Verify.WasCalledWithAnyArguments(() => fake.Increment()); - } - - - - - - Specify that an intercepted call will throw the given exception. - - - This interface is returned by method. - - The exception to throw - - This test shows faking an object, and overriding one of its methods to throw an exception: - - [TestMethod] - [Isolated] - [ExpectedException(typeof(OutOfMemoryException))] - public void WillThrowOnFakeInstance() - { - RealLogger fake = Isolate.Fake.Instance<RealLogger>(); - - // Override the Write() method to throw an exception - Isolate.WhenCalled(() => fake.Write("")).WillThrow(new OutOfMemoryException()); - - // This call will now throw an exception when called - this is verified by the - // [ExpectedException] decorator - fake.Write("Hello"); - } - - - - - - Specify that an intercepted call should be ignored without executing any logic. - - - This interface is returned by method. - - - This example shows using IgnoreCall() to stub out a call to a method: - - [TestMethod] - [Isolated] - public void FakeAnInstance_StubIncrementMethod() - { - RealLogger fake = Isolate.Fake.Instance<RealLogger>(); - - // Increment call will be ignored (stubbed) - Isolate.WhenCalled(() => fake.Increment()).IgnoreCall(); - - // Make sure Count is reset - fake.Count = 0; - - // This call is faked - count should not increment - fake.Increment(); - - Assert.AreEqual(0, fake.Count); - } - - - - - - Run a custom action instead of the methods in the WhecnCalled block. - - The action that will run instead of the faked method - - This example shows using DoInstead() to run custom code instead of a function: - - [TestMethod] - [Isolated] - public void FakeAnInstance_DoInstead() - { - var fake = Isolate.Fake.Instance<RealLogger>(Members.CallOriginal); - - // Use DoInstead to replace the called method with custom action - Isolate.WhenCalled(() => fake.CallWithArguments("", 0, 0.0)) - .DoInstead((callContext) => - { - // Change the value of a field in the object that called the method - ((RealLogger)callContext.Instance).count = (int)callContext.Parameters[1]; - }); - - // Call the method - fake.CallWithArguments(100); - - // Verify the field's value - Assert.AreEqual(100, fake.count); - } - - - - - - Interface for specifying behavior for intercepted calls on methods returning values. - The interface is returned by . - - - This interface allow tweaking the behavior of methods that has return values. - - - - - Specify that the intercepted method will return the given value. - The real implementation will not be executed. - - The fake value to return when the call is intercepted - - This example shows using WillReturn() to change the return value for a property call: - - [TestMethod] - [Isolated] - public void FakeAnInstance_ChangeMethodReturnValue() - { - RealLogger fake = Isolate.Fake.Instance<RealLogger>(); - - // Change the return value for Count property - Isolate.WhenCalled(() => fake.Count).WillReturn(10); - - // fake.Count will return the assigned value - Assert.AreEqual(10, fake.Count); - } - - - - - - Run a custom dunction instead of the methods in the WhecnCalled block. - - The function that will run instead of the faked method - - This example shows using DoInstead() to run custom code instead of a function: - - [TestMethod] - [Isolated] - public void FakeAnInstance_DoInstead() - { - var fake = Isolate.Fake.Instance<RealLogger>(Members.CallOriginal); - - // Use DoInstead to replace the method called with custom function - Isolate.WhenCalled(() => fake.IntCallWithArgs(0)) - .DoInstead((callContext) => - { - // We can set field on the instance that called the method - ((RealLogger)callContext.Instance).count = (int)callContext.Parameters[0]; - - // Change the returned value - return 100; - }); - - int value = fake.IntCallWithArgs(10); - - // Verify - Assert.AreEqual(100, value); - Assert.AreEqual(10, fake.count); - - - - - - This is the entry point to all AAA APIs. - Use it to fake, swap, set method behavior and verify calls. - The Isolate APIs use fluent interfaces, thus - - - - - Accepts a method in the form of a Lambda expression, to set a specific behavior on it. - - An Action in a form of a Lambda expression (with no parameters) that expresses the method we want to set a behavior on. - A interface reference. - - Because of the nature of fluent interface, WhenCalled should be used with its proceeding methods. - - Here is an example how to use WhenCalled in order to ignore (stub) a call: - - [TestMethod] - [Isolated] - public void FakeAnInstance_StubIncrementMethod() - { - RealLogger fake = Isolate.Fake.Instance<RealLogger>(); - - // Increment call will be ignored (stubbed) - Isolate.WhenCalled(() => fake.Increment()).IgnoreCall(); - - // Make sure Count is reset - fake.Count = 0; - - // This call is faked - count should not increment - fake.Increment(); - - Assert.AreEqual(0, fake.Count); - } - - - - - - - Accepts a method in the form of a Lambda expression, to set a specific behavior on it. - - - A function in the form of a Lambda Expression (with no parameters) that expresses the method we want to set a behavior on. - A interface reference. - - Because of the nature of fluent interface, WhenCalled should be used with its proceeding methods. - - Here is an example how to use WhenCalled in order to return a value: - - [TestMethod] - [Isolated] - public void FakeAnInstance_StubIncrementMethod() - { - RealLogger fake = Isolate.Fake.Instance<RealLogger>(); - - // Change the return value of IntCall() - Isolate.WhenCalled(() => fake.IntCall()).WillReturn(10); - - Assert.AreEqual(10, fake.IntCall()); - } - - - - - - - CleanUp should be called at the end of a test. It can be substituted with the . - - - Here is an example how to use CleanUp. The following test uses CleanUp: - - [TestMethod] - public void FakeAnInstance_StubIncrementMethod() - { - RealLogger fake = Isolate.Fake.Instance<RealLogger>(); - - // Increment call will be ignored (stubbed) - Isolate.WhenCalled(() => fake.IntCall()).WillReturn(10); - - Assert.AreEqual(10, fake.IntCall()); - Isolate.CleanUp(); - } - - - The following test uses IsolatedAttribute and similar in functionality: - - [TestMethod] - [Isolated] - public void FakeAnInstance_StubIncrementMethod() - { - RealLogger fake = Isolate.Fake.Instance<RealLogger>(); - - // Increment call will be ignored (stubbed) - Isolate.WhenCalled(() => fake.IntCall()).WillReturn(10); - - Assert.AreEqual(10, fake.IntCall()); - } - - - - - - This is the entry point to all AAA APIs. - Use it to fake, swap, set method behavior and verify calls. - The Isolate APIs use fluent interfaces, thus - - - - - A read-only property, used to swap objects and behaviors - - - An interface reference. - - - Because of the nature of fluent interface, you need to use Swap with one of its proceeding methods - - see for details. - - - This example shows how to use Isolate.Swap.. in order to fake a future instance: - - [TestMethod] - [Isolated] - public void SwapAFutureInstance_StubIncrementMethod() - { - RealLogger fake = Isolate.Fake.Instance<RealLogger>(); - Isolate.Swap.NextInstance<RealLogger>().With(fake); - - Isolate.WhenCalled(() => fake.Increment()).IgnoreCall(); - - // This object is swapped with the fake - RealLogger logger = new RealLogger(); - - // Make sure Count is reset - logger.Count = 0; - - // This call is faked - count should not increment - logger.Increment(); - - Assert.AreEqual(0, logger.Count); - } - - This example shows how to use Isolate.Swap.. in order to - redirect calls from an object to a stand-in object: - - [TestMethod] - [Isolated] - public void SwapCallsOnObject_CallsRedirectedToTargetObject() - { - // Create the object under test - RealLogger logger = new RealLogger(); - // Create the object calls will be redirected to - TestLogger swapped = new TestLogger(); - - // Redirect any calls from the object under test to the swapping target - Isolate.Swap.CallsOn(logger).WithCallsTo(swapped); - - // logger.Write() is redirected to TestLogger.Write() which writes to console instead of disk - logger.Write("Hello World"); - - // We can still verify the call to logger.Write() happened - Isolate.Verify.WasCalledWithAnyArguments(() => logger.Write("")); - } - - // excerpt code for the class under test: - public class RealLogger - { - string logFilePath = ...; - public void Write(string toWrite) - { - logFile.WriteAllText(logFilePath, toWrite); - } - } - - // excerpt code for the replacement class: - public class TestLogger - { - public void Write(string toWrite) - { - Console.WriteLine("RealLogger.Write() was called with {0}", toWrite); - } - } - - - - - - A read-only property, used to fake a new object. - - - An interface reference. - - - Because of the nature of fluent interface, you need to use Fake with its proceeding methods - - see for details. - - - This example shows how to use Fake in order to fake a RealLogger instance: - - [TestMethod] - [Isolated] - public void FakeAnInstance_StubIncrementMethod() - { - RealLogger fake = Isolate.Fake.Instance<RealLogger>(); - - // Increment call will be ignored (stubbed) - Isolate.WhenCalled(() => fake.Increment()).IgnoreCall(); - - // Make sure Count is reset - fake.Count = 0; - - // This call is faked - count should not increment - fake.Increment(); - - Assert.AreEqual(0, fake.Count); - } - - - - - - - A read-only property, used to fake non public members - - - An IIsolateNonPublic reference - - - Because of the nature of fluent interface, you need to use NonPublic with one of its proceeding methods, see - - When handling non public (private, protected, internal) class members all access to method names is string-based. - - - - This example shows how to use NonPublic in order to set behavior on a private method: - - [TestMethod] - [Isolated] - public void StubPrivateMethod() - { - RealLogger fake = Isolate.Fake.Instance<RealLogger>(); - - // Avoid performing actual write to disk by ignoring (stubbing) a private call - Isolate.NonPublic.WhenCalled(fake, "WriteToDisk").IgnoreCall(); - - // This call is faked - count should not increment - fake.Log("Hello World"); - - Assert.AreEqual(1, fake.LineCount); - // Verify the private call was actually made - Isolate.Verify.NonPublic.WasCalled(fake, "WriteToDisk").WithArguments("Hello World"); - } - - - - - - Return a verifying object that can verify calls were made or not, and check if their arguments were sent correctly. - - An ICallVerifier interface reference. - - Because of the nature of fluent interface, you need to use Verify with one of its proceeding methods: - , , - and - - - This example shows how to use Verify in order to check a method was called: - - [TestMethod] - [Isolated] - public void VerifyStubWasCalled_FailWhenNotCalled() - { - RealLogger fake = Isolate.Fake.Instance<RealLogger>(); - - fake.Increment(); - - Isolate.Verify.WasCalledWithAnyArguments(() => fake.Increment()); - } - - - - - - Returned by Isolate.Verify., this interface contains methods for verifying non - public (private, protected and internal) method, property and index calls, and checking argumentrs. - - - - - Overloaded. Verifies that a non-public method has been called - - The fake object to verify method behavior on - The method to verify behavior for - An interface reference, used to add argument checking - - In order to perform additional argument checking as part of the verification, use the proceeding - method. - - - Thrown if the method was not called. - - - This example shows how to use Isolate.Verify.NonPublic in order to check a method was called: - - [TestMethod] - [Isolated] - public void VerifyMethodWasCalled() - { - RealLogger fake = Isolate.Fake.Instance<RealLogger>(Members.CallOriginal); - - fake.Write("Hello"); - - // Verify the internal call to WriteToDisk() was performed with correct arguments - Isolate.Verify.NonPublic.WasCalled(fake, "WriteToDisk").WithArguments("Hello"); - } - - - - - - - Overloaded. Verifies that a non-public static method has been called - - The type to verify static method behavior on - The method to verify behavior for - An interface reference, used to add argument checking - - In order to perform additional argument checking as part of the verification, use the proceeding - method. - - - Thrown if the method was not called. - - - This example shows how to use Isolate.Verify.NonPublic in order to check a static method was called: - - [TestMethod] - [Isolated] - public void VerifyStaticMethodWasCalled() - { - Isolate.Fake.Instance<LoggerFactory>(Members.CallOriginal); - - RealLogger logger = LoggerFactory.GetLogger("logfile.txt", Access.ReadWrite); - - // Verify the call to internal method LoggerFactory.GetRealLogger() has been made - Isolate.Verify.NonPublic.WasNotCalled(typeof(LoggerFactory), "GetRealLogger"). - WithArguments("logfile.txt", Access.ReadWrite); - } - - - - - - - Overloaded. Verifies that a non-public method was not called regardless of parameters. - - The fake object to verify method behavior on - The method to verify behavior for - - Thrown if the method was called at least once. - - - This example shows how to use Isolate.Verify.NonPublic in order to check a method was not called - - [TestMethod] - [Isolated] - public void VerifyMethodWasNotCalled() - { - RealLogger fake = Isolate.Fake.Instance<RealLogger>(Members.CallOriginal); - - fake.Write("Hello world!"); - - // The logger write was called, so an internal WriteToDisk() was performed - - // this verification should fail - Isolate.Verify.NonPublic.WasNotCalled(fake, "WriteToDisk"); - } - - - - - - Overloaded. Verifies that a non-public static method was not called regardless of parameters. - - The type to verify static method behavior on - The method to verify behavior for - - Thrown if the method was called at least once. - - - This example shows how to use Isolate.Verify.NonPublic in order to check a method was not called - - [TestMethod] - [Isolated] - public void VerifyMethodWasNotCalled() - { - Isolate.Fake.Instance<LoggerFactory>(Members.CallOriginal); - - RealLogger logger = LoggerFactory.GetLogger(); - - // We retrieved a RealLogger and an internal call to GetRealLogger() was made - - // this verification should fail - Isolate.Verify.NonPublic.WasNotCalled(typeof(LoggerFactory), "GetRealLogger"); - } - - - - - - A read only property, used to verify calls on non-public properties - - - An reference - - - Because of the nature of fluent interface, you need to use Property with one of its proceeding methods, see . - - When handling non public (private, protected, internal) properties all access to property names is string-based. - - - - This example shows how to use Isolate.NonPublic.Property in order to verify the behavior of a private property getter: - - [TestMethod] - [Isolated] - public void VerifyPropertyWasCalled() - { - RealLogger fake = Isolate.Fake.Instance<RealLogger>(Members.CallOriginal); - - fake.Log("Hello World"); - - // Verify an internal disk space check was performed - Isolate.Verify.NonPublic.Property.WasCalledGet(fake, "IsDiskFull"); - } - - - - - - - A read only property, used to verify calls on non-public indexers - - - An reference - - - Because of the nature of fluent interface, you need to use Indexer with one of its proceeding methods, see . - - - This example shows how to use Isolate.NonPublic.Indexer in order to verify behavior on a private index setter: - - [TestMethod] - [Isolated] - public void VerifyIndexSetterWasCalled() - { - LogFile fake = Isolate.Fake.Instance<LogFile>(Members.CallOriginal); - - fake.Write("Hello"); - - // Verify a set call to the LogFile's internal indexer was made - Isolate.Verify.NonPublic.Indexer.WasSetCalled(fake); - } - - - - - - - Returned by Isolate.NonPublic., this interface contains methods for faking and setting - behavior for non-public (private, protected and internal) property get and set calls - - - - - Sets specific behavior for a non-public property getter on an object - - The object to set property behavior for. - The name of a property to set behavior on. - An interface reference. - - Because of the nature of fluent interface, Property.WhenGetCalled should be used with its proceeding methods. - See . - - Here is an example how to use Property.WhenGetCalled in order to set return value on a private property: - - [TestMethod] - [Isolated] - [ExpectedExcetion(typeof(OutOfDiskSpaceException))] - public void ChangePrivatePropertyReturnValue_SimulateDiskError() - { - RealLogger fake = Isolate.Fake.Instance<RealLogger>(); - - // Set the behavior on the internal IsDiskFull property to true - Isolate.NonPublic.Property.WhenGetCalled(fake, "IsDiskFull").WillReturn(true); - - // The fake object checks the disk is full before logging and throws an exception - fake.Log("Hello World"); - } - - // Excerpt from class under test - public class RealLogger : ILogger - { - private string fileName; - // method under test - public override void Log(string message) - { - if(IsDiskFull) - { - throw new OutOfDiskSpaceException(); - } - - AppendToFile(fileName, message); - } - - private bool IsDiskFull - { - get { return ...; } - } - } - - - - - - - - Sets specific behavior for a non-public static property getter for a class type - - The type to set static property getter behavior on. Applies to static methods. - The name of a property to set behavior on. - An interface reference. - - Because of the nature of fluent interface, Property.WhenGetCalled should be used with its proceeding methods. - See . - - Here is an example how to use Property.WhenGetCalled in order to set return value on a private property: - - [TestMethod] - [Isolated] - [ExpectedException(typeof(OutOfDiskSpaceException))] - public void ChangePrivatePropertyReturnValue_SimulateDiskError() - { - Isolate.Fake.StaticMethods<RealLogger>(); - - // Set the behavior on the internal IsDiskFull property to true - Isolate.NonPublic.Property.WhenGetCalled(typeof(RealLogger), "IsDiskFull").WillReturn(true); - - RealLogger logger = new RealLogger(); - - // The logger object calls the static property to find out if the disk is full before logging and throws an exception - logger.Log("Hello World"); - } - - // Excerpt from class under test - public class RealLogger : ILogger - { - private string fileName; - // method under test - public static override void Log(string message) - { - if(IsDiskFull) - { - throw new OutOfDiskSpaceException(); - } - - AppendToFile(fileName, message); - } - - private static bool IsDiskFull - { - get { return ...; } - } - } - - - - - - - - Sets specific behavior for a non-public property setter on an object - - The object to set property behavior for. - The name of a property to set behavior on. - An interface reference. - - Because of the nature of fluent interface, Property.WhenSetCalled should be used with its proceeding methods. - See . - - Here is an example how to use Property.WhenSetCalled in order to simulate an error by throwing an exception - on an internal property setter call: - - [TestMethod] - [Isolated] - [ExpectedException(typeof(OutOfDiskSpaceException))] - public void ThrowExceptionFromPrivatePropertySetter_SimulateDiskError() - { - RealLogger fake = Isolate.Fake.Instance<RealLogger>(); - - // Set the behavior of the internal CurrentLine property to throw an exception when set - Isolate.NonPublic.Property.WhenSetCalled(fake, "CurrentLine").WillThrow(new OutOfDiskSpaceException()); - - // The object under test tries to log to its internal container and fails because of the exception we set - fake.Log("Hello World"); - } - - // Excerpt from classes under test - public class RealLogger : ILogger - { - private string fileName; - // method under test - public static override void Log(string message) - { - if(IsDiskFull) - { - throw new OutOfDiskSpaceException(); - } - - CurrentLine = message; - } - - private static bool IsDiskFull - { - get { return ...; } - } - - internal string CurrentLine - { - get { return current; } - set { WriteToLogFile(value); current = value; } - } - } - - - - - - - - Sets specific behavior for a non-public static property setter for a class - - The type to set static property setter behavior on. Applies to static methods. - The name of a property to set behavior on. - An interface reference. - - Because of the nature of fluent interface, Property.WhenSetCalled should be used with its proceeding methods. - See . - - Here is an example how to use Property.WhenSetCalled in order to simulate an error by throwing an exception - on an internal property setter call: - - [TestMethod] - [Isolated] - [ExpectedException(typeof(OutOfMemoryException))] - public void ThrowExceptionFromPrivatePropertySetter_SimulateMemoryFull() - { - Isolate.Fake.Instance<LogContainer>(); - - // Set the behavior on the internal IsDiskFull property to true - Isolate.NonPublic.Property.WhenSetCalled(typeof(LogContainer), "Cache").WillThrow(new OutOfMemoryException()); - - // The object under test tries to log using the LogContainer.Cache internal container and fails because of the exception we set - fake.Log("Hello World"); - } - - // Excerpt from class under test: - public class LogContainer - { - public void Log(string message) - { - LogContainer.Cache.Add(message); - WriteToDisk(message); - } - } - - - - - - - - Interface used for swapping between object method calls and collection values. - - - This interface is returned by the Isolate. property. - - - - - Return a swapping object, in order to swap a future instance of type T with an existing fake object. - - An IFutureSwapper interface refernce. - - Because of the nature of fluent interface, you need to use NextInstance with its proceeding method - - - This example shows using NextInstance in order to fake a future instance: - - [TestMethod] - [Isolated] - public void SwapAFutureInstance_StubIncrementMethod() - { - RealLogger fake = Isolate.Fake.Instance<RealLogger>(); - Isolate.Swap.NextInstance<RealLogger>().With(fake); - - Isolate.WhenCalled(() => fake.Increment()).IgnoreCall(); - - // This object is swapped with the fake - RealLogger logger = new RealLogger(); - - // Make sure Count is reset - logger.Count = 0; - - // This call is faked - count should not increment - logger.Increment(); - - Assert.AreEqual(0, logger.Count); - } - - - Type of instance to swap. - - - - Enables swapping one object's implementation with another. Followed by the completing statement - . - - The object to swap implementation for - An interface reference. - - When a method is called on the swapped object, it is replaced with a corresponding implementation (a method - with the same signature) on the swapping object. This means that the swapped object will start behaving like - the object it was swapped with for all methods they have in common. - - - This example shows how to use Isolate.Swap.. - in order to redirect calls from an object to a stand-in object: - - [TestMethod] - [Isolated] - public void SwapCallsOnObject_CallsRedirectedToTargetObject() - { - // Create the object under test - RealLogger logger = new RealLogger(); - // Create the object calls will be redirected to - TestLogger swapped = new TestLogger(); - - // Redirect any calls from the object under test to the swapping target - Isolate.Swap.CallsOn(logger).WithCallsTo(swapped); - - // logger.Write() is redirected to TestLogger.Write() which writes to console instead of disk - logger.Write("Hello World"); - - // We can still verify the call to logger.Write() happened - Isolate.Verify.WasCalledWithAnyArguments(() => logger.Write("")); - } - - // excerpt code for the class under test: - public class RealLogger - { - string logFilePath = ...; - public void Write(string toWrite) - { - logFile.WriteAllText(logFilePath, toWrite); - } - } - - // excerpt code for the replacement class: - public class TestLogger - { - public void Write(string toWrite) - { - Console.WriteLine("RealLogger.Write() was called with {0}", toWrite); - } - } - - - - - - - Returned by Isolate.Verify.NonPublic., this interface contains methods for verifying non - public (private, protected and internal) properties - - - - - Overloaded. Verifies that a non-public property getter has been called - - The fake object to verify property behavior on - The non-public property to verify behavior for - - Thrown if the property get was not called. - - - This example shows how to use Isolate.Verify.NonPublic.Property in order to check a private property - get has been called: - - [TestMethod] - [Isolated] - public void VerifyPropertyWasCalled() - { - RealLogger fake = Isolate.Fake.Instance<RealLogger>(Members.CallOriginal); - - fake.Write("Hello"); - - // Verify the private property IsDiskFull has been called - Isolate.Verify.NonPublic.Property.WasCalledGet(fake, "IsDiskFull"); - } - - // Exceprt from class under test - public class RealLogger : ILogger - { - private string fileName; - public void override Write(string message) - { - if(IsDiskFull) - { - throw new OutOfDiskSpaceException(); - } - - WriteToFile(fileName, message); - } - - private bool IsDiskFull - { - get { return ...; } - } - } - - - - - - Overloaded. Verifies that a non-public static property getter has been called - - The type to verify static property get behavior on - The non-public property to verify behavior for - - Thrown if the property get was not called. - - - This example shows how to use Isolate.Verify.NonPublic in order to check a private property - get has been called: - - [TestMethod] - [Isolated] - public void VerifyPropertyWasCalled() - { - Isolate.Fake.Instance<LoggerFactory>(Members.CallOriginal); - - RealLogger logger = LoggerFactory.GetLogger(); - - // Verify the private property DoesLoggerExist has been called - Isolate.Verify.NonPublic.Property.WasCalledGet(typeof(LoggerFactory), "DoesLoggerExist"); - } - - // Excerpt from class under test - public class LoggerFactory - { - private ILogger logger; - public ILogger GetLogger() - { - if(!DoesLoggerExist) - { - logger = new RealLogger(); - } - - return logger; - } - - private bool DoesLoggerExist - { - get { return logger != null; } - } - } - - - - - - Overloaded. Verifies that a non-public property setter has been called with a specific value - - The fake object to verify property behavior on - The non-public property to verify behavior for - - Thrown if the property set was not called or if it was called with a mismatching value. - - - In order to specify the argument to verify use the proceeding method . - - - This example shows how to use Isolate.Verify.NonPublic in order to check a private property - set has been called with a specific value: - - [TestMethod] - [Isolated] - public void VerifyPropertyWasCalled_WithSpecificArgument() - { - RealLogger fake = Isolate.Fake.Instance<RealLogger>(Members.CallOriginal); - - fake.Write("Hello"); - - // Verify the private property LineCount has been set to 1 - Isolate.Verify.NonPublic.Property.WasCalledSetWithExactArgument(fake, "LineCount").WithArgument(1); - } - - // Excerpt from class under test - public class RealLogger : ILogger - { - public void override Write(string message) - { - LineCount = lineCount + 1; - WriteToDisk(lineCount, message); - } - - private int lineCount; - internal int LineCount - { get; set; } - } - - - - - - Overloaded. Verifies that a non-public static property setter has been called with a specific value - - The type to verify static property get behavior on - The non-public property to verify behavior for - - Thrown if the property set was not called or if it was called with a mismatching value. - - - In order to specify the argument to verify use the proceeding method . - - - This example shows how to use Isolate.Verify.NonPublic in order to check a private static property - set has been called with a specific value: - - [TestMethod] - [Isolated] - public void VerifyPropertyWasCalled_WithSpecificArgument() - { - Isolate.Fake.Instance<LoggerFactory>(Members.CallOriginal); - - RealLogger logger = LoggerFactory.GetLogger(); - - // Verify the private property LoggerCount has been set to 1 - Isolate.Verify.NonPublic.Property.WasCalledSetWithExactArgument(typeof(LoggerFactory), "LoggerCount").WithArgument(1); - } - - // Excerpt from class under test - public class LoggerFactory - { - public ILogger GetLogger() - { - LoggerCount++; - return ...; - } - - private static int loggerCount = 0; - protected static int LoggerCount - { get; set; } - } - - - - - - Overloaded. Verifies that a non-public property get was not called regardless of parameters. - - The fake object to verify property behavior on - The property to verify behavior for - - Thrown if the property getter was called at least once. - - - This example shows how to use Isolate.Verify.NonPublic.Property in order to check a property get was not called - - [TestMethod] - [Isolated] - public void VerifyPropertyWasNotCalled() - { - RealLogger fake = Isolate.Fake.Instance<RealLogger>(Members.CallOriginal); - - fake.Write("Hello world!"); - - // The logger write was called, so an internal call to the IsDiskFull property was performed - - // this verification should fail - Isolate.Verify.NonPublic.Property.WasNotCalledGet(fake, "IsDiskFull"); - } - - - // Exceprt from class under test - public class RealLogger : ILogger - { - private string fileName; - public void override Write(string message) - { - if(IsDiskFull) - { - throw new OutOfDiskSpaceException(); - } - - WriteToFile(fileName, message); - } - - private bool IsDiskFull - { - get { return ...; } - } - } - - - - - - Overloaded. Verifies that a non-public static property get was not called regardless of parameters. - - The type to verify static property behavior on - The property to verify behavior for - - Thrown if the property getter was called at least once. - - - This example shows how to use Isolate.Verify.NonPublic.Property in order to check a property get was not called - - [TestMethod] - [Isolated] - public void VerifyPropertyWasNotCalled() - { - Isolate.Fake.Instance<LoggerFactory>(Members.CallOriginal); - - RealLogger logger = LoggerFactory.GetLogger(); - - // We retrieved a RealLogger and an internal call to LoggerFactory.LoggerInstance was made - - // this verification should fail - Isolate.Verify.NonPublic.Property.WasNotCalledGet(typeof(LoggerFactory), "LoggerInstance"); - } - - // Excerpt from class under test - public class LoggerFactory - { - public ILogger GetLogger() - { - if(LoggerInstance == null) - { - LoggerInstance = new ...; - } - return LoggerInstance; - } - - protected ILogger LoggerInstance - { - get { ... } - set { ... } - } - } - - - - - - Overloaded. Verifies that a non-public property set was not called regardless of parameters. - - The fake object to verify property behavior on - The property to verify behavior for - - Thrown if the property setter was called at least once. - - - This example shows how to use Isolate.Verify.NonPublic.Property in order to check a property set was not called - - [TestMethod] - [Isolated] - public void VerifyPropertyWasNotCalled() - { - RealLogger fake = Isolate.Fake.Instance<RealLogger>(Members.CallOriginal); - - fake.Write("Hello world!"); - - // The logger write was called, so internal property LineCount was updated - - // this verification should fail - Isolate.Verify.NonPublic.Property.WasNotCalledSet(fake, "LineCount"); - } - - // Excerpt from class under test - public class RealLogger : ILogger - { - public void override Write(string message) - { - LineCount = lineCount + 1; - WriteToDisk(lineCount, message); - } - - private int lineCount; - internal int LineCount - { get; set; } - } - - - - - - Overloaded. Verifies that a non-public static property set was not called regardless of parameters. - - The type to verify static property behavior on - The property to verify behavior for - - Thrown if the property setter was called at least once. - - - This example shows how to use Isolate.Verify.NonPublic.Property in order to check a property set was not called - - [TestMethod] - [Isolated] - public void VerifyPropertyWasNotCalled() - { - Isolate.Fake.Instance<LoggerFactory>(Members.CallOriginal); - - RealLogger logger = LoggerFactory.GetLogger(); - - // We created a RealLogger and an internal property LoggerFactory.LoggerCount was updated - - // this verification should fail - Isolate.Verify.NonPublic.Property.WasNotCalledSet(typeof(LoggerFactory), "LoggerCount"); - } - - // Excerpt from class under test - public class LoggerFactory - { - public ILogger GetLogger() - { - LoggerCount++; - return ...; - } - - private static int loggerCount = 0; - protected static int LoggerCount - { get; set; } - } - - - - - - Returned by Isolate.Verify., this interface is used to verify - the call was made with specific arguments - - - - - Verify the call was made with the specified arguments - - Mandatory. The first argument to verify. - Optional. Additional arguments to verify. - - - This method is used to complement verifying calls, using - Isolate.Verify.NonPublic., with specific argument verification. - - - All expected call arguments must be passed to this method in order for verification to be performed. - - - Thrown if the call was made with mismatching arguments - - This example shows how to use Isolate.Verify.NonPublic in order to check a method was called with specific arguments: - - [TestMethod] - [Isolated] - public void VerifyMethodWasCalled() - { - RealLogger fake = Isolate.Fake.Instance<RealLogger>(Members.CallOriginal); - - fake.Write("Hello"); - - // Verify the internal call to WriteToDisk() was performed with correct arguments - Isolate.Verify.NonPublic.WasCalled(fake, "WriteToDisk").WithArguments("Hello"); - } - - // Excerpt from class under test - public class RealLogger : ILogger - { - public void override Write(string message) - { - WriteToDisk(message); - } - - private void WriteToDisk(string content) - { ... } - } - - - - - - Returned by Isolate.Verify.Property. and - Isolate.Verify., this interface is used to verify - a property setter call was made with the correct argument - - - - - Verify the property set call was made with the specified argument - - The property set value to verify. - - This method is used to complement verifying property set, using - Isolate.Verify.NonPublic.Property., - with specific argument verification. - - Thrown if the property set call was made with a mismatching argument - - This example shows how to use Isolate.Verify.NonPublic in order to check a private property - set has been called with a specific value: - - [TestMethod] - [Isolated] - public void VerifyPropertyWasCalled_WithSpecificArgument() - { - RealLogger fake = Isolate.Fake.Instance<RealLogger>(Members.CallOriginal); - - fake.Write("Hello"); - - // Verify the private property LineCount has been set to 1 - Isolate.Verify.NonPublic.Property.WasCalledSetWithExactArgument(fake, "LineCount").WithArgument(1); - } - - // Excerpt from class under test - public class RealLogger : ILogger - { - public override void Write(string message) - { - LineCount++; - WriteToDisk...; - } - - private int lineCount; - internal int LineCount - { get; set; } - - } - - - - - - Returned by Isolate.Verify., this interface contains methods for verifying non - public (private, protected and internal) index calls. - - - - - Verify a call has been made to a non-private index getter - - - An reference - - The fake object to verify index behavior on - - In order to verify the index getter has been called at a specific index location, use the proceeding method - . - - - This example shows how to use Isolate.NonPublic.Indexer.WasCalledGet() in order to verify behavior on a private index setter: - - [TestMethod] - [Isolated] - public void VerifyIndexGetterWasCalled() - { - LogFile fake = Isolate.Fake.Instance<LogFile>(Members.CallOriginal); - - string line = fake.GetLineAt(10); - - // Verify a get call to the LogFile's internal indexer was made - Isolate.Verify.NonPublic.Indexer.WasGetCalled(fake).WithIndex(10); - } - - // Excerpt from class under test - public class LogFile - { - public string GetLineAt(int lineNumber) - { - return this[lineNumber]; - } - - protected string this[int line] - { - get { return ...; } - } - } - - - - - - - Verify a call has been made to a non-private index setter - - - An reference - - The fake object to verify index behavior on - - In order to verify the index getter has been called at a specific index location and value, use the proceeding method - . - - - This example shows how to use Isolate.NonPublic.Indexer.WasCalledSet() in - order to verify behavior on a private index setter: - - [TestMethod] - [Isolated] - public void VerifyIndexSetterWasCalled() - { - LogFile fake = Isolate.Fake.Instance<LogFile>(Members.CallOriginal); - - // set the position to write at - this will be used for internal index value - fake.SetPosition(10); - fake.Write("Hello World"); - - // Verify a set call to the LogFile's internal indexer was made at the correct index - Isolate.Verify.NonPublic.Indexer.WasSetCalled(fake).WithIndexAndValue(10, "Hello World"); - } - - // Excerpt from class under test - public class LogFile - { - private int currentPosition = 0; - public void Write(string message) - { - this[currentPosition] = message; - } - - public void SetPosition(int value) - { - currentPosition = value; - } - - protected string this[int line] - { - set { WriteToFile(line, value); } - } - } - - - - - - - Verify a call has not been made to a non-private index getter - - The fake object to verify index behavior on - - This example shows how to use Isolate.NonPublic.Indexer.WasNotCalledGet() - in order to verify a private index getter has not been called: - - [TestMethod] - [Isolated] - public void VerifyIndexGetterWasNotCalled() - { - LogFile fake = Isolate.Fake.Instance<LogFile>(Members.CallOriginal); - - string line = fake.GetLineAt(10) - - // The internal index was used to retrieve the log line - this verification should fail - Isolate.Verify.NonPublic.Indexer.WasNotCalledGet(fake); - } - - - // Excerpt from class under test - public class LogFile - { - public string GetLineAt(int lineNumber) - { - return this[lineNumber]; - } - - protected string this[int line] - { - get { return ...; } - } - } - - - - - - Verify a call has not been made to a non-private index setter - - The fake object to verify index behavior on - - This example shows how to use Isolate.NonPublic.Indexer.WasNotCalledSet() - in order to verify a private index getter has not been called: - - [TestMethod] - [Isolated] - public void VerifyIndexSetterWasNotCalled() - { - LogFile fake = Isolate.Fake.Instance<LogFile>(Members.CallOriginal); - - // set the position to write at - this will be used for internal index value - fake.SetPosition(10); - fake.Write("Hello World"); - - // The internal index was set during the Write operation so this verification will fail - Isolate.Verify.NonPublic.Indexer.WasNotCalledSet(fake); - } - - // Excerpt from class under test - public class LogFile - { - private int currentPosition = 0; - public void Write(string message) - { - this[currentPosition] = message; - } - - public void SetPosition(int value) - { - currentPosition = value; - } - - protected string this[int line] - { - set { WriteToFile(line, value); } - } - } - - - - - - Returned by Isolate.Verify., this interface is used to verify an index - getter was called with a specific index. - - - - - Verify the index getter was made with the specific index location - - The index location value to verify - The type of the index used. Can be inferred from - - This method is used to complement verifying index getter calls, using - Isolate.Verify.NonPublic.Indexer., with specific index location verification. - - - This example shows how to use Isolate.NonPublic.Indexer.WasCalledGet() in order to verify behavior on a private index setter: - - [TestMethod] - [Isolated] - public void VerifyIndexGetterWasCalled() - { - LogFile fake = Isolate.Fake.Instance<LogFile>(Members.CallOriginal); - - string line = fake.GetLineAt(10); - - // Verify a get call to the LogFile's internal indexer was made - Isolate.Verify.NonPublic.Indexer.WasGetCalled(fake).WithIndex(10); - } - - // Excerpt from class under test - public class LogFile - { - public string GetLineAt(int index) - { - return this[index]; - } - - internal string this[int line] - { - get { return GetFromLog(line); } - } - } - - - - - - - Verify the index setter was called with a specific index location and setter value - - The index location value to verify - The setter value to verify - The type of the index used. Can be inferred from - The type of the setter value used. Can be inferred from - - This method is used to complement verifying index setter calls, using - Isolate.Verify.NonPublic.Indexer., with specific - index location and value verification. - - - This example shows how to use Isolate.NonPublic.Indexer.WasCalledSet() in - order to verify behavior on a private index setter: - - [TestMethod] - [Isolated] - public void VerifyIndexSetterWasCalled() - { - LogFile fake = Isolate.Fake.Instance<LogFile>(Members.CallOriginal); - - // set the position to write at - this will be used for internal index value - fake.SetPosition(10); - fake.Write("Hello World"); - - // Verify a set call to the LogFile's internal indexer was made - Isolate.Verify.NonPublic.Indexer.WasSetCalled(fake).WithIndexAndValue(10, "Hello World"); - } - - // Excerpt from class under test - public class LogFile - { - private int currentPosition = 0; - public void Write(string message) - { - this[currentPosition] = message; - } - - public void SetPosition(int value) - { - currentPosition = value; - } - - protected string this[int line] - { - set { WriteToFile(line, value); } - } - } - - - - - - - Returned by Isolate.NonPublic., this interface - contains methods for defining behavior for non public methods, as will as a modifier for applying behavior for - generic methods - - - - - Specifies generic type arguments that apply to a non-public method to set behavior on. The behavior will - be set only for a method bound to the passed type arguments - - The first generic type argument the method binds to - Optional. Further generic type arguments the method binds to. - an INonPublicMethodBehavior interface reference - - WithGenericArguments() modifies a call to Isolate.NonPublic.. - Due to the fluent nature of the AAA API it should be used with its proceeding methods; see . - - - Here is an example how to use WhenCalled with WithGenericArguments in order to simulate an error creating - a factory generated object: - - [TestMethod] - [Isolated] - public void ThrowExceptionFromGenericMethod_SimulateErrorCreatingLogger() - { - LoggerFactory fake = Isolate.Fake.Instance<LoggerFactory>(); - - // Set the logger factory to throw an exception when trying to retrieve a RealLogger - Isolate.NonPublic.WhenCalled(fake, "GetLogger"). - WithGenericArguments(typeof(RealLogger)). - WillThrow(new ArgumentNullException()); - - // The following method call is not faked because it does not match the specified generic - // type arguments - no exception is thrown - DiskLogger logger = fake.GetLogger<DiskLogger>(); - - // This call will throws an exception as specified - try - { - fake.GetLogger<RealLogger>(); - Assert.Fail("Retrieving a RealLogger should have failed with an ArgumentNullException"); - } - catch(ArgumentNullException) - { - } - } - - - - - Used to clean up the defined expectations. This attribute cant be inherited. - Any method marks with this attribute will clean all set expectation - after the test is done. A marked class will do this for any test defined in - it. The attribute can be replaced with the method. - - - [TestFixture] - [Isolated] // clear all mocks between tests - public TestClass - { - [Test] - public void MyTest1() - { - // the test code - } - } - - - < TestFixture >_ - < Isolated >_ ' clear all mocks between tests - Public class TestClass - < Test >_ - Public Sub MyTest1() - ' the test code - End Sub - End Class - - - - - - Called by the framework instead of the original method. This will run the original method and - afterwards clear the MockManager. - - the result of the original method - - - - Returned by , this interface contains methods for faking and setting - behavior for method calls on non public methods, properties and indexers. - - - - - Sets behavior for a specific method on a an object - - The object to set method behavior on. - The name of a method to set behavior on. - An interface reference. - - Because of the nature of fluent interface, WhenCalled should be used with its proceeding methods. - See - - Here is an example how to use WhenCalled in order to ignore (stub) a private call: - - [TestMethod] - [Isolated] - public void StubPrivateMethod_DoNotWriteToDisk() - { - RealLogger fake = Isolate.Fake.Instance<RealLogger>(); - - // Avoid performing actual write to disk by ignoring (stubbing) a private call - Isolate.NonPublic.WhenCalled(fake, "WriteToDisk").IgnoreCall(); - - // The private call is stubbed so no actual disk writes are performed - fake.Log("Hello World"); - - Assert.AreEqual(1, fake.LineCount); - } - - - - - - - - Sets behavior for a specific static method on a class - - The type to set method behavior on. Applies to static methods. - The name of a static method to set behavior on. - An interface reference. - - Because of the nature of fluent interface, WhenCalled should be used with its proceeding methods. - See - - Here is an example how to use WhenCalled in order to ignore (stub) a private call: - - [TestMethod] - [Isolated] - public void StubPrivateStaticMethod_FactoryCreate() - { - Isolate.Fake.StaticMethods<LoggerFactory>(); - - // Avoid performing to network access by ignoring (stubbing) a private call - Isolate.NonPublic.WhenCalled(typeof(LoggerFactory), "ReportToControllerServer").IgnoreCall(); - - // The private method is stubbed and the unit test will not perform external calls - RealLogger logger = LoggerFactory.CreateLogger(); - - Assert.IsNotNull(logger); - } - - - - - - - - A read only property, used to set behavior on non-public properties - - - An reference - - - Because of the nature of fluent interface, you need to use Property with one of its proceeding methods, see . - - When handling non public (private, protected, internal) properties all access to property names is string-based. - - - - This example shows how to use Isolate.NonPublic.Property in order to set behavior on a private property getter: - - [TestMethod] - [Isolated] - public void SetPrivatePropertyBehavior_ChangeReturnValue() - { - RealLogger fake = Isolate.Fake.Instance<RealLogger>(Members.CallOriginal); - - // have private RealLogger.IsDiskFull property return true to simulate an error - Isolate.NonPublic.Property.WhenCalledGet(fake, "IsDiskFull").WillReturn(true); - - // Because we simulated a disk full error, this call should throw an exception - try - { - fake.Log("Hello World"); - Assert.Fail("fake.Log() should have thrown because IsDiskFull is true"); - } - catch(OutOfDiskSpaceException) - { - } - } - - - - - - - A read only property, used to set behavior on non-public indexers - - - An reference - - - Because of the nature of fluent interface, you need to use Indexer with one of its proceeding methods, see . - - - This example shows how to use Isolate.NonPublic.Indexer in order to set behavior on a private index getter: - - [TestMethod] - [Isolated] - public void SetPrivateIndexBehavior_ChangeReturnValue() - { - LogFile fake = Isolate.Fake.Instance<LogFile>(Members.CallOriginal); - - // have private LogFile[i] index return a specified log line - Isolate.NonPublic.Indexer.WhenCalledGet(fake).WillReturn("Info: this is a test log line"); - - // We set the value of the next log line the internal implementation will look at - Assert.AreEqual("this is a test log line", fake.GetNextLogLine(Level.Info)); - } - - - - - - - Returned by Isolate.NonPublic., this interface contains methods for faking and setting - behavior for non-public (private, protected and internal) index get and set calls - - - - - Sets specific behavior for a non-public index getter on a an object - - The object to set indexer behavior for. - An interface reference. - - Because of the nature of fluent interface, WhenGetCalled should be used with its proceeding methods. - See . - - Here is an example how to use Isolate.NonPublic.Indexer.WhenGetCalled() in order to set return value for an index call: - - [TestMethod] - [Isolated] - public void ChangeIndexGetReturnValue() - { - RealLogger fake = Isolate.Fake.Instance<LogContainer>(); - - // Set the internal indexer to return a specific value - Isolate.NonPublic.Indexer.WhenGetCalled(fake).WillReturn("hello"); - - // The object under test uses the private index get result as part of a calculation - string result = fake.GetStringAt(10); - Assert.AreEqual("hello", result); - } - - // Excerpt from class under test - public class LogContainer - { - // method under test - public string GetStringAt(int line) - { - return this[line]; - } - - private string fileName = ... - - // private indexer - private string this[int line] - { - get { return ReadFromFile(fileName, line); } - } - - } - - - - - - - - Sets specific behavior for a non-public index set on a an object - - The object to set indexer behavior for. - An interface reference. - - Because of the nature of fluent interface, WhenSetCalled should be used with its proceeding methods. - See . - - Here is an example how to use Isolate.NonPublic.Indexer.WhenSetCalled() in order to simulate a memory error on index write access: - - [TestMethod] - [Isolated] - [ExpectedException(typeof(OutOfMemoryException)) - public void ThrowExceptionFromIndexSet_SimulateMemoryError() - { - RealLogger fake = Isolate.Fake.Instance<LogContainer>(); - - // Set the internal indexer to throw an exception on set - Isolate.NonPublic.Indexer.WhenSetCalled(fake).WillThrow(new OutOfMemoryException()); - - // The object under test uses the private index setter when writing to log - fake.WriteToLog("hello"); - } - - // Excerpt from class under test - public class LogContainer - { - // method under test - public string WriteToLog(string message) - { - this[currentLine] = message; - currentLine++; - } - - private string fileName = ... - private int currentLine = 0; - - // private indexer - private string this[int line] - { - set { InternalWrite(fileName, line, value); } - } - } - - - - - - - - Interface for specifying fake object creation settings. The interface is typed by the preceeding Faker property. - - - This interface is returned by the property. - - - - - Overloaded. Returns a fake instance of type T. Using this overload is equal to using Members.MustSpecifyReturnValues. - - The type of fake object to create. - A fake instance of type T. - Members Enum - - - Here is an example how to use Instance in order to fake a RealLogger instance: - - [TestMethod] - [Isolated] - public void FakeAnInstance_StubIncrementMethod() - { - RealLogger fake = Isolate.Fake.Instance<RealLogger>(); - - fake.Count = 0; - - // This call is faked because we used the default Instance overload - count should not increment - fake.Increment(); - - Assert.AreEqual(0, fake.Count); - } - - - - - - Overloaded. Returns a fake instance of type T. - - - - The type of the fake instance to be created. - - Can be one of the following values: - - - Members ValueDescription - - Members.MustSpecifyReturnValues - All void calls are ignored. Unless using on methods that return values and properties, they will throw a . - - - - Members.ReturnNulls - All void calls are ignored. Unless using on methods that return values and properties, they will return Null values (or zero for value types). - - - - Members.CallOriginal - All methods are called. Using allow to change this behavior. - - - - Members.ReturnRecursiveFakes - Default. All void calls are ignored. When calling the fake's methods returning values or properties, they will return a fake value, which presents this behavior recursively. Any deep call will never return a Null value. - - - - - A fake instance of Type T. - - - - The following test shows the faking an instance using Members.MustSpecifyReturnValue: - - [TestMethod] - [Isolated] - public void FakeAnInstance_MustSpecifyReturnValues() - { - RealLogger fake = Isolate.Fake.Instance<RealLogger>(Members.MustSpecifyReturnValues); - - fake.Count = 0; - - // This call is faked because we used MustSpecifyReturnValues - count should not increment - fake.Increment(); - Assert.AreEqual(0, fake.count); - - // The following statement will throw, because we didn't set behavior on IntCall method. - int x = fake.IntCall(); - } - - The next test shows the CallOriginal setting on Instance: - - [TestMethod] - [Isolated] - public void FakeAnInstance_UseCallOriginal() - { - RealLogger fake = Isolate.Fake.Instance<RealLogger>(Members.CallOriginal); - - fake.Count = 0; - - // This call is not faked. Count should be incremented. - fake.Increment(); - Assert.AreEqual(1, fake.Count); - } - - The next test shows what happens when using ReturnNulls: - - [TestMethod] - [Isolated] - public void FakeAnInstance_UseReturnNulls() - { - RealLogger fake = Isolate.Fake.Instance<RealLogger>(Members.ReturnNulls); - - fake.Count = 0; - // This call is faked because we set faked method behavior using ReturnNulls - fake.Increment(); - Assert.AreEqual(0, fake.Count); - - // Since we're returning Null by default the following Assert passes - Assert.IsNull(fake.IntCall()); - } - - Finally, using recursive faking, this test should pass: - - [TestMethod] - [Isolated] - public void RecursiveStubsChain() - { - RealLogger fake = Isolate.Fake.Instance<RealLogger>(Members.ReturnRecursiveFakes); - - // This method returns a value type, and therefore, returns a fake 0. - Assert.AreEqual(0, fake.ReturnFive()); - - // This method returns an object, and therefore returns a non-null object - Assert.IsNotNull(fake.GetSon()); - - // And the result of GetSon also returns a non-null object - Assert.IsNotNull(fake.GetSon().GetNephew()); - } - - - - - - Overloaded. Returns a fake instance of type T. - - - - The type of the fake instance to be created. - - Can be one of the following values: - - - Members ValueDescription - - Members.MustSpecifyReturnValues - All void calls are ignored. Unless using on methods that return values and properties, they will throw a . - - - - Members.ReturnNulls - All void calls are ignored. Unless using on methods that return values and properties, they will return Null values (or zero for value types). - - - - Members.CallOriginal - All methods are called. Using allow to change this behavior. - - - - Members.ReturnRecursiveFakes - Default. All void calls are ignored. When calling the fake's methods returning values or properties, they will return a fake value, which presents this behavior recursively. Any deep call will never return a Null value. - - - - - - Can Be One OF the following values: - - - ConstructorWillBe ValueDescription - - - ConstructorWillBe.Ignored - Constructor will not be executed when creating the fake object - - - ConstructorWillBe.Called - Execute Constructor when creating the fake object - - - - A fake instance of Type T. - - - - The following test shows the faking an instance using Members.MustSpecifyReturnValue: - - [TestMethod] - [Isolated] - public void FakeAnInstance_MustSpecifyReturnValues() - { - RealLogger fake = Isolate.Fake.Instance<RealLogger>(Members.MustSpecifyReturnValues, ConstructorWillBe.Ignored); - - fake.Count = 0; - - // This call is faked because we used MustSpecifyReturnValues - count should not increment - fake.Increment(); - Assert.AreEqual(0, fake.count); - - // The following statement will throw, because we didn't set behavior on IntCall method. - int x = fake.IntCall(); - } - - The next test shows the CallOriginal setting on Instance: - - [TestMethod] - [Isolated] - public void FakeAnInstance_UseCallOriginal() - { - RealLogger fake = Isolate.Fake.Instance<RealLogger>(Members.CallOriginal, ConstructorWillBe.Ignored); - - // Because constructor was not called Count was not initialized - Assert.AreEqual(0, fake.Count); - - // This call is not faked. Count should be incremented. - fake.Increment(); - Assert.AreEqual(1, fake.Count); - } - - The next test shows what happens when using ReturnNulls: - - [TestMethod] - [Isolated] - public void FakeAnInstance_UseReturnNulls() - { - RealLogger fake = Isolate.Fake.Instance<RealLogger>(Members.ReturnNulls, ConstructorWillBe.Ignored); - - fake.Count = 0; - // This call is faked because we set faked method behavior using ReturnNulls - fake.Increment(); - Assert.AreEqual(0, fake.Count); - - // Since we're returning Null by default the following Assert passes - Assert.IsNull(fake.IntCall()); - } - - Finally, using recursive faking, this test should pass: - - [TestMethod] - [Isolated] - public void RecursiveStubsChain() - { - // We create a fake after running the real constructor that sets count field to 5 - RealLogger fake = Isolate.Fake.Instance<RealLogger>(Members.ReturnRecursiveFakes, ConstructorWillBe.Called); - - // Because Constructor was called fake.count field was initialized - Assert.AreEqual(5, fake.count); - - // This method returns a value type, and therefore, returns a fake 0. - Assert.AreEqual(0, fake.ReturnFive()); - - // This method returns an object, and therefore returns a non-null object - Assert.IsNotNull(fake.GetSon()); - - // And the result of GetSon also returns a non-null object - Assert.IsNotNull(fake.GetSon().GetNephew()); - } - - - - - - Overloaded. Returns a fake instance of type T. - - - - The type of the fake instance to be created. - - Can be one of the following values: - - - Members ValueDescription - - Members.MustSpecifyReturnValues - All void calls are ignored. Unless using on methods that return values and properties, they will throw a . - - - - Members.ReturnNulls - All void calls are ignored. Unless using on methods that return values and properties, they will return Null values (or zero for value types). - - - - Members.CallOriginal - All methods are called. Using allow to change this behavior. - - - - Members.ReturnRecursiveFakes - Default. All void calls are ignored. When calling the fake's methods returning values or properties, they will return a fake value, which presents this behavior recursively. Any deep call will never return a Null value. - - - - - - Can Be One of the following values: - - - ConstructorWillBe ValueDescription - - - ConstructorWillBe.Ignored - Constructor will not be executed when creating the fake object - - - ConstructorWillBe.Called - Execute Constructor when creating the fake object - - - - - The parameters to pass to a specific constructor. - If constructor behavior is set to and this value isn't empty a will be throw - - A fake instance of Type T. - - - - The following test shows the faking an instance using Members.MustSpecifyReturnValue: - - [TestMethod] - [Isolated] - public void FakeAnInstance_MustSpecifyReturnValues() - { - // Call class constructor passing a number that will be passed to count field - RealLogger fake = Isolate.Fake.Instance<RealLogger>(Members.MustSpecifyReturnValues, ConstructorWillBe.Called, 10); - - // Check that the value we've passed to the constructor was passed to the field - Assert.AreEqual(10, fake.count); - fake.Count = 0; - - // This call is faked because we used MustSpecifyReturnValues - count should not increment - fake.Increment(); - Assert.AreEqual(0, fake.count); - - // The following statement will throw, because we didn't set behavior on IntCall method. - int x = fake.IntCall(); - } - - The next test shows the CallOriginal setting on Instance: - - [TestMethod] - [Isolated] - public void FakeAnInstance_UseCallOriginal() - { - // Call class constructor passing a number that will be passed to count field - RealLogger fake = Isolate.Fake.Instance<RealLogger>(Members.CallOriginal, ConstructorWillBe.Called, 10); - - // Check that the value we've passed to the constructor was passed to the field - Assert.AreEqual(10, fake.count); - - // Because constructor was not called Count was not initialized - Assert.AreEqual(0, fake.Count); - - // This call is not faked. Count should be incremented. - fake.Increment(); - Assert.AreEqual(1, fake.Count); - } - - The next test shows what happens when using ReturnNulls: - - [TestMethod] - [Isolated] - public void FakeAnInstance_UseReturnNulls() - { - // Call class constructor passing a number that will be passed to count field - RealLogger fake = Isolate.Fake.Instance<RealLogger>(Members.ReturnNulls, ConstructorWillBe.Called, 10); - - // Check that the value we've passed to the constructor was passed to the field - Assert.AreEqual(10, fake.count); - - fake.Count = 0; - // This call is faked because we set faked method behavior using ReturnNulls - fake.Increment(); - Assert.AreEqual(0, fake.Count); - - // Since we're returning Null by default the following Assert passes - Assert.IsNull(fake.IntCall()); - } - - Finally, using recursive faking, this test should pass: - - [TestMethod] - [Isolated] - public void RecursiveStubsChain() - { - // Call class constructor passing a number that will be passed to count field - RealLogger fake = Isolate.Fake.Instance<RealLogger>(Members.ReturnRecursiveFakes, ConstructorWillBe.Called, 10); - - // Check that the value we've passed to the constructor was passed to the field - Assert.AreEqual(10, fake.count); - - // This method returns a value type, and therefore, returns a fake 0. - Assert.AreEqual(0, fake.ReturnFive()); - - // This method returns an object, and therefore returns a non-null object - Assert.IsNotNull(fake.GetSon()); - - // And the result of GetSon also returns a non-null object - Assert.IsNotNull(fake.GetSon().GetNephew()); - } - - - - - - Overloaded. Fake future calls to static constructors of the given type. - - The type for which to fake static constructor calls - - Thown if the static constructor for the provided type has already been called, if an - instance fake of the type has already been created or if FakeStaticConstructors has already - been called for it. - - - This overload for FakeStaticConstructor receives a generic parameter. Because static classes cannot be instantiated, they - also cannot be used as generic type parameters. In order to fake the static constructors for a static class, use the non - generic overload which receives a Type parameter. - - - This example shows using Isolate.Fake.StaticConstructor() to fake a call to a static constructor - - [TestMethod] - [Isolated] - public void FakeStaticConstructor_CCtorNotCalled() - { - Isolate.Fake.StaticConstructor<TestClass>() - - TestClass.DoSomething(); // this causes the static constructor to be called - - // the call to the static constructor was faked so the flag equals false - Assert.IsFalse(TestClass.TrueIfCCtorHappened); - } - - - - - - - Overloaded. Fake future calls to static constructors of the given type. - - The type for which to fake static constructor calls - - Thown if the static constructor for the provided type has already been called, if an - instance fake of the type has already been created or if FakeStaticConstructors has already - been called for it. - - - This overload for FakeStaticConstructor receives a Type parameter which represents the class to fake static constructors for, - and should be used when faking constructors for static classes. For other non-static classes it is generally recommended to use the - generic overload , which receives the class as a generic type argument. - - - This example shows using Isolate.Fake.StaticConstructor() to fake a call to a static constructor - - [TestMethod] - [Isolated] - public void FakeStaticConstructor_CCtorNotCalled() - { - Isolate.Fake.StaticConstructor( typeof(StaticTestClass)) - - StaticTestClass.DoSomething(); // this causes the static constructor to be called - - // the call to the static constructor was faked so the flag equals false - Assert.IsFalse(StaticTestClass.TrueIfCCtorHappened); - } - - - - - - - Overloaded. Fakes all static methods for type T. Using this overload is equal to using Members.MustSpecifyReturnValues. - - The type to fake static methods for. - Members Enum - - Static class cannot be used as type argument. - Use IFaker.StaticMethods(Type type) or IFaker.StaticMethods(Type type, Members behavior) instead. - - - This example shows using FakeStaticMethods to stub all static void calls for a class - - [TestMethod] - [Isolated] - public void FakeStaticMethods_StubIncrementMethod() - { - Isolate.Fake.StaticMethods<LoggerFactory>(); - - LoggerFactory.Count = 0; - // This call is faked because we used the default overload for FakeStaticMethods - - // IncrementCount() is not really performed - LoggerFactory.IncrementCount(); - - Assert.AreEqual(0, LoggerFactory.Count); - } - - - - - - Overloaded. Fakes all static methods for the provided type. Using this overload is equal to using Members.MustSpecifyReturnValues. - - The type to fake static methods for. - Members Enum - - This overload receives a Type parameter representing the class to fake static methods for, and should be used - when faking methods for static classes. For other non-static classes it is generally recommended to use the - generic overload , which receives the class as a generic type argument. - - - This example shows using FakeStaticMethods to stub all static void calls for a class - - [TestMethod] - [Isolated] - public void FakeStaticMethods_StubIncrementMethod() - { - Isolate.Fake.StaticMethods( typeof(LoggerFactory)); - - LoggerFactory.Count = 0; - // This call is faked because we used the default overload for FakeStaticMethods - - // IncrementCount() is not really performed - LoggerFactory.IncrementCount(); - - Assert.AreEqual(0, LoggerFactory.Count); - } - - - - - - - Overloaded. Fakes all static methods for type T. - - The type to fake static methods for. - - Can be one of the following values: - - - Members ValueDescription - - Members.MustSpecifyReturnValues - Default. All void calls are ignored. Unless using on methods that return values and properties, they will throw a . - - - - Members.ReturnNulls - All void calls are ignored. Unless using on methods that return values and properties, they will return Null values (or zero for value types). - - - - Members.CallOriginal - All methods are called. Using allow to change this behavior. - - - - Members.ReturnRecursiveFakes - All void calls are ignored. When calling the fake's methods returning values or properties, they will return a fake value, which presents this behavior recursively. Any deep call will never return a Null value. - - - - - A fake instance of Type T. - - Static class cannot be used as type argument. - Use IFaker.StaticMethods(Type type) or IFaker.StaticMethods(Type type, Members behavior) instead. - - - - - - The following test shows the default behavior of FakeStaticMethods(): - - [TestMethod] - [Isolated] - public void FakeStaticMethods_UseDefault() - { - Isolate.Fake.StaticMethods<LoggerFactory>(); - - LoggerFactory.Count = 0; - // This call is faked because we used the default overload for FakeStaticMethods - - // IncrementCount() is not really performed - LoggerFactory.IncrementCount(); - - Assert.AreEqual(0, LoggerFactory.Count); - - // The following statement will throw, because we didn't set behavior on GetCount() method. - int x = LoggerFactory.GetCount(); - } - - The next test shows the CallOriginal setting for FakeStaticMethods(): - - [TestMethod] - [Isolated] - public void FakeStaticMethods_UseCallOriginal() - { - Isolate.Fake.StaticMethods<LoggerFactory>(Members.CallOriginal); - - LoggerFactory.Count = 0; - - // This call is not faked. Count should be incremented. - LoggerFactory.Increment(); - Assert.AreEqual(1, fake.Count); - } - - The next test shows what happens when using ReturnNulls: - - [TestMethod] - [Isolated] - public void FakeStaticMethods_UseReturnNulls() - { - Isolate.Fake.StaticMethods<LoggerFactory>(Members.ReturnNulls); - - LoggerFactory.Count = 0; - // This call is faked because we set faked method behavior using ReturnNulls - LoggerFactory.Increment(); - Assert.AreEqual(0, fake.Count); - - // Since we're returning Null by default the following Assert passes - Assert.IsNull(LoggerFactory.GetLogger()); - } - - Finally, using recursive faking, this test should pass: - - [TestMethod] - [Isolated] - public void RecursiveStubsChain() - { - Isolate.Fake.StaticMethods<LoggerFactory>(Members.ReturnRecursiveFakes); - - // This method returns a value type, and therefore, returns a fake 0. - Assert.AreEqual(0, LoggerFactory.GetLoggerCount()); - - // This method returns an object, and therefore returns a non-null object - Assert.IsNotNull(LoggerFactory.GetLogger()); - - // And the result of GetLogger also returns a non-null object - Assert.IsNotNull(LoggerFactory.GetLogger().GetWriter()); - } - - - - - - Overloaded. Fakes all static methods for the given type. - - The type to fake static methods for. - - Can be one of the following values: - - - Members ValueDescription - - Members.MustSpecifyReturnValues - Default. All void calls are ignored. Unless using on methods that return values and properties, they will throw a . - - - - Members.ReturnNulls - All void calls are ignored. Unless using on methods that return values and properties, they will return Null values (or zero for value types). - - - - Members.CallOriginal - All methods are called. Using allow to change this behavior. - - - - Members.ReturnRecursiveFakes - All void calls are ignored. When calling the fake's methods returning values or properties, they will return a fake value, which presents this behavior recursively. Any deep call will never return a Null value. - - - - - A fake instance of Type T. - - - - - - This overload receives a Type parameter representing the class to fake static methods for, and should be used - when faking methods for static classes. For other non-static classes it is generally recommended to use the - generic overload , which receives the class as a generic type argument. - - - The following test shows the default behavior of FakeStaticMethods(): - - [TestMethod] - [Isolated] - public void FakeStaticMethods_UseDefault() - { - Isolate.Fake.StaticMethods(typeof (LoggerFactory)); - - LoggerFactory.Count = 0; - // This call is faked because we used the default overload for FakeStaticMethods - - // IncrementCount() is not really performed - LoggerFactory.IncrementCount(); - - Assert.AreEqual(0, LoggerFactory.Count); - - // The following statement will throw, because we didn't set behavior on GetCount() method. - int x = LoggerFactory.GetCount(); - } - - The next test shows the CallOriginal setting for FakeStaticMethods(): - - [TestMethod] - [Isolated] - public void FakeStaticMethods_UseCallOriginal() - { - Isolate.Fake.StaticMethods(typeof (LoggerFactory), Members.CallOriginal); - - LoggerFactory.Count = 0; - - // This call is not faked. Count should be incremented. - LoggerFactory.Increment(); - Assert.AreEqual(1, fake.Count); - } - - The next test shows what happens when using ReturnNulls: - - [TestMethod] - [Isolated] - public void FakeStaticMethods_UseReturnNulls() - { - Isolate.Fake.StaticMethods(typeof (LoggerFactory), Members.ReturnNulls); - - LoggerFactory.Count = 0; - // This call is faked because we set faked method behavior using ReturnNulls - LoggerFactory.Increment(); - Assert.AreEqual(0, fake.Count); - - // Since we're returning Null by default the following Assert passes - Assert.IsNull(LoggerFactory.GetLogger()); - } - - Finally, using recursive faking, this test should pass: - - [TestMethod] - [Isolated] - public void RecursiveStubsChain() - { - Isolate.Fake.StaticMethods(typeof (LoggerFactory), Members.ReturnRecursiveFakes); - - // This method returns a value type, and therefore, returns a fake 0. - Assert.AreEqual(0, LoggerFactory.GetLoggerCount()); - - // This method returns an object, and therefore returns a non-null object - Assert.IsNotNull(LoggerFactory.GetLogger()); - - // And the result of GetLogger also returns a non-null object - Assert.IsNotNull(LoggerFactory.GetLogger().GetWriter()); - } - - - - - - Returned by , this interface contains methods for verifying the method calls and checking their arguments. - - - - - Overloaded. Verifies that a method was called, without checking its arguments. - - A void method in the form of a Lambda Expression that we want to verify if was called. - - Thrown if the method, or chain of methods was not called. - - - This can also be a chain of methods. In that case, the verification is on the entire chain, and not part of it. - When arguments are specified, they are ignored in the verification. - - - This example shows how to use Isolate.Verify in order to check a method was called: - - [TestMethod] - [Isolated] - public void VerifyMethodWasCalled() - { - RealLogger fake = Isolate.Fake.Instance<RealLogger>(); - - fake.Write("Hello"); - - // We did not check the call for argument matching so this verification should pass - Isolate.Verify.WasCalledWithAnyArguments(() => fake.Write("Goodbye")); - } - - - - - - - Overloaded. Verifies that a method was called, without checking its arguments. - - A method returning a value in the form of a Lambda Expression that we want to verify if was called. - - Thrown if the method, or chain of methods was not called. - - - This can also be a chain of methods. In that case, the verification is on the entire chain, and not part of it. - When arguments are specified, they are ignored in the verification. - - - This example shows how to use Isolate.Verify in order to check a method was called: - - [TestMethod] - [Isolated] - public void VerifyMethodWasCalled() - { - RealLogger fake = Isolate.Fake.Instance<RealLogger>(Members.ReturnNulls); - - int x = fake.GetCount(); - - Isolate.Verify.WasCalledWithAnyArguments(() => fake.GetCount()); - } - - - - - - Overloaded. Verifies that a method was called, and checking its arguments. - - A void method in the form of a Lambda Expression that we want to verify if was called. - - Thrown if the method, or chain of methods was not called with the specified arguments. - - - This can also be a chain of methods. In that case, the verification is on the entire chain, and not part of it. - - - This example shows how to use Isolate.Verify in order to check a method was called - with a specific set of arguments: - - [TestMethod] - [Isolated] - public void VerifyMethodWasCalled_WithExactArguments() - { - RealLogger fake = Isolate.Fake.Instance<RealLogger>(); - - fake.Write("Hello"); - - // As we're verifying the call was made with exact arguments, this verification should fail - Isolate.Verify.WasCalledWithExactArguments(() => fake.Write("Goodbye")); - } - - - - - - Overloaded. Verifies that a method was called, and checking its arguments. - - A method returning a value in the form of a Lambda Expression that we want to verify if was called. - - Thrown if the method, or chain of methods was not called with the specified arguments. - - - This can also be a chain of methods. In that case, the verification is on the entire chain, and not part of it. - - - This example shows how to use Isolate.Verify in order to check a method was called - with a specific set of arguments: - - [TestMethod] - [Isolated] - public void VerifyMethodWasCalled_WithExactArguments() - { - RealLogger fake = Isolate.Fake.Instance<RealLogger>(); - - fake.Write("Hello"); - - // As we're verifying the call was made with exact arguments, this verification should fail - Isolate.Verify.WasCalledWithExactArguments(() => fake.Write("Goodbye")); - } - - - - - - Overloaded. Verifies that a method was not called regardless of parameters. - - A void method in the form of a Lambda Expression that we want to verify if was called. - - Thrown if the method, or chain of methods was called at least once. - - - This can also be a chain of methods. In that case, the verification is on the entire chain, and not part of it. - - - This example shows how to use Isolate.Verify in order to check a method was not called - - [TestMethod] - [Isolated] - public void VerifyMethodWasNotCalled() - { - RealLogger fake = Isolate.Fake.Instance<RealLogger>(); - - fake.Increment(); - - // This verification should fail - Isolate.Verify.WasNotCalled(() => fake.Increment()); - } - - - - - - Overloaded. Verifies that a method was not called regardless of parameters. - - A method returning a value in the form of a Lambda Expression that we want to verify if was called. - - Thrown if the method, or chain of methods was called at least once. - - - This can also be a chain of methods. In that case, the verification is on the entire chain, and not part of it. - - - This example shows how to use Isolate.Verify in order to check a method was not called - - [TestMethod] - [Isolated] - public void VerifyMethodWasNotCalled() - { - RealLogger fake = Isolate.Fake.Instance<RealLogger>(); - - fake.Increment(); - - // This verification should fail - Isolate.Verify.WasNotCalled(() => fake.Increment()); - } - - - - - - Provides an entry point to verify non-public (private, protected, internal) members - - - - - Interface used as part of the future object pattern. The pattern allows swapping of a - given instance with a mocked instance on its creation - - - - Here is an example how to use Isolate.Swap.NextInstance in order to fake a future instance: - - [TestMethod] - [Isolated] - public void SwapAFutureInstance_StubIncrementMethod() - { - RealLogger fake = Isolate.Fake.Instance<RealLogger>(); - Isolate.Swap.NextInstance<RealLogger>().With(fake); - - Isolate.WhenCalled(() => fake.Increment()).IgnoreCall(); - - // This object is swapped with the fake - RealLogger logger = new RealLogger(); - - // Make sure Count is reset - logger.Count = 0; - - // This call is faked - count should not increment - logger.Increment(); - - Assert.AreEqual(0, logger.Count); - } - - - - - - Specify the fake instance that will replace the created instance. - - the fake instance that will replace the created instance - - - - Specify that an exception will be thrown the next time a construction is encountered for the type - - The exception that will be thrown when the constructor is called - - - - Specifies that the behavior will only be set on method calls with the exact arguments. - - - - WithExactArguments() is a completing statement for . - - - - This example shows how to use WithExactArguments() to set behavior on specific method call - - [TestMethod] - [Isolated] - public void WithExactArguments_DifferentArgsReturnDifferentValues() - { - // create a fake logger which will behave as the original one - RealLogger fake = Isolate.Fake.Instance<RealLogger>(Members.CallOriginal); - - // Set return value according to exact arguments - Isolate.WhenCalled(() => fake.VoidCallWithArg(0)).WithExactArguments().IgnoreCall(); - Isolate.WhenCalled(() => fake.VoidCallWithArg(1)).WithExactArguments().CallOriginal(); - Isolate.WhenCalled(() => fake.VoidCallWithArg(2)).WithExactArguments().WillThrow(new Exception("")); - - // Check that the correct value returned - fake.VoidCallWithArg(0); // This call will be ignored - fake.VoidCallWithArg(1); // This call will call the real method - fake.VoidCallWithArg(2); // This call will throw an exception - } - - - - - - Interface for performing object to object method call swapping - - - This interface is returned by calling Isolate.Swap.. Follow it by calling - the completing statement. - - - - - - - Completes swapping method calls for an object. Is called as a completing statement for Isolate.Swap., - and defines the target object to perform swapping on. - - The object whose implementation should be used - An interface reference. - - When a method is called on the swapped object, it is replaced with a corresponding implementation (a method - with the same signature) on the swapping object. This means that the swapped object will start behaving like - the object it was swapped with for all methods they have in common. - - When a method is called on the swapped object that does not exist in the target object, it will be called on the original - object. - - - - If there are no compatible methods to swap between the swapping source and target objects. - - - This example shows how to use Isolate.Swap.. in order to - redirect calls from an object to a stand-in object: - - [TestMethod] - [Isolated] - public void SwapCallsOnObject_CallsRedirectedToTargetObject() - { - // Create the object under test - RealLogger logger = new RealLogger(); - // Create the object calls will be redirected to - TestLogger swapped = new TestLogger(); - - // Redirect any calls from the object under test to the swapping target - Isolate.Swap.CallsOn(logger).WithCallsTo(swapped); - - // logger.Write() is redirected to TestLogger.Write() which writes to console instead of disk - logger.Write("Hello World"); - - // We can still verify the call to logger.Write() happened - Isolate.Verify.WasCalledWithAnyArguments(() => logger.Write("")); - } - - // excerpt code for the class under test: - public class RealLogger - { - string logFilePath = ...; - public void Write(string toWrite) - { - logFile.WriteAllText(logFilePath, toWrite); - } - } - - // excerpt code for the replacement class: - public class TestLogger - { - public void Write(string toWrite) - { - Console.WriteLine("RealLogger.Write() was called with {0}", toWrite); - } - } - - - - - - Interface for tweaking behavior for methods returning collection types. This can be used to replace collection values returned - by a method or property with another test data collection. - This interface is returned by the method. - - - - - Swaps a collection returned by a method or property with a collection of test data. Follows a call to - . - - The collection to use instead of the replaced collection - - - This method is used as a completing statement to , and is used to - replace the collection in the preceeding statement with the provided collection. - This is useful when the code under test uses collection data that is prepared externally and then iterated over. - The collection containing this data can be swapped with a test data collection prepared during the test set up and thus remove - the dependency on the code populating the collection. - - - Note: because Typemock Isolator does not currently support faking objects implemented in MsCorLib.dll, - the source collection used with WhenCalled() cannot be one implemented in MsCorLib, such as - and . - - - - If the lambda expression provided in Isolate.WhenCalled() does not - evaluate to an object implementing . - - - This example shows how to use Isolate.. in order to - swap a collection data for test data: - - [TestMethod] - [Isolated] - public void SwapCollectionValues_ReplaceCollectionWithTestData() - { - // Create a logger to use as test data - RealLogger logger = new RealLogger(); - // Swap the logger collection for the class under test with a collection containing the prepared test data - Isolate.WhenCalled(() => LoggerFactory.Loggers).WithValuesFrom(new[] { logger }); - - // Verify the GetLogger() method returned the existing logger instead of creating a new one. - RealLogger actual = LoggerFactory.GetLogger(); - Assert.AreSame(logger, actual); - } - - - - - - A behavior setting on how the fake object is created. - - - - - All void calls are ignored. Unless using WhenCalled on methods that return values and properties, they will throw a . - - - - - All methods are called. Using WhenCalled allow to change this behavior. - - - - - All void calls are ignored. Unless using WhenCalled on methods that return values and properties, they will return Null values (or zero for value types). - - - - - Default. All void calls are ignored. When calling the fake's methods returning values or properties, they will return a fake value, which presents this behavior recursively. Any deep call will never return a Null value. - - - - - A behavior setting on how the fake object is created. - - - - - Don't execute constructor when creating a fake object - - - - - Run constructor when creating a fake object - - - - - Overloaded. Returns a fake instance of type T. Using this overload is equal to using Members.MustSpecifyReturnValues. - - The type of fake object to create. - A fake instance of type T. - Members Enum - - Here is an example how to use Instance in order to fake a RealLogger instance: - - [TestMethod] - [Isolated] - public void FakeAnInstance_StubIncrementMethod() - { - RealLogger fake = Isolate.Fake.Instance<RealLogger>(); - - fake.Count = 0; - - // This call is faked because we used the default Instance overload - count should not increment - fake.Increment(); - - Assert.AreEqual(0, fake.Count); - } - - - - - - Overloaded. Returns a fake instance of type T. - - - - The type of the fake instance to be created. - - Can be one of the following values: - - - Members ValueDescription - - Members.MustSpecifyReturnValues - Default. All void calls are ignored. Unless using on methods that return values and properties, they will throw a . - - - - Members.ReturnNulls - All void calls are ignored. Unless using on methods that return values and properties, they will return Null values (or zero for value types). - - - - Members.CallOriginal - All methods are called. Using allow to change this behavior. - - - - Members.ReturnRecursiveFakes - All void calls are ignored. When calling the fake's methods returning values or properties, they will return a fake value, which presents this behavior recursively. Any deep call will never return a Null value. - - - - - A fake instance of Type T. - - - The following test shows the default behavior of Instance: - - [TestMethod] - [Isolated] - public void FakeAnInstance_UseDefault() - { - RealLogger fake = Isolate.Fake.Instance<RealLogger>(); - - fake.Count = 0; - - // This call is faked because we used Instance's default overload - count should not increment - fake.Increment(); - Assert.AreEqual(0, fake.Count); - - // The following statement will throw, because we didn't set behavior on IntCall method. - int x = fake.IntCall(); - } - - The next test shows the CallOriginal setting on Instance: - - [TestMethod] - [Isolated] - public void FakeAnInstance_UseCallOriginal() - { - RealLogger fake = Isolate.Fake.Instance<RealLogger>(Members.CallOriginal); - - fake.Count = 0; - - // This call is not faked. Count should be incremented. - fake.Increment(); - Assert.AreEqual(1, fake.Count); - } - - The next test shows what happens when using ReturnNulls: - - [TestMethod] - [Isolated] - public void FakeAnInstance_UseReturnNulls() - { - RealLogger fake = Isolate.Fake.Instance<RealLogger>(Members.ReturnNulls); - - fake.Count = 0; - // This call is faked because we set faked method behavior using ReturnNulls - fake.Increment(); - Assert.AreEqual(0, fake.Count); - - // Since we're returning Null by default the following Assert passes - Assert.IsNull(fake.IntCall()); - } - - Finally, using recursive faking, this test should pass: - - [TestMethod] - [Isolated] - public void RecursiveStubsChain() - { - RealLogger fake = Isolate.Fake.Instance<RealLogger>(Members.ReturnRecursiveFakes); - - // This method returns a value type, and therefore, returns a fake 0. - Assert.AreEqual(0, fake.ReturnFive()); - - // This method returns an object, and therefore returns a non-null object - Assert.IsNotNull(fake.GetSon()); - - // And the result of GetSon also returns a non-null object - Assert.IsNotNull(fake.GetSon().GetNephew()); - } - - - - - - Interface for specifying behavior for intercepted calls on public methods returning values. The interface is returned - by the method. - - - This interface allow tweaking the behavior of public methods that has return values. - - - - - Specify that the intercepted method will return a recursive fake. - The real implementation will not be executed. - - - - ReturnRecursiveFake() is a completing statement for . It - is similar to using the behavior setting when creating - fake objects with , but applies only to a single method. - - Use ReturnRecursiveFake() on a method to fake out calls to the method and any call chains - beginning with it. When ReturnRecursiveFake() is called on a method returning an object, - a fake object will be returned. That fake object in turn will return fake values for any - method calls. - ReturnRecursiveFake() on a method returning a value type will set the method to return - the default value of that type. - - - - - This example shows using ReturnRecursiveFake() to fake out a call chain - - [TestMethod] - [Isolated] - public void ReturnRecursiveFake_ChainedCallsAreFake() - { - // create a fake logger which will behave as the original one - RealLogger fake = Isolate.Fake.Instance<RealLogger>(Members.CallOriginal); - - // exclude one method from the default behavior and return a recursive fake from it - Isolate.WhenCalled(() => fake.Storage).ReturnRecursiveFake(); - - // subsequent calls to the method will not return null values - Assert.IsNotNull(fake.Storage); - Assert.IsNotNull(fake.Storage.FileSystem); - // methods returning a value type will return the default value for the type - Assert.AreEqual(0, fake.Storage.FreeSpaceInBytes); - } - - - - - - Specifies that the behavior will only be set on method calls with the exact arguments. - - - - WithExactArguments() is a completing statement for . - - - - This example shows how to use WithExactArguments() to set behavior on specific method call - - [TestMethod] - [Isolated] - public void WithExactArguments_DifferentArgsReturnDifferentValues() - { - // create a fake logger which will behave as the original one - RealLogger fake = Isolate.Fake.Instance<RealLogger>(Members.CallOriginal); - - // Set return value according to exact arguments - Isolate.WhenCalled(() => fake.IntCallWithArg(0)).WithExactArguments().WillReturn(10); - Isolate.WhenCalled(() => fake.IntCallWithArg(1)).WithExactArguments().WillReturn(20); - - // Check that the correct value returned - Assert.AreEqual(10, fake.IntCallWithArg(0)); - Assert.AreEqual(20, fake.IntCallWithArg(1)); - } - - - - - - This class used as part of the future object pattern. The pattern allows swapping of a - given instance with a mocked instance on its creation - - - - Here is an example how to use NextInstance in order to fake a future instance: - - [TestMethod] - [Isolated] - public void SwapAFutureInstance_StubIncrementMethod() - { - RealLogger fake = Isolate.Fake.Instance<RealLogger>(); - Isolate.Swap.NextInstance<RealLogger>().With(fake); - - Isolate.WhenCalled(() => fake.Increment()).IgnoreCall(); - - // This object is swapped with the fake - RealLogger logger = new RealLogger(); - - // Make sure Count is reset - logger.Count = 0; - - // This call is faked - count should not increment - logger.Increment(); - - Assert.AreEqual(0, logger.Count); - } - - - - - - - Specify the fake instance that will replace the created instance. - - the fake instance that will replace the created instance - - - - - This class used as part of the future object pattern. The pattern allows swapping of a - given instance with a mocked instance on its creation - - - - Here is an example how to use NextInstance in order to fake a future instance: - - [TestMethod] - [Isolated] - public void SwapAFutureInstance_StubIncrementMethod() - { - RealLogger fake = Isolate.Fake.Instance<RealLogger>(); - Isolate.Swap.NextInstance<RealLogger>().With(fake); - - Isolate.WhenCalled(() => fake.Increment()).IgnoreCall(); - - // This object is swapped with the fake - RealLogger logger = new RealLogger(); - - // Make sure Count is reset - logger.Count = 0; - - // This call is faked - count should not increment - logger.Increment(); - - Assert.AreEqual(0, logger.Count); - } - - - - - - diff --git a/src/LinqToUmbraco/dep/Schemas/DocTypeML.xsd b/src/LinqToUmbraco/dep/Schemas/DocTypeML.xsd deleted file mode 100644 index e27765e1e7..0000000000 --- a/src/LinqToUmbraco/dep/Schemas/DocTypeML.xsd +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - - - Repesents an Umbraco Document Type and its known properties - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Name prefix for the DataContext that will be generated - - - - - - - - Serialization mode of the generated classes - - - - - - - - - - - - - - Pairing of ID and Name - - - - - - - - \ No newline at end of file diff --git a/src/LinqToUmbraco/dep/Schemas/UmbracoConfig.xsd b/src/LinqToUmbraco/dep/Schemas/UmbracoConfig.xsd deleted file mode 100644 index bbb8ae92b4..0000000000 --- a/src/LinqToUmbraco/dep/Schemas/UmbracoConfig.xsd +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/LinqToUmbraco/src/umbraco.Linq/Core.Mockable.Tests/Core.Mockable.Tests.csproj b/src/LinqToUmbraco/src/umbraco.Linq/Core.Mockable.Tests/Core.Mockable.Tests.csproj deleted file mode 100644 index 351b3025bf..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/Core.Mockable.Tests/Core.Mockable.Tests.csproj +++ /dev/null @@ -1,83 +0,0 @@ - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {324A7FA9-8F19-4D4D-B96A-6F673C82BC92} - Library - Properties - umbraco.LinqCore.Mockable.Tests - umbraco.LinqCore.Mockable.Tests - v3.5 - 512 - {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - SAK - SAK - SAK - SAK - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - true - bin\Debug - Fixed Version\ - DEBUG;TRACE - full - AnyCPU - true - GlobalSuppressions.cs - prompt - - - - - False - ..\..\..\dep\Reference Assemblies\Mocking\Rhino.Mocks.dll - - - - 3.5 - - - 3.0 - - - - - Properties\SolutionInfo.cs - - - - - - - - {31CAEC36-0C3D-4D69-B092-84866811EA07} - umbraco.Linq.Core - - - - - \ No newline at end of file diff --git a/src/LinqToUmbraco/src/umbraco.Linq/Core.Mockable.Tests/DataContextMockTest.cs b/src/LinqToUmbraco/src/umbraco.Linq/Core.Mockable.Tests/DataContextMockTest.cs deleted file mode 100644 index abf73aa49c..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/Core.Mockable.Tests/DataContextMockTest.cs +++ /dev/null @@ -1,84 +0,0 @@ -using System; -using System.Text; -using System.Collections.Generic; -using System.Linq; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Rhino.Mocks; -using umbraco.Linq.Core; -using umbraco.Test; - -namespace umbraco.LinqCore.Mockable.Tests -{ - /// - /// Summary description for DataContextMockTest - /// - [TestClass] - public class DataContextMockTest - { - public DataContextMockTest() - { - - } - - private TestContext testContextInstance; - - /// - ///Gets or sets the test context which provides - ///information about and functionality for the current test run. - /// - public TestContext TestContext - { - get - { - return testContextInstance; - } - set - { - testContextInstance = value; - } - } - - #region Additional test attributes - // - // You can use the following additional attributes as you write your tests: - // - // Use ClassInitialize to run code before running the first test in the class - // [ClassInitialize()] - // public static void MyClassInitialize(TestContext testContext) { } - // - // Use ClassCleanup to run code after all tests in a class have run - // [ClassCleanup()] - // public static void MyClassCleanup() { } - // - // Use TestInitialize to run code before running each test - // [TestInitialize()] - // public void MyTestInitialize() { } - // - // Use TestCleanup to run code after each test has run - // [TestCleanup()] - // public void MyTestCleanup() { } - // - #endregion - - [TestMethod] - public void DataContextMockTest_MockProvider() - { - var dataProvider = MockRepository.GenerateMock(); - using (var ctx = new MyUmbracoDataContext(dataProvider)) - { - } - } - - [TestMethod, ExpectedException(typeof(NotImplementedException))] - public void DataContextMockTest_MockProviderThrowsException() - { - var dataProvider = MockRepository.GenerateMock(); - - dataProvider.Stub(d => d.LoadTree()).Throw(new NotImplementedException()); - using (var ctx = new MyUmbracoDataContext(dataProvider)) - { - var homes = ctx.CwsHomes; - } - } - } -} diff --git a/src/LinqToUmbraco/src/umbraco.Linq/Core.Mockable.Tests/MyUmbraco.designer.cs b/src/LinqToUmbraco/src/umbraco.Linq/Core.Mockable.Tests/MyUmbraco.designer.cs deleted file mode 100644 index 63fd92b661..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/Core.Mockable.Tests/MyUmbraco.designer.cs +++ /dev/null @@ -1,3868 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:2.0.50727.3074 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace umbraco.Test -{ - using umbraco.Linq.Core; - using umbraco.Linq.Core.Node; - using System.Linq; - - - public partial class MyUmbracoDataContext : UmbracoDataContext - { - - #region Partials - partial void OnCreated(); - #endregion - - - public MyUmbracoDataContext() : - base() - { - OnCreated(); - } - - public MyUmbracoDataContext(UmbracoDataProvider provider) : - base(provider) - { - OnCreated(); - } - - public Tree Runwayhomepages - { - get - { - return this.LoadTree(); - } - } - - public Tree Runwaytextpages - { - get - { - return this.LoadTree(); - } - } - - public Tree ContentFolders - { - get - { - return this.LoadTree(); - } - } - - public Tree Persons - { - get - { - return this.LoadTree(); - } - } - - public Tree InheritedFolders - { - get - { - return this.LoadTree(); - } - } - - public Tree CwsContacts - { - get - { - return this.LoadTree(); - } - } - - public Tree CwsEmailafriends - { - get - { - return this.LoadTree(); - } - } - - public Tree CwsEventitems - { - get - { - return this.LoadTree(); - } - } - - public Tree CwsGallerylists - { - get - { - return this.LoadTree(); - } - } - - public Tree CwsGalleries - { - get - { - return this.LoadTree(); - } - } - - public Tree CwsHomes - { - get - { - return this.LoadTree(); - } - } - - public Tree CwsNewseventslists - { - get - { - return this.LoadTree(); - } - } - - public Tree CwsNewsitems - { - get - { - return this.LoadTree(); - } - } - - public Tree CwsPhotos - { - get - { - return this.LoadTree(); - } - } - - public Tree CwsTextpages - { - get - { - return this.LoadTree(); - } - } - - public Tree CwsTextpagetwocols - { - get - { - return this.LoadTree(); - } - } - - public Tree TextpageThreeCols - { - get - { - return this.LoadTree(); - } - } - } - - /// - /// The homepage of a Runway website. - /// - [UmbracoInfo("RunwayHomepage")] - [System.Runtime.Serialization.DataContractAttribute()] - [DocType()] - public partial class Runwayhomepage : DocTypeBase - { - - private string _Bodytext; - - private string _Sitename; - - private string _Sitedescription; - - private AssociationTree _Runwaytextpages; - - public Runwayhomepage() - { - } - - /// - /// - /// - [UmbracoInfo("bodyText", DisplayName = "Body text", Mandatory = false)] - [Property()] - public virtual string Bodytext - { - get - { - return this._Bodytext; - } - set - { - if ((this._Bodytext != value)) - { - this.RaisePropertyChanging(); - this._Bodytext = value; - this.RaisePropertyChanged("Bodytext"); - } - } - } - - /// - /// - /// - [UmbracoInfo("siteName", DisplayName = "Site Name", Mandatory = false)] - [Property()] - public virtual string Sitename - { - get - { - return this._Sitename; - } - set - { - if ((this._Sitename != value)) - { - this.RaisePropertyChanging(); - this._Sitename = value; - this.RaisePropertyChanged("Sitename"); - } - } - } - - /// - /// - /// - [UmbracoInfo("siteDescription", DisplayName = "Site Description", Mandatory = false)] - [Property()] - public virtual string Sitedescription - { - get - { - return this._Sitedescription; - } - set - { - if ((this._Sitedescription != value)) - { - this.RaisePropertyChanging(); - this._Sitedescription = value; - this.RaisePropertyChanged("Sitedescription"); - } - } - } - - public AssociationTree Runwaytextpages - { - get - { - if ((this._Runwaytextpages == null)) - { - this._Runwaytextpages = this.ChildrenOfType(); - } - return this._Runwaytextpages; - } - set - { - this._Runwaytextpages = value; - } - } - } - - /// - /// Runway textpage; this is the standard content page for a Runway website. - /// - [UmbracoInfo("RunwayTextpage")] - [System.Runtime.Serialization.DataContractAttribute()] - [DocType()] - public partial class Runwaytextpage : DocTypeBase - { - - private string _Bodytext; - - private int _umbraconavihide; - - private AssociationTree _Runwaytextpages; - - public Runwaytextpage() - { - } - - /// - /// - /// - [UmbracoInfo("bodyText", DisplayName = "Body Text", Mandatory = false)] - [Property()] - public virtual string Bodytext - { - get - { - return this._Bodytext; - } - set - { - if ((this._Bodytext != value)) - { - this.RaisePropertyChanging(); - this._Bodytext = value; - this.RaisePropertyChanged("Bodytext"); - } - } - } - - /// - /// - /// - [UmbracoInfo("umbracoNaviHide", DisplayName = "Hide in navigation", Mandatory = false)] - [Property()] - public virtual int umbraconavihide - { - get - { - return this._umbraconavihide; - } - set - { - if ((this._umbraconavihide != value)) - { - this.RaisePropertyChanging(); - this._umbraconavihide = value; - this.RaisePropertyChanged("umbraconavihide"); - } - } - } - - private bool umbraconavihideBoolean - { - get - { - return (this._umbraconavihide == 0); - } - } - - public AssociationTree Runwaytextpages - { - get - { - if ((this._Runwaytextpages == null)) - { - this._Runwaytextpages = this.ChildrenOfType(); - } - return this._Runwaytextpages; - } - set - { - this._Runwaytextpages = value; - } - } - } - - /// - /// - /// - [UmbracoInfo("Content Folder")] - [System.Runtime.Serialization.DataContractAttribute()] - [DocType()] - public partial class ContentFolder : DocTypeBase - { - - private AssociationTree _Persons; - - public ContentFolder() - { - } - - public AssociationTree Persons - { - get - { - if ((this._Persons == null)) - { - this._Persons = this.ChildrenOfType(); - } - return this._Persons; - } - set - { - this._Persons = value; - } - } - } - - /// - /// - /// - [UmbracoInfo("Person")] - [System.Runtime.Serialization.DataContractAttribute()] - [DocType()] - public partial class Person : DocTypeBase - { - - private string _Firstname; - - private string _Lastname; - - public Person() - { - } - - /// - /// - /// - [UmbracoInfo("FirstName", DisplayName = "First Name", Mandatory = false)] - [Property()] - public virtual string Firstname - { - get - { - return this._Firstname; - } - set - { - if ((this._Firstname != value)) - { - this.RaisePropertyChanging(); - this._Firstname = value; - this.RaisePropertyChanged("Firstname"); - } - } - } - - /// - /// - /// - [UmbracoInfo("LastName", DisplayName = "Last Name", Mandatory = false)] - [Property()] - public virtual string Lastname - { - get - { - return this._Lastname; - } - set - { - if ((this._Lastname != value)) - { - this.RaisePropertyChanging(); - this._Lastname = value; - this.RaisePropertyChanged("Lastname"); - } - } - } - } - - /// - /// - /// - [UmbracoInfo("Inherited Folder")] - [System.Runtime.Serialization.DataContractAttribute()] - [DocType()] - public partial class InheritedFolder : ContentFolder - { - - public InheritedFolder() - { - } - } - - /// - /// This is the contact form document type for your site. - /// - [UmbracoInfo("CWS_Contact")] - [System.Runtime.Serialization.DataContractAttribute()] - [DocType()] - public partial class CwsContact : DocTypeBase - { - - private string _Emailto; - - private string _Emailsubject; - - private string _Emailbody; - - private string _Emailreplyfrom; - - private string _Emailreplysubject; - - private string _Emailreplybody; - - private int _Enablessl; - - private string _umbracourlname; - - private string _umbracourlalias; - - private string _Metadescription; - - private string _Metakeywords; - - private int _umbracoredirect; - - private int _umbraconavihide; - - private string _Headertext; - - private string _Formtext; - - private string _Thankyouheadertext; - - private string _Thankyoumessagetext; - - private AssociationTree _CwsTextpages; - - public CwsContact() - { - } - - /// - /// The email address that you want the form to be sent to. - /// - [UmbracoInfo("emailTo", DisplayName = "Email To", Mandatory = true)] - [Property()] - public virtual string Emailto - { - get - { - return this._Emailto; - } - set - { - if ((this._Emailto != value)) - { - this.RaisePropertyChanging(); - this._Emailto = value; - this.RaisePropertyChanged("Emailto"); - } - } - } - - /// - /// The subject of the email that will be sent to you. - /// - [UmbracoInfo("emailSubject", DisplayName = "Email Subject", Mandatory = true)] - [Property()] - public virtual string Emailsubject - { - get - { - return this._Emailsubject; - } - set - { - if ((this._Emailsubject != value)) - { - this.RaisePropertyChanging(); - this._Emailsubject = value; - this.RaisePropertyChanged("Emailsubject"); - } - } - } - - /// - /// Use placeholders [Name], [AddressLine1], [AddressLine2], [Email], [Message], [Time] and [Date] - /// - [UmbracoInfo("emailBody", DisplayName = "Email Message", Mandatory = true)] - [Property()] - public virtual string Emailbody - { - get - { - return this._Emailbody; - } - set - { - if ((this._Emailbody != value)) - { - this.RaisePropertyChanging(); - this._Emailbody = value; - this.RaisePropertyChanged("Emailbody"); - } - } - } - - /// - /// The email address that you want the automated reply to be sent from. - /// - [UmbracoInfo("emailReplyFrom", DisplayName = "Email Reply From", Mandatory = true)] - [Property()] - public virtual string Emailreplyfrom - { - get - { - return this._Emailreplyfrom; - } - set - { - if ((this._Emailreplyfrom != value)) - { - this.RaisePropertyChanging(); - this._Emailreplyfrom = value; - this.RaisePropertyChanged("Emailreplyfrom"); - } - } - } - - /// - /// The subject of the email that will be sent as the automated reply. - /// - /// - [UmbracoInfo("emailReplySubject", DisplayName = "Email Reply Subject", Mandatory = false)] - [Property()] - public virtual string Emailreplysubject - { - get - { - return this._Emailreplysubject; - } - set - { - if ((this._Emailreplysubject != value)) - { - this.RaisePropertyChanging(); - this._Emailreplysubject = value; - this.RaisePropertyChanged("Emailreplysubject"); - } - } - } - - /// - /// Use placeholder [Name] - /// - [UmbracoInfo("emailReplyBody", DisplayName = "Email Reply Body", Mandatory = false)] - [Property()] - public virtual string Emailreplybody - { - get - { - return this._Emailreplybody; - } - set - { - if ((this._Emailreplybody != value)) - { - this.RaisePropertyChanging(); - this._Emailreplybody = value; - this.RaisePropertyChanged("Emailreplybody"); - } - } - } - - /// - /// Does your SMTP server require SSL? - /// - [UmbracoInfo("enableSSL", DisplayName = "Enable SSL", Mandatory = false)] - [Property()] - public virtual int Enablessl - { - get - { - return this._Enablessl; - } - set - { - if ((this._Enablessl != value)) - { - this.RaisePropertyChanging(); - this._Enablessl = value; - this.RaisePropertyChanged("Enablessl"); - } - } - } - - private bool EnablesslBoolean - { - get - { - return (this._Enablessl == 0); - } - } - - /// - /// If you wish to change the URL of the node without changing the node name fill this in. - /// - ///eg: warren - /// - [UmbracoInfo("umbracoUrlName", DisplayName = "umbraco URL Name", Mandatory = false)] - [Property()] - public virtual string umbracourlname - { - get - { - return this._umbracourlname; - } - set - { - if ((this._umbracourlname != value)) - { - this.RaisePropertyChanging(); - this._umbracourlname = value; - this.RaisePropertyChanged("umbracourlname"); - } - } - } - - /// - /// Use this to give a node multiple urls. - /// - ///eg: home,homepage/another-level - /// - [UmbracoInfo("umbracoUrlAlias", DisplayName = "umbraco URL Alias", Mandatory = false)] - [Property()] - public virtual string umbracourlalias - { - get - { - return this._umbracourlalias; - } - set - { - if ((this._umbracourlalias != value)) - { - this.RaisePropertyChanging(); - this._umbracourlalias = value; - this.RaisePropertyChanged("umbracourlalias"); - } - } - } - - /// - /// Enter the description for the page. - /// - [UmbracoInfo("metaDescription", DisplayName = "Meta Description", Mandatory = false)] - [Property()] - public virtual string Metadescription - { - get - { - return this._Metadescription; - } - set - { - if ((this._Metadescription != value)) - { - this.RaisePropertyChanging(); - this._Metadescription = value; - this.RaisePropertyChanged("Metadescription"); - } - } - } - - /// - /// Enter a comma seperated list of keywords. - ///warren, keyword, test - /// - [UmbracoInfo("metaKeywords", DisplayName = "Meta Keywords", Mandatory = false)] - [Property()] - public virtual string Metakeywords - { - get - { - return this._Metakeywords; - } - set - { - if ((this._Metakeywords != value)) - { - this.RaisePropertyChanging(); - this._Metakeywords = value; - this.RaisePropertyChanged("Metakeywords"); - } - } - } - - /// - /// Pick a node you wish to redirect to if the user lands on this node. - /// - [UmbracoInfo("umbracoRedirect", DisplayName = " umbraco Redirect", Mandatory = false)] - [Property()] - public virtual int umbracoredirect - { - get - { - return this._umbracoredirect; - } - set - { - if ((this._umbracoredirect != value)) - { - this.RaisePropertyChanging(); - this._umbracoredirect = value; - this.RaisePropertyChanged("umbracoredirect"); - } - } - } - - /// - /// Use this property if you wish to hide this page in the navigation. - /// - [UmbracoInfo("umbracoNaviHide", DisplayName = "Hide in Navi", Mandatory = false)] - [Property()] - public virtual int umbraconavihide - { - get - { - return this._umbraconavihide; - } - set - { - if ((this._umbraconavihide != value)) - { - this.RaisePropertyChanging(); - this._umbraconavihide = value; - this.RaisePropertyChanged("umbraconavihide"); - } - } - } - - private bool umbraconavihideBoolean - { - get - { - return (this._umbraconavihide == 0); - } - } - - /// - /// - /// - [UmbracoInfo("headerText", DisplayName = "Header", Mandatory = false)] - [Property()] - public virtual string Headertext - { - get - { - return this._Headertext; - } - set - { - if ((this._Headertext != value)) - { - this.RaisePropertyChanging(); - this._Headertext = value; - this.RaisePropertyChanged("Headertext"); - } - } - } - - /// - /// This is the text that sits to the left of the contact form. - /// - [UmbracoInfo("formText", DisplayName = "Form Text", Mandatory = false)] - [Property()] - public virtual string Formtext - { - get - { - return this._Formtext; - } - set - { - if ((this._Formtext != value)) - { - this.RaisePropertyChanging(); - this._Formtext = value; - this.RaisePropertyChanged("Formtext"); - } - } - } - - /// - /// This is the header for the thankyou the user will see after sumbitting the contact form. - /// - [UmbracoInfo("thankYouHeaderText", DisplayName = "Thank You Header", Mandatory = true)] - [Property()] - public virtual string Thankyouheadertext - { - get - { - return this._Thankyouheadertext; - } - set - { - if ((this._Thankyouheadertext != value)) - { - this.RaisePropertyChanging(); - this._Thankyouheadertext = value; - this.RaisePropertyChanged("Thankyouheadertext"); - } - } - } - - /// - /// This is the thankyou message that the user will see after submitting your form. - /// - [UmbracoInfo("thankYouMessageText", DisplayName = "Thank You Message", Mandatory = true)] - [Property()] - public virtual string Thankyoumessagetext - { - get - { - return this._Thankyoumessagetext; - } - set - { - if ((this._Thankyoumessagetext != value)) - { - this.RaisePropertyChanging(); - this._Thankyoumessagetext = value; - this.RaisePropertyChanged("Thankyoumessagetext"); - } - } - } - - public AssociationTree CwsTextpages - { - get - { - if ((this._CwsTextpages == null)) - { - this._CwsTextpages = this.ChildrenOfType(); - } - return this._CwsTextpages; - } - set - { - this._CwsTextpages = value; - } - } - } - - /// - /// This is the email a friend form document type for your site. - /// - [UmbracoInfo("CWS_EmailAFriend")] - [System.Runtime.Serialization.DataContractAttribute()] - [DocType()] - public partial class CwsEmailafriend : DocTypeBase - { - - private string _Emailfrom; - - private string _Emailsubjecttofriend; - - private string _Emailmessagetofriend; - - private int _Enablessl; - - private string _umbracourlname; - - private string _umbracourlalias; - - private string _Metadescription; - - private string _Metakeywords; - - private int _umbracoredirect; - - private int _umbraconavihide; - - private string _Headertext; - - private string _Thankyouheadertext; - - private string _Thankyoumessagetext; - - private AssociationTree _CwsTextpages; - - public CwsEmailafriend() - { - } - - /// - /// The email address that you want the email to be sent from. - /// - [UmbracoInfo("emailFrom", DisplayName = "Email From", Mandatory = true)] - [Property()] - public virtual string Emailfrom - { - get - { - return this._Emailfrom; - } - set - { - if ((this._Emailfrom != value)) - { - this.RaisePropertyChanging(); - this._Emailfrom = value; - this.RaisePropertyChanged("Emailfrom"); - } - } - } - - /// - /// The subject of the email that will be sent to the friend. - /// - [UmbracoInfo("emailSubjectToFriend", DisplayName = "Email Subject to Friend", Mandatory = true)] - [Property()] - public virtual string Emailsubjecttofriend - { - get - { - return this._Emailsubjecttofriend; - } - set - { - if ((this._Emailsubjecttofriend != value)) - { - this.RaisePropertyChanging(); - this._Emailsubjecttofriend = value; - this.RaisePropertyChanged("Emailsubjecttofriend"); - } - } - } - - /// - /// Use placeholders [FriendName], [FriendEmail], [YourName], [YourEmail], [Message], [Date], [Time], [URL] - /// - [UmbracoInfo("emailMessageToFriend", DisplayName = "Email Message to Friend", Mandatory = true)] - [Property()] - public virtual string Emailmessagetofriend - { - get - { - return this._Emailmessagetofriend; - } - set - { - if ((this._Emailmessagetofriend != value)) - { - this.RaisePropertyChanging(); - this._Emailmessagetofriend = value; - this.RaisePropertyChanged("Emailmessagetofriend"); - } - } - } - - /// - /// Does your SMTP server require SSL? - /// - [UmbracoInfo("enableSSL", DisplayName = "Enable SSL", Mandatory = false)] - [Property()] - public virtual int Enablessl - { - get - { - return this._Enablessl; - } - set - { - if ((this._Enablessl != value)) - { - this.RaisePropertyChanging(); - this._Enablessl = value; - this.RaisePropertyChanged("Enablessl"); - } - } - } - - private bool EnablesslBoolean - { - get - { - return (this._Enablessl == 0); - } - } - - /// - /// If you wish to change the URL of the node without changing the node name fill this in. - /// - ///eg: warren - /// - [UmbracoInfo("umbracoUrlName", DisplayName = "umbraco URL Name", Mandatory = false)] - [Property()] - public virtual string umbracourlname - { - get - { - return this._umbracourlname; - } - set - { - if ((this._umbracourlname != value)) - { - this.RaisePropertyChanging(); - this._umbracourlname = value; - this.RaisePropertyChanged("umbracourlname"); - } - } - } - - /// - /// Use this to give a node multiple urls. - /// - ///eg: home,homepage/another-level - /// - [UmbracoInfo("umbracoUrlAlias", DisplayName = "umbraco URL Alias", Mandatory = false)] - [Property()] - public virtual string umbracourlalias - { - get - { - return this._umbracourlalias; - } - set - { - if ((this._umbracourlalias != value)) - { - this.RaisePropertyChanging(); - this._umbracourlalias = value; - this.RaisePropertyChanged("umbracourlalias"); - } - } - } - - /// - /// Enter the description for the page. - /// - [UmbracoInfo("metaDescription", DisplayName = "Meta Description", Mandatory = false)] - [Property()] - public virtual string Metadescription - { - get - { - return this._Metadescription; - } - set - { - if ((this._Metadescription != value)) - { - this.RaisePropertyChanging(); - this._Metadescription = value; - this.RaisePropertyChanged("Metadescription"); - } - } - } - - /// - /// Enter a comma seperated list of keywords. - ///warren, keyword, test - /// - [UmbracoInfo("metaKeywords", DisplayName = "Meta Keywords", Mandatory = false)] - [Property()] - public virtual string Metakeywords - { - get - { - return this._Metakeywords; - } - set - { - if ((this._Metakeywords != value)) - { - this.RaisePropertyChanging(); - this._Metakeywords = value; - this.RaisePropertyChanged("Metakeywords"); - } - } - } - - /// - /// Pick a node you wish to redirect to if the user lands on this node. - /// - [UmbracoInfo("umbracoRedirect", DisplayName = " umbraco Redirect", Mandatory = false)] - [Property()] - public virtual int umbracoredirect - { - get - { - return this._umbracoredirect; - } - set - { - if ((this._umbracoredirect != value)) - { - this.RaisePropertyChanging(); - this._umbracoredirect = value; - this.RaisePropertyChanged("umbracoredirect"); - } - } - } - - /// - /// Use this property if you wish to hide this page in the navigation. - /// - [UmbracoInfo("umbracoNaviHide", DisplayName = "Hide in Navi", Mandatory = false)] - [Property()] - public virtual int umbraconavihide - { - get - { - return this._umbraconavihide; - } - set - { - if ((this._umbraconavihide != value)) - { - this.RaisePropertyChanging(); - this._umbraconavihide = value; - this.RaisePropertyChanged("umbraconavihide"); - } - } - } - - private bool umbraconavihideBoolean - { - get - { - return (this._umbraconavihide == 0); - } - } - - /// - /// - /// - [UmbracoInfo("headerText", DisplayName = "Header", Mandatory = false)] - [Property()] - public virtual string Headertext - { - get - { - return this._Headertext; - } - set - { - if ((this._Headertext != value)) - { - this.RaisePropertyChanging(); - this._Headertext = value; - this.RaisePropertyChanged("Headertext"); - } - } - } - - /// - /// This is the header for the thankyou the user will see after sumbitting the contact form. - /// - [UmbracoInfo("thankYouHeaderText", DisplayName = "Thank You Header", Mandatory = true)] - [Property()] - public virtual string Thankyouheadertext - { - get - { - return this._Thankyouheadertext; - } - set - { - if ((this._Thankyouheadertext != value)) - { - this.RaisePropertyChanging(); - this._Thankyouheadertext = value; - this.RaisePropertyChanged("Thankyouheadertext"); - } - } - } - - /// - /// This is the thankyou message that the user will see after submitting your form. - /// - [UmbracoInfo("thankYouMessageText", DisplayName = "Thank You Text", Mandatory = true)] - [Property()] - public virtual string Thankyoumessagetext - { - get - { - return this._Thankyoumessagetext; - } - set - { - if ((this._Thankyoumessagetext != value)) - { - this.RaisePropertyChanging(); - this._Thankyoumessagetext = value; - this.RaisePropertyChanged("Thankyoumessagetext"); - } - } - } - - public AssociationTree CwsTextpages - { - get - { - if ((this._CwsTextpages == null)) - { - this._CwsTextpages = this.ChildrenOfType(); - } - return this._CwsTextpages; - } - set - { - this._CwsTextpages = value; - } - } - } - - /// - /// This is the event document type for your site and lives beneath the News & Events List document type. - /// - [UmbracoInfo("CWS_EventItem")] - [System.Runtime.Serialization.DataContractAttribute()] - [DocType()] - public partial class CwsEventitem : DocTypeBase - { - - private System.DateTime _Eventdate; - - private string _Bodytext; - - private string _Articlephoto; - - private string _umbracourlname; - - private string _umbracourlalias; - - private string _Metadescription; - - private string _Metakeywords; - - private int _umbracoredirect; - - private int _umbraconavihide; - - public CwsEventitem() - { - } - - /// - /// - /// - [UmbracoInfo("eventDate", DisplayName = "Date", Mandatory = false)] - [Property()] - public virtual System.DateTime Eventdate - { - get - { - return this._Eventdate; - } - set - { - if ((this._Eventdate != value)) - { - this.RaisePropertyChanging(); - this._Eventdate = value; - this.RaisePropertyChanged("Eventdate"); - } - } - } - - /// - /// - /// - [UmbracoInfo("bodyText", DisplayName = "Text", Mandatory = false)] - [Property()] - public virtual string Bodytext - { - get - { - return this._Bodytext; - } - set - { - if ((this._Bodytext != value)) - { - this.RaisePropertyChanging(); - this._Bodytext = value; - this.RaisePropertyChanged("Bodytext"); - } - } - } - - /// - /// - /// - [UmbracoInfo("articlePhoto", DisplayName = "Photo", Mandatory = false)] - [Property()] - public virtual string Articlephoto - { - get - { - return this._Articlephoto; - } - set - { - if ((this._Articlephoto != value)) - { - this.RaisePropertyChanging(); - this._Articlephoto = value; - this.RaisePropertyChanged("Articlephoto"); - } - } - } - - /// - /// If you wish to change the URL of the node without changing the node name fill this in. - /// - ///eg: warren - /// - [UmbracoInfo("umbracoUrlName", DisplayName = "umbraco URL Name", Mandatory = false)] - [Property()] - public virtual string umbracourlname - { - get - { - return this._umbracourlname; - } - set - { - if ((this._umbracourlname != value)) - { - this.RaisePropertyChanging(); - this._umbracourlname = value; - this.RaisePropertyChanged("umbracourlname"); - } - } - } - - /// - /// Use this to give a node multiple urls. - /// - ///eg: home,homepage/another-level - /// - [UmbracoInfo("umbracoUrlAlias", DisplayName = "umbraco URL Alias", Mandatory = false)] - [Property()] - public virtual string umbracourlalias - { - get - { - return this._umbracourlalias; - } - set - { - if ((this._umbracourlalias != value)) - { - this.RaisePropertyChanging(); - this._umbracourlalias = value; - this.RaisePropertyChanged("umbracourlalias"); - } - } - } - - /// - /// Enter the description for the page. - /// - [UmbracoInfo("metaDescription", DisplayName = "Meta Description", Mandatory = false)] - [Property()] - public virtual string Metadescription - { - get - { - return this._Metadescription; - } - set - { - if ((this._Metadescription != value)) - { - this.RaisePropertyChanging(); - this._Metadescription = value; - this.RaisePropertyChanged("Metadescription"); - } - } - } - - /// - /// Enter a comma seperated list of keywords. - ///warren, keyword, test - /// - [UmbracoInfo("metaKeywords", DisplayName = "Meta Keywords", Mandatory = false)] - [Property()] - public virtual string Metakeywords - { - get - { - return this._Metakeywords; - } - set - { - if ((this._Metakeywords != value)) - { - this.RaisePropertyChanging(); - this._Metakeywords = value; - this.RaisePropertyChanged("Metakeywords"); - } - } - } - - /// - /// Pick a node you wish to redirect to if the user lands on this node. - /// - [UmbracoInfo("umbracoRedirect", DisplayName = " umbraco Redirect", Mandatory = false)] - [Property()] - public virtual int umbracoredirect - { - get - { - return this._umbracoredirect; - } - set - { - if ((this._umbracoredirect != value)) - { - this.RaisePropertyChanging(); - this._umbracoredirect = value; - this.RaisePropertyChanged("umbracoredirect"); - } - } - } - - /// - /// Use this property if you wish to hide this page in the navigation. - /// - [UmbracoInfo("umbracoNaviHide", DisplayName = "Hide in Navi", Mandatory = false)] - [Property()] - public virtual int umbraconavihide - { - get - { - return this._umbraconavihide; - } - set - { - if ((this._umbraconavihide != value)) - { - this.RaisePropertyChanging(); - this._umbraconavihide = value; - this.RaisePropertyChanged("umbraconavihide"); - } - } - } - - private bool umbraconavihideBoolean - { - get - { - return (this._umbraconavihide == 0); - } - } - } - - /// - /// This is the Galleries document type for your site which stores the Gallery document type as children. - /// - [UmbracoInfo("CWS_GalleryList")] - [System.Runtime.Serialization.DataContractAttribute()] - [DocType()] - public partial class CwsGallerylist : DocTypeBase - { - - private string _umbracourlname; - - private string _umbracourlalias; - - private string _Metadescription; - - private string _Metakeywords; - - private int _umbracoredirect; - - private int _umbraconavihide; - - private string _Headertext; - - private string _Sortby; - - private string _Sortorder; - - private AssociationTree _CwsGalleries; - - public CwsGallerylist() - { - } - - /// - /// If you wish to change the URL of the node without changing the node name fill this in. - /// - ///eg: warren - /// - [UmbracoInfo("umbracoUrlName", DisplayName = "umbraco URL Name", Mandatory = false)] - [Property()] - public virtual string umbracourlname - { - get - { - return this._umbracourlname; - } - set - { - if ((this._umbracourlname != value)) - { - this.RaisePropertyChanging(); - this._umbracourlname = value; - this.RaisePropertyChanged("umbracourlname"); - } - } - } - - /// - /// Use this to give a node multiple urls. - /// - ///eg: home,homepage/another-level - /// - [UmbracoInfo("umbracoUrlAlias", DisplayName = "umbraco URL Alias", Mandatory = false)] - [Property()] - public virtual string umbracourlalias - { - get - { - return this._umbracourlalias; - } - set - { - if ((this._umbracourlalias != value)) - { - this.RaisePropertyChanging(); - this._umbracourlalias = value; - this.RaisePropertyChanged("umbracourlalias"); - } - } - } - - /// - /// Enter the description for the page. - /// - [UmbracoInfo("metaDescription", DisplayName = "Meta Description", Mandatory = false)] - [Property()] - public virtual string Metadescription - { - get - { - return this._Metadescription; - } - set - { - if ((this._Metadescription != value)) - { - this.RaisePropertyChanging(); - this._Metadescription = value; - this.RaisePropertyChanged("Metadescription"); - } - } - } - - /// - /// Enter a comma seperated list of keywords. - ///warren, keyword, test - /// - [UmbracoInfo("metaKeywords", DisplayName = "Meta Keywords", Mandatory = false)] - [Property()] - public virtual string Metakeywords - { - get - { - return this._Metakeywords; - } - set - { - if ((this._Metakeywords != value)) - { - this.RaisePropertyChanging(); - this._Metakeywords = value; - this.RaisePropertyChanged("Metakeywords"); - } - } - } - - /// - /// Pick a node you wish to redirect to if the user lands on this node. - /// - [UmbracoInfo("umbracoRedirect", DisplayName = " umbraco Redirect", Mandatory = false)] - [Property()] - public virtual int umbracoredirect - { - get - { - return this._umbracoredirect; - } - set - { - if ((this._umbracoredirect != value)) - { - this.RaisePropertyChanging(); - this._umbracoredirect = value; - this.RaisePropertyChanged("umbracoredirect"); - } - } - } - - /// - /// Use this property if you wish to hide this page in the navigation. - /// - [UmbracoInfo("umbracoNaviHide", DisplayName = "Hide in Navi", Mandatory = false)] - [Property()] - public virtual int umbraconavihide - { - get - { - return this._umbraconavihide; - } - set - { - if ((this._umbraconavihide != value)) - { - this.RaisePropertyChanging(); - this._umbraconavihide = value; - this.RaisePropertyChanged("umbraconavihide"); - } - } - } - - private bool umbraconavihideBoolean - { - get - { - return (this._umbraconavihide == 0); - } - } - - /// - /// - /// - [UmbracoInfo("headerText", DisplayName = "Header", Mandatory = false)] - [Property()] - public virtual string Headertext - { - get - { - return this._Headertext; - } - set - { - if ((this._Headertext != value)) - { - this.RaisePropertyChanging(); - this._Headertext = value; - this.RaisePropertyChanged("Headertext"); - } - } - } - - /// - /// Choose how you want to sort the child items. - /// - [UmbracoInfo("sortBy", DisplayName = "Sort By", Mandatory = true)] - [Property()] - public virtual string Sortby - { - get - { - return this._Sortby; - } - set - { - if ((this._Sortby != value)) - { - this.RaisePropertyChanging(); - this._Sortby = value; - this.RaisePropertyChanged("Sortby"); - } - } - } - - /// - /// Choose how you want to sort the child items. - /// - [UmbracoInfo("sortOrder", DisplayName = "Sort Order", Mandatory = true)] - [Property()] - public virtual string Sortorder - { - get - { - return this._Sortorder; - } - set - { - if ((this._Sortorder != value)) - { - this.RaisePropertyChanging(); - this._Sortorder = value; - this.RaisePropertyChanged("Sortorder"); - } - } - } - - public AssociationTree CwsGalleries - { - get - { - if ((this._CwsGalleries == null)) - { - this._CwsGalleries = this.ChildrenOfType(); - } - return this._CwsGalleries; - } - set - { - this._CwsGalleries = value; - } - } - } - - /// - /// This is the gallery document type which stores the Photo document type as children. - /// - [UmbracoInfo("CWS_Gallery")] - [System.Runtime.Serialization.DataContractAttribute()] - [DocType()] - public partial class CwsGallery : DocTypeBase - { - - private string _umbracourlname; - - private string _umbracourlalias; - - private string _Metadescription; - - private string _Metakeywords; - - private int _umbracoredirect; - - private int _umbraconavihide; - - private string _Headertext; - - private string _Sortby; - - private string _Sortorder; - - private string _Gallerythumbnail; - - private AssociationTree _CwsPhotos; - - public CwsGallery() - { - } - - /// - /// If you wish to change the URL of the node without changing the node name fill this in. - /// - ///eg: warren - /// - [UmbracoInfo("umbracoUrlName", DisplayName = "umbraco URL Name", Mandatory = false)] - [Property()] - public virtual string umbracourlname - { - get - { - return this._umbracourlname; - } - set - { - if ((this._umbracourlname != value)) - { - this.RaisePropertyChanging(); - this._umbracourlname = value; - this.RaisePropertyChanged("umbracourlname"); - } - } - } - - /// - /// Use this to give a node multiple urls. - /// - ///eg: home,homepage/another-level - /// - [UmbracoInfo("umbracoUrlAlias", DisplayName = "umbraco URL Alias", Mandatory = false)] - [Property()] - public virtual string umbracourlalias - { - get - { - return this._umbracourlalias; - } - set - { - if ((this._umbracourlalias != value)) - { - this.RaisePropertyChanging(); - this._umbracourlalias = value; - this.RaisePropertyChanged("umbracourlalias"); - } - } - } - - /// - /// Enter the description for the page. - /// - [UmbracoInfo("metaDescription", DisplayName = "Meta Description", Mandatory = false)] - [Property()] - public virtual string Metadescription - { - get - { - return this._Metadescription; - } - set - { - if ((this._Metadescription != value)) - { - this.RaisePropertyChanging(); - this._Metadescription = value; - this.RaisePropertyChanged("Metadescription"); - } - } - } - - /// - /// Enter a comma seperated list of keywords. - ///warren, keyword, test - /// - [UmbracoInfo("metaKeywords", DisplayName = "Meta Keywords", Mandatory = false)] - [Property()] - public virtual string Metakeywords - { - get - { - return this._Metakeywords; - } - set - { - if ((this._Metakeywords != value)) - { - this.RaisePropertyChanging(); - this._Metakeywords = value; - this.RaisePropertyChanged("Metakeywords"); - } - } - } - - /// - /// Pick a node you wish to redirect to if the user lands on this node. - /// - [UmbracoInfo("umbracoRedirect", DisplayName = " umbraco Redirect", Mandatory = false)] - [Property()] - public virtual int umbracoredirect - { - get - { - return this._umbracoredirect; - } - set - { - if ((this._umbracoredirect != value)) - { - this.RaisePropertyChanging(); - this._umbracoredirect = value; - this.RaisePropertyChanged("umbracoredirect"); - } - } - } - - /// - /// Use this property if you wish to hide this page in the navigation. - /// - [UmbracoInfo("umbracoNaviHide", DisplayName = "Hide in Navi", Mandatory = false)] - [Property()] - public virtual int umbraconavihide - { - get - { - return this._umbraconavihide; - } - set - { - if ((this._umbraconavihide != value)) - { - this.RaisePropertyChanging(); - this._umbraconavihide = value; - this.RaisePropertyChanged("umbraconavihide"); - } - } - } - - private bool umbraconavihideBoolean - { - get - { - return (this._umbraconavihide == 0); - } - } - - /// - /// - /// - [UmbracoInfo("headerText", DisplayName = "Header", Mandatory = false)] - [Property()] - public virtual string Headertext - { - get - { - return this._Headertext; - } - set - { - if ((this._Headertext != value)) - { - this.RaisePropertyChanging(); - this._Headertext = value; - this.RaisePropertyChanged("Headertext"); - } - } - } - - /// - /// Choose how you want to sort the child items. - /// - [UmbracoInfo("sortBy", DisplayName = "Sort By", Mandatory = true)] - [Property()] - public virtual string Sortby - { - get - { - return this._Sortby; - } - set - { - if ((this._Sortby != value)) - { - this.RaisePropertyChanging(); - this._Sortby = value; - this.RaisePropertyChanged("Sortby"); - } - } - } - - /// - /// Choose how you want to sort the child items. - /// - [UmbracoInfo("sortOrder", DisplayName = "Sort Order", Mandatory = true)] - [Property()] - public virtual string Sortorder - { - get - { - return this._Sortorder; - } - set - { - if ((this._Sortorder != value)) - { - this.RaisePropertyChanging(); - this._Sortorder = value; - this.RaisePropertyChanged("Sortorder"); - } - } - } - - /// - /// 208px x 108px - /// - [UmbracoInfo("galleryThumbnail", DisplayName = "Thumbnail for Gallery", Mandatory = false)] - [Property()] - public virtual string Gallerythumbnail - { - get - { - return this._Gallerythumbnail; - } - set - { - if ((this._Gallerythumbnail != value)) - { - this.RaisePropertyChanging(); - this._Gallerythumbnail = value; - this.RaisePropertyChanged("Gallerythumbnail"); - } - } - } - - public AssociationTree CwsPhotos - { - get - { - if ((this._CwsPhotos == null)) - { - this._CwsPhotos = this.ChildrenOfType(); - } - return this._CwsPhotos; - } - set - { - this._CwsPhotos = value; - } - } - } - - /// - /// This is the homepage document type for your site. - /// - [UmbracoInfo("CWS_Home")] - [System.Runtime.Serialization.DataContractAttribute()] - [DocType()] - public partial class CwsHome : DocTypeBase - { - - private string _umbracourlname; - - private string _umbracourlalias; - - private string _Metadescription; - - private string _Metakeywords; - - private int _umbracoredirect; - - private int _umbraconavihide; - - private string _Sitename; - - private string _Headertext; - - private string _Homepagephoto; - - private string _Bodytext; - - private AssociationTree _CwsContacts; - - private AssociationTree _CwsEmailafriends; - - private AssociationTree _CwsGallerylists; - - private AssociationTree _CwsNewseventslists; - - private AssociationTree _CwsTextpages; - - private AssociationTree _CwsTextpagetwocols; - - public CwsHome() - { - } - - /// - /// If you wish to change the URL of the node without changing the node name fill this in. - /// - ///eg: warren - /// - [UmbracoInfo("umbracoUrlName", DisplayName = "umbraco URL Name", Mandatory = false)] - [Property()] - public virtual string umbracourlname - { - get - { - return this._umbracourlname; - } - set - { - if ((this._umbracourlname != value)) - { - this.RaisePropertyChanging(); - this._umbracourlname = value; - this.RaisePropertyChanged("umbracourlname"); - } - } - } - - /// - /// Use this to give a node multiple urls. - /// - ///eg: home,homepage/another-level - /// - [UmbracoInfo("umbracoUrlAlias", DisplayName = "umbraco URL Alias", Mandatory = false)] - [Property()] - public virtual string umbracourlalias - { - get - { - return this._umbracourlalias; - } - set - { - if ((this._umbracourlalias != value)) - { - this.RaisePropertyChanging(); - this._umbracourlalias = value; - this.RaisePropertyChanged("umbracourlalias"); - } - } - } - - /// - /// Enter the description for the page. - /// - [UmbracoInfo("metaDescription", DisplayName = "Meta Description", Mandatory = false)] - [Property()] - public virtual string Metadescription - { - get - { - return this._Metadescription; - } - set - { - if ((this._Metadescription != value)) - { - this.RaisePropertyChanging(); - this._Metadescription = value; - this.RaisePropertyChanged("Metadescription"); - } - } - } - - /// - /// Enter a comma seperated list of keywords. - ///warren, keyword, test - /// - [UmbracoInfo("metaKeywords", DisplayName = "Meta Keywords", Mandatory = false)] - [Property()] - public virtual string Metakeywords - { - get - { - return this._Metakeywords; - } - set - { - if ((this._Metakeywords != value)) - { - this.RaisePropertyChanging(); - this._Metakeywords = value; - this.RaisePropertyChanged("Metakeywords"); - } - } - } - - /// - /// Pick a node you wish to redirect to if the user lands on this node. - /// - [UmbracoInfo("umbracoRedirect", DisplayName = " umbraco Redirect", Mandatory = false)] - [Property()] - public virtual int umbracoredirect - { - get - { - return this._umbracoredirect; - } - set - { - if ((this._umbracoredirect != value)) - { - this.RaisePropertyChanging(); - this._umbracoredirect = value; - this.RaisePropertyChanged("umbracoredirect"); - } - } - } - - /// - /// Use this property if you wish to hide this page in the navigation. - /// - [UmbracoInfo("umbracoNaviHide", DisplayName = "Hide in Navi", Mandatory = false)] - [Property()] - public virtual int umbraconavihide - { - get - { - return this._umbraconavihide; - } - set - { - if ((this._umbraconavihide != value)) - { - this.RaisePropertyChanging(); - this._umbraconavihide = value; - this.RaisePropertyChanged("umbraconavihide"); - } - } - } - - private bool umbraconavihideBoolean - { - get - { - return (this._umbraconavihide == 0); - } - } - - /// - /// This is what your site is called. - /// - [UmbracoInfo("siteName", DisplayName = "Site Name", Mandatory = false)] - [Property()] - public virtual string Sitename - { - get - { - return this._Sitename; - } - set - { - if ((this._Sitename != value)) - { - this.RaisePropertyChanging(); - this._Sitename = value; - this.RaisePropertyChanged("Sitename"); - } - } - } - - /// - /// - /// - [UmbracoInfo("headerText", DisplayName = "Header", Mandatory = false)] - [Property()] - public virtual string Headertext - { - get - { - return this._Headertext; - } - set - { - if ((this._Headertext != value)) - { - this.RaisePropertyChanging(); - this._Headertext = value; - this.RaisePropertyChanged("Headertext"); - } - } - } - - /// - /// - /// - [UmbracoInfo("homepagePhoto", DisplayName = "Photo", Mandatory = false)] - [Property()] - public virtual string Homepagephoto - { - get - { - return this._Homepagephoto; - } - set - { - if ((this._Homepagephoto != value)) - { - this.RaisePropertyChanging(); - this._Homepagephoto = value; - this.RaisePropertyChanged("Homepagephoto"); - } - } - } - - /// - /// - /// - [UmbracoInfo("bodyText", DisplayName = "Text", Mandatory = false)] - [Property()] - public virtual string Bodytext - { - get - { - return this._Bodytext; - } - set - { - if ((this._Bodytext != value)) - { - this.RaisePropertyChanging(); - this._Bodytext = value; - this.RaisePropertyChanged("Bodytext"); - } - } - } - - public AssociationTree CwsContacts - { - get - { - if ((this._CwsContacts == null)) - { - this._CwsContacts = this.ChildrenOfType(); - } - return this._CwsContacts; - } - set - { - this._CwsContacts = value; - } - } - - public AssociationTree CwsEmailafriends - { - get - { - if ((this._CwsEmailafriends == null)) - { - this._CwsEmailafriends = this.ChildrenOfType(); - } - return this._CwsEmailafriends; - } - set - { - this._CwsEmailafriends = value; - } - } - - public AssociationTree CwsGallerylists - { - get - { - if ((this._CwsGallerylists == null)) - { - this._CwsGallerylists = this.ChildrenOfType(); - } - return this._CwsGallerylists; - } - set - { - this._CwsGallerylists = value; - } - } - - public AssociationTree CwsNewseventslists - { - get - { - if ((this._CwsNewseventslists == null)) - { - this._CwsNewseventslists = this.ChildrenOfType(); - } - return this._CwsNewseventslists; - } - set - { - this._CwsNewseventslists = value; - } - } - - public AssociationTree CwsTextpages - { - get - { - if ((this._CwsTextpages == null)) - { - this._CwsTextpages = this.ChildrenOfType(); - } - return this._CwsTextpages; - } - set - { - this._CwsTextpages = value; - } - } - - public AssociationTree CwsTextpagetwocols - { - get - { - if ((this._CwsTextpagetwocols == null)) - { - this._CwsTextpagetwocols = this.ChildrenOfType(); - } - return this._CwsTextpagetwocols; - } - set - { - this._CwsTextpagetwocols = value; - } - } - } - - /// - /// This is the News & Events List document type for your site which stores the News and Event Item document types as children. - /// - [UmbracoInfo("CWS_NewsEventsList")] - [System.Runtime.Serialization.DataContractAttribute()] - [DocType()] - public partial class CwsNewseventslist : DocTypeBase - { - - private string _umbracourlname; - - private string _umbracourlalias; - - private string _Metadescription; - - private string _Metakeywords; - - private int _umbracoredirect; - - private int _umbraconavihide; - - private string _Sortby; - - private string _Sortorder; - - private string _Headertext; - - private AssociationTree _CwsEventitems; - - private AssociationTree _CwsNewsitems; - - public CwsNewseventslist() - { - } - - /// - /// If you wish to change the URL of the node without changing the node name fill this in. - /// - ///eg: warren - /// - [UmbracoInfo("umbracoUrlName", DisplayName = "umbraco URL Name", Mandatory = false)] - [Property()] - public virtual string umbracourlname - { - get - { - return this._umbracourlname; - } - set - { - if ((this._umbracourlname != value)) - { - this.RaisePropertyChanging(); - this._umbracourlname = value; - this.RaisePropertyChanged("umbracourlname"); - } - } - } - - /// - /// Use this to give a node multiple urls. - /// - ///eg: home,homepage/another-level - /// - [UmbracoInfo("umbracoUrlAlias", DisplayName = "umbraco URL Alias", Mandatory = false)] - [Property()] - public virtual string umbracourlalias - { - get - { - return this._umbracourlalias; - } - set - { - if ((this._umbracourlalias != value)) - { - this.RaisePropertyChanging(); - this._umbracourlalias = value; - this.RaisePropertyChanged("umbracourlalias"); - } - } - } - - /// - /// Enter the description for the page. - /// - [UmbracoInfo("metaDescription", DisplayName = "Meta Description", Mandatory = false)] - [Property()] - public virtual string Metadescription - { - get - { - return this._Metadescription; - } - set - { - if ((this._Metadescription != value)) - { - this.RaisePropertyChanging(); - this._Metadescription = value; - this.RaisePropertyChanged("Metadescription"); - } - } - } - - /// - /// Enter a comma seperated list of keywords. - ///warren, keyword, test - /// - [UmbracoInfo("metaKeywords", DisplayName = "Meta Keywords", Mandatory = false)] - [Property()] - public virtual string Metakeywords - { - get - { - return this._Metakeywords; - } - set - { - if ((this._Metakeywords != value)) - { - this.RaisePropertyChanging(); - this._Metakeywords = value; - this.RaisePropertyChanged("Metakeywords"); - } - } - } - - /// - /// Pick a node you wish to redirect to if the user lands on this node. - /// - [UmbracoInfo("umbracoRedirect", DisplayName = " umbraco Redirect", Mandatory = false)] - [Property()] - public virtual int umbracoredirect - { - get - { - return this._umbracoredirect; - } - set - { - if ((this._umbracoredirect != value)) - { - this.RaisePropertyChanging(); - this._umbracoredirect = value; - this.RaisePropertyChanged("umbracoredirect"); - } - } - } - - /// - /// Use this property if you wish to hide this page in the navigation. - /// - [UmbracoInfo("umbracoNaviHide", DisplayName = "Hide in Navi", Mandatory = false)] - [Property()] - public virtual int umbraconavihide - { - get - { - return this._umbraconavihide; - } - set - { - if ((this._umbraconavihide != value)) - { - this.RaisePropertyChanging(); - this._umbraconavihide = value; - this.RaisePropertyChanged("umbraconavihide"); - } - } - } - - private bool umbraconavihideBoolean - { - get - { - return (this._umbraconavihide == 0); - } - } - - /// - /// Choose how you want to sort the child items. - /// - [UmbracoInfo("sortBy", DisplayName = "Sort By", Mandatory = true)] - [Property()] - public virtual string Sortby - { - get - { - return this._Sortby; - } - set - { - if ((this._Sortby != value)) - { - this.RaisePropertyChanging(); - this._Sortby = value; - this.RaisePropertyChanged("Sortby"); - } - } - } - - /// - /// Choose how you want to sort the child items. - /// - [UmbracoInfo("sortOrder", DisplayName = "Sort Order", Mandatory = true)] - [Property()] - public virtual string Sortorder - { - get - { - return this._Sortorder; - } - set - { - if ((this._Sortorder != value)) - { - this.RaisePropertyChanging(); - this._Sortorder = value; - this.RaisePropertyChanged("Sortorder"); - } - } - } - - /// - /// - /// - [UmbracoInfo("headerText", DisplayName = "Header", Mandatory = false)] - [Property()] - public virtual string Headertext - { - get - { - return this._Headertext; - } - set - { - if ((this._Headertext != value)) - { - this.RaisePropertyChanging(); - this._Headertext = value; - this.RaisePropertyChanged("Headertext"); - } - } - } - - public AssociationTree CwsEventitems - { - get - { - if ((this._CwsEventitems == null)) - { - this._CwsEventitems = this.ChildrenOfType(); - } - return this._CwsEventitems; - } - set - { - this._CwsEventitems = value; - } - } - - public AssociationTree CwsNewsitems - { - get - { - if ((this._CwsNewsitems == null)) - { - this._CwsNewsitems = this.ChildrenOfType(); - } - return this._CwsNewsitems; - } - set - { - this._CwsNewsitems = value; - } - } - } - - /// - /// This is the news document type for your site and lives beneath the News & Events List document type. - /// - [UmbracoInfo("CWS_NewsItem")] - [System.Runtime.Serialization.DataContractAttribute()] - [DocType()] - public partial class CwsNewsitem : DocTypeBase - { - - private string _Bodytext; - - private string _Articlephoto; - - private string _umbracourlname; - - private string _umbracourlalias; - - private string _Metadescription; - - private string _Metakeywords; - - private int _umbracoredirect; - - private int _umbraconavihide; - - private AssociationTree _CwsNewsitems; - - public CwsNewsitem() - { - } - - /// - /// - /// - [UmbracoInfo("bodyText", DisplayName = "Text", Mandatory = false)] - [Property()] - public virtual string Bodytext - { - get - { - return this._Bodytext; - } - set - { - if ((this._Bodytext != value)) - { - this.RaisePropertyChanging(); - this._Bodytext = value; - this.RaisePropertyChanged("Bodytext"); - } - } - } - - /// - /// - /// - [UmbracoInfo("articlePhoto", DisplayName = "Photo", Mandatory = false)] - [Property()] - public virtual string Articlephoto - { - get - { - return this._Articlephoto; - } - set - { - if ((this._Articlephoto != value)) - { - this.RaisePropertyChanging(); - this._Articlephoto = value; - this.RaisePropertyChanged("Articlephoto"); - } - } - } - - /// - /// If you wish to change the URL of the node without changing the node name fill this in. - /// - ///eg: warren - /// - [UmbracoInfo("umbracoUrlName", DisplayName = "umbraco URL Name", Mandatory = false)] - [Property()] - public virtual string umbracourlname - { - get - { - return this._umbracourlname; - } - set - { - if ((this._umbracourlname != value)) - { - this.RaisePropertyChanging(); - this._umbracourlname = value; - this.RaisePropertyChanged("umbracourlname"); - } - } - } - - /// - /// Use this to give a node multiple urls. - /// - ///eg: home,homepage/another-level - /// - [UmbracoInfo("umbracoUrlAlias", DisplayName = "umbraco URL Alias", Mandatory = false)] - [Property()] - public virtual string umbracourlalias - { - get - { - return this._umbracourlalias; - } - set - { - if ((this._umbracourlalias != value)) - { - this.RaisePropertyChanging(); - this._umbracourlalias = value; - this.RaisePropertyChanged("umbracourlalias"); - } - } - } - - /// - /// Enter the description for the page. - /// - [UmbracoInfo("metaDescription", DisplayName = "Meta Description", Mandatory = false)] - [Property()] - public virtual string Metadescription - { - get - { - return this._Metadescription; - } - set - { - if ((this._Metadescription != value)) - { - this.RaisePropertyChanging(); - this._Metadescription = value; - this.RaisePropertyChanged("Metadescription"); - } - } - } - - /// - /// Enter a comma seperated list of keywords. - ///warren, keyword, test - /// - [UmbracoInfo("metaKeywords", DisplayName = "Meta Keywords", Mandatory = false)] - [Property()] - public virtual string Metakeywords - { - get - { - return this._Metakeywords; - } - set - { - if ((this._Metakeywords != value)) - { - this.RaisePropertyChanging(); - this._Metakeywords = value; - this.RaisePropertyChanged("Metakeywords"); - } - } - } - - /// - /// Pick a node you wish to redirect to if the user lands on this node. - /// - [UmbracoInfo("umbracoRedirect", DisplayName = " umbraco Redirect", Mandatory = false)] - [Property()] - public virtual int umbracoredirect - { - get - { - return this._umbracoredirect; - } - set - { - if ((this._umbracoredirect != value)) - { - this.RaisePropertyChanging(); - this._umbracoredirect = value; - this.RaisePropertyChanged("umbracoredirect"); - } - } - } - - /// - /// Use this property if you wish to hide this page in the navigation. - /// - [UmbracoInfo("umbracoNaviHide", DisplayName = "Hide in Navi", Mandatory = false)] - [Property()] - public virtual int umbraconavihide - { - get - { - return this._umbraconavihide; - } - set - { - if ((this._umbraconavihide != value)) - { - this.RaisePropertyChanging(); - this._umbraconavihide = value; - this.RaisePropertyChanged("umbraconavihide"); - } - } - } - - private bool umbraconavihideBoolean - { - get - { - return (this._umbraconavihide == 0); - } - } - - public AssociationTree CwsNewsitems - { - get - { - if ((this._CwsNewsitems == null)) - { - this._CwsNewsitems = this.ChildrenOfType(); - } - return this._CwsNewsitems; - } - set - { - this._CwsNewsitems = value; - } - } - } - - /// - /// This is the Photo document type for your site and lives beneath the Gallery document type. - /// - [UmbracoInfo("CWS_Photo")] - [System.Runtime.Serialization.DataContractAttribute()] - [DocType()] - public partial class CwsPhoto : DocTypeBase - { - - private string _Phototext; - - private string _Photo; - - private string _Photothumbnail; - - private string _umbracourlname; - - private string _umbracourlalias; - - private string _Metadescription; - - private string _Metakeywords; - - private int _umbracoredirect; - - private int _umbraconavihide; - - public CwsPhoto() - { - } - - /// - /// Enter a description - /// - [UmbracoInfo("photoText", DisplayName = "Photo Text", Mandatory = false)] - [Property()] - public virtual string Phototext - { - get - { - return this._Phototext; - } - set - { - if ((this._Phototext != value)) - { - this.RaisePropertyChanging(); - this._Phototext = value; - this.RaisePropertyChanged("Phototext"); - } - } - } - - /// - /// - /// - [UmbracoInfo("photo", DisplayName = "Photo", Mandatory = false)] - [Property()] - public virtual string Photo - { - get - { - return this._Photo; - } - set - { - if ((this._Photo != value)) - { - this.RaisePropertyChanging(); - this._Photo = value; - this.RaisePropertyChanged("Photo"); - } - } - } - - /// - /// 151px x 108px - /// - [UmbracoInfo("photoThumbnail", DisplayName = "Thumbnail", Mandatory = false)] - [Property()] - public virtual string Photothumbnail - { - get - { - return this._Photothumbnail; - } - set - { - if ((this._Photothumbnail != value)) - { - this.RaisePropertyChanging(); - this._Photothumbnail = value; - this.RaisePropertyChanged("Photothumbnail"); - } - } - } - - /// - /// If you wish to change the URL of the node without changing the node name fill this in. - /// - ///eg: warren - /// - [UmbracoInfo("umbracoUrlName", DisplayName = "umbraco URL Name", Mandatory = false)] - [Property()] - public virtual string umbracourlname - { - get - { - return this._umbracourlname; - } - set - { - if ((this._umbracourlname != value)) - { - this.RaisePropertyChanging(); - this._umbracourlname = value; - this.RaisePropertyChanged("umbracourlname"); - } - } - } - - /// - /// Use this to give a node multiple urls. - /// - ///eg: home,homepage/another-level - /// - [UmbracoInfo("umbracoUrlAlias", DisplayName = "umbraco URL Alias", Mandatory = false)] - [Property()] - public virtual string umbracourlalias - { - get - { - return this._umbracourlalias; - } - set - { - if ((this._umbracourlalias != value)) - { - this.RaisePropertyChanging(); - this._umbracourlalias = value; - this.RaisePropertyChanged("umbracourlalias"); - } - } - } - - /// - /// Enter the description for the page. - /// - [UmbracoInfo("metaDescription", DisplayName = "Meta Description", Mandatory = false)] - [Property()] - public virtual string Metadescription - { - get - { - return this._Metadescription; - } - set - { - if ((this._Metadescription != value)) - { - this.RaisePropertyChanging(); - this._Metadescription = value; - this.RaisePropertyChanged("Metadescription"); - } - } - } - - /// - /// Enter a comma seperated list of keywords. - ///warren, keyword, test - /// - [UmbracoInfo("metaKeywords", DisplayName = "Meta Keywords", Mandatory = false)] - [Property()] - public virtual string Metakeywords - { - get - { - return this._Metakeywords; - } - set - { - if ((this._Metakeywords != value)) - { - this.RaisePropertyChanging(); - this._Metakeywords = value; - this.RaisePropertyChanged("Metakeywords"); - } - } - } - - /// - /// Pick a node you wish to redirect to if the user lands on this node. - /// - [UmbracoInfo("umbracoRedirect", DisplayName = " umbraco Redirect", Mandatory = false)] - [Property()] - public virtual int umbracoredirect - { - get - { - return this._umbracoredirect; - } - set - { - if ((this._umbracoredirect != value)) - { - this.RaisePropertyChanging(); - this._umbracoredirect = value; - this.RaisePropertyChanged("umbracoredirect"); - } - } - } - - /// - /// Use this property if you wish to hide this page in the navigation. - /// - [UmbracoInfo("umbracoNaviHide", DisplayName = "Hide in Navi", Mandatory = false)] - [Property()] - public virtual int umbraconavihide - { - get - { - return this._umbraconavihide; - } - set - { - if ((this._umbraconavihide != value)) - { - this.RaisePropertyChanging(); - this._umbraconavihide = value; - this.RaisePropertyChanged("umbraconavihide"); - } - } - } - - private bool umbraconavihideBoolean - { - get - { - return (this._umbraconavihide == 0); - } - } - } - - /// - /// This is the Textpage document type for your site. - /// - [UmbracoInfo("CWS_Textpage")] - [System.Runtime.Serialization.DataContractAttribute()] - [DocType()] - public partial class CwsTextpage : DocTypeBase - { - - private string _umbracourlname; - - private string _umbracourlalias; - - private string _Metadescription; - - private string _Metakeywords; - - private int _umbracoredirect; - - private int _umbraconavihide; - - private string _Headertext; - - private string _Articlephoto; - - private string _Bodytext; - - private AssociationTree _CwsTextpages; - - private AssociationTree _CwsTextpagetwocols; - - public CwsTextpage() - { - } - - /// - /// If you wish to change the URL of the node without changing the node name fill this in. - /// - ///eg: warren - /// - [UmbracoInfo("umbracoUrlName", DisplayName = "umbraco URL Name", Mandatory = false)] - [Property()] - public virtual string umbracourlname - { - get - { - return this._umbracourlname; - } - set - { - if ((this._umbracourlname != value)) - { - this.RaisePropertyChanging(); - this._umbracourlname = value; - this.RaisePropertyChanged("umbracourlname"); - } - } - } - - /// - /// Use this to give a node multiple urls. - /// - ///eg: home,homepage/another-level - /// - [UmbracoInfo("umbracoUrlAlias", DisplayName = "umbraco URL Alias", Mandatory = false)] - [Property()] - public virtual string umbracourlalias - { - get - { - return this._umbracourlalias; - } - set - { - if ((this._umbracourlalias != value)) - { - this.RaisePropertyChanging(); - this._umbracourlalias = value; - this.RaisePropertyChanged("umbracourlalias"); - } - } - } - - /// - /// Enter the description for the page. - /// - [UmbracoInfo("metaDescription", DisplayName = "Meta Description", Mandatory = false)] - [Property()] - public virtual string Metadescription - { - get - { - return this._Metadescription; - } - set - { - if ((this._Metadescription != value)) - { - this.RaisePropertyChanging(); - this._Metadescription = value; - this.RaisePropertyChanged("Metadescription"); - } - } - } - - /// - /// Enter a comma seperated list of keywords. - ///warren, keyword, test - /// - [UmbracoInfo("metaKeywords", DisplayName = "Meta Keywords", Mandatory = false)] - [Property()] - public virtual string Metakeywords - { - get - { - return this._Metakeywords; - } - set - { - if ((this._Metakeywords != value)) - { - this.RaisePropertyChanging(); - this._Metakeywords = value; - this.RaisePropertyChanged("Metakeywords"); - } - } - } - - /// - /// Pick a node you wish to redirect to if the user lands on this node. - /// - [UmbracoInfo("umbracoRedirect", DisplayName = " umbraco Redirect", Mandatory = false)] - [Property()] - public virtual int umbracoredirect - { - get - { - return this._umbracoredirect; - } - set - { - if ((this._umbracoredirect != value)) - { - this.RaisePropertyChanging(); - this._umbracoredirect = value; - this.RaisePropertyChanged("umbracoredirect"); - } - } - } - - /// - /// Use this property if you wish to hide this page in the navigation. - /// - [UmbracoInfo("umbracoNaviHide", DisplayName = "Hide in Navi", Mandatory = false)] - [Property()] - public virtual int umbraconavihide - { - get - { - return this._umbraconavihide; - } - set - { - if ((this._umbraconavihide != value)) - { - this.RaisePropertyChanging(); - this._umbraconavihide = value; - this.RaisePropertyChanged("umbraconavihide"); - } - } - } - - private bool umbraconavihideBoolean - { - get - { - return (this._umbraconavihide == 0); - } - } - - /// - /// - /// - [UmbracoInfo("headerText", DisplayName = "Header", Mandatory = false)] - [Property()] - public virtual string Headertext - { - get - { - return this._Headertext; - } - set - { - if ((this._Headertext != value)) - { - this.RaisePropertyChanging(); - this._Headertext = value; - this.RaisePropertyChanged("Headertext"); - } - } - } - - /// - /// - /// - [UmbracoInfo("articlePhoto", DisplayName = "Photo", Mandatory = false)] - [Property()] - public virtual string Articlephoto - { - get - { - return this._Articlephoto; - } - set - { - if ((this._Articlephoto != value)) - { - this.RaisePropertyChanging(); - this._Articlephoto = value; - this.RaisePropertyChanged("Articlephoto"); - } - } - } - - /// - /// - /// - [UmbracoInfo("bodyText", DisplayName = "Text", Mandatory = false)] - [Property()] - public virtual string Bodytext - { - get - { - return this._Bodytext; - } - set - { - if ((this._Bodytext != value)) - { - this.RaisePropertyChanging(); - this._Bodytext = value; - this.RaisePropertyChanged("Bodytext"); - } - } - } - - public AssociationTree CwsTextpages - { - get - { - if ((this._CwsTextpages == null)) - { - this._CwsTextpages = this.ChildrenOfType(); - } - return this._CwsTextpages; - } - set - { - this._CwsTextpages = value; - } - } - - public AssociationTree CwsTextpagetwocols - { - get - { - if ((this._CwsTextpagetwocols == null)) - { - this._CwsTextpagetwocols = this.ChildrenOfType(); - } - return this._CwsTextpagetwocols; - } - set - { - this._CwsTextpagetwocols = value; - } - } - } - - /// - /// This is the Textpage document type for your site which has two columns. - /// - [UmbracoInfo("CWS_TextpageTwoCol")] - [System.Runtime.Serialization.DataContractAttribute()] - [DocType()] - public partial class CwsTextpagetwocol : DocTypeBase - { - - private string _Articlephotocolone; - - private string _Articlephotocoltwo; - - private string _Bodytextcoltwo; - - private string _Bodytextcolone; - - private string _umbracourlname; - - private string _umbracourlalias; - - private string _Metadescription; - - private string _Metakeywords; - - private int _umbracoredirect; - - private int _umbraconavihide; - - private string _Headertext; - - private AssociationTree _CwsTextpages; - - private AssociationTree _CwsTextpagetwocols; - - public CwsTextpagetwocol() - { - } - - /// - /// - /// - [UmbracoInfo("articlePhotoColOne", DisplayName = "Photo", Mandatory = false)] - [Property()] - public virtual string Articlephotocolone - { - get - { - return this._Articlephotocolone; - } - set - { - if ((this._Articlephotocolone != value)) - { - this.RaisePropertyChanging(); - this._Articlephotocolone = value; - this.RaisePropertyChanged("Articlephotocolone"); - } - } - } - - /// - /// - /// - [UmbracoInfo("articlePhotoColTwo", DisplayName = "Photo", Mandatory = false)] - [Property()] - public virtual string Articlephotocoltwo - { - get - { - return this._Articlephotocoltwo; - } - set - { - if ((this._Articlephotocoltwo != value)) - { - this.RaisePropertyChanging(); - this._Articlephotocoltwo = value; - this.RaisePropertyChanged("Articlephotocoltwo"); - } - } - } - - /// - /// - /// - [UmbracoInfo("bodyTextColTwo", DisplayName = "Text", Mandatory = false)] - [Property()] - public virtual string Bodytextcoltwo - { - get - { - return this._Bodytextcoltwo; - } - set - { - if ((this._Bodytextcoltwo != value)) - { - this.RaisePropertyChanging(); - this._Bodytextcoltwo = value; - this.RaisePropertyChanged("Bodytextcoltwo"); - } - } - } - - /// - /// - /// - [UmbracoInfo("bodyTextColOne", DisplayName = "Text", Mandatory = false)] - [Property()] - public virtual string Bodytextcolone - { - get - { - return this._Bodytextcolone; - } - set - { - if ((this._Bodytextcolone != value)) - { - this.RaisePropertyChanging(); - this._Bodytextcolone = value; - this.RaisePropertyChanged("Bodytextcolone"); - } - } - } - - /// - /// If you wish to change the URL of the node without changing the node name fill this in. - /// - ///eg: warren - /// - [UmbracoInfo("umbracoUrlName", DisplayName = "umbraco URL Name", Mandatory = false)] - [Property()] - public virtual string umbracourlname - { - get - { - return this._umbracourlname; - } - set - { - if ((this._umbracourlname != value)) - { - this.RaisePropertyChanging(); - this._umbracourlname = value; - this.RaisePropertyChanged("umbracourlname"); - } - } - } - - /// - /// Use this to give a node multiple urls. - /// - ///eg: home,homepage/another-level - /// - [UmbracoInfo("umbracoUrlAlias", DisplayName = "umbraco URL Alias", Mandatory = false)] - [Property()] - public virtual string umbracourlalias - { - get - { - return this._umbracourlalias; - } - set - { - if ((this._umbracourlalias != value)) - { - this.RaisePropertyChanging(); - this._umbracourlalias = value; - this.RaisePropertyChanged("umbracourlalias"); - } - } - } - - /// - /// Enter the description for the page. - /// - [UmbracoInfo("metaDescription", DisplayName = "Meta Description", Mandatory = false)] - [Property()] - public virtual string Metadescription - { - get - { - return this._Metadescription; - } - set - { - if ((this._Metadescription != value)) - { - this.RaisePropertyChanging(); - this._Metadescription = value; - this.RaisePropertyChanged("Metadescription"); - } - } - } - - /// - /// Enter a comma seperated list of keywords. - ///warren, keyword, test - /// - [UmbracoInfo("metaKeywords", DisplayName = "Meta Keywords", Mandatory = false)] - [Property()] - public virtual string Metakeywords - { - get - { - return this._Metakeywords; - } - set - { - if ((this._Metakeywords != value)) - { - this.RaisePropertyChanging(); - this._Metakeywords = value; - this.RaisePropertyChanged("Metakeywords"); - } - } - } - - /// - /// Pick a node you wish to redirect to if the user lands on this node. - /// - [UmbracoInfo("umbracoRedirect", DisplayName = " umbraco Redirect", Mandatory = false)] - [Property()] - public virtual int umbracoredirect - { - get - { - return this._umbracoredirect; - } - set - { - if ((this._umbracoredirect != value)) - { - this.RaisePropertyChanging(); - this._umbracoredirect = value; - this.RaisePropertyChanged("umbracoredirect"); - } - } - } - - /// - /// Use this property if you wish to hide this page in the navigation. - /// - [UmbracoInfo("umbracoNaviHide", DisplayName = "Hide in Navi", Mandatory = false)] - [Property()] - public virtual int umbraconavihide - { - get - { - return this._umbraconavihide; - } - set - { - if ((this._umbraconavihide != value)) - { - this.RaisePropertyChanging(); - this._umbraconavihide = value; - this.RaisePropertyChanged("umbraconavihide"); - } - } - } - - private bool umbraconavihideBoolean - { - get - { - return (this._umbraconavihide == 0); - } - } - - /// - /// - /// - [UmbracoInfo("headerText", DisplayName = "Header", Mandatory = false)] - [Property()] - public virtual string Headertext - { - get - { - return this._Headertext; - } - set - { - if ((this._Headertext != value)) - { - this.RaisePropertyChanging(); - this._Headertext = value; - this.RaisePropertyChanged("Headertext"); - } - } - } - - public AssociationTree CwsTextpages - { - get - { - if ((this._CwsTextpages == null)) - { - this._CwsTextpages = this.ChildrenOfType(); - } - return this._CwsTextpages; - } - set - { - this._CwsTextpages = value; - } - } - - public AssociationTree CwsTextpagetwocols - { - get - { - if ((this._CwsTextpagetwocols == null)) - { - this._CwsTextpagetwocols = this.ChildrenOfType(); - } - return this._CwsTextpagetwocols; - } - set - { - this._CwsTextpagetwocols = value; - } - } - } - - /// - /// - /// - [UmbracoInfo("Textpage (Three Col)")] - [System.Runtime.Serialization.DataContractAttribute()] - [DocType()] - public partial class TextpageThreeCol : CwsTextpagetwocol - { - - private string _Thirdcontentarea; - - public TextpageThreeCol() - { - } - - /// - /// - /// - [UmbracoInfo("ThirdContentArea", DisplayName = "Third content area", Mandatory = false)] - [Property()] - public virtual string Thirdcontentarea - { - get - { - return this._Thirdcontentarea; - } - set - { - if ((this._Thirdcontentarea != value)) - { - this.RaisePropertyChanging(); - this._Thirdcontentarea = value; - this.RaisePropertyChanged("Thirdcontentarea"); - } - } - } - } -} diff --git a/src/LinqToUmbraco/src/umbraco.Linq/Core.Mockable.Tests/Properties/AssemblyInfo.cs b/src/LinqToUmbraco/src/umbraco.Linq/Core.Mockable.Tests/Properties/AssemblyInfo.cs deleted file mode 100644 index ad7442479a..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/Core.Mockable.Tests/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System.Reflection; - -// 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("Core")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyProduct("Core")] \ No newline at end of file diff --git a/src/LinqToUmbraco/src/umbraco.Linq/Core.Tests/AncestorTest.cs b/src/LinqToUmbraco/src/umbraco.Linq/Core.Tests/AncestorTest.cs deleted file mode 100644 index 1dab5f0424..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/Core.Tests/AncestorTest.cs +++ /dev/null @@ -1,118 +0,0 @@ -using System; -using System.Text; -using System.Collections.Generic; -using System.Linq; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using TypeMock.ArrangeActAssert; -using umbraco.Test; - -namespace umbraco.Linq.Core.Tests -{ - /// - /// Summary description for AncestorTest - /// - [TestClass, DeploymentItem("umbraco.config")] - public class AncestorTest - { - public AncestorTest() - { - // - // TODO: Add constructor logic here - // - } - - private TestContext testContextInstance; - - /// - ///Gets or sets the test context which provides - ///information about and functionality for the current test run. - /// - public TestContext TestContext - { - get - { - return testContextInstance; - } - set - { - testContextInstance = value; - } - } - - #region Additional test attributes - // - // You can use the following additional attributes as you write your tests: - // - // Use ClassInitialize to run code before running the first test in the class - // [ClassInitialize()] - // public static void MyClassInitialize(TestContext testContext) { } - // - // Use ClassCleanup to run code after all tests in a class have run - // [ClassCleanup()] - // public static void MyClassCleanup() { } - // - // Use TestInitialize to run code before running each test - // [TestInitialize()] - // public void MyTestInitialize() { } - // - // Use TestCleanup to run code after each test has run - // [TestCleanup()] - // public void MyTestCleanup() { } - // - #endregion - - [TestMethod, Isolated] - public void AncestorTest_NoWhereCondition_Exists() - { - MockHelpers.SetupFakeHttpContext(); - using (var ctx = new MyUmbracoDataContext()) - { - var textPage = ctx.CWSTextpages.First(); - - var hp = textPage.AncestorOrDefault(); - - Assert.IsNotNull(hp); - } - } - - [TestMethod, Isolated] - public void AncestorTest_NoWhereCondition_NotExists() - { - MockHelpers.SetupFakeHttpContext(); - using (var ctx = new MyUmbracoDataContext()) - { - var textPage = ctx.CWSTextpages.First(); - - var a = textPage.AncestorOrDefault(); - - Assert.IsNull(a); - } - } - - [TestMethod, Isolated] - public void AncestorTest_Where_Exists() - { - MockHelpers.SetupFakeHttpContext(); - using (var ctx = new MyUmbracoDataContext()) - { - var photo = ctx.CWSPhotos.First(p => p.Name.Contains("Umbraco")); - var gallery = photo.AncestorOrDefault(g => g.Name.Contains("Codegarden")); - - Assert.IsNotNull(gallery); - } - } - - [TestMethod, Isolated] - public void AncestorTest_Where_NotExists() - { - MockHelpers.SetupFakeHttpContext(); - using (var ctx = new MyUmbracoDataContext()) - { - var photo = ctx.CWSPhotos.First(p => p.Name.Contains("Umbraco")); - var gallery = photo.AncestorOrDefault(g => g.Name.Contains("Bookhouses")); - - Assert.IsNull(gallery); - } - } - } -} diff --git a/src/LinqToUmbraco/src/umbraco.Linq/Core.Tests/App.config b/src/LinqToUmbraco/src/umbraco.Linq/Core.Tests/App.config deleted file mode 100644 index 0eb1e54b3e..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/Core.Tests/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/LinqToUmbraco/src/umbraco.Linq/Core.Tests/AuthoringTests.txt b/src/LinqToUmbraco/src/umbraco.Linq/Core.Tests/AuthoringTests.txt deleted file mode 100644 index 64bab9481d..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/Core.Tests/AuthoringTests.txt +++ /dev/null @@ -1,136 +0,0 @@ -========================================================================== - Visual Studio Team System: Overview of Authoring and Running Tests -========================================================================== - -This overview describes the features for authoring and running tests in -Visual Studio Team System and Visual Studio Team Edition for Software Testers. - -Opening Tests -------------- -To open a test, open a test project or a test metadata file (a file with -extension .vsmdi) that contains the definition of the test. You can find -test projects and metadata files in Solution Explorer. - -Viewing Tests -------------- -To see which tests are available to you, open the Test View window. Or, -if you have installed Team Edition for Software Testers, you can also open -the Test List Editor window to view tests. - -To open the Test View window, click the Test menu, point to Windows, and -then click Test View. To open the Test List Editor window (if you have -installed Team Edition for Software Testers), click Test, point to Windows, -and then click Test List Editor. - -Running Tests -------------- -You can run tests from the Test View window and the Test List Editor window. -See Viewing Tests to learn how to open these windows. To run one or more -tests displayed in the Test View window, first select the tests in that -window; to select multiple tests, hold either the Shift or CTRL key while -clicking tests. Then click the Run Tests button in the Test View window -toolbar. - -If you have installed Visual Studio Team Edition for Software Testers, you can -also use the Test List Editor window to run tests. To run tests in Test List Editor, -select the check box next to each test that you want to run. Then click the -Run Tests button in the Test List Editor window toolbar. - -Viewing Test Results --------------------- -When you run a test or a series of tests, the results of the test run will be -shown in the Test Results window. Each individual test in the run is shown on -a separate line so that you can see its status. The window contains an -embedded status bar in the top half of the window that provides you with -summary details of the complete test run. - -To see more detailed results for a particular test result, double-click it in -the Test Results window. This opens a window that provides more information -about the particular test result, such as any specific error messages returned -by the test. - -Changing the way that tests are run ------------------------------------ -Each time you run one or more tests, a collection of settings is used to -determine how those tests are run. These settings are contained in a “test -run configuration” file. - -Here is a partial list of the changes you can make with a test run -configuration file: - - - Change the naming scheme for each test run. - - Change the test controller that the tests are run on so that you can run - tests remotely. - - Gather code coverage data for the code being tested so that you can see - which lines of code are covered by your tests. - - Enable and disable test deployment. - - Specify additional files to deploy before tests are run. - - Select a different host, ASP.NET, for running ASP.NET unit tests. - - Select a different host, the smart device test host, for running smart device unit tests. - - Set various properties for the test agents that run your tests. - - Run custom scripts at the start and end of each test run so that you can - set up the test environment exactly as required each time tests are run. - - Set time limits for tests and test runs. - - Set the browser mix and the number of times to repeat Web tests in the - test run. - -By default, a test run configuration file is created whenever you create a -new test project. You make changes to this file by double-clicking it in -Solution Explorer and then changing its settings. (Test run configuration -files have the extension .testrunconfig.) - -A solution can contain multiple test run configuration files. Only one of -those files, known as the “Active” test run configuration file, is used to -determine the settings that are currently used for test runs. You select -the active test run configuration by clicking Select Active Test Run -Configuration on the Test menu. - -------------------------------------------------------------------------------- - -Test Types ----------- -Using Visual Studio Team Edition for Software Testers, you can create a number -of different test types: - -Unit test: Use a unit test to create a programmatic test in C++, Visual C# or -Visual Basic that exercises source code. A unit test calls the methods of a -class, passing suitable parameters, and verifies that the returned value is -what you expect. -There are three specialized variants of unit tests: - - Data-driven unit tests are created when you configure a unit test to be - called repeatedly for each row of a data source. The data from each row - is used by the unit test as input data. - - ASP.NET unit tests are unit tests that exercise code in an ASP.NET Web - application. - - Smart device unit tests are unit tests that are deployed to a smart device - or emulator and then executed by the smart device test host. - -Web Test: Web tests consist of an ordered series of HTTP requests that you -record in a browser session using Microsoft Internet Explorer. You can have -the test report specific details about the pages or sites it requests, such -as whether a particular page contains a specified string. - -Load Test: You use a load test to encapsulate non-manual tests, such as -unit, Web, and generic tests, and then run them simultaneously by using -virtual users. Running these tests under load generates test results, -including performance and other counters, in tables and in graphs. - -Generic test: A generic test is an existing program wrapped to function as a -test in Visual Studio. The following are examples of tests or programs that -you can turn into generic tests: - - An existing test that uses process exit codes to communicate whether the - test passed or failed. 0 indicates passing and any other value indicates - a failure. - - A general program to obtain specific functionality during a test scenario. - - A test or program that uses a special XML file (called a “summary results - file”), to communicate detailed results. - -Manual test: The manual test type is used when the test tasks are to be -completed by a test engineer as opposed to an automated script. - -Ordered test: Use an ordered test to execute a set of tests in an order you -specify. - -------------------------------------------------------------------------------- - - diff --git a/src/LinqToUmbraco/src/umbraco.Linq/Core.Tests/CacheTest.cs b/src/LinqToUmbraco/src/umbraco.Linq/Core.Tests/CacheTest.cs deleted file mode 100644 index 353d0ecdfc..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/Core.Tests/CacheTest.cs +++ /dev/null @@ -1,93 +0,0 @@ -using System; -using System.Text; -using System.Collections.Generic; -using System.Linq; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using TypeMock.ArrangeActAssert; -using umbraco.Test; - -namespace umbraco.Linq.Core.Tests -{ - /// - /// Summary description for CacheTest - /// - [TestClass, DeploymentItem("umbraco.config")] - public class CacheTest - { - public CacheTest() - { - } - - private TestContext testContextInstance; - - /// - ///Gets or sets the test context which provides - ///information about and functionality for the current test run. - /// - public TestContext TestContext - { - get - { - return testContextInstance; - } - set - { - testContextInstance = value; - } - } - - #region Additional test attributes - // - // You can use the following additional attributes as you write your tests: - // - // Use ClassInitialize to run code before running the first test in the class - // [ClassInitialize()] - // public static void MyClassInitialize(TestContext testContext) { } - // - // Use ClassCleanup to run code after all tests in a class have run - // [ClassCleanup()] - // public static void MyClassCleanup() { } - // - // Use TestInitialize to run code before running each test - // [TestInitialize()] - // public void MyTestInitialize() { } - // - // Use TestCleanup to run code after each test has run - // [TestCleanup()] - // public void MyTestCleanup() { } - // - #endregion - - [TestMethod, Isolated] - public void CacheTest_ForcedRefresh() - { - MockHelpers.SetupFakeHttpContext(); - - using (var ctx = new MyUmbracoDataContext()) - { - var hps = ctx.CWSHomes; - - ctx.CWSHomes.ReloadCache(); - - var reloadedHps = ctx.CWSHomes; - - Assert.AreNotSame(reloadedHps, hps, "Force reload should result in a different object"); - } - } - - [TestMethod, Isolated] - public void CacheTest_RequeryLoadFromCache() - { - MockHelpers.SetupFakeHttpContext(); - - using (var ctx = new MyUmbracoDataContext()) - { - var hps = ctx.CWSHomes; - - var requeriedHps = ctx.CWSHomes; - - Assert.AreSame(requeriedHps, hps, "Requeried objects should result in the same collection"); - } - } - } -} diff --git a/src/LinqToUmbraco/src/umbraco.Linq/Core.Tests/ChildTest.cs b/src/LinqToUmbraco/src/umbraco.Linq/Core.Tests/ChildTest.cs deleted file mode 100644 index c0a458f20d..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/Core.Tests/ChildTest.cs +++ /dev/null @@ -1,102 +0,0 @@ -using System; -using System.Text; -using System.Collections.Generic; -using System.Linq; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using TypeMock.ArrangeActAssert; -using umbraco.Test; - -namespace umbraco.Linq.Core.Tests -{ - /// - /// Summary description for ChildTest - /// - [TestClass, DeploymentItem("umbraco.config")] - public class ChildTest - { - public ChildTest() - { - // - // TODO: Add constructor logic here - // - } - - private TestContext testContextInstance; - - /// - ///Gets or sets the test context which provides - ///information about and functionality for the current test run. - /// - public TestContext TestContext - { - get - { - return testContextInstance; - } - set - { - testContextInstance = value; - } - } - - #region Additional test attributes - // - // You can use the following additional attributes as you write your tests: - // - // Use ClassInitialize to run code before running the first test in the class - // [ClassInitialize()] - // public static void MyClassInitialize(TestContext testContext) { } - // - // Use ClassCleanup to run code after all tests in a class have run - // [ClassCleanup()] - // public static void MyClassCleanup() { } - // - // Use TestInitialize to run code before running each test - // [TestInitialize()] - // public void MyTestInitialize() { } - // - // Use TestCleanup to run code after each test has run - // [TestCleanup()] - // public void MyTestCleanup() { } - // - #endregion - - [TestMethod, Isolated] - public void ChildTest_ChildExist() - { - MockHelpers.SetupFakeHttpContext(); - using (var ctx = new MyUmbracoDataContext()) - { - var pages = ctx.CWSHomes.First().CWSTextpages; - - Assert.AreNotEqual(0, pages.Count()); - } - } - - [TestMethod, Isolated] - public void ChildTest_ChildToParent() - { - MockHelpers.SetupFakeHttpContext(); - using (var ctx = new MyUmbracoDataContext()) - { - var page = ctx.CWSHomes.First().CWSTextpages.First(); - - Assert.AreEqual(ctx.CWSHomes.First().Id, page.Parent().Id); - } - } - - [TestMethod, Isolated] - public void ChildTest_AllChildren() - { - MockHelpers.SetupFakeHttpContext(); - using (var ctx = new MyUmbracoDataContext()) - { - var hp = ctx.CWSHomes.First(); - - Assert.IsTrue(hp.Children.Count() > 0); - Assert.IsInstanceOfType(hp.Children.First(), typeof(CWSTextpage)); - Assert.IsInstanceOfType(hp.Children.Skip(1).First(), typeof(CWSGalleryList)); - } - } - } -} diff --git a/src/LinqToUmbraco/src/umbraco.Linq/Core.Tests/Core.Tests.csproj b/src/LinqToUmbraco/src/umbraco.Linq/Core.Tests/Core.Tests.csproj deleted file mode 100644 index a82e334bbc..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/Core.Tests/Core.Tests.csproj +++ /dev/null @@ -1,130 +0,0 @@ - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {A80528D0-E68C-4A94-9489-C712216665B0} - Library - Properties - umbraco.Linq.Core.Tests - umbraco.Linq.Core.Tests - v3.5 - 512 - {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - SAK - SAK - SAK - SAK - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - true - bin\Debug - Fixed Version\ - DEBUG;TRACE - full - AnyCPU - true - GlobalSuppressions.cs - prompt - - - - - - 3.5 - - - - 3.5 - - - 3.0 - - - - - 3.5 - - - False - ..\..\..\dep\Reference Assemblies\Mocking\TypeMock.dll - - - False - ..\..\..\dep\Reference Assemblies\Mocking\Typemock.ArrangeActAssert.Dll - - - - - Properties\SolutionInfo.cs - - - - - - - - - - - - - - - - - - - - - - - umbraco.config - PreserveNewest - - - - - - {E469A9CE-1BEC-423F-AC44-713CD72457EA} - umbraco.businesslogic - - - {C7CB79F0-1C97-4B33-BFA7-00731B579AE2} - umbraco.datalayer - - - {651E1350-91B6-44B7-BD60-7207006D7003} - umbraco.presentation - - - {31CAEC36-0C3D-4D69-B092-84866811EA07} - umbraco.Linq.Core - - - - - \ No newline at end of file diff --git a/src/LinqToUmbraco/src/umbraco.Linq/Core.Tests/CwsReplicationTest.cs b/src/LinqToUmbraco/src/umbraco.Linq/Core.Tests/CwsReplicationTest.cs deleted file mode 100644 index b48476b424..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/Core.Tests/CwsReplicationTest.cs +++ /dev/null @@ -1,85 +0,0 @@ -using System; -using System.Text; -using System.Collections.Generic; -using System.Linq; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using TypeMock.ArrangeActAssert; -using umbraco.Test; - -namespace umbraco.Linq.Core.Tests -{ - /// - /// Tests to replicate the functionality of the CWS2 xslt's - /// - [TestClass, DeploymentItem("umbraco.config")] - public class CwsReplicationTest - { - public CwsReplicationTest() - { - - } - - private TestContext testContextInstance; - - /// - ///Gets or sets the test context which provides - ///information about and functionality for the current test run. - /// - public TestContext TestContext - { - get - { - return testContextInstance; - } - set - { - testContextInstance = value; - } - } - - #region Additional test attributes - // - // You can use the following additional attributes as you write your tests: - // - // Use ClassInitialize to run code before running the first test in the class - // [ClassInitialize()] - // public static void MyClassInitialize(TestContext testContext) { } - // - // Use ClassCleanup to run code after all tests in a class have run - // [ClassCleanup()] - // public static void MyClassCleanup() { } - // - // Use TestInitialize to run code before running each test - // [TestInitialize()] - // public void MyTestInitialize() { } - // - // Use TestCleanup to run code after each test has run - // [TestCleanup()] - // public void MyTestCleanup() { } - // - #endregion - - [TestMethod, Isolated] - public void CwsReplicationTest_ListGalleries() - { - MockHelpers.SetupFakeHttpContext(); - using (var ctx = new MyUmbracoDataContext()) - { - var galleryList = ctx.CWSGalleryLists.First(); //this would really be a Where(g => g.Id == umbracoContext.Current.PageId.Value) but since I'm not really on a page... - - var galleries = from g in galleryList.CWSGalleries - where g.CWSPhotos.Count() >= 1 - orderby g.Name - select new - { - g.Name, - Url = umbraco.library.NiceUrl(g.Id), - Thumbnail = (string.IsNullOrEmpty(g.GalleryThumbnail) ? "/Assets/Placeholders/gallery_placeholder.gif" : g.GalleryThumbnail), - PhotoCount = g.CWSPhotos.Count(), - }; - - Assert.AreEqual(3, galleries.Count()); - } - } - } -} diff --git a/src/LinqToUmbraco/src/umbraco.Linq/Core.Tests/DataContextTest.cs b/src/LinqToUmbraco/src/umbraco.Linq/Core.Tests/DataContextTest.cs deleted file mode 100644 index 73e8716213..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/Core.Tests/DataContextTest.cs +++ /dev/null @@ -1,145 +0,0 @@ -using System; -using System.Text; -using System.Collections.Generic; -using System.Linq; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using TypeMock.ArrangeActAssert; -using umbraco.Linq.Core.Node; -using umbraco.Test; -using System.IO; -using System.Web; - -namespace umbraco.Linq.Core.Tests -{ - /// - /// Summary description for DataContextTest - /// - [TestClass, DeploymentItem("umbraco.config")] - public class DataContextTest - { - public DataContextTest() - { - } - - private TestContext testContextInstance; - - /// - ///Gets or sets the test context which provides - ///information about and functionality for the current test run. - /// - public TestContext TestContext - { - get - { - return testContextInstance; - } - set - { - testContextInstance = value; - } - } - - #region Additional test attributes - // - // You can use the following additional attributes as you write your tests: - // - // Use ClassInitialize to run code before running the first test in the class - // [ClassInitialize()] - // public static void MyClassInitialize(TestContext testContext) { } - // - // Use ClassCleanup to run code after all tests in a class have run - // [ClassCleanup()] - // public static void MyClassCleanup() { } - // - // Use TestInitialize to run code before running each test - // [TestInitialize()] - // public void MyTestInitialize() { } - // - // Use TestCleanup to run code after each test has run - // [TestCleanup()] - // public void MyTestCleanup() { } - // - #endregion - - [TestMethod, ExpectedException(typeof(ArgumentNullException))] - public void DataContextTest_FileNameRequired() - { - var nodeProvider = new NodeDataProvider(string.Empty); - } - - [TestMethod, ExpectedException(typeof(FileNotFoundException))] - public void DataContextTest_FileMustExist() - { - var nodeProvider = new NodeDataProvider(@"C:\fakeFile.config"); - } - - [TestMethod] - public void DataContextTest_ConstructFromExistingProvider() - { - var nodeProvider = new NodeDataProvider(Path.Combine(Environment.CurrentDirectory, "umbraco.config")); - - MyUmbracoDataContext ctx = new MyUmbracoDataContext(nodeProvider); - } - - [TestMethod] - public void DataContextTest_EnsureSchemaValidation() - { - var nodeProvider = new NodeDataProvider(Path.Combine(Environment.CurrentDirectory, "umbraco.config"), true); - - MyUmbracoDataContext ctx = new MyUmbracoDataContext(nodeProvider); - - var hp = ctx.CWSHomes.First(); - - Assert.IsNotNull(hp); - } - - [TestMethod, Isolated] - public void DataContextTest_DefaultConstructorIsNodeProvider() - { - MockHelpers.SetupFakeHttpContext(); - - var ctx = new MyUmbracoDataContext(); - - Assert.IsInstanceOfType(ctx.DataProvider, typeof(NodeDataProvider)); - } - - [TestMethod, Isolated] - public void DataContextTest_NodeCached() - { - MockHelpers.SetupFakeHttpContext(); - using (var ctx = new MyUmbracoDataContext()) - { - var hp = ctx.CWSHomes.First(); - var hp2 = ctx.CWSHomes.First(); - - Assert.AreSame(hp, hp2); - } - } - - [TestMethod, Isolated] - public void DataContextTest_FullCache() - { - MockHelpers.SetupFakeHttpContext(); - using (var ctx = new MyUmbracoDataContext()) - { - var one = ctx.CWSHomes; - var two = ctx.CWSHomes; - - Assert.AreSame(one, two); - } - } - - [TestMethod, Isolated] - public void DataContextTest_OfNodeTypes() - { - MockHelpers.SetupFakeHttpContext(); - using (var ctx = new MyUmbracoDataContext()) - { - var tree = ctx.CWSHomes; - - Assert.IsInstanceOfType(tree, typeof(NodeTree)); - Assert.IsInstanceOfType(tree.First().CWSTextpages, typeof(NodeAssociationTree)); - } - } - } -} diff --git a/src/LinqToUmbraco/src/umbraco.Linq/Core.Tests/Extensions.cs b/src/LinqToUmbraco/src/umbraco.Linq/Core.Tests/Extensions.cs deleted file mode 100644 index ad00d901a4..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/Core.Tests/Extensions.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using TypeMock.ArrangeActAssert; - -namespace umbraco.Linq.Core.Tests -{ - public static class Extensions - { - public static ActionRepeater WillReturnRepeat(this IPublicNonVoidMethodHandler ret, TReturn value, int numberOfReturns) - { - for (var i = 0; i < numberOfReturns; i++) - ret.WillReturn(value); - - return new ActionRepeater(ret); - } - - public static ActionRepeater CallOriginalRepeat(this IPublicNonVoidMethodHandler ret, int numberOfReturns) - { - for (var i = 0; i < numberOfReturns; i++) - ret.CallOriginal(); - - return new ActionRepeater(ret); - } - } - - public class ActionRepeater - { - private IPublicNonVoidMethodHandler _actionRepeater; - public ActionRepeater(IPublicNonVoidMethodHandler actionRepeater) - { - _actionRepeater = actionRepeater; - } - - public IPublicNonVoidMethodHandler AndThen() - { - return _actionRepeater; - } - } -} - diff --git a/src/LinqToUmbraco/src/umbraco.Linq/Core.Tests/InheritanceTest.cs b/src/LinqToUmbraco/src/umbraco.Linq/Core.Tests/InheritanceTest.cs deleted file mode 100644 index 0664025609..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/Core.Tests/InheritanceTest.cs +++ /dev/null @@ -1,80 +0,0 @@ -using System; -using System.Text; -using System.Collections.Generic; -using System.Linq; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using TypeMock.ArrangeActAssert; -using umbraco.Test; - -namespace umbraco.Linq.Core.Tests -{ - /// - /// Summary description for InheritanceTest - /// - [TestClass, DeploymentItem("umbraco.config")] - public class InheritanceTest - { - public InheritanceTest() - { - // - // TODO: Add constructor logic here - // - } - - private TestContext testContextInstance; - - /// - ///Gets or sets the test context which provides - ///information about and functionality for the current test run. - /// - public TestContext TestContext - { - get - { - return testContextInstance; - } - set - { - testContextInstance = value; - } - } - - #region Additional test attributes - // - // You can use the following additional attributes as you write your tests: - // - // Use ClassInitialize to run code before running the first test in the class - // [ClassInitialize()] - // public static void MyClassInitialize(TestContext testContext) { } - // - // Use ClassCleanup to run code after all tests in a class have run - // [ClassCleanup()] - // public static void MyClassCleanup() { } - // - // Use TestInitialize to run code before running each test - // [TestInitialize()] - // public void MyTestInitialize() { } - // - // Use TestCleanup to run code after each test has run - // [TestCleanup()] - // public void MyTestCleanup() { } - // - #endregion - - [TestMethod] - public void InheritanceTest_ImplementsBaseClass() - { - var tmp = new TextPageThreeCol(); - - Assert.AreEqual(typeof(CWSTextpageTwoCol), tmp.GetType().BaseType); - } - - [TestMethod, Isolated] - public void InheritanceTest_PropertyFromBase() - { - var fake = Isolate.Fake.Instance(); - - Assert.AreEqual(typeof(CWSTextpageTwoCol), fake.GetType().GetProperties().Single(p => p.Name == "Headertext").DeclaringType); - } - } -} diff --git a/src/LinqToUmbraco/src/umbraco.Linq/Core.Tests/MockHelpers.cs b/src/LinqToUmbraco/src/umbraco.Linq/Core.Tests/MockHelpers.cs deleted file mode 100644 index 65af51a3d6..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/Core.Tests/MockHelpers.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Web; -using TypeMock.ArrangeActAssert; -using System.IO; - -namespace umbraco.Linq.Core.Tests -{ - internal class MockHelpers - { - public static void SetupFakeHttpContext() - { - HttpContext fakeHttpContext = Isolate.Fake.Instance(Members.MustSpecifyReturnValues); - HttpServerUtility fakeServer = Isolate.Fake.Instance(); - Isolate.WhenCalled(() => HttpContext.Current).WillReturn(fakeHttpContext); - Isolate.WhenCalled(() => fakeHttpContext.Server).WillReturn(fakeServer); - Isolate.WhenCalled(() => fakeServer.MapPath(string.Empty)).WillReturn(Path.Combine(Environment.CurrentDirectory, "umbraco.config")); - } - } -} diff --git a/src/LinqToUmbraco/src/umbraco.Linq/Core.Tests/MyUmbraco.Abstractions.cs b/src/LinqToUmbraco/src/umbraco.Linq/Core.Tests/MyUmbraco.Abstractions.cs deleted file mode 100644 index f0ba3baa02..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/Core.Tests/MyUmbraco.Abstractions.cs +++ /dev/null @@ -1,1729 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:2.0.50727.4927 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace umbraco.Test -{ - using umbraco.Linq.Core; - using umbraco.Linq.Core.Node; - using System.Linq; - - - /// - /// This is the contact form document type for your site. - /// - [UmbracoInfo("CWS_Contact")] - [DocType()] - public interface ICWSContact : IDocTypeBase - { - - - - - - - - - - - - - - - - - - - - /// - /// The email address that you want the form to be sent to. - /// - [UmbracoInfo("emailTo", DisplayName = "Email To", Mandatory = true)] - [Property()] - string EmailTo - { - get; - set; - } - - /// - /// The subject of the email that will be sent to you. - /// - [UmbracoInfo("emailSubject", DisplayName = "Email Subject", Mandatory = true)] - [Property()] - string EmailSubject - { - get; - set; - } - - /// - /// Use placeholders [Name], [AddressLine1], [AddressLine2], [Email], [Message], [Time] and [Date] - /// - [UmbracoInfo("emailBody", DisplayName = "Email Message", Mandatory = true)] - [Property()] - string EmailBody - { - get; - set; - } - - /// - /// The email address that you want the automated reply to be sent from. - /// - [UmbracoInfo("emailReplyFrom", DisplayName = "Email Reply From", Mandatory = true)] - [Property()] - string EmailReplyFrom - { - get; - set; - } - - /// - /// The subject of the email that will be sent as the automated reply. - /// - /// - [UmbracoInfo("emailReplySubject", DisplayName = "Email Reply Subject", Mandatory = false)] - [Property()] - string EmailReplySubject - { - get; - set; - } - - /// - /// Use placeholder [Name] - /// - [UmbracoInfo("emailReplyBody", DisplayName = "Email Reply Body", Mandatory = false)] - [Property()] - string EmailReplyBody - { - get; - set; - } - - /// - /// Does your SMTP server require SSL? - /// - [UmbracoInfo("enableSSL", DisplayName = "Enable SSL", Mandatory = false)] - [Property()] - int EnableSSL - { - get; - set; - } - - bool EnableSSLBoolean - { - get; - } - - /// - /// If you wish to change the URL of the node without changing the node name fill this in. - /// - ///eg: warren - /// - [UmbracoInfo("umbracoUrlName", DisplayName = "Umbraco URL Name", Mandatory = false)] - [Property()] - string UmbracoUrlName - { - get; - set; - } - - /// - /// Use this to give a node multiple urls. - /// - ///eg: home,homepage/another-level - /// - [UmbracoInfo("umbracoUrlAlias", DisplayName = "Umbraco URL Alias", Mandatory = false)] - [Property()] - string UmbracoUrlAlias - { - get; - set; - } - - /// - /// Enter the description for the page. - /// - [UmbracoInfo("metaDescription", DisplayName = "Meta Description", Mandatory = false)] - [Property()] - string MetaDescription - { - get; - set; - } - - /// - /// Enter a comma seperated list of keywords. - ///warren, keyword, test - /// - [UmbracoInfo("metaKeywords", DisplayName = "Meta Keywords", Mandatory = false)] - [Property()] - string MetaKeywords - { - get; - set; - } - - /// - /// Pick a node you wish to redirect to if the user lands on this node. - /// - [UmbracoInfo("umbracoRedirect", DisplayName = " Umbraco Redirect", Mandatory = false)] - [Property()] - int UmbracoRedirect - { - get; - set; - } - - /// - /// Use this property if you wish to hide this page in the navigation. - /// - [UmbracoInfo("umbracoNaviHide", DisplayName = "Hide in Navi", Mandatory = false)] - [Property()] - int UmbracoNaviHide - { - get; - set; - } - - bool UmbracoNaviHideBoolean - { - get; - } - - /// - /// - /// - [UmbracoInfo("headerText", DisplayName = "Header", Mandatory = false)] - [Property()] - string HeaderText - { - get; - set; - } - - /// - /// This is the text that sits to the left of the contact form. - /// - [UmbracoInfo("formText", DisplayName = "Form Text", Mandatory = false)] - [Property()] - string FormText - { - get; - set; - } - - /// - /// This is the header for the thankyou the user will see after sumbitting the contact form. - /// - [UmbracoInfo("thankYouHeaderText", DisplayName = "Thank You Header", Mandatory = true)] - [Property()] - string ThankYouHeaderText - { - get; - set; - } - - /// - /// This is the thankyou message that the user will see after submitting your form. - /// - [UmbracoInfo("thankYouMessageText", DisplayName = "Thank You Message", Mandatory = true)] - [Property()] - string ThankYouMessageText - { - get; - set; - } - - AssociationTree CWSTextpages - { - get; - set; - } - } - - /// - /// This is the email a friend form document type for your site. - /// - [UmbracoInfo("CWS_EmailAFriend")] - [DocType()] - public interface ICWSEmailAFriend : IDocTypeBase - { - - - - - - - - - - - - - - - - /// - /// The email address that you want the email to be sent from. - /// - [UmbracoInfo("emailFrom", DisplayName = "Email From", Mandatory = true)] - [Property()] - string EmailFrom - { - get; - set; - } - - /// - /// The subject of the email that will be sent to the friend. - /// - [UmbracoInfo("emailSubjectToFriend", DisplayName = "Email Subject to Friend", Mandatory = true)] - [Property()] - string EmailSubjectToFriend - { - get; - set; - } - - /// - /// Use placeholders [FriendName], [FriendEmail], [YourName], [YourEmail], [Message], [Date], [Time], [URL] - /// - [UmbracoInfo("emailMessageToFriend", DisplayName = "Email Message to Friend", Mandatory = true)] - [Property()] - string EmailMessageToFriend - { - get; - set; - } - - /// - /// Does your SMTP server require SSL? - /// - [UmbracoInfo("enableSSL", DisplayName = "Enable SSL", Mandatory = false)] - [Property()] - int EnableSSL - { - get; - set; - } - - bool EnableSSLBoolean - { - get; - } - - /// - /// If you wish to change the URL of the node without changing the node name fill this in. - /// - ///eg: warren - /// - [UmbracoInfo("umbracoUrlName", DisplayName = "Umbraco URL Name", Mandatory = false)] - [Property()] - string UmbracoUrlName - { - get; - set; - } - - /// - /// Use this to give a node multiple urls. - /// - ///eg: home,homepage/another-level - /// - [UmbracoInfo("umbracoUrlAlias", DisplayName = "Umbraco URL Alias", Mandatory = false)] - [Property()] - string UmbracoUrlAlias - { - get; - set; - } - - /// - /// Enter the description for the page. - /// - [UmbracoInfo("metaDescription", DisplayName = "Meta Description", Mandatory = false)] - [Property()] - string MetaDescription - { - get; - set; - } - - /// - /// Enter a comma seperated list of keywords. - ///warren, keyword, test - /// - [UmbracoInfo("metaKeywords", DisplayName = "Meta Keywords", Mandatory = false)] - [Property()] - string MetaKeywords - { - get; - set; - } - - /// - /// Pick a node you wish to redirect to if the user lands on this node. - /// - [UmbracoInfo("umbracoRedirect", DisplayName = " Umbraco Redirect", Mandatory = false)] - [Property()] - int UmbracoRedirect - { - get; - set; - } - - /// - /// Use this property if you wish to hide this page in the navigation. - /// - [UmbracoInfo("umbracoNaviHide", DisplayName = "Hide in Navi", Mandatory = false)] - [Property()] - int UmbracoNaviHide - { - get; - set; - } - - bool UmbracoNaviHideBoolean - { - get; - } - - /// - /// - /// - [UmbracoInfo("headerText", DisplayName = "Header", Mandatory = false)] - [Property()] - string HeaderText - { - get; - set; - } - - /// - /// This is the header for the thankyou the user will see after sumbitting the contact form. - /// - [UmbracoInfo("thankYouHeaderText", DisplayName = "Thank You Header", Mandatory = true)] - [Property()] - string ThankYouHeaderText - { - get; - set; - } - - /// - /// This is the thankyou message that the user will see after submitting your form. - /// - [UmbracoInfo("thankYouMessageText", DisplayName = "Thank You Text", Mandatory = true)] - [Property()] - string ThankYouMessageText - { - get; - set; - } - - AssociationTree CWSTextpages - { - get; - set; - } - } - - /// - /// This is the event document type for your site and lives beneath the News & Events List document type. - /// - [UmbracoInfo("CWS_EventItem")] - [DocType()] - public interface ICWSEventItem : IDocTypeBase - { - - - - - - - - - - - - /// - /// - /// - [UmbracoInfo("eventDate", DisplayName = "Date", Mandatory = false)] - [Property()] - System.DateTime EventDate - { - get; - set; - } - - /// - /// - /// - [UmbracoInfo("bodyText", DisplayName = "Text", Mandatory = false)] - [Property()] - string BodyText - { - get; - set; - } - - /// - /// - /// - [UmbracoInfo("articlePhoto", DisplayName = "Photo", Mandatory = false)] - [Property()] - string ArticlePhoto - { - get; - set; - } - - /// - /// If you wish to change the URL of the node without changing the node name fill this in. - /// - ///eg: warren - /// - [UmbracoInfo("umbracoUrlName", DisplayName = "Umbraco URL Name", Mandatory = false)] - [Property()] - string UmbracoUrlName - { - get; - set; - } - - /// - /// Use this to give a node multiple urls. - /// - ///eg: home,homepage/another-level - /// - [UmbracoInfo("umbracoUrlAlias", DisplayName = "Umbraco URL Alias", Mandatory = false)] - [Property()] - string UmbracoUrlAlias - { - get; - set; - } - - /// - /// Enter the description for the page. - /// - [UmbracoInfo("metaDescription", DisplayName = "Meta Description", Mandatory = false)] - [Property()] - string MetaDescription - { - get; - set; - } - - /// - /// Enter a comma seperated list of keywords. - ///warren, keyword, test - /// - [UmbracoInfo("metaKeywords", DisplayName = "Meta Keywords", Mandatory = false)] - [Property()] - string MetaKeywords - { - get; - set; - } - - /// - /// Pick a node you wish to redirect to if the user lands on this node. - /// - [UmbracoInfo("umbracoRedirect", DisplayName = " Umbraco Redirect", Mandatory = false)] - [Property()] - int UmbracoRedirect - { - get; - set; - } - - /// - /// Use this property if you wish to hide this page in the navigation. - /// - [UmbracoInfo("umbracoNaviHide", DisplayName = "Hide in Navi", Mandatory = false)] - [Property()] - int UmbracoNaviHide - { - get; - set; - } - - bool UmbracoNaviHideBoolean - { - get; - } - } - - /// - /// This is the Galleries document type for your site which stores the Gallery document type as children. - /// - [UmbracoInfo("CWS_GalleryList")] - [DocType()] - public interface ICWSGalleryList : IDocTypeBase - { - - - - - - - - - - - - /// - /// If you wish to change the URL of the node without changing the node name fill this in. - /// - ///eg: warren - /// - [UmbracoInfo("umbracoUrlName", DisplayName = "Umbraco URL Name", Mandatory = false)] - [Property()] - string UmbracoUrlName - { - get; - set; - } - - /// - /// Use this to give a node multiple urls. - /// - ///eg: home,homepage/another-level - /// - [UmbracoInfo("umbracoUrlAlias", DisplayName = "Umbraco URL Alias", Mandatory = false)] - [Property()] - string UmbracoUrlAlias - { - get; - set; - } - - /// - /// Enter the description for the page. - /// - [UmbracoInfo("metaDescription", DisplayName = "Meta Description", Mandatory = false)] - [Property()] - string MetaDescription - { - get; - set; - } - - /// - /// Enter a comma seperated list of keywords. - ///warren, keyword, test - /// - [UmbracoInfo("metaKeywords", DisplayName = "Meta Keywords", Mandatory = false)] - [Property()] - string MetaKeywords - { - get; - set; - } - - /// - /// Pick a node you wish to redirect to if the user lands on this node. - /// - [UmbracoInfo("umbracoRedirect", DisplayName = " Umbraco Redirect", Mandatory = false)] - [Property()] - int UmbracoRedirect - { - get; - set; - } - - /// - /// Use this property if you wish to hide this page in the navigation. - /// - [UmbracoInfo("umbracoNaviHide", DisplayName = "Hide in Navi", Mandatory = false)] - [Property()] - int UmbracoNaviHide - { - get; - set; - } - - bool UmbracoNaviHideBoolean - { - get; - } - - /// - /// - /// - [UmbracoInfo("headerText", DisplayName = "Header", Mandatory = false)] - [Property()] - string HeaderText - { - get; - set; - } - - /// - /// Choose how you want to sort the child items. - /// - [UmbracoInfo("sortBy", DisplayName = "Sort By", Mandatory = true)] - [Property()] - string SortBy - { - get; - set; - } - - /// - /// Choose how you want to sort the child items. - /// - [UmbracoInfo("sortOrder", DisplayName = "Sort Order", Mandatory = true)] - [Property()] - string SortOrder - { - get; - set; - } - - AssociationTree CWSGalleries - { - get; - set; - } - } - - /// - /// This is the gallery document type which stores the Photo document type as children. - /// - [UmbracoInfo("CWS_Gallery")] - [DocType()] - public interface ICWSGallery : IDocTypeBase - { - - - - - - - - - - - - - /// - /// If you wish to change the URL of the node without changing the node name fill this in. - /// - ///eg: warren - /// - [UmbracoInfo("umbracoUrlName", DisplayName = "Umbraco URL Name", Mandatory = false)] - [Property()] - string UmbracoUrlName - { - get; - set; - } - - /// - /// Use this to give a node multiple urls. - /// - ///eg: home,homepage/another-level - /// - [UmbracoInfo("umbracoUrlAlias", DisplayName = "Umbraco URL Alias", Mandatory = false)] - [Property()] - string UmbracoUrlAlias - { - get; - set; - } - - /// - /// Enter the description for the page. - /// - [UmbracoInfo("metaDescription", DisplayName = "Meta Description", Mandatory = false)] - [Property()] - string MetaDescription - { - get; - set; - } - - /// - /// Enter a comma seperated list of keywords. - ///warren, keyword, test - /// - [UmbracoInfo("metaKeywords", DisplayName = "Meta Keywords", Mandatory = false)] - [Property()] - string MetaKeywords - { - get; - set; - } - - /// - /// Pick a node you wish to redirect to if the user lands on this node. - /// - [UmbracoInfo("umbracoRedirect", DisplayName = " Umbraco Redirect", Mandatory = false)] - [Property()] - int UmbracoRedirect - { - get; - set; - } - - /// - /// Use this property if you wish to hide this page in the navigation. - /// - [UmbracoInfo("umbracoNaviHide", DisplayName = "Hide in Navi", Mandatory = false)] - [Property()] - int UmbracoNaviHide - { - get; - set; - } - - bool UmbracoNaviHideBoolean - { - get; - } - - /// - /// - /// - [UmbracoInfo("headerText", DisplayName = "Header", Mandatory = false)] - [Property()] - string HeaderText - { - get; - set; - } - - /// - /// Choose how you want to sort the child items. - /// - [UmbracoInfo("sortBy", DisplayName = "Sort By", Mandatory = true)] - [Property()] - string SortBy - { - get; - set; - } - - /// - /// Choose how you want to sort the child items. - /// - [UmbracoInfo("sortOrder", DisplayName = "Sort Order", Mandatory = true)] - [Property()] - string SortOrder - { - get; - set; - } - - /// - /// 208px x 108px - /// - [UmbracoInfo("galleryThumbnail", DisplayName = "Thumbnail for Gallery", Mandatory = false)] - [Property()] - string GalleryThumbnail - { - get; - set; - } - - AssociationTree CWSPhotos - { - get; - set; - } - } - - /// - /// This is the homepage document type for your site. - /// - [UmbracoInfo("CWS_Home")] - [DocType()] - public interface ICWSHome : IDocTypeBase - { - - - - - - - - - - - - - /// - /// If you wish to change the URL of the node without changing the node name fill this in. - /// - ///eg: warren - /// - [UmbracoInfo("umbracoUrlName", DisplayName = "Umbraco URL Name", Mandatory = false)] - [Property()] - string UmbracoUrlName - { - get; - set; - } - - /// - /// Use this to give a node multiple urls. - /// - ///eg: home,homepage/another-level - /// - [UmbracoInfo("umbracoUrlAlias", DisplayName = "Umbraco URL Alias", Mandatory = false)] - [Property()] - string UmbracoUrlAlias - { - get; - set; - } - - /// - /// Enter the description for the page. - /// - [UmbracoInfo("metaDescription", DisplayName = "Meta Description", Mandatory = false)] - [Property()] - string MetaDescription - { - get; - set; - } - - /// - /// Enter a comma seperated list of keywords. - ///warren, keyword, test - /// - [UmbracoInfo("metaKeywords", DisplayName = "Meta Keywords", Mandatory = false)] - [Property()] - string MetaKeywords - { - get; - set; - } - - /// - /// Pick a node you wish to redirect to if the user lands on this node. - /// - [UmbracoInfo("umbracoRedirect", DisplayName = " Umbraco Redirect", Mandatory = false)] - [Property()] - int UmbracoRedirect - { - get; - set; - } - - /// - /// Use this property if you wish to hide this page in the navigation. - /// - [UmbracoInfo("umbracoNaviHide", DisplayName = "Hide in Navi", Mandatory = false)] - [Property()] - int UmbracoNaviHide - { - get; - set; - } - - bool UmbracoNaviHideBoolean - { - get; - } - - /// - /// This is what your site is called. - /// - [UmbracoInfo("siteName", DisplayName = "Site Name", Mandatory = false)] - [Property()] - string SiteName - { - get; - set; - } - - /// - /// - /// - [UmbracoInfo("headerText", DisplayName = "Header", Mandatory = false)] - [Property()] - string HeaderText - { - get; - set; - } - - /// - /// - /// - [UmbracoInfo("homepagePhoto", DisplayName = "Photo", Mandatory = false)] - [Property()] - string HomepagePhoto - { - get; - set; - } - - /// - /// - /// - [UmbracoInfo("bodyText", DisplayName = "Text", Mandatory = false)] - [Property()] - string BodyText - { - get; - set; - } - - AssociationTree CWSContacts - { - get; - set; - } - - AssociationTree CWSEmailAFriends - { - get; - set; - } - - AssociationTree CWSGalleryLists - { - get; - set; - } - - AssociationTree CWSNewsEventsLists - { - get; - set; - } - - AssociationTree CWSTextpages - { - get; - set; - } - - AssociationTree CWSTextpageTwoCols - { - get; - set; - } - } - - /// - /// This is the News & Events List document type for your site which stores the News and Event Item document types as children. - /// - [UmbracoInfo("CWS_NewsEventsList")] - [DocType()] - public interface ICWSNewsEventsList : IDocTypeBase - { - - - - - - - - - - - - /// - /// If you wish to change the URL of the node without changing the node name fill this in. - /// - ///eg: warren - /// - [UmbracoInfo("umbracoUrlName", DisplayName = "Umbraco URL Name", Mandatory = false)] - [Property()] - string UmbracoUrlName - { - get; - set; - } - - /// - /// Use this to give a node multiple urls. - /// - ///eg: home,homepage/another-level - /// - [UmbracoInfo("umbracoUrlAlias", DisplayName = "Umbraco URL Alias", Mandatory = false)] - [Property()] - string UmbracoUrlAlias - { - get; - set; - } - - /// - /// Enter the description for the page. - /// - [UmbracoInfo("metaDescription", DisplayName = "Meta Description", Mandatory = false)] - [Property()] - string MetaDescription - { - get; - set; - } - - /// - /// Enter a comma seperated list of keywords. - ///warren, keyword, test - /// - [UmbracoInfo("metaKeywords", DisplayName = "Meta Keywords", Mandatory = false)] - [Property()] - string MetaKeywords - { - get; - set; - } - - /// - /// Pick a node you wish to redirect to if the user lands on this node. - /// - [UmbracoInfo("umbracoRedirect", DisplayName = " Umbraco Redirect", Mandatory = false)] - [Property()] - int UmbracoRedirect - { - get; - set; - } - - /// - /// Use this property if you wish to hide this page in the navigation. - /// - [UmbracoInfo("umbracoNaviHide", DisplayName = "Hide in Navi", Mandatory = false)] - [Property()] - int UmbracoNaviHide - { - get; - set; - } - - bool UmbracoNaviHideBoolean - { - get; - } - - /// - /// Choose how you want to sort the child items. - /// - [UmbracoInfo("sortBy", DisplayName = "Sort By", Mandatory = true)] - [Property()] - string SortBy - { - get; - set; - } - - /// - /// Choose how you want to sort the child items. - /// - [UmbracoInfo("sortOrder", DisplayName = "Sort Order", Mandatory = true)] - [Property()] - string SortOrder - { - get; - set; - } - - /// - /// - /// - [UmbracoInfo("headerText", DisplayName = "Header", Mandatory = false)] - [Property()] - string HeaderText - { - get; - set; - } - - AssociationTree CWSEventItems - { - get; - set; - } - - AssociationTree CWSNewsItems - { - get; - set; - } - } - - /// - /// This is the news document type for your site and lives beneath the News & Events List document type. - /// - [UmbracoInfo("CWS_NewsItem")] - [DocType()] - public interface ICWSNewsItem : IDocTypeBase - { - - - - - - - - - - - /// - /// - /// - [UmbracoInfo("bodyText", DisplayName = "Text", Mandatory = false)] - [Property()] - string BodyText - { - get; - set; - } - - /// - /// - /// - [UmbracoInfo("articlePhoto", DisplayName = "Photo", Mandatory = false)] - [Property()] - string ArticlePhoto - { - get; - set; - } - - /// - /// If you wish to change the URL of the node without changing the node name fill this in. - /// - ///eg: warren - /// - [UmbracoInfo("umbracoUrlName", DisplayName = "Umbraco URL Name", Mandatory = false)] - [Property()] - string UmbracoUrlName - { - get; - set; - } - - /// - /// Use this to give a node multiple urls. - /// - ///eg: home,homepage/another-level - /// - [UmbracoInfo("umbracoUrlAlias", DisplayName = "Umbraco URL Alias", Mandatory = false)] - [Property()] - string UmbracoUrlAlias - { - get; - set; - } - - /// - /// Enter the description for the page. - /// - [UmbracoInfo("metaDescription", DisplayName = "Meta Description", Mandatory = false)] - [Property()] - string MetaDescription - { - get; - set; - } - - /// - /// Enter a comma seperated list of keywords. - ///warren, keyword, test - /// - [UmbracoInfo("metaKeywords", DisplayName = "Meta Keywords", Mandatory = false)] - [Property()] - string MetaKeywords - { - get; - set; - } - - /// - /// Pick a node you wish to redirect to if the user lands on this node. - /// - [UmbracoInfo("umbracoRedirect", DisplayName = " Umbraco Redirect", Mandatory = false)] - [Property()] - int UmbracoRedirect - { - get; - set; - } - - /// - /// Use this property if you wish to hide this page in the navigation. - /// - [UmbracoInfo("umbracoNaviHide", DisplayName = "Hide in Navi", Mandatory = false)] - [Property()] - int UmbracoNaviHide - { - get; - set; - } - - bool UmbracoNaviHideBoolean - { - get; - } - - AssociationTree CWSNewsItems - { - get; - set; - } - } - - /// - /// This is the Photo document type for your site and lives beneath the Gallery document type. - /// - [UmbracoInfo("CWS_Photo")] - [DocType()] - public interface ICWSPhoto : IDocTypeBase - { - - - - - - - - - - - - /// - /// Enter a description - /// - [UmbracoInfo("photoText", DisplayName = "Photo Text", Mandatory = false)] - [Property()] - string PhotoText - { - get; - set; - } - - /// - /// - /// - [UmbracoInfo("photo", DisplayName = "Photo", Mandatory = false)] - [Property()] - string Photo - { - get; - set; - } - - /// - /// 151px x 108px - /// - [UmbracoInfo("photoThumbnail", DisplayName = "Thumbnail", Mandatory = false)] - [Property()] - string PhotoThumbnail - { - get; - set; - } - - /// - /// If you wish to change the URL of the node without changing the node name fill this in. - /// - ///eg: warren - /// - [UmbracoInfo("umbracoUrlName", DisplayName = "Umbraco URL Name", Mandatory = false)] - [Property()] - string UmbracoUrlName - { - get; - set; - } - - /// - /// Use this to give a node multiple urls. - /// - ///eg: home,homepage/another-level - /// - [UmbracoInfo("umbracoUrlAlias", DisplayName = "Umbraco URL Alias", Mandatory = false)] - [Property()] - string UmbracoUrlAlias - { - get; - set; - } - - /// - /// Enter the description for the page. - /// - [UmbracoInfo("metaDescription", DisplayName = "Meta Description", Mandatory = false)] - [Property()] - string MetaDescription - { - get; - set; - } - - /// - /// Enter a comma seperated list of keywords. - ///warren, keyword, test - /// - [UmbracoInfo("metaKeywords", DisplayName = "Meta Keywords", Mandatory = false)] - [Property()] - string MetaKeywords - { - get; - set; - } - - /// - /// Pick a node you wish to redirect to if the user lands on this node. - /// - [UmbracoInfo("umbracoRedirect", DisplayName = " Umbraco Redirect", Mandatory = false)] - [Property()] - int UmbracoRedirect - { - get; - set; - } - - /// - /// Use this property if you wish to hide this page in the navigation. - /// - [UmbracoInfo("umbracoNaviHide", DisplayName = "Hide in Navi", Mandatory = false)] - [Property()] - int UmbracoNaviHide - { - get; - set; - } - - bool UmbracoNaviHideBoolean - { - get; - } - } - - /// - /// This is the Textpage document type for your site. - /// - [UmbracoInfo("CWS_Textpage")] - [DocType()] - public interface ICWSTextpage : IDocTypeBase - { - - - - - - - - - - - - /// - /// If you wish to change the URL of the node without changing the node name fill this in. - /// - ///eg: warren - /// - [UmbracoInfo("umbracoUrlName", DisplayName = "Umbraco URL Name", Mandatory = false)] - [Property()] - string UmbracoUrlName - { - get; - set; - } - - /// - /// Use this to give a node multiple urls. - /// - ///eg: home,homepage/another-level - /// - [UmbracoInfo("umbracoUrlAlias", DisplayName = "Umbraco URL Alias", Mandatory = false)] - [Property()] - string UmbracoUrlAlias - { - get; - set; - } - - /// - /// Enter the description for the page. - /// - [UmbracoInfo("metaDescription", DisplayName = "Meta Description", Mandatory = false)] - [Property()] - string MetaDescription - { - get; - set; - } - - /// - /// Enter a comma seperated list of keywords. - ///warren, keyword, test - /// - [UmbracoInfo("metaKeywords", DisplayName = "Meta Keywords", Mandatory = false)] - [Property()] - string MetaKeywords - { - get; - set; - } - - /// - /// Pick a node you wish to redirect to if the user lands on this node. - /// - [UmbracoInfo("umbracoRedirect", DisplayName = " Umbraco Redirect", Mandatory = false)] - [Property()] - int UmbracoRedirect - { - get; - set; - } - - /// - /// Use this property if you wish to hide this page in the navigation. - /// - [UmbracoInfo("umbracoNaviHide", DisplayName = "Hide in Navi", Mandatory = false)] - [Property()] - int UmbracoNaviHide - { - get; - set; - } - - bool UmbracoNaviHideBoolean - { - get; - } - - /// - /// - /// - [UmbracoInfo("headerText", DisplayName = "Header", Mandatory = false)] - [Property()] - string HeaderText - { - get; - set; - } - - /// - /// - /// - [UmbracoInfo("articlePhoto", DisplayName = "Photo", Mandatory = false)] - [Property()] - string ArticlePhoto - { - get; - set; - } - - /// - /// - /// - [UmbracoInfo("bodyText", DisplayName = "Text", Mandatory = false)] - [Property()] - string BodyText - { - get; - set; - } - - AssociationTree CWSTextpages - { - get; - set; - } - - AssociationTree CWSTextpageTwoCols - { - get; - set; - } - } - - /// - /// This is the Textpage document type for your site which has two columns. - /// - [UmbracoInfo("CWS_TextpageTwoCol")] - [DocType()] - public interface ICWSTextpageTwoCol : IDocTypeBase - { - - - - - - - - - - - - - - /// - /// - /// - [UmbracoInfo("articlePhotoColOne", DisplayName = "Photo", Mandatory = false)] - [Property()] - string ArticlePhotoColOne - { - get; - set; - } - - /// - /// - /// - [UmbracoInfo("articlePhotoColTwo", DisplayName = "Photo", Mandatory = false)] - [Property()] - string ArticlePhotoColTwo - { - get; - set; - } - - /// - /// - /// - [UmbracoInfo("bodyTextColTwo", DisplayName = "Text", Mandatory = false)] - [Property()] - string BodyTextColTwo - { - get; - set; - } - - /// - /// - /// - [UmbracoInfo("bodyTextColOne", DisplayName = "Text", Mandatory = false)] - [Property()] - string BodyTextColOne - { - get; - set; - } - - /// - /// If you wish to change the URL of the node without changing the node name fill this in. - /// - ///eg: warren - /// - [UmbracoInfo("umbracoUrlName", DisplayName = "Umbraco URL Name", Mandatory = false)] - [Property()] - string UmbracoUrlName - { - get; - set; - } - - /// - /// Use this to give a node multiple urls. - /// - ///eg: home,homepage/another-level - /// - [UmbracoInfo("umbracoUrlAlias", DisplayName = "Umbraco URL Alias", Mandatory = false)] - [Property()] - string UmbracoUrlAlias - { - get; - set; - } - - /// - /// Enter the description for the page. - /// - [UmbracoInfo("metaDescription", DisplayName = "Meta Description", Mandatory = false)] - [Property()] - string MetaDescription - { - get; - set; - } - - /// - /// Enter a comma seperated list of keywords. - ///warren, keyword, test - /// - [UmbracoInfo("metaKeywords", DisplayName = "Meta Keywords", Mandatory = false)] - [Property()] - string MetaKeywords - { - get; - set; - } - - /// - /// Pick a node you wish to redirect to if the user lands on this node. - /// - [UmbracoInfo("umbracoRedirect", DisplayName = " Umbraco Redirect", Mandatory = false)] - [Property()] - int UmbracoRedirect - { - get; - set; - } - - /// - /// Use this property if you wish to hide this page in the navigation. - /// - [UmbracoInfo("umbracoNaviHide", DisplayName = "Hide in Navi", Mandatory = false)] - [Property()] - int UmbracoNaviHide - { - get; - set; - } - - bool UmbracoNaviHideBoolean - { - get; - } - - /// - /// - /// - [UmbracoInfo("headerText", DisplayName = "Header", Mandatory = false)] - [Property()] - string HeaderText - { - get; - set; - } - - AssociationTree CWSTextpages - { - get; - set; - } - - AssociationTree CWSTextpageTwoCols - { - get; - set; - } - } - - /// - /// - /// - [UmbracoInfo("TextPageThreeCol")] - [DocType()] - public interface ITextPageThreeCol : ICWSTextpageTwoCol - { - - } -} - diff --git a/src/LinqToUmbraco/src/umbraco.Linq/Core.Tests/MyUmbraco.designer.cs b/src/LinqToUmbraco/src/umbraco.Linq/Core.Tests/MyUmbraco.designer.cs deleted file mode 100644 index d9315b5c2d..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/Core.Tests/MyUmbraco.designer.cs +++ /dev/null @@ -1,3505 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:2.0.50727.4927 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace umbraco.Test -{ - using umbraco.Linq.Core; - using umbraco.Linq.Core.Node; - using System.Linq; - - - public partial class MyUmbracoDataContext : UmbracoDataContext - { - - #region Partials - partial void OnCreated(); - #endregion - - - public MyUmbracoDataContext() : - base() - { - OnCreated(); - } - - public MyUmbracoDataContext(UmbracoDataProvider provider) : - base(provider) - { - OnCreated(); - } - - public Tree CWSContacts - { - get - { - return this.LoadTree(); - } - } - - public Tree CWSEmailAFriends - { - get - { - return this.LoadTree(); - } - } - - public Tree CWSEventItems - { - get - { - return this.LoadTree(); - } - } - - public Tree CWSGalleryLists - { - get - { - return this.LoadTree(); - } - } - - public Tree CWSGalleries - { - get - { - return this.LoadTree(); - } - } - - public Tree CWSHomes - { - get - { - return this.LoadTree(); - } - } - - public Tree CWSNewsEventsLists - { - get - { - return this.LoadTree(); - } - } - - public Tree CWSNewsItems - { - get - { - return this.LoadTree(); - } - } - - public Tree CWSPhotos - { - get - { - return this.LoadTree(); - } - } - - public Tree CWSTextpages - { - get - { - return this.LoadTree(); - } - } - - public Tree CWSTextpageTwoCols - { - get - { - return this.LoadTree(); - } - } - - public Tree TextPageTwoCols - { - get - { - return this.LoadTree(); - } - } - } - - /// - /// This is the contact form document type for your site. - /// - [UmbracoInfo("CWS_Contact")] - [System.Runtime.Serialization.DataContractAttribute()] - [DocType()] - public partial class CWSContact : DocTypeBase - { - - private string _EmailTo; - - private string _EmailSubject; - - private string _EmailBody; - - private string _EmailReplyFrom; - - private string _EmailReplySubject; - - private string _EmailReplyBody; - - private int _EnableSSL; - - private string _UmbracoUrlName; - - private string _UmbracoUrlAlias; - - private string _MetaDescription; - - private string _MetaKeywords; - - private int _UmbracoRedirect; - - private int _UmbracoNaviHide; - - private string _HeaderText; - - private string _FormText; - - private string _ThankYouHeaderText; - - private string _ThankYouMessageText; - - private AssociationTree _CWSTextpages; - - public CWSContact() - { - } - - /// - /// The email address that you want the form to be sent to. - /// - [UmbracoInfo("emailTo", DisplayName = "Email To", Mandatory = true)] - [Property()] - public virtual string EmailTo - { - get - { - return this._EmailTo; - } - set - { - if ((this._EmailTo != value)) - { - this.RaisePropertyChanging(); - this._EmailTo = value; - this.RaisePropertyChanged("EmailTo"); - } - } - } - - /// - /// The subject of the email that will be sent to you. - /// - [UmbracoInfo("emailSubject", DisplayName = "Email Subject", Mandatory = true)] - [Property()] - public virtual string EmailSubject - { - get - { - return this._EmailSubject; - } - set - { - if ((this._EmailSubject != value)) - { - this.RaisePropertyChanging(); - this._EmailSubject = value; - this.RaisePropertyChanged("EmailSubject"); - } - } - } - - /// - /// Use placeholders [Name], [AddressLine1], [AddressLine2], [Email], [Message], [Time] and [Date] - /// - [UmbracoInfo("emailBody", DisplayName = "Email Message", Mandatory = true)] - [Property()] - public virtual string EmailBody - { - get - { - return this._EmailBody; - } - set - { - if ((this._EmailBody != value)) - { - this.RaisePropertyChanging(); - this._EmailBody = value; - this.RaisePropertyChanged("EmailBody"); - } - } - } - - /// - /// The email address that you want the automated reply to be sent from. - /// - [UmbracoInfo("emailReplyFrom", DisplayName = "Email Reply From", Mandatory = true)] - [Property()] - public virtual string EmailReplyFrom - { - get - { - return this._EmailReplyFrom; - } - set - { - if ((this._EmailReplyFrom != value)) - { - this.RaisePropertyChanging(); - this._EmailReplyFrom = value; - this.RaisePropertyChanged("EmailReplyFrom"); - } - } - } - - /// - /// The subject of the email that will be sent as the automated reply. - /// - /// - [UmbracoInfo("emailReplySubject", DisplayName = "Email Reply Subject", Mandatory = false)] - [Property()] - public virtual string EmailReplySubject - { - get - { - return this._EmailReplySubject; - } - set - { - if ((this._EmailReplySubject != value)) - { - this.RaisePropertyChanging(); - this._EmailReplySubject = value; - this.RaisePropertyChanged("EmailReplySubject"); - } - } - } - - /// - /// Use placeholder [Name] - /// - [UmbracoInfo("emailReplyBody", DisplayName = "Email Reply Body", Mandatory = false)] - [Property()] - public virtual string EmailReplyBody - { - get - { - return this._EmailReplyBody; - } - set - { - if ((this._EmailReplyBody != value)) - { - this.RaisePropertyChanging(); - this._EmailReplyBody = value; - this.RaisePropertyChanged("EmailReplyBody"); - } - } - } - - /// - /// Does your SMTP server require SSL? - /// - [UmbracoInfo("enableSSL", DisplayName = "Enable SSL", Mandatory = false)] - [Property()] - public virtual int EnableSSL - { - get - { - return this._EnableSSL; - } - set - { - if ((this._EnableSSL != value)) - { - this.RaisePropertyChanging(); - this._EnableSSL = value; - this.RaisePropertyChanged("EnableSSL"); - } - } - } - - public virtual bool EnableSSLBoolean - { - get - { - return (this._EnableSSL == 0); - } - } - - /// - /// If you wish to change the URL of the node without changing the node name fill this in. - /// - ///eg: warren - /// - [UmbracoInfo("umbracoUrlName", DisplayName = "Umbraco URL Name", Mandatory = false)] - [Property()] - public virtual string UmbracoUrlName - { - get - { - return this._UmbracoUrlName; - } - set - { - if ((this._UmbracoUrlName != value)) - { - this.RaisePropertyChanging(); - this._UmbracoUrlName = value; - this.RaisePropertyChanged("UmbracoUrlName"); - } - } - } - - /// - /// Use this to give a node multiple urls. - /// - ///eg: home,homepage/another-level - /// - [UmbracoInfo("umbracoUrlAlias", DisplayName = "Umbraco URL Alias", Mandatory = false)] - [Property()] - public virtual string UmbracoUrlAlias - { - get - { - return this._UmbracoUrlAlias; - } - set - { - if ((this._UmbracoUrlAlias != value)) - { - this.RaisePropertyChanging(); - this._UmbracoUrlAlias = value; - this.RaisePropertyChanged("UmbracoUrlAlias"); - } - } - } - - /// - /// Enter the description for the page. - /// - [UmbracoInfo("metaDescription", DisplayName = "Meta Description", Mandatory = false)] - [Property()] - public virtual string MetaDescription - { - get - { - return this._MetaDescription; - } - set - { - if ((this._MetaDescription != value)) - { - this.RaisePropertyChanging(); - this._MetaDescription = value; - this.RaisePropertyChanged("MetaDescription"); - } - } - } - - /// - /// Enter a comma seperated list of keywords. - ///warren, keyword, test - /// - [UmbracoInfo("metaKeywords", DisplayName = "Meta Keywords", Mandatory = false)] - [Property()] - public virtual string MetaKeywords - { - get - { - return this._MetaKeywords; - } - set - { - if ((this._MetaKeywords != value)) - { - this.RaisePropertyChanging(); - this._MetaKeywords = value; - this.RaisePropertyChanged("MetaKeywords"); - } - } - } - - /// - /// Pick a node you wish to redirect to if the user lands on this node. - /// - [UmbracoInfo("umbracoRedirect", DisplayName = " Umbraco Redirect", Mandatory = false)] - [Property()] - public virtual int UmbracoRedirect - { - get - { - return this._UmbracoRedirect; - } - set - { - if ((this._UmbracoRedirect != value)) - { - this.RaisePropertyChanging(); - this._UmbracoRedirect = value; - this.RaisePropertyChanged("UmbracoRedirect"); - } - } - } - - /// - /// Use this property if you wish to hide this page in the navigation. - /// - [UmbracoInfo("umbracoNaviHide", DisplayName = "Hide in Navi", Mandatory = false)] - [Property()] - public virtual int UmbracoNaviHide - { - get - { - return this._UmbracoNaviHide; - } - set - { - if ((this._UmbracoNaviHide != value)) - { - this.RaisePropertyChanging(); - this._UmbracoNaviHide = value; - this.RaisePropertyChanged("UmbracoNaviHide"); - } - } - } - - public virtual bool UmbracoNaviHideBoolean - { - get - { - return (this._UmbracoNaviHide == 0); - } - } - - /// - /// - /// - [UmbracoInfo("headerText", DisplayName = "Header", Mandatory = false)] - [Property()] - public virtual string HeaderText - { - get - { - return this._HeaderText; - } - set - { - if ((this._HeaderText != value)) - { - this.RaisePropertyChanging(); - this._HeaderText = value; - this.RaisePropertyChanged("HeaderText"); - } - } - } - - /// - /// This is the text that sits to the left of the contact form. - /// - [UmbracoInfo("formText", DisplayName = "Form Text", Mandatory = false)] - [Property()] - public virtual string FormText - { - get - { - return this._FormText; - } - set - { - if ((this._FormText != value)) - { - this.RaisePropertyChanging(); - this._FormText = value; - this.RaisePropertyChanged("FormText"); - } - } - } - - /// - /// This is the header for the thankyou the user will see after sumbitting the contact form. - /// - [UmbracoInfo("thankYouHeaderText", DisplayName = "Thank You Header", Mandatory = true)] - [Property()] - public virtual string ThankYouHeaderText - { - get - { - return this._ThankYouHeaderText; - } - set - { - if ((this._ThankYouHeaderText != value)) - { - this.RaisePropertyChanging(); - this._ThankYouHeaderText = value; - this.RaisePropertyChanged("ThankYouHeaderText"); - } - } - } - - /// - /// This is the thankyou message that the user will see after submitting your form. - /// - [UmbracoInfo("thankYouMessageText", DisplayName = "Thank You Message", Mandatory = true)] - [Property()] - public virtual string ThankYouMessageText - { - get - { - return this._ThankYouMessageText; - } - set - { - if ((this._ThankYouMessageText != value)) - { - this.RaisePropertyChanging(); - this._ThankYouMessageText = value; - this.RaisePropertyChanged("ThankYouMessageText"); - } - } - } - - public AssociationTree CWSTextpages - { - get - { - if ((this._CWSTextpages == null)) - { - this._CWSTextpages = this.ChildrenOfType(); - } - return this._CWSTextpages; - } - set - { - this._CWSTextpages = value; - } - } - } - - /// - /// This is the email a friend form document type for your site. - /// - [UmbracoInfo("CWS_EmailAFriend")] - [System.Runtime.Serialization.DataContractAttribute()] - [DocType()] - public partial class CWSEmailAFriend : DocTypeBase - { - - private string _EmailFrom; - - private string _EmailSubjectToFriend; - - private string _EmailMessageToFriend; - - private int _EnableSSL; - - private string _UmbracoUrlName; - - private string _UmbracoUrlAlias; - - private string _MetaDescription; - - private string _MetaKeywords; - - private int _UmbracoRedirect; - - private int _UmbracoNaviHide; - - private string _HeaderText; - - private string _ThankYouHeaderText; - - private string _ThankYouMessageText; - - private AssociationTree _CWSTextpages; - - public CWSEmailAFriend() - { - } - - /// - /// The email address that you want the email to be sent from. - /// - [UmbracoInfo("emailFrom", DisplayName = "Email From", Mandatory = true)] - [Property()] - public virtual string EmailFrom - { - get - { - return this._EmailFrom; - } - set - { - if ((this._EmailFrom != value)) - { - this.RaisePropertyChanging(); - this._EmailFrom = value; - this.RaisePropertyChanged("EmailFrom"); - } - } - } - - /// - /// The subject of the email that will be sent to the friend. - /// - [UmbracoInfo("emailSubjectToFriend", DisplayName = "Email Subject to Friend", Mandatory = true)] - [Property()] - public virtual string EmailSubjectToFriend - { - get - { - return this._EmailSubjectToFriend; - } - set - { - if ((this._EmailSubjectToFriend != value)) - { - this.RaisePropertyChanging(); - this._EmailSubjectToFriend = value; - this.RaisePropertyChanged("EmailSubjectToFriend"); - } - } - } - - /// - /// Use placeholders [FriendName], [FriendEmail], [YourName], [YourEmail], [Message], [Date], [Time], [URL] - /// - [UmbracoInfo("emailMessageToFriend", DisplayName = "Email Message to Friend", Mandatory = true)] - [Property()] - public virtual string EmailMessageToFriend - { - get - { - return this._EmailMessageToFriend; - } - set - { - if ((this._EmailMessageToFriend != value)) - { - this.RaisePropertyChanging(); - this._EmailMessageToFriend = value; - this.RaisePropertyChanged("EmailMessageToFriend"); - } - } - } - - /// - /// Does your SMTP server require SSL? - /// - [UmbracoInfo("enableSSL", DisplayName = "Enable SSL", Mandatory = false)] - [Property()] - public virtual int EnableSSL - { - get - { - return this._EnableSSL; - } - set - { - if ((this._EnableSSL != value)) - { - this.RaisePropertyChanging(); - this._EnableSSL = value; - this.RaisePropertyChanged("EnableSSL"); - } - } - } - - public virtual bool EnableSSLBoolean - { - get - { - return (this._EnableSSL == 0); - } - } - - /// - /// If you wish to change the URL of the node without changing the node name fill this in. - /// - ///eg: warren - /// - [UmbracoInfo("umbracoUrlName", DisplayName = "Umbraco URL Name", Mandatory = false)] - [Property()] - public virtual string UmbracoUrlName - { - get - { - return this._UmbracoUrlName; - } - set - { - if ((this._UmbracoUrlName != value)) - { - this.RaisePropertyChanging(); - this._UmbracoUrlName = value; - this.RaisePropertyChanged("UmbracoUrlName"); - } - } - } - - /// - /// Use this to give a node multiple urls. - /// - ///eg: home,homepage/another-level - /// - [UmbracoInfo("umbracoUrlAlias", DisplayName = "Umbraco URL Alias", Mandatory = false)] - [Property()] - public virtual string UmbracoUrlAlias - { - get - { - return this._UmbracoUrlAlias; - } - set - { - if ((this._UmbracoUrlAlias != value)) - { - this.RaisePropertyChanging(); - this._UmbracoUrlAlias = value; - this.RaisePropertyChanged("UmbracoUrlAlias"); - } - } - } - - /// - /// Enter the description for the page. - /// - [UmbracoInfo("metaDescription", DisplayName = "Meta Description", Mandatory = false)] - [Property()] - public virtual string MetaDescription - { - get - { - return this._MetaDescription; - } - set - { - if ((this._MetaDescription != value)) - { - this.RaisePropertyChanging(); - this._MetaDescription = value; - this.RaisePropertyChanged("MetaDescription"); - } - } - } - - /// - /// Enter a comma seperated list of keywords. - ///warren, keyword, test - /// - [UmbracoInfo("metaKeywords", DisplayName = "Meta Keywords", Mandatory = false)] - [Property()] - public virtual string MetaKeywords - { - get - { - return this._MetaKeywords; - } - set - { - if ((this._MetaKeywords != value)) - { - this.RaisePropertyChanging(); - this._MetaKeywords = value; - this.RaisePropertyChanged("MetaKeywords"); - } - } - } - - /// - /// Pick a node you wish to redirect to if the user lands on this node. - /// - [UmbracoInfo("umbracoRedirect", DisplayName = " Umbraco Redirect", Mandatory = false)] - [Property()] - public virtual int UmbracoRedirect - { - get - { - return this._UmbracoRedirect; - } - set - { - if ((this._UmbracoRedirect != value)) - { - this.RaisePropertyChanging(); - this._UmbracoRedirect = value; - this.RaisePropertyChanged("UmbracoRedirect"); - } - } - } - - /// - /// Use this property if you wish to hide this page in the navigation. - /// - [UmbracoInfo("umbracoNaviHide", DisplayName = "Hide in Navi", Mandatory = false)] - [Property()] - public virtual int UmbracoNaviHide - { - get - { - return this._UmbracoNaviHide; - } - set - { - if ((this._UmbracoNaviHide != value)) - { - this.RaisePropertyChanging(); - this._UmbracoNaviHide = value; - this.RaisePropertyChanged("UmbracoNaviHide"); - } - } - } - - public virtual bool UmbracoNaviHideBoolean - { - get - { - return (this._UmbracoNaviHide == 0); - } - } - - /// - /// - /// - [UmbracoInfo("headerText", DisplayName = "Header", Mandatory = false)] - [Property()] - public virtual string HeaderText - { - get - { - return this._HeaderText; - } - set - { - if ((this._HeaderText != value)) - { - this.RaisePropertyChanging(); - this._HeaderText = value; - this.RaisePropertyChanged("HeaderText"); - } - } - } - - /// - /// This is the header for the thankyou the user will see after sumbitting the contact form. - /// - [UmbracoInfo("thankYouHeaderText", DisplayName = "Thank You Header", Mandatory = true)] - [Property()] - public virtual string ThankYouHeaderText - { - get - { - return this._ThankYouHeaderText; - } - set - { - if ((this._ThankYouHeaderText != value)) - { - this.RaisePropertyChanging(); - this._ThankYouHeaderText = value; - this.RaisePropertyChanged("ThankYouHeaderText"); - } - } - } - - /// - /// This is the thankyou message that the user will see after submitting your form. - /// - [UmbracoInfo("thankYouMessageText", DisplayName = "Thank You Text", Mandatory = true)] - [Property()] - public virtual string ThankYouMessageText - { - get - { - return this._ThankYouMessageText; - } - set - { - if ((this._ThankYouMessageText != value)) - { - this.RaisePropertyChanging(); - this._ThankYouMessageText = value; - this.RaisePropertyChanged("ThankYouMessageText"); - } - } - } - - public AssociationTree CWSTextpages - { - get - { - if ((this._CWSTextpages == null)) - { - this._CWSTextpages = this.ChildrenOfType(); - } - return this._CWSTextpages; - } - set - { - this._CWSTextpages = value; - } - } - } - - /// - /// This is the event document type for your site and lives beneath the News & Events List document type. - /// - [UmbracoInfo("CWS_EventItem")] - [System.Runtime.Serialization.DataContractAttribute()] - [DocType()] - public partial class CWSEventItem : DocTypeBase - { - - private System.DateTime _EventDate; - - private string _BodyText; - - private string _ArticlePhoto; - - private string _UmbracoUrlName; - - private string _UmbracoUrlAlias; - - private string _MetaDescription; - - private string _MetaKeywords; - - private int _UmbracoRedirect; - - private int _UmbracoNaviHide; - - public CWSEventItem() - { - } - - /// - /// - /// - [UmbracoInfo("eventDate", DisplayName = "Date", Mandatory = false)] - [Property()] - public virtual System.DateTime EventDate - { - get - { - return this._EventDate; - } - set - { - if ((this._EventDate != value)) - { - this.RaisePropertyChanging(); - this._EventDate = value; - this.RaisePropertyChanged("EventDate"); - } - } - } - - /// - /// - /// - [UmbracoInfo("bodyText", DisplayName = "Text", Mandatory = false)] - [Property()] - public virtual string BodyText - { - get - { - return this._BodyText; - } - set - { - if ((this._BodyText != value)) - { - this.RaisePropertyChanging(); - this._BodyText = value; - this.RaisePropertyChanged("BodyText"); - } - } - } - - /// - /// - /// - [UmbracoInfo("articlePhoto", DisplayName = "Photo", Mandatory = false)] - [Property()] - public virtual string ArticlePhoto - { - get - { - return this._ArticlePhoto; - } - set - { - if ((this._ArticlePhoto != value)) - { - this.RaisePropertyChanging(); - this._ArticlePhoto = value; - this.RaisePropertyChanged("ArticlePhoto"); - } - } - } - - /// - /// If you wish to change the URL of the node without changing the node name fill this in. - /// - ///eg: warren - /// - [UmbracoInfo("umbracoUrlName", DisplayName = "Umbraco URL Name", Mandatory = false)] - [Property()] - public virtual string UmbracoUrlName - { - get - { - return this._UmbracoUrlName; - } - set - { - if ((this._UmbracoUrlName != value)) - { - this.RaisePropertyChanging(); - this._UmbracoUrlName = value; - this.RaisePropertyChanged("UmbracoUrlName"); - } - } - } - - /// - /// Use this to give a node multiple urls. - /// - ///eg: home,homepage/another-level - /// - [UmbracoInfo("umbracoUrlAlias", DisplayName = "Umbraco URL Alias", Mandatory = false)] - [Property()] - public virtual string UmbracoUrlAlias - { - get - { - return this._UmbracoUrlAlias; - } - set - { - if ((this._UmbracoUrlAlias != value)) - { - this.RaisePropertyChanging(); - this._UmbracoUrlAlias = value; - this.RaisePropertyChanged("UmbracoUrlAlias"); - } - } - } - - /// - /// Enter the description for the page. - /// - [UmbracoInfo("metaDescription", DisplayName = "Meta Description", Mandatory = false)] - [Property()] - public virtual string MetaDescription - { - get - { - return this._MetaDescription; - } - set - { - if ((this._MetaDescription != value)) - { - this.RaisePropertyChanging(); - this._MetaDescription = value; - this.RaisePropertyChanged("MetaDescription"); - } - } - } - - /// - /// Enter a comma seperated list of keywords. - ///warren, keyword, test - /// - [UmbracoInfo("metaKeywords", DisplayName = "Meta Keywords", Mandatory = false)] - [Property()] - public virtual string MetaKeywords - { - get - { - return this._MetaKeywords; - } - set - { - if ((this._MetaKeywords != value)) - { - this.RaisePropertyChanging(); - this._MetaKeywords = value; - this.RaisePropertyChanged("MetaKeywords"); - } - } - } - - /// - /// Pick a node you wish to redirect to if the user lands on this node. - /// - [UmbracoInfo("umbracoRedirect", DisplayName = " Umbraco Redirect", Mandatory = false)] - [Property()] - public virtual int UmbracoRedirect - { - get - { - return this._UmbracoRedirect; - } - set - { - if ((this._UmbracoRedirect != value)) - { - this.RaisePropertyChanging(); - this._UmbracoRedirect = value; - this.RaisePropertyChanged("UmbracoRedirect"); - } - } - } - - /// - /// Use this property if you wish to hide this page in the navigation. - /// - [UmbracoInfo("umbracoNaviHide", DisplayName = "Hide in Navi", Mandatory = false)] - [Property()] - public virtual int UmbracoNaviHide - { - get - { - return this._UmbracoNaviHide; - } - set - { - if ((this._UmbracoNaviHide != value)) - { - this.RaisePropertyChanging(); - this._UmbracoNaviHide = value; - this.RaisePropertyChanged("UmbracoNaviHide"); - } - } - } - - public virtual bool UmbracoNaviHideBoolean - { - get - { - return (this._UmbracoNaviHide == 0); - } - } - } - - /// - /// This is the Galleries document type for your site which stores the Gallery document type as children. - /// - [UmbracoInfo("CWS_GalleryList")] - [System.Runtime.Serialization.DataContractAttribute()] - [DocType()] - public partial class CWSGalleryList : DocTypeBase - { - - private string _UmbracoUrlName; - - private string _UmbracoUrlAlias; - - private string _MetaDescription; - - private string _MetaKeywords; - - private int _UmbracoRedirect; - - private int _UmbracoNaviHide; - - private string _HeaderText; - - private string _SortBy; - - private string _SortOrder; - - private AssociationTree _CWSGalleries; - - public CWSGalleryList() - { - } - - /// - /// If you wish to change the URL of the node without changing the node name fill this in. - /// - ///eg: warren - /// - [UmbracoInfo("umbracoUrlName", DisplayName = "Umbraco URL Name", Mandatory = false)] - [Property()] - public virtual string UmbracoUrlName - { - get - { - return this._UmbracoUrlName; - } - set - { - if ((this._UmbracoUrlName != value)) - { - this.RaisePropertyChanging(); - this._UmbracoUrlName = value; - this.RaisePropertyChanged("UmbracoUrlName"); - } - } - } - - /// - /// Use this to give a node multiple urls. - /// - ///eg: home,homepage/another-level - /// - [UmbracoInfo("umbracoUrlAlias", DisplayName = "Umbraco URL Alias", Mandatory = false)] - [Property()] - public virtual string UmbracoUrlAlias - { - get - { - return this._UmbracoUrlAlias; - } - set - { - if ((this._UmbracoUrlAlias != value)) - { - this.RaisePropertyChanging(); - this._UmbracoUrlAlias = value; - this.RaisePropertyChanged("UmbracoUrlAlias"); - } - } - } - - /// - /// Enter the description for the page. - /// - [UmbracoInfo("metaDescription", DisplayName = "Meta Description", Mandatory = false)] - [Property()] - public virtual string MetaDescription - { - get - { - return this._MetaDescription; - } - set - { - if ((this._MetaDescription != value)) - { - this.RaisePropertyChanging(); - this._MetaDescription = value; - this.RaisePropertyChanged("MetaDescription"); - } - } - } - - /// - /// Enter a comma seperated list of keywords. - ///warren, keyword, test - /// - [UmbracoInfo("metaKeywords", DisplayName = "Meta Keywords", Mandatory = false)] - [Property()] - public virtual string MetaKeywords - { - get - { - return this._MetaKeywords; - } - set - { - if ((this._MetaKeywords != value)) - { - this.RaisePropertyChanging(); - this._MetaKeywords = value; - this.RaisePropertyChanged("MetaKeywords"); - } - } - } - - /// - /// Pick a node you wish to redirect to if the user lands on this node. - /// - [UmbracoInfo("umbracoRedirect", DisplayName = " Umbraco Redirect", Mandatory = false)] - [Property()] - public virtual int UmbracoRedirect - { - get - { - return this._UmbracoRedirect; - } - set - { - if ((this._UmbracoRedirect != value)) - { - this.RaisePropertyChanging(); - this._UmbracoRedirect = value; - this.RaisePropertyChanged("UmbracoRedirect"); - } - } - } - - /// - /// Use this property if you wish to hide this page in the navigation. - /// - [UmbracoInfo("umbracoNaviHide", DisplayName = "Hide in Navi", Mandatory = false)] - [Property()] - public virtual int UmbracoNaviHide - { - get - { - return this._UmbracoNaviHide; - } - set - { - if ((this._UmbracoNaviHide != value)) - { - this.RaisePropertyChanging(); - this._UmbracoNaviHide = value; - this.RaisePropertyChanged("UmbracoNaviHide"); - } - } - } - - public virtual bool UmbracoNaviHideBoolean - { - get - { - return (this._UmbracoNaviHide == 0); - } - } - - /// - /// - /// - [UmbracoInfo("headerText", DisplayName = "Header", Mandatory = false)] - [Property()] - public virtual string HeaderText - { - get - { - return this._HeaderText; - } - set - { - if ((this._HeaderText != value)) - { - this.RaisePropertyChanging(); - this._HeaderText = value; - this.RaisePropertyChanged("HeaderText"); - } - } - } - - /// - /// Choose how you want to sort the child items. - /// - [UmbracoInfo("sortBy", DisplayName = "Sort By", Mandatory = true)] - [Property()] - public virtual string SortBy - { - get - { - return this._SortBy; - } - set - { - if ((this._SortBy != value)) - { - this.RaisePropertyChanging(); - this._SortBy = value; - this.RaisePropertyChanged("SortBy"); - } - } - } - - /// - /// Choose how you want to sort the child items. - /// - [UmbracoInfo("sortOrder", DisplayName = "Sort Order", Mandatory = true)] - [Property()] - public virtual string SortOrder - { - get - { - return this._SortOrder; - } - set - { - if ((this._SortOrder != value)) - { - this.RaisePropertyChanging(); - this._SortOrder = value; - this.RaisePropertyChanged("SortOrder"); - } - } - } - - public AssociationTree CWSGalleries - { - get - { - if ((this._CWSGalleries == null)) - { - this._CWSGalleries = this.ChildrenOfType(); - } - return this._CWSGalleries; - } - set - { - this._CWSGalleries = value; - } - } - } - - /// - /// This is the gallery document type which stores the Photo document type as children. - /// - [UmbracoInfo("CWS_Gallery")] - [System.Runtime.Serialization.DataContractAttribute()] - [DocType()] - public partial class CWSGallery : DocTypeBase - { - - private string _UmbracoUrlName; - - private string _UmbracoUrlAlias; - - private string _MetaDescription; - - private string _MetaKeywords; - - private int _UmbracoRedirect; - - private int _UmbracoNaviHide; - - private string _HeaderText; - - private string _SortBy; - - private string _SortOrder; - - private string _GalleryThumbnail; - - private AssociationTree _CWSPhotos; - - public CWSGallery() - { - } - - /// - /// If you wish to change the URL of the node without changing the node name fill this in. - /// - ///eg: warren - /// - [UmbracoInfo("umbracoUrlName", DisplayName = "Umbraco URL Name", Mandatory = false)] - [Property()] - public virtual string UmbracoUrlName - { - get - { - return this._UmbracoUrlName; - } - set - { - if ((this._UmbracoUrlName != value)) - { - this.RaisePropertyChanging(); - this._UmbracoUrlName = value; - this.RaisePropertyChanged("UmbracoUrlName"); - } - } - } - - /// - /// Use this to give a node multiple urls. - /// - ///eg: home,homepage/another-level - /// - [UmbracoInfo("umbracoUrlAlias", DisplayName = "Umbraco URL Alias", Mandatory = false)] - [Property()] - public virtual string UmbracoUrlAlias - { - get - { - return this._UmbracoUrlAlias; - } - set - { - if ((this._UmbracoUrlAlias != value)) - { - this.RaisePropertyChanging(); - this._UmbracoUrlAlias = value; - this.RaisePropertyChanged("UmbracoUrlAlias"); - } - } - } - - /// - /// Enter the description for the page. - /// - [UmbracoInfo("metaDescription", DisplayName = "Meta Description", Mandatory = false)] - [Property()] - public virtual string MetaDescription - { - get - { - return this._MetaDescription; - } - set - { - if ((this._MetaDescription != value)) - { - this.RaisePropertyChanging(); - this._MetaDescription = value; - this.RaisePropertyChanged("MetaDescription"); - } - } - } - - /// - /// Enter a comma seperated list of keywords. - ///warren, keyword, test - /// - [UmbracoInfo("metaKeywords", DisplayName = "Meta Keywords", Mandatory = false)] - [Property()] - public virtual string MetaKeywords - { - get - { - return this._MetaKeywords; - } - set - { - if ((this._MetaKeywords != value)) - { - this.RaisePropertyChanging(); - this._MetaKeywords = value; - this.RaisePropertyChanged("MetaKeywords"); - } - } - } - - /// - /// Pick a node you wish to redirect to if the user lands on this node. - /// - [UmbracoInfo("umbracoRedirect", DisplayName = " Umbraco Redirect", Mandatory = false)] - [Property()] - public virtual int UmbracoRedirect - { - get - { - return this._UmbracoRedirect; - } - set - { - if ((this._UmbracoRedirect != value)) - { - this.RaisePropertyChanging(); - this._UmbracoRedirect = value; - this.RaisePropertyChanged("UmbracoRedirect"); - } - } - } - - /// - /// Use this property if you wish to hide this page in the navigation. - /// - [UmbracoInfo("umbracoNaviHide", DisplayName = "Hide in Navi", Mandatory = false)] - [Property()] - public virtual int UmbracoNaviHide - { - get - { - return this._UmbracoNaviHide; - } - set - { - if ((this._UmbracoNaviHide != value)) - { - this.RaisePropertyChanging(); - this._UmbracoNaviHide = value; - this.RaisePropertyChanged("UmbracoNaviHide"); - } - } - } - - public virtual bool UmbracoNaviHideBoolean - { - get - { - return (this._UmbracoNaviHide == 0); - } - } - - /// - /// - /// - [UmbracoInfo("headerText", DisplayName = "Header", Mandatory = false)] - [Property()] - public virtual string HeaderText - { - get - { - return this._HeaderText; - } - set - { - if ((this._HeaderText != value)) - { - this.RaisePropertyChanging(); - this._HeaderText = value; - this.RaisePropertyChanged("HeaderText"); - } - } - } - - /// - /// Choose how you want to sort the child items. - /// - [UmbracoInfo("sortBy", DisplayName = "Sort By", Mandatory = true)] - [Property()] - public virtual string SortBy - { - get - { - return this._SortBy; - } - set - { - if ((this._SortBy != value)) - { - this.RaisePropertyChanging(); - this._SortBy = value; - this.RaisePropertyChanged("SortBy"); - } - } - } - - /// - /// Choose how you want to sort the child items. - /// - [UmbracoInfo("sortOrder", DisplayName = "Sort Order", Mandatory = true)] - [Property()] - public virtual string SortOrder - { - get - { - return this._SortOrder; - } - set - { - if ((this._SortOrder != value)) - { - this.RaisePropertyChanging(); - this._SortOrder = value; - this.RaisePropertyChanged("SortOrder"); - } - } - } - - /// - /// 208px x 108px - /// - [UmbracoInfo("galleryThumbnail", DisplayName = "Thumbnail for Gallery", Mandatory = false)] - [Property()] - public virtual string GalleryThumbnail - { - get - { - return this._GalleryThumbnail; - } - set - { - if ((this._GalleryThumbnail != value)) - { - this.RaisePropertyChanging(); - this._GalleryThumbnail = value; - this.RaisePropertyChanged("GalleryThumbnail"); - } - } - } - - public AssociationTree CWSPhotos - { - get - { - if ((this._CWSPhotos == null)) - { - this._CWSPhotos = this.ChildrenOfType(); - } - return this._CWSPhotos; - } - set - { - this._CWSPhotos = value; - } - } - } - - /// - /// This is the homepage document type for your site. - /// - [UmbracoInfo("CWS_Home")] - [System.Runtime.Serialization.DataContractAttribute()] - [DocType()] - public partial class CWSHome : DocTypeBase - { - - private string _UmbracoUrlName; - - private string _UmbracoUrlAlias; - - private string _MetaDescription; - - private string _MetaKeywords; - - private int _UmbracoRedirect; - - private int _UmbracoNaviHide; - - private string _SiteName; - - private string _HeaderText; - - private string _HomepagePhoto; - - private string _BodyText; - - private AssociationTree _CWSContacts; - - private AssociationTree _CWSEmailAFriends; - - private AssociationTree _CWSGalleryLists; - - private AssociationTree _CWSNewsEventsLists; - - private AssociationTree _CWSTextpages; - - private AssociationTree _CWSTextpageTwoCols; - - public CWSHome() - { - } - - /// - /// If you wish to change the URL of the node without changing the node name fill this in. - /// - ///eg: warren - /// - [UmbracoInfo("umbracoUrlName", DisplayName = "Umbraco URL Name", Mandatory = false)] - [Property()] - public virtual string UmbracoUrlName - { - get - { - return this._UmbracoUrlName; - } - set - { - if ((this._UmbracoUrlName != value)) - { - this.RaisePropertyChanging(); - this._UmbracoUrlName = value; - this.RaisePropertyChanged("UmbracoUrlName"); - } - } - } - - /// - /// Use this to give a node multiple urls. - /// - ///eg: home,homepage/another-level - /// - [UmbracoInfo("umbracoUrlAlias", DisplayName = "Umbraco URL Alias", Mandatory = false)] - [Property()] - public virtual string UmbracoUrlAlias - { - get - { - return this._UmbracoUrlAlias; - } - set - { - if ((this._UmbracoUrlAlias != value)) - { - this.RaisePropertyChanging(); - this._UmbracoUrlAlias = value; - this.RaisePropertyChanged("UmbracoUrlAlias"); - } - } - } - - /// - /// Enter the description for the page. - /// - [UmbracoInfo("metaDescription", DisplayName = "Meta Description", Mandatory = false)] - [Property()] - public virtual string MetaDescription - { - get - { - return this._MetaDescription; - } - set - { - if ((this._MetaDescription != value)) - { - this.RaisePropertyChanging(); - this._MetaDescription = value; - this.RaisePropertyChanged("MetaDescription"); - } - } - } - - /// - /// Enter a comma seperated list of keywords. - ///warren, keyword, test - /// - [UmbracoInfo("metaKeywords", DisplayName = "Meta Keywords", Mandatory = false)] - [Property()] - public virtual string MetaKeywords - { - get - { - return this._MetaKeywords; - } - set - { - if ((this._MetaKeywords != value)) - { - this.RaisePropertyChanging(); - this._MetaKeywords = value; - this.RaisePropertyChanged("MetaKeywords"); - } - } - } - - /// - /// Pick a node you wish to redirect to if the user lands on this node. - /// - [UmbracoInfo("umbracoRedirect", DisplayName = " Umbraco Redirect", Mandatory = false)] - [Property()] - public virtual int UmbracoRedirect - { - get - { - return this._UmbracoRedirect; - } - set - { - if ((this._UmbracoRedirect != value)) - { - this.RaisePropertyChanging(); - this._UmbracoRedirect = value; - this.RaisePropertyChanged("UmbracoRedirect"); - } - } - } - - /// - /// Use this property if you wish to hide this page in the navigation. - /// - [UmbracoInfo("umbracoNaviHide", DisplayName = "Hide in Navi", Mandatory = false)] - [Property()] - public virtual int UmbracoNaviHide - { - get - { - return this._UmbracoNaviHide; - } - set - { - if ((this._UmbracoNaviHide != value)) - { - this.RaisePropertyChanging(); - this._UmbracoNaviHide = value; - this.RaisePropertyChanged("UmbracoNaviHide"); - } - } - } - - public virtual bool UmbracoNaviHideBoolean - { - get - { - return (this._UmbracoNaviHide == 0); - } - } - - /// - /// This is what your site is called. - /// - [UmbracoInfo("siteName", DisplayName = "Site Name", Mandatory = false)] - [Property()] - public virtual string SiteName - { - get - { - return this._SiteName; - } - set - { - if ((this._SiteName != value)) - { - this.RaisePropertyChanging(); - this._SiteName = value; - this.RaisePropertyChanged("SiteName"); - } - } - } - - /// - /// - /// - [UmbracoInfo("headerText", DisplayName = "Header", Mandatory = false)] - [Property()] - public virtual string HeaderText - { - get - { - return this._HeaderText; - } - set - { - if ((this._HeaderText != value)) - { - this.RaisePropertyChanging(); - this._HeaderText = value; - this.RaisePropertyChanged("HeaderText"); - } - } - } - - /// - /// - /// - [UmbracoInfo("homepagePhoto", DisplayName = "Photo", Mandatory = false)] - [Property()] - public virtual string HomepagePhoto - { - get - { - return this._HomepagePhoto; - } - set - { - if ((this._HomepagePhoto != value)) - { - this.RaisePropertyChanging(); - this._HomepagePhoto = value; - this.RaisePropertyChanged("HomepagePhoto"); - } - } - } - - /// - /// - /// - [UmbracoInfo("bodyText", DisplayName = "Text", Mandatory = false)] - [Property()] - public virtual string BodyText - { - get - { - return this._BodyText; - } - set - { - if ((this._BodyText != value)) - { - this.RaisePropertyChanging(); - this._BodyText = value; - this.RaisePropertyChanged("BodyText"); - } - } - } - - public AssociationTree CWSContacts - { - get - { - if ((this._CWSContacts == null)) - { - this._CWSContacts = this.ChildrenOfType(); - } - return this._CWSContacts; - } - set - { - this._CWSContacts = value; - } - } - - public AssociationTree CWSEmailAFriends - { - get - { - if ((this._CWSEmailAFriends == null)) - { - this._CWSEmailAFriends = this.ChildrenOfType(); - } - return this._CWSEmailAFriends; - } - set - { - this._CWSEmailAFriends = value; - } - } - - public AssociationTree CWSGalleryLists - { - get - { - if ((this._CWSGalleryLists == null)) - { - this._CWSGalleryLists = this.ChildrenOfType(); - } - return this._CWSGalleryLists; - } - set - { - this._CWSGalleryLists = value; - } - } - - public AssociationTree CWSNewsEventsLists - { - get - { - if ((this._CWSNewsEventsLists == null)) - { - this._CWSNewsEventsLists = this.ChildrenOfType(); - } - return this._CWSNewsEventsLists; - } - set - { - this._CWSNewsEventsLists = value; - } - } - - public AssociationTree CWSTextpages - { - get - { - if ((this._CWSTextpages == null)) - { - this._CWSTextpages = this.ChildrenOfType(); - } - return this._CWSTextpages; - } - set - { - this._CWSTextpages = value; - } - } - - public AssociationTree CWSTextpageTwoCols - { - get - { - if ((this._CWSTextpageTwoCols == null)) - { - this._CWSTextpageTwoCols = this.ChildrenOfType(); - } - return this._CWSTextpageTwoCols; - } - set - { - this._CWSTextpageTwoCols = value; - } - } - } - - /// - /// This is the News & Events List document type for your site which stores the News and Event Item document types as children. - /// - [UmbracoInfo("CWS_NewsEventsList")] - [System.Runtime.Serialization.DataContractAttribute()] - [DocType()] - public partial class CWSNewsEventsList : DocTypeBase - { - - private string _UmbracoUrlName; - - private string _UmbracoUrlAlias; - - private string _MetaDescription; - - private string _MetaKeywords; - - private int _UmbracoRedirect; - - private int _UmbracoNaviHide; - - private string _SortBy; - - private string _SortOrder; - - private string _HeaderText; - - private AssociationTree _CWSEventItems; - - private AssociationTree _CWSNewsItems; - - public CWSNewsEventsList() - { - } - - /// - /// If you wish to change the URL of the node without changing the node name fill this in. - /// - ///eg: warren - /// - [UmbracoInfo("umbracoUrlName", DisplayName = "Umbraco URL Name", Mandatory = false)] - [Property()] - public virtual string UmbracoUrlName - { - get - { - return this._UmbracoUrlName; - } - set - { - if ((this._UmbracoUrlName != value)) - { - this.RaisePropertyChanging(); - this._UmbracoUrlName = value; - this.RaisePropertyChanged("UmbracoUrlName"); - } - } - } - - /// - /// Use this to give a node multiple urls. - /// - ///eg: home,homepage/another-level - /// - [UmbracoInfo("umbracoUrlAlias", DisplayName = "Umbraco URL Alias", Mandatory = false)] - [Property()] - public virtual string UmbracoUrlAlias - { - get - { - return this._UmbracoUrlAlias; - } - set - { - if ((this._UmbracoUrlAlias != value)) - { - this.RaisePropertyChanging(); - this._UmbracoUrlAlias = value; - this.RaisePropertyChanged("UmbracoUrlAlias"); - } - } - } - - /// - /// Enter the description for the page. - /// - [UmbracoInfo("metaDescription", DisplayName = "Meta Description", Mandatory = false)] - [Property()] - public virtual string MetaDescription - { - get - { - return this._MetaDescription; - } - set - { - if ((this._MetaDescription != value)) - { - this.RaisePropertyChanging(); - this._MetaDescription = value; - this.RaisePropertyChanged("MetaDescription"); - } - } - } - - /// - /// Enter a comma seperated list of keywords. - ///warren, keyword, test - /// - [UmbracoInfo("metaKeywords", DisplayName = "Meta Keywords", Mandatory = false)] - [Property()] - public virtual string MetaKeywords - { - get - { - return this._MetaKeywords; - } - set - { - if ((this._MetaKeywords != value)) - { - this.RaisePropertyChanging(); - this._MetaKeywords = value; - this.RaisePropertyChanged("MetaKeywords"); - } - } - } - - /// - /// Pick a node you wish to redirect to if the user lands on this node. - /// - [UmbracoInfo("umbracoRedirect", DisplayName = " Umbraco Redirect", Mandatory = false)] - [Property()] - public virtual int UmbracoRedirect - { - get - { - return this._UmbracoRedirect; - } - set - { - if ((this._UmbracoRedirect != value)) - { - this.RaisePropertyChanging(); - this._UmbracoRedirect = value; - this.RaisePropertyChanged("UmbracoRedirect"); - } - } - } - - /// - /// Use this property if you wish to hide this page in the navigation. - /// - [UmbracoInfo("umbracoNaviHide", DisplayName = "Hide in Navi", Mandatory = false)] - [Property()] - public virtual int UmbracoNaviHide - { - get - { - return this._UmbracoNaviHide; - } - set - { - if ((this._UmbracoNaviHide != value)) - { - this.RaisePropertyChanging(); - this._UmbracoNaviHide = value; - this.RaisePropertyChanged("UmbracoNaviHide"); - } - } - } - - public virtual bool UmbracoNaviHideBoolean - { - get - { - return (this._UmbracoNaviHide == 0); - } - } - - /// - /// Choose how you want to sort the child items. - /// - [UmbracoInfo("sortBy", DisplayName = "Sort By", Mandatory = true)] - [Property()] - public virtual string SortBy - { - get - { - return this._SortBy; - } - set - { - if ((this._SortBy != value)) - { - this.RaisePropertyChanging(); - this._SortBy = value; - this.RaisePropertyChanged("SortBy"); - } - } - } - - /// - /// Choose how you want to sort the child items. - /// - [UmbracoInfo("sortOrder", DisplayName = "Sort Order", Mandatory = true)] - [Property()] - public virtual string SortOrder - { - get - { - return this._SortOrder; - } - set - { - if ((this._SortOrder != value)) - { - this.RaisePropertyChanging(); - this._SortOrder = value; - this.RaisePropertyChanged("SortOrder"); - } - } - } - - /// - /// - /// - [UmbracoInfo("headerText", DisplayName = "Header", Mandatory = false)] - [Property()] - public virtual string HeaderText - { - get - { - return this._HeaderText; - } - set - { - if ((this._HeaderText != value)) - { - this.RaisePropertyChanging(); - this._HeaderText = value; - this.RaisePropertyChanged("HeaderText"); - } - } - } - - public AssociationTree CWSEventItems - { - get - { - if ((this._CWSEventItems == null)) - { - this._CWSEventItems = this.ChildrenOfType(); - } - return this._CWSEventItems; - } - set - { - this._CWSEventItems = value; - } - } - - public AssociationTree CWSNewsItems - { - get - { - if ((this._CWSNewsItems == null)) - { - this._CWSNewsItems = this.ChildrenOfType(); - } - return this._CWSNewsItems; - } - set - { - this._CWSNewsItems = value; - } - } - } - - /// - /// This is the news document type for your site and lives beneath the News & Events List document type. - /// - [UmbracoInfo("CWS_NewsItem")] - [System.Runtime.Serialization.DataContractAttribute()] - [DocType()] - public partial class CWSNewsItem : DocTypeBase - { - - private string _BodyText; - - private string _ArticlePhoto; - - private string _UmbracoUrlName; - - private string _UmbracoUrlAlias; - - private string _MetaDescription; - - private string _MetaKeywords; - - private int _UmbracoRedirect; - - private int _UmbracoNaviHide; - - private AssociationTree _CWSNewsItems; - - public CWSNewsItem() - { - } - - /// - /// - /// - [UmbracoInfo("bodyText", DisplayName = "Text", Mandatory = false)] - [Property()] - public virtual string BodyText - { - get - { - return this._BodyText; - } - set - { - if ((this._BodyText != value)) - { - this.RaisePropertyChanging(); - this._BodyText = value; - this.RaisePropertyChanged("BodyText"); - } - } - } - - /// - /// - /// - [UmbracoInfo("articlePhoto", DisplayName = "Photo", Mandatory = false)] - [Property()] - public virtual string ArticlePhoto - { - get - { - return this._ArticlePhoto; - } - set - { - if ((this._ArticlePhoto != value)) - { - this.RaisePropertyChanging(); - this._ArticlePhoto = value; - this.RaisePropertyChanged("ArticlePhoto"); - } - } - } - - /// - /// If you wish to change the URL of the node without changing the node name fill this in. - /// - ///eg: warren - /// - [UmbracoInfo("umbracoUrlName", DisplayName = "Umbraco URL Name", Mandatory = false)] - [Property()] - public virtual string UmbracoUrlName - { - get - { - return this._UmbracoUrlName; - } - set - { - if ((this._UmbracoUrlName != value)) - { - this.RaisePropertyChanging(); - this._UmbracoUrlName = value; - this.RaisePropertyChanged("UmbracoUrlName"); - } - } - } - - /// - /// Use this to give a node multiple urls. - /// - ///eg: home,homepage/another-level - /// - [UmbracoInfo("umbracoUrlAlias", DisplayName = "Umbraco URL Alias", Mandatory = false)] - [Property()] - public virtual string UmbracoUrlAlias - { - get - { - return this._UmbracoUrlAlias; - } - set - { - if ((this._UmbracoUrlAlias != value)) - { - this.RaisePropertyChanging(); - this._UmbracoUrlAlias = value; - this.RaisePropertyChanged("UmbracoUrlAlias"); - } - } - } - - /// - /// Enter the description for the page. - /// - [UmbracoInfo("metaDescription", DisplayName = "Meta Description", Mandatory = false)] - [Property()] - public virtual string MetaDescription - { - get - { - return this._MetaDescription; - } - set - { - if ((this._MetaDescription != value)) - { - this.RaisePropertyChanging(); - this._MetaDescription = value; - this.RaisePropertyChanged("MetaDescription"); - } - } - } - - /// - /// Enter a comma seperated list of keywords. - ///warren, keyword, test - /// - [UmbracoInfo("metaKeywords", DisplayName = "Meta Keywords", Mandatory = false)] - [Property()] - public virtual string MetaKeywords - { - get - { - return this._MetaKeywords; - } - set - { - if ((this._MetaKeywords != value)) - { - this.RaisePropertyChanging(); - this._MetaKeywords = value; - this.RaisePropertyChanged("MetaKeywords"); - } - } - } - - /// - /// Pick a node you wish to redirect to if the user lands on this node. - /// - [UmbracoInfo("umbracoRedirect", DisplayName = " Umbraco Redirect", Mandatory = false)] - [Property()] - public virtual int UmbracoRedirect - { - get - { - return this._UmbracoRedirect; - } - set - { - if ((this._UmbracoRedirect != value)) - { - this.RaisePropertyChanging(); - this._UmbracoRedirect = value; - this.RaisePropertyChanged("UmbracoRedirect"); - } - } - } - - /// - /// Use this property if you wish to hide this page in the navigation. - /// - [UmbracoInfo("umbracoNaviHide", DisplayName = "Hide in Navi", Mandatory = false)] - [Property()] - public virtual int UmbracoNaviHide - { - get - { - return this._UmbracoNaviHide; - } - set - { - if ((this._UmbracoNaviHide != value)) - { - this.RaisePropertyChanging(); - this._UmbracoNaviHide = value; - this.RaisePropertyChanged("UmbracoNaviHide"); - } - } - } - - public virtual bool UmbracoNaviHideBoolean - { - get - { - return (this._UmbracoNaviHide == 0); - } - } - - public AssociationTree CWSNewsItems - { - get - { - if ((this._CWSNewsItems == null)) - { - this._CWSNewsItems = this.ChildrenOfType(); - } - return this._CWSNewsItems; - } - set - { - this._CWSNewsItems = value; - } - } - } - - /// - /// This is the Photo document type for your site and lives beneath the Gallery document type. - /// - [UmbracoInfo("CWS_Photo")] - [System.Runtime.Serialization.DataContractAttribute()] - [DocType()] - public partial class CWSPhoto : DocTypeBase - { - - private string _PhotoText; - - private string _Photo; - - private string _PhotoThumbnail; - - private string _UmbracoUrlName; - - private string _UmbracoUrlAlias; - - private string _MetaDescription; - - private string _MetaKeywords; - - private int _UmbracoRedirect; - - private int _UmbracoNaviHide; - - public CWSPhoto() - { - } - - /// - /// Enter a description - /// - [UmbracoInfo("photoText", DisplayName = "Photo Text", Mandatory = false)] - [Property()] - public virtual string PhotoText - { - get - { - return this._PhotoText; - } - set - { - if ((this._PhotoText != value)) - { - this.RaisePropertyChanging(); - this._PhotoText = value; - this.RaisePropertyChanged("PhotoText"); - } - } - } - - /// - /// - /// - [UmbracoInfo("photo", DisplayName = "Photo", Mandatory = false)] - [Property()] - public virtual string Photo - { - get - { - return this._Photo; - } - set - { - if ((this._Photo != value)) - { - this.RaisePropertyChanging(); - this._Photo = value; - this.RaisePropertyChanged("Photo"); - } - } - } - - /// - /// 151px x 108px - /// - [UmbracoInfo("photoThumbnail", DisplayName = "Thumbnail", Mandatory = false)] - [Property()] - public virtual string PhotoThumbnail - { - get - { - return this._PhotoThumbnail; - } - set - { - if ((this._PhotoThumbnail != value)) - { - this.RaisePropertyChanging(); - this._PhotoThumbnail = value; - this.RaisePropertyChanged("PhotoThumbnail"); - } - } - } - - /// - /// If you wish to change the URL of the node without changing the node name fill this in. - /// - ///eg: warren - /// - [UmbracoInfo("umbracoUrlName", DisplayName = "Umbraco URL Name", Mandatory = false)] - [Property()] - public virtual string UmbracoUrlName - { - get - { - return this._UmbracoUrlName; - } - set - { - if ((this._UmbracoUrlName != value)) - { - this.RaisePropertyChanging(); - this._UmbracoUrlName = value; - this.RaisePropertyChanged("UmbracoUrlName"); - } - } - } - - /// - /// Use this to give a node multiple urls. - /// - ///eg: home,homepage/another-level - /// - [UmbracoInfo("umbracoUrlAlias", DisplayName = "Umbraco URL Alias", Mandatory = false)] - [Property()] - public virtual string UmbracoUrlAlias - { - get - { - return this._UmbracoUrlAlias; - } - set - { - if ((this._UmbracoUrlAlias != value)) - { - this.RaisePropertyChanging(); - this._UmbracoUrlAlias = value; - this.RaisePropertyChanged("UmbracoUrlAlias"); - } - } - } - - /// - /// Enter the description for the page. - /// - [UmbracoInfo("metaDescription", DisplayName = "Meta Description", Mandatory = false)] - [Property()] - public virtual string MetaDescription - { - get - { - return this._MetaDescription; - } - set - { - if ((this._MetaDescription != value)) - { - this.RaisePropertyChanging(); - this._MetaDescription = value; - this.RaisePropertyChanged("MetaDescription"); - } - } - } - - /// - /// Enter a comma seperated list of keywords. - ///warren, keyword, test - /// - [UmbracoInfo("metaKeywords", DisplayName = "Meta Keywords", Mandatory = false)] - [Property()] - public virtual string MetaKeywords - { - get - { - return this._MetaKeywords; - } - set - { - if ((this._MetaKeywords != value)) - { - this.RaisePropertyChanging(); - this._MetaKeywords = value; - this.RaisePropertyChanged("MetaKeywords"); - } - } - } - - /// - /// Pick a node you wish to redirect to if the user lands on this node. - /// - [UmbracoInfo("umbracoRedirect", DisplayName = " Umbraco Redirect", Mandatory = false)] - [Property()] - public virtual int UmbracoRedirect - { - get - { - return this._UmbracoRedirect; - } - set - { - if ((this._UmbracoRedirect != value)) - { - this.RaisePropertyChanging(); - this._UmbracoRedirect = value; - this.RaisePropertyChanged("UmbracoRedirect"); - } - } - } - - /// - /// Use this property if you wish to hide this page in the navigation. - /// - [UmbracoInfo("umbracoNaviHide", DisplayName = "Hide in Navi", Mandatory = false)] - [Property()] - public virtual int UmbracoNaviHide - { - get - { - return this._UmbracoNaviHide; - } - set - { - if ((this._UmbracoNaviHide != value)) - { - this.RaisePropertyChanging(); - this._UmbracoNaviHide = value; - this.RaisePropertyChanged("UmbracoNaviHide"); - } - } - } - - public virtual bool UmbracoNaviHideBoolean - { - get - { - return (this._UmbracoNaviHide == 0); - } - } - } - - /// - /// This is the Textpage document type for your site. - /// - [UmbracoInfo("CWS_Textpage")] - [System.Runtime.Serialization.DataContractAttribute()] - [DocType()] - public partial class CWSTextpage : DocTypeBase - { - - private string _UmbracoUrlName; - - private string _UmbracoUrlAlias; - - private string _MetaDescription; - - private string _MetaKeywords; - - private int _UmbracoRedirect; - - private int _UmbracoNaviHide; - - private string _HeaderText; - - private string _ArticlePhoto; - - private string _BodyText; - - private AssociationTree _CWSTextpages; - - private AssociationTree _CWSTextpageTwoCols; - - public CWSTextpage() - { - } - - /// - /// If you wish to change the URL of the node without changing the node name fill this in. - /// - ///eg: warren - /// - [UmbracoInfo("umbracoUrlName", DisplayName = "Umbraco URL Name", Mandatory = false)] - [Property()] - public virtual string UmbracoUrlName - { - get - { - return this._UmbracoUrlName; - } - set - { - if ((this._UmbracoUrlName != value)) - { - this.RaisePropertyChanging(); - this._UmbracoUrlName = value; - this.RaisePropertyChanged("UmbracoUrlName"); - } - } - } - - /// - /// Use this to give a node multiple urls. - /// - ///eg: home,homepage/another-level - /// - [UmbracoInfo("umbracoUrlAlias", DisplayName = "Umbraco URL Alias", Mandatory = false)] - [Property()] - public virtual string UmbracoUrlAlias - { - get - { - return this._UmbracoUrlAlias; - } - set - { - if ((this._UmbracoUrlAlias != value)) - { - this.RaisePropertyChanging(); - this._UmbracoUrlAlias = value; - this.RaisePropertyChanged("UmbracoUrlAlias"); - } - } - } - - /// - /// Enter the description for the page. - /// - [UmbracoInfo("metaDescription", DisplayName = "Meta Description", Mandatory = false)] - [Property()] - public virtual string MetaDescription - { - get - { - return this._MetaDescription; - } - set - { - if ((this._MetaDescription != value)) - { - this.RaisePropertyChanging(); - this._MetaDescription = value; - this.RaisePropertyChanged("MetaDescription"); - } - } - } - - /// - /// Enter a comma seperated list of keywords. - ///warren, keyword, test - /// - [UmbracoInfo("metaKeywords", DisplayName = "Meta Keywords", Mandatory = false)] - [Property()] - public virtual string MetaKeywords - { - get - { - return this._MetaKeywords; - } - set - { - if ((this._MetaKeywords != value)) - { - this.RaisePropertyChanging(); - this._MetaKeywords = value; - this.RaisePropertyChanged("MetaKeywords"); - } - } - } - - /// - /// Pick a node you wish to redirect to if the user lands on this node. - /// - [UmbracoInfo("umbracoRedirect", DisplayName = " Umbraco Redirect", Mandatory = false)] - [Property()] - public virtual int UmbracoRedirect - { - get - { - return this._UmbracoRedirect; - } - set - { - if ((this._UmbracoRedirect != value)) - { - this.RaisePropertyChanging(); - this._UmbracoRedirect = value; - this.RaisePropertyChanged("UmbracoRedirect"); - } - } - } - - /// - /// Use this property if you wish to hide this page in the navigation. - /// - [UmbracoInfo("umbracoNaviHide", DisplayName = "Hide in Navi", Mandatory = false)] - [Property()] - public virtual int UmbracoNaviHide - { - get - { - return this._UmbracoNaviHide; - } - set - { - if ((this._UmbracoNaviHide != value)) - { - this.RaisePropertyChanging(); - this._UmbracoNaviHide = value; - this.RaisePropertyChanged("UmbracoNaviHide"); - } - } - } - - public virtual bool UmbracoNaviHideBoolean - { - get - { - return (this._UmbracoNaviHide == 0); - } - } - - /// - /// - /// - [UmbracoInfo("headerText", DisplayName = "Header", Mandatory = false)] - [Property()] - public virtual string HeaderText - { - get - { - return this._HeaderText; - } - set - { - if ((this._HeaderText != value)) - { - this.RaisePropertyChanging(); - this._HeaderText = value; - this.RaisePropertyChanged("HeaderText"); - } - } - } - - /// - /// - /// - [UmbracoInfo("articlePhoto", DisplayName = "Photo", Mandatory = false)] - [Property()] - public virtual string ArticlePhoto - { - get - { - return this._ArticlePhoto; - } - set - { - if ((this._ArticlePhoto != value)) - { - this.RaisePropertyChanging(); - this._ArticlePhoto = value; - this.RaisePropertyChanged("ArticlePhoto"); - } - } - } - - /// - /// - /// - [UmbracoInfo("bodyText", DisplayName = "Text", Mandatory = false)] - [Property()] - public virtual string BodyText - { - get - { - return this._BodyText; - } - set - { - if ((this._BodyText != value)) - { - this.RaisePropertyChanging(); - this._BodyText = value; - this.RaisePropertyChanged("BodyText"); - } - } - } - - public AssociationTree CWSTextpages - { - get - { - if ((this._CWSTextpages == null)) - { - this._CWSTextpages = this.ChildrenOfType(); - } - return this._CWSTextpages; - } - set - { - this._CWSTextpages = value; - } - } - - public AssociationTree CWSTextpageTwoCols - { - get - { - if ((this._CWSTextpageTwoCols == null)) - { - this._CWSTextpageTwoCols = this.ChildrenOfType(); - } - return this._CWSTextpageTwoCols; - } - set - { - this._CWSTextpageTwoCols = value; - } - } - } - - /// - /// This is the Textpage document type for your site which has two columns. - /// - [UmbracoInfo("CWS_TextpageTwoCol")] - [System.Runtime.Serialization.DataContractAttribute()] - [DocType()] - public partial class CWSTextpageTwoCol : DocTypeBase - { - - private string _ArticlePhotoColOne; - - private string _ArticlePhotoColTwo; - - private string _BodyTextColTwo; - - private string _BodyTextColOne; - - private string _UmbracoUrlName; - - private string _UmbracoUrlAlias; - - private string _MetaDescription; - - private string _MetaKeywords; - - private int _UmbracoRedirect; - - private int _UmbracoNaviHide; - - private string _HeaderText; - - private AssociationTree _CWSTextpages; - - private AssociationTree _CWSTextpageTwoCols; - - public CWSTextpageTwoCol() - { - } - - /// - /// - /// - [UmbracoInfo("articlePhotoColOne", DisplayName = "Photo", Mandatory = false)] - [Property()] - public virtual string ArticlePhotoColOne - { - get - { - return this._ArticlePhotoColOne; - } - set - { - if ((this._ArticlePhotoColOne != value)) - { - this.RaisePropertyChanging(); - this._ArticlePhotoColOne = value; - this.RaisePropertyChanged("ArticlePhotoColOne"); - } - } - } - - /// - /// - /// - [UmbracoInfo("articlePhotoColTwo", DisplayName = "Photo", Mandatory = false)] - [Property()] - public virtual string ArticlePhotoColTwo - { - get - { - return this._ArticlePhotoColTwo; - } - set - { - if ((this._ArticlePhotoColTwo != value)) - { - this.RaisePropertyChanging(); - this._ArticlePhotoColTwo = value; - this.RaisePropertyChanged("ArticlePhotoColTwo"); - } - } - } - - /// - /// - /// - [UmbracoInfo("bodyTextColTwo", DisplayName = "Text", Mandatory = false)] - [Property()] - public virtual string BodyTextColTwo - { - get - { - return this._BodyTextColTwo; - } - set - { - if ((this._BodyTextColTwo != value)) - { - this.RaisePropertyChanging(); - this._BodyTextColTwo = value; - this.RaisePropertyChanged("BodyTextColTwo"); - } - } - } - - /// - /// - /// - [UmbracoInfo("bodyTextColOne", DisplayName = "Text", Mandatory = false)] - [Property()] - public virtual string BodyTextColOne - { - get - { - return this._BodyTextColOne; - } - set - { - if ((this._BodyTextColOne != value)) - { - this.RaisePropertyChanging(); - this._BodyTextColOne = value; - this.RaisePropertyChanged("BodyTextColOne"); - } - } - } - - /// - /// If you wish to change the URL of the node without changing the node name fill this in. - /// - ///eg: warren - /// - [UmbracoInfo("umbracoUrlName", DisplayName = "Umbraco URL Name", Mandatory = false)] - [Property()] - public virtual string UmbracoUrlName - { - get - { - return this._UmbracoUrlName; - } - set - { - if ((this._UmbracoUrlName != value)) - { - this.RaisePropertyChanging(); - this._UmbracoUrlName = value; - this.RaisePropertyChanged("UmbracoUrlName"); - } - } - } - - /// - /// Use this to give a node multiple urls. - /// - ///eg: home,homepage/another-level - /// - [UmbracoInfo("umbracoUrlAlias", DisplayName = "Umbraco URL Alias", Mandatory = false)] - [Property()] - public virtual string UmbracoUrlAlias - { - get - { - return this._UmbracoUrlAlias; - } - set - { - if ((this._UmbracoUrlAlias != value)) - { - this.RaisePropertyChanging(); - this._UmbracoUrlAlias = value; - this.RaisePropertyChanged("UmbracoUrlAlias"); - } - } - } - - /// - /// Enter the description for the page. - /// - [UmbracoInfo("metaDescription", DisplayName = "Meta Description", Mandatory = false)] - [Property()] - public virtual string MetaDescription - { - get - { - return this._MetaDescription; - } - set - { - if ((this._MetaDescription != value)) - { - this.RaisePropertyChanging(); - this._MetaDescription = value; - this.RaisePropertyChanged("MetaDescription"); - } - } - } - - /// - /// Enter a comma seperated list of keywords. - ///warren, keyword, test - /// - [UmbracoInfo("metaKeywords", DisplayName = "Meta Keywords", Mandatory = false)] - [Property()] - public virtual string MetaKeywords - { - get - { - return this._MetaKeywords; - } - set - { - if ((this._MetaKeywords != value)) - { - this.RaisePropertyChanging(); - this._MetaKeywords = value; - this.RaisePropertyChanged("MetaKeywords"); - } - } - } - - /// - /// Pick a node you wish to redirect to if the user lands on this node. - /// - [UmbracoInfo("umbracoRedirect", DisplayName = " Umbraco Redirect", Mandatory = false)] - [Property()] - public virtual int UmbracoRedirect - { - get - { - return this._UmbracoRedirect; - } - set - { - if ((this._UmbracoRedirect != value)) - { - this.RaisePropertyChanging(); - this._UmbracoRedirect = value; - this.RaisePropertyChanged("UmbracoRedirect"); - } - } - } - - /// - /// Use this property if you wish to hide this page in the navigation. - /// - [UmbracoInfo("umbracoNaviHide", DisplayName = "Hide in Navi", Mandatory = false)] - [Property()] - public virtual int UmbracoNaviHide - { - get - { - return this._UmbracoNaviHide; - } - set - { - if ((this._UmbracoNaviHide != value)) - { - this.RaisePropertyChanging(); - this._UmbracoNaviHide = value; - this.RaisePropertyChanged("UmbracoNaviHide"); - } - } - } - - public virtual bool UmbracoNaviHideBoolean - { - get - { - return (this._UmbracoNaviHide == 0); - } - } - - /// - /// - /// - [UmbracoInfo("headerText", DisplayName = "Header", Mandatory = false)] - [Property()] - public virtual string HeaderText - { - get - { - return this._HeaderText; - } - set - { - if ((this._HeaderText != value)) - { - this.RaisePropertyChanging(); - this._HeaderText = value; - this.RaisePropertyChanged("HeaderText"); - } - } - } - - public AssociationTree CWSTextpages - { - get - { - if ((this._CWSTextpages == null)) - { - this._CWSTextpages = this.ChildrenOfType(); - } - return this._CWSTextpages; - } - set - { - this._CWSTextpages = value; - } - } - - public AssociationTree CWSTextpageTwoCols - { - get - { - if ((this._CWSTextpageTwoCols == null)) - { - this._CWSTextpageTwoCols = this.ChildrenOfType(); - } - return this._CWSTextpageTwoCols; - } - set - { - this._CWSTextpageTwoCols = value; - } - } - } - - /// - /// - /// - [UmbracoInfo("TextPageThreeCol")] - [System.Runtime.Serialization.DataContractAttribute()] - [DocType()] - public partial class TextPageThreeCol : CWSTextpageTwoCol - { - - public TextPageThreeCol() - { - } - } -} - diff --git a/src/LinqToUmbraco/src/umbraco.Linq/Core.Tests/OrderingTest.cs b/src/LinqToUmbraco/src/umbraco.Linq/Core.Tests/OrderingTest.cs deleted file mode 100644 index fe7edfc8b6..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/Core.Tests/OrderingTest.cs +++ /dev/null @@ -1,81 +0,0 @@ -using System; -using System.Text; -using System.Collections.Generic; -using System.Linq; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using TypeMock.ArrangeActAssert; -using umbraco.Test; - -namespace umbraco.Linq.Core.Tests -{ - /// - /// Summary description for OrderingTest - /// - [TestClass, DeploymentItem("umbraco.config")] - public class OrderingTest - { - public OrderingTest() - { - // - // TODO: Add constructor logic here - // - } - - private TestContext testContextInstance; - - /// - ///Gets or sets the test context which provides - ///information about and functionality for the current test run. - /// - public TestContext TestContext - { - get - { - return testContextInstance; - } - set - { - testContextInstance = value; - } - } - - #region Additional test attributes - // - // You can use the following additional attributes as you write your tests: - // - // Use ClassInitialize to run code before running the first test in the class - // [ClassInitialize()] - // public static void MyClassInitialize(TestContext testContext) { } - // - // Use ClassCleanup to run code after all tests in a class have run - // [ClassCleanup()] - // public static void MyClassCleanup() { } - // - // Use TestInitialize to run code before running each test - // [TestInitialize()] - // public void MyTestInitialize() { } - // - // Use TestCleanup to run code after each test has run - // [TestCleanup()] - // public void MyTestCleanup() { } - // - #endregion - - [TestMethod, Isolated] - public void OrderingTest_Date() - { - MockHelpers.SetupFakeHttpContext(); - - using (var orderedContext = new MyUmbracoDataContext()) - { - var asc = orderedContext.CWSTextpages.OrderBy(p => p.CreateDate); - - var desc = orderedContext.CWSTextpages.OrderByDescending(p => p.CreateDate); - - Assert.AreEqual(asc.Count(), desc.Count()); - Assert.AreNotEqual(asc.First().Id, desc.First().Id); - Assert.AreEqual(asc.First().Id, desc.Last().Id); - } - } - } -} diff --git a/src/LinqToUmbraco/src/umbraco.Linq/Core.Tests/ParentTest.cs b/src/LinqToUmbraco/src/umbraco.Linq/Core.Tests/ParentTest.cs deleted file mode 100644 index 1ba91e413b..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/Core.Tests/ParentTest.cs +++ /dev/null @@ -1,109 +0,0 @@ -using System; -using System.Text; -using System.Collections.Generic; -using System.Linq; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using TypeMock.ArrangeActAssert; -using umbraco.Test; - -namespace umbraco.Linq.Core.Tests -{ - /// - /// Summary description for ParentTest - /// - [TestClass, DeploymentItem("umbraco.config")] - public class ParentTest - { - public ParentTest() - { - } - - private TestContext testContextInstance; - - /// - ///Gets or sets the test context which provides - ///information about and functionality for the current test run. - /// - public TestContext TestContext - { - get - { - return testContextInstance; - } - set - { - testContextInstance = value; - } - } - - #region Additional test attributes - // - // You can use the following additional attributes as you write your tests: - // - // Use ClassInitialize to run code before running the first test in the class - // [ClassInitialize()] - // public static void MyClassInitialize(TestContext testContext) { } - // - // Use ClassCleanup to run code after all tests in a class have run - // [ClassCleanup()] - // public static void MyClassCleanup() { } - // - // Use TestInitialize to run code before running each test - // [TestInitialize()] - // public void MyTestInitialize() { } - // - // Use TestCleanup to run code after each test has run - // [TestCleanup()] - // public void MyTestCleanup() { } - // - #endregion - - [TestMethod, Isolated] - public void ParentTest_ParentIdExists() - { - MockHelpers.SetupFakeHttpContext(); - using (var ctx = new MyUmbracoDataContext()) - { - var p = ctx.CWSTextpages.First(); - Assert.AreNotEqual(0, p.ParentNodeId); - } - } - - [TestMethod, Isolated] - public void ParentTest_ParentCreated() - { - MockHelpers.SetupFakeHttpContext(); - using (var ctx = new MyUmbracoDataContext()) - { - var page = ctx.CWSTextpages.Single(p => p.Id == 1099); - - Assert.AreEqual(1098, page.ParentNodeId); - - var parent = page.Parent(); - - Assert.AreEqual(page.ParentNodeId, parent.Id); - } - } - - [TestMethod, Isolated] - public void ParentTest_TopParentNull() - { - MockHelpers.SetupFakeHttpContext(); - using (var ctx = new MyUmbracoDataContext()) - { - var hp = ctx.CWSHomes.First(); - Assert.IsNull(hp.Parent()); - } - } - - [TestMethod, Isolated, ExpectedException(typeof(DocTypeMissMatchException))] - public void ParentTest_InvalidParentType() - { - MockHelpers.SetupFakeHttpContext(); - using (var ctx = new MyUmbracoDataContext()) - { - var p = ctx.CWSPhotos.First().Parent(); - } - } - } -} diff --git a/src/LinqToUmbraco/src/umbraco.Linq/Core.Tests/Properties/AssemblyInfo.cs b/src/LinqToUmbraco/src/umbraco.Linq/Core.Tests/Properties/AssemblyInfo.cs deleted file mode 100644 index ad7442479a..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/Core.Tests/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System.Reflection; - -// 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("Core")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyProduct("Core")] \ No newline at end of file diff --git a/src/LinqToUmbraco/src/umbraco.Linq/Core.Tests/SelectTest.cs b/src/LinqToUmbraco/src/umbraco.Linq/Core.Tests/SelectTest.cs deleted file mode 100644 index 00893a9dc1..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/Core.Tests/SelectTest.cs +++ /dev/null @@ -1,179 +0,0 @@ -using System; -using System.Text; -using System.Collections.Generic; -using System.Linq; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using umbraco.Test; -using TypeMock.ArrangeActAssert; - -namespace umbraco.Linq.Core.Tests -{ - /// - /// Summary description for SelectTest - /// - [TestClass, DeploymentItem("umbraco.config")] - public class SelectTest - { - public SelectTest() - { - // - // TODO: Add constructor logic here - // - } - - private TestContext testContextInstance; - - /// - ///Gets or sets the test context which provides - ///information about and functionality for the current test run. - /// - public TestContext TestContext - { - get - { - return testContextInstance; - } - set - { - testContextInstance = value; - } - } - - #region Additional test attributes - // - // You can use the following additional attributes as you write your tests: - // - // Use ClassInitialize to run code before running the first test in the class - // [ClassInitialize()] - // public static void MyClassInitialize(TestContext testContext) { } - // - // Use ClassCleanup to run code after all tests in a class have run - // [ClassCleanup()] - // public static void MyClassCleanup() { } - // - // Use TestInitialize to run code before running each test - // [TestInitialize()] - // public void MyTestInitialize() { } - // - // Use TestCleanup to run code after each test has run - // [TestCleanup()] - // public void MyTestCleanup() { } - // - #endregion - - [TestMethod, Isolated] - public void SelectTest_LoopTree_Query() - { - MockHelpers.SetupFakeHttpContext(); - - using (var ctx = new MyUmbracoDataContext()) - { - var homePages = from hp in ctx.CWSHomes - select hp; - - Assert.IsNotNull(homePages); - foreach (var item in homePages) - { - Assert.IsTrue(item.BodyText.Length > 0); - } - } - } - - [TestMethod, Isolated] - public void SelectTest_LoopTree_Lambda() - { - MockHelpers.SetupFakeHttpContext(); - - using (var ctx = new MyUmbracoDataContext()) - { - var homePages = ctx.CWSHomes; - - Assert.IsNotNull(homePages); - foreach (CWSHome item in homePages) - { - Assert.IsTrue(item.BodyText.Length > 0); - } - } - } - - [TestMethod, Isolated] - public void SelectTest_SingleProperty_Query() - { - MockHelpers.SetupFakeHttpContext(); - - using (var ctx = new MyUmbracoDataContext()) - { - var homePageText = from hp in ctx.CWSHomes - select hp.BodyText; - - Assert.IsNotNull(homePageText); - foreach (var item in homePageText) - { - Assert.IsNotNull(item); - } - } - } - - [TestMethod, Isolated] - public void SelectTest_SingleProperty_Lambda() - { - MockHelpers.SetupFakeHttpContext(); - - using (var ctx = new MyUmbracoDataContext()) - { - var homePageText = ctx.CWSHomes.Select(hp => hp.BodyText); - - Assert.IsNotNull(homePageText); - foreach (var item in homePageText) - { - Assert.IsNotNull(item); - } - } - } - - [TestMethod, Isolated] - public void SelectTest_Anonymous_Query() - { - MockHelpers.SetupFakeHttpContext(); - - using (var ctx = new MyUmbracoDataContext()) - { - var anon = from hp in ctx.CWSHomes - select new - { - hp.BodyText, - CreatedDate = hp.CreateDate - }; - - Assert.IsNotNull(anon); - foreach (var item in anon) - { - Assert.IsNotNull(item.BodyText); - Assert.AreNotEqual(DateTime.MinValue, item.CreatedDate); - } - } - } - - [TestMethod, Isolated] - public void SelectTest_Anonymous_Lambda() - { - MockHelpers.SetupFakeHttpContext(); - - using (var ctx = new MyUmbracoDataContext()) - { - var anon = ctx.CWSHomes.Select(hp => new - { - hp.BodyText, - CreatedDate = hp.CreateDate - }); - - Assert.IsNotNull(anon); - foreach (var item in anon) - { - Assert.IsNotNull(item.BodyText); - Assert.AreNotEqual(DateTime.MinValue, item.CreatedDate); - } - } - } - } -} diff --git a/src/LinqToUmbraco/src/umbraco.Linq/Core.Tests/WhereTest.cs b/src/LinqToUmbraco/src/umbraco.Linq/Core.Tests/WhereTest.cs deleted file mode 100644 index 1f8c605319..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/Core.Tests/WhereTest.cs +++ /dev/null @@ -1,130 +0,0 @@ -using System; -using System.Text; -using System.Collections.Generic; -using System.Linq; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using TypeMock.ArrangeActAssert; -using umbraco.Test; - -namespace umbraco.Linq.Core.Tests -{ - /// - /// Summary description for WhereTest - /// - [TestClass, DeploymentItem("umbraco.config")] - public class WhereTest - { - public WhereTest() - { - // - // TODO: Add constructor logic here - // - } - - private TestContext testContextInstance; - - /// - ///Gets or sets the test context which provides - ///information about and functionality for the current test run. - /// - public TestContext TestContext - { - get - { - return testContextInstance; - } - set - { - testContextInstance = value; - } - } - - #region Additional test attributes - // - // You can use the following additional attributes as you write your tests: - // - // Use ClassInitialize to run code before running the first test in the class - // [ClassInitialize()] - // public static void MyClassInitialize(TestContext testContext) { } - // - // Use ClassCleanup to run code after all tests in a class have run - // [ClassCleanup()] - // public static void MyClassCleanup() { } - // - // Use TestInitialize to run code before running each test - // [TestInitialize()] - // public void MyTestInitialize() { } - // - // Use TestCleanup to run code after each test has run - // [TestCleanup()] - // public void MyTestCleanup() { } - // - #endregion - - [TestMethod, Isolated] - public void WhereTest_SingleParameter_Query() - { - MockHelpers.SetupFakeHttpContext(); - - using (var ctx = new MyUmbracoDataContext()) - { - var pages = from page in ctx.CWSTextpages - where page.BodyText.Length > 0 - select page; - - Assert.IsNotNull(pages); - Assert.IsTrue(pages.Count() > 0); - } - } - - [TestMethod, Isolated] - public void WhereTest_DateTimeGreaterThan_Query() - { - MockHelpers.SetupFakeHttpContext(); - - using (var ctx = new MyUmbracoDataContext()) - { - var pages = from page in ctx.CWSTextpages - where page.CreateDate > DateTime.MinValue - select page; - - Assert.IsNotNull(pages); - Assert.IsTrue(pages.Count() > 0); - } - } - - [TestMethod, Isolated] - public void WhereTest_TwoParameter_Query() - { - MockHelpers.SetupFakeHttpContext(); - using (var ctx = new MyUmbracoDataContext()) - { - var pages = from page in ctx.CWSTextpages - where page.BodyText.Length > 0 - && page.CreateDate > DateTime.MinValue - select page; - - Assert.IsNotNull(pages); - Assert.IsTrue(pages.Count() > 0); - } - } - - [TestMethod, Isolated] - public void WhereTest_ToAnonymous() - { - MockHelpers.SetupFakeHttpContext(); - using (var ctx = new MyUmbracoDataContext()) - { - var pages = from page in ctx.CWSTextpages - where page.BodyText.Length > 0 - select new - { - page.Id, - page.BodyText - }; - - Assert.AreNotEqual(0, pages.Count()); - } - } - } -} diff --git a/src/LinqToUmbraco/src/umbraco.Linq/Core/AssociationTree.cs b/src/LinqToUmbraco/src/umbraco.Linq/Core/AssociationTree.cs deleted file mode 100644 index de9f54cbec..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/Core/AssociationTree.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace umbraco.Linq.Core -{ - /// - /// Represents the child items of TDocTypeBase - /// - /// - /// This is used for creating a DataProvider specific child item collection of a DocType instance. - /// - /// It allows a DocType to have strongly typed child associations, and accessors such as: - /// - /// myDocType.SomeChildTypes - /// - /// - /// The type of the DocTypeBase which this association represents. - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix")] - public abstract class AssociationTree : Tree where TDocTypeBase : DocTypeBase, new() - { - /// - /// Gets or sets the parent node id which this AssociationTree is for - /// - /// The parent node id. - public int ParentNodeId { get; protected set; } - } -} diff --git a/src/LinqToUmbraco/src/umbraco.Linq/Core/Attributes.cs b/src/LinqToUmbraco/src/umbraco.Linq/Core/Attributes.cs deleted file mode 100644 index 8db47e610a..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/Core/Attributes.cs +++ /dev/null @@ -1,85 +0,0 @@ -using System; - -namespace umbraco.Linq.Core -{ - /// - /// Standard umbraco info - /// - [global::System.AttributeUsage(AttributeTargets.Property | AttributeTargets.Class | AttributeTargets.Interface, Inherited = true, AllowMultiple = false)] - public sealed class UmbracoInfoAttribute : Attribute - { - /// - /// Initializes a new instance of the class. - /// - /// The alias for this piece of umbraco info. - public UmbracoInfoAttribute(string alias) - { - this.Alias = alias; - } - - /// - /// Gets or sets the display name of the item. - /// - /// The display name. - public string DisplayName { get; set; } - /// - /// Gets or sets the alias. - /// - /// The alias. - public string Alias { get; private set; } - /// - /// Gets or sets a value indicating whether this property is mandatory. - /// - /// true if mandatory; otherwise, false. - public bool Mandatory { get; set; } - - } - - /// - /// Marks a class as an umbraco DocType - /// - [global::System.AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface, Inherited = true, AllowMultiple = false)] - public sealed class DocTypeAttribute : Attribute - { - /// - /// Initializes a new instance of the class. - /// - public DocTypeAttribute() - { - } - } - - /// - /// Marks a property as a standard umbraco field - /// - /// - /// Example usage: - /// - ID - /// - ParentID - /// - CreateDate - /// - [global::System.AttributeUsage(AttributeTargets.Property, Inherited = true, AllowMultiple = false)] - public sealed class FieldAttribute : Attribute - { - /// - /// Initializes a new instance of the class. - /// - public FieldAttribute() - { - } - } - - /// - /// Marks a property as a custom umbraco DocType property - /// - [global::System.AttributeUsage(AttributeTargets.Property, Inherited = true, AllowMultiple = false)] - public sealed class PropertyAttribute : Attribute - { - /// - /// Initializes a new instance of the class. - /// - public PropertyAttribute() - { - } - } -} diff --git a/src/LinqToUmbraco/src/umbraco.Linq/Core/CoreClasses.cd b/src/LinqToUmbraco/src/umbraco.Linq/Core/CoreClasses.cd deleted file mode 100644 index f7eb2f6826..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/Core/CoreClasses.cd +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAA= - AssociationTree.cs - - - - - - - - - - MAASJAACAQCEAAAgAACUYAQBgACAAAAhEAIBAAEEAYI= - DocTypeBase.cs - - - - - - - - - - AAAQAAAAAAAEABAQAAAAAAAAAAAAAAAEAAAAAAAAAAA= - Tree.cs - - - - - - - - - - AAAAAAAAACAEAAAAAAAAAABAAAAAAAAAAAAACACAAAA= - UmbracoDataContext.cs - - - - - - - - - - - AAAUABAAAAAEABAQAAAAAAAAAAAAAAAAAAAAAAAAAAA= - Node\NodeAssociationTree.cs - - - - - - - - - - IAAAiAAAACAUAAQAAAABCKQAAAAAAAAAAAACKAiAAAA= - Node\NodeDataProvider.cs - - - - - - - - - - AAASABAAAAAEABAQAAAAAAAAAAAAAAAAAAAAAAAAAAA= - Node\NodeTree.cs - - - - - - AAAAgAAAACAAAAQAAAABAAQAAAAAAAAAAAAAAACAAAA= - UmbracoDataProvider.cs - - - - - - - AAAQAAAAAAAEAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAA= - ITree.cs - - - - \ No newline at end of file diff --git a/src/LinqToUmbraco/src/umbraco.Linq/Core/DocTypeBase.cs b/src/LinqToUmbraco/src/umbraco.Linq/Core/DocTypeBase.cs deleted file mode 100644 index e07b945e74..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/Core/DocTypeBase.cs +++ /dev/null @@ -1,442 +0,0 @@ -using System; -using System.ComponentModel; -using System.Linq; -using System.Runtime.Serialization; -using umbraco.BusinessLogic; -using System.Collections.Generic; -using System.Text.RegularExpressions; - -namespace umbraco.Linq.Core -{ - /// - /// Provides the base framework for an umbraco item - /// - [DataContract] - public class DocTypeBase : IDocTypeBase //This class should be abstract but it can't be done AND achieve the Children property like this - { - #region Internal Storage - private int _Id; - private string _nodeName; - private string _versionId; - private int _templateId; - private int _parentId; - private int writerID; - private User _writer; - private int creatorID; - private User _creator; - private string _path; - private IEnumerable _ancestors; - private AssociationTree _children; - #endregion - - /// - /// Initializes a new instance of the class. - /// - public DocTypeBase() - { - this.IsDirty = true; - } - - /// - /// Gets or sets the provider. - /// - /// The provider. - protected internal UmbracoDataProvider Provider { get; set; } - - /// - /// Gets or sets a value indicating whether this instance has been modified since it was first loaded - /// - /// true if this instance has been modified; otherwise, false. - public bool IsDirty { get; protected internal set; } - - #region Fields - /// - /// Gets or sets the id of the umbraco item - /// - /// The id. - [Field] - [UmbracoInfo("id", DisplayName = "Id", Mandatory = true), DataMember(Name = "Id")] - public virtual int Id - { - get - { - return this._Id; - } - protected internal set - { - if (this._Id != value) - { - this.RaisePropertyChanging(); - this._Id = value; - this.RaisePropertyChanged("Id"); - } - } - } - - /// - /// Gets or sets the name (title) of the umbraco item - /// - /// The name. - [Field] - [UmbracoInfo("nodeName", DisplayName = "NodeName", Mandatory = true), DataMember(Name = "NodeName")] - public virtual string NodeName - { - get - { - return this._nodeName; - } - set - { - if (this._nodeName != value) - { - this.RaisePropertyChanging(); - this._nodeName = value; - this.IsDirty = true; - this.RaisePropertyChanged("NodeName"); - } - } - } - - [Field] - [Obsolete("Name property is obsolete, use NodeName instead")] //this is because most people expect NodeName not Name as the property - public virtual string Name - { - get - { - return this.NodeName; - } - set - { - this.NodeName = value; - } - } - - /// - /// Gets or sets the template ID of the umbraco item - /// - /// The name. - [Field] - [UmbracoInfo("template", DisplayName = "Template", Mandatory = true), DataMember(Name = "TemplateId")] - public virtual int TemplateId - { - get - { - return this._templateId; - } - set - { - if (this._templateId != value) - { - this.RaisePropertyChanging(); - this._templateId = value; - this.IsDirty = true; - this.RaisePropertyChanged("Template"); - } - } - } - - /// - /// Gets or sets the version of the umbraco item - /// - /// The version. - [Field] - [UmbracoInfo("version", DisplayName = "Version", Mandatory = true), DataMember(Name = "Version")] - public virtual string Version - { - get - { - return this._versionId; - } - protected internal set - { - if (this._versionId != value) - { - this.RaisePropertyChanging(); - this._versionId = value; - this.RaisePropertyChanged("Version"); - } - } - } - - /// - /// Gets or sets the ID of the parent node. - /// - /// The parent node id. - [Field] - [UmbracoInfo("parentID", DisplayName = "ParentId", Mandatory = true), DataMember(Name = "ParentId")] - public virtual int ParentNodeId - { - get - { - return this._parentId; - } - set - { - if (this._parentId != value) - { - this.RaisePropertyChanging(); - this._parentId = value; - this.RaisePropertyChanged("ParentId"); - } - } - } - - /// - /// Gets or sets the created date. - /// - /// The create date. - [Field] - [UmbracoInfo("createDate", DisplayName = "CreateDate"), DataMember(Name = "CreateDate")] - public virtual DateTime CreateDate { get; set; } - - /// - /// Gets or sets the sort order. - /// - /// The sort order. - [Field] - [UmbracoInfo("sortOrder", DisplayName = "SortOrder"), DataMember(Name = "SortOrder")] - public virtual int SortOrder { get; set; } - - /// - /// Gets or sets the last updated date of the current version - /// - /// The update date. - [Field] - [UmbracoInfo("updateDate", DisplayName = "UpdateDate"), DataMember(Name = "UpdateDate")] - public virtual DateTime UpdateDate { get; set; } - - /// - /// Gets or sets the level of this item in the content tree - /// - /// The level. - [Field] - [UmbracoInfo("level", DisplayName = "Level"), DataMember(Name = "Level")] - public virtual int Level { get; set; } - - /// - /// Gets or sets the path. - /// - /// The path. - [Field] - [UmbracoInfo("path", DisplayName = "Path")] - [DataMember(Name = "Path")] - public virtual string Path - { - get - { - return this._path; - } - set - { - if (this._path != value) - { - this.RaisePropertyChanging(); - this._path = value; - this.RaisePropertyChanged("Path"); - } - } - } - #endregion - - #region Parents and Children - /// - /// Gets the children of this DocType instance. - /// - /// The children of this DocType instance. - public AssociationTree Children - { - get - { - if (this._children == null) - { - this._children = this.Provider.LoadAssociation(this.Id); //tell the provider to create it - } - - return this._children; - } - } - - /// - /// Gets the children which are of the type TDocTypeBase. - /// - /// The DocType of the children desired. - /// An of the children - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter")] - protected AssociationTree ChildrenOfType() where TDocTypeBase : DocTypeBase, new() - { - return this.Provider.LoadAssociation(this.Children.Where(d => d is TDocTypeBase).Cast()); - } - - /// - /// Parent this instance. - /// - /// The type of the parent. - /// Null when at the root level, else the parent instance - /// If the type of the parent does not match the provided type - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter")] - public virtual TParent Parent() where TParent : DocTypeBase, new() - { - if (this._parentId == -1) - { - return null; - } - - return this.Provider.Load(this._parentId); - } - - /// - /// Retrieves the first matching ancestor of the current type - /// - /// - /// Provides similar functionality to the XPath method - /// - /// First ancestor matching type. Null if no match found - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter")] - public TDocType AncestorOrDefault() where TDocType : DocTypeBase - { - return this.AncestorOrDefault(t => true); //just a simple little true statement ;) - } - - /// - /// Retrieves the first matching ancestor of the current type and additional boolean function - /// - /// The type of the doc type. - /// Additional boolean operation to filter on - /// First ancestor matching type and function. Null if no match found - /// Func parameter required - public TDocType AncestorOrDefault(Func func) where TDocType : DocTypeBase - { - if (func == null) - { - throw new ArgumentNullException("func"); - } - - if (this._ancestors == null) - { - this._ancestors = this.Provider.LoadAncestors(this.Id); - } - - return this._ancestors.Where(a => a is TDocType).Cast().FirstOrDefault(func); - } - #endregion - - /// - /// Gets or sets the creator ID. - /// - /// The creator ID. - public int CreatorID - { - get - { - return creatorID; - } - internal set - { - this.creatorID = value; - } - } - /// - /// Gets the umbraco user who created the item - /// - /// The creator. - public virtual User Creator - { - get - { - if (this._creator == null) - { - this._creator = new User(this.CreatorID); - } - - return this._creator; - } - } - - public virtual string CreatorName { get; internal set; } - - /// - /// ID of the user who last edited the item - /// - public int WriterID - { - get - { - return writerID; - } - internal set - { - this.writerID = value; - } - } - /// - /// Gets the umbraco user who last edited the instance - /// - /// The writer. - public virtual User Writer - { - get - { - if (this._writer == null) - { - this._writer = new User(this.WriterID); - } - - return this._writer; - } - } - - public virtual string WriterName { get; internal set; } - - /// - /// Raises the property changing event. - /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1030:UseEventsWhereAppropriate")] - protected virtual void RaisePropertyChanging() - { - if (this.PropertyChanging != null) - { - this.PropertyChanging(this, new PropertyChangingEventArgs(String.Empty)); - } - } - - /// - /// Raises the property changed event. - /// - /// The name of the changed property. - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1030:UseEventsWhereAppropriate")] - protected virtual void RaisePropertyChanged(string name) - { - if (this.PropertyChanged != null) - { - this.PropertyChanged(this, new PropertyChangedEventArgs(name)); - } - } - - #region INotifyPropertyChanging Members - - /// - /// Occurs when a property value is changing. - /// - public event PropertyChangingEventHandler PropertyChanging; - - #endregion - - #region INotifyPropertyChanged Members - - /// - /// Occurs when a property value changes. - /// - public event PropertyChangedEventHandler PropertyChanged; - - #endregion - - protected void ValidateProperty(string regex, string value) - { - Regex r = new Regex(regex); - if (!r.IsMatch(value)) - { - throw new InvalidCastException("Value does not match validation expression from Umbraco"); - } - } - } -} diff --git a/src/LinqToUmbraco/src/umbraco.Linq/Core/Exceptions.cs b/src/LinqToUmbraco/src/umbraco.Linq/Core/Exceptions.cs deleted file mode 100644 index 5d83367cff..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/Core/Exceptions.cs +++ /dev/null @@ -1,128 +0,0 @@ -using System; - -namespace umbraco.Linq.Core -{ - /// - /// Exception for when the provided class does not meet the expected class - /// - [global::System.Serializable] - public class DocTypeMissMatchException : ArgumentException - { - /// - /// Initializes a new instance of the class. - /// - /// The actual doc type alias. - /// The expcected doc type alias. - public DocTypeMissMatchException(string actual, string expected) : this(actual, expected, string.Empty) { } - /// - /// Initializes a new instance of the class. - /// - /// The actual doc type alias. - /// The expcected doc type alias. - /// Additional message information. - public DocTypeMissMatchException(string actual, string expected, string message) - : base(string.Format("DocTypeAlias provided did not match what was expected (provided: {0}, expected: {1}){2}{3}", actual, expected, Environment.NewLine, message)) - { - Expected = expected; - Actual = actual; - } - /// - /// Initializes a new instance of the class. - /// - /// The actual doc type alias. - /// The expcected doc type alias. - /// Additional message information. - /// The inner exception. - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.String.Format(System.String,System.Object[])")] - public DocTypeMissMatchException(string actual, string expected, string message, Exception innerException) - : base(string.Format("DocTypeAlias provided did not match what was expected (provided: {0}, expected: {1}){2}{3}", actual, expected, Environment.NewLine, message), innerException) - { - Expected = expected; - Actual = actual; - } - - /// - /// Initializes a new instance of the class. - /// - /// 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). - /// - protected DocTypeMissMatchException( - System.Runtime.Serialization.SerializationInfo info, - System.Runtime.Serialization.StreamingContext context) - : base(info, context) { } - - /// - /// Gets or sets the expected DocTypeAlias - /// - /// The expected DocTypeAlias. - public string Expected { get; set; } - /// - /// Gets or sets the actual DocTypeAlias - /// - /// The actual DocTypeAlias. - public string Actual { get; set; } - } - - /// - /// Exception raised when a field isn't meeting its mandatory requirement - /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors"), global::System.Serializable] - public class MandatoryFailureException : Exception - { - /// - /// Initializes a new instance of the class. - /// - /// Name of the property that failed the mandatory check. - public MandatoryFailureException(string propertyName) : this(propertyName, string.Empty) { } - /// - /// Initializes a new instance of the class. - /// - /// Name of the property that failed the mandatory check. - /// Additional message information. - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.String.Format(System.String,System.Object,System.Object,System.Object)")] - public MandatoryFailureException(string propertyName, string message) - : base(string.Format("The mandatory property \"{0}\" did not have a value.{1}{2}", propertyName, Environment.NewLine, message)) - { - PropertyName = propertyName; - } - /// - /// Initializes a new instance of the class. - /// - /// Name of the property that failed the mandatory check. - /// Additional message information. - /// The inner exception. - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.String.Format(System.String,System.Object,System.Object,System.Object)")] - public MandatoryFailureException(string propertyName, string message, Exception innerException) - : base(string.Format("The mandatory property \"{0}\" did not have a value.{1}{2}", propertyName, Environment.NewLine, message), innerException) - { - PropertyName = propertyName; - } - /// - /// Initializes a new instance of the class. - /// - /// 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). - /// - protected MandatoryFailureException( - System.Runtime.Serialization.SerializationInfo info, - System.Runtime.Serialization.StreamingContext context) - : base(info, context) { } - - /// - /// Gets or sets the name of the property the exception was raised for. - /// - /// The name of the property. - public string PropertyName { get; set; } - } -} diff --git a/src/LinqToUmbraco/src/umbraco.Linq/Core/GlobalSuppressions.cs b/src/LinqToUmbraco/src/umbraco.Linq/Core/GlobalSuppressions.cs deleted file mode 100644 index 6add7f8300..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/Core/GlobalSuppressions.cs +++ /dev/null @@ -1,26 +0,0 @@ -// This file is used by Code Analysis to maintain SuppressMessage -// attributes that are applied to this project. -// Project-level suppressions either have no target or are given -// a specific target and scoped to a namespace, type, member, etc. -// -// To add a suppression to this file, right-click the message in the -// Error List, point to "Suppress Message(s)", and click -// "In Project Suppression File". -// You do not need to add suppressions to this file manually. - -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "umbraco", Scope = "namespace", Target = "umbraco.Linq.Core")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "umbraco.Linq.Core.Node")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "umbraco", Scope = "namespace", Target = "umbraco.Linq.Core.Node")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "umbraco")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors", Scope = "type", Target = "umbraco.Linq.Core.DocTypeMissMatchException")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.String.Format(System.String,System.Object[])", Scope = "member", Target = "umbraco.Linq.Core.DocTypeMissMatchException.#.ctor(System.String,System.String,System.String)")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "umbraco", Scope = "member", Target = "umbraco.Linq.Core.ReflectionAssistance.#GetumbracoInfoAttribute(System.Type)")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "umbraco", Scope = "type", Target = "umbraco.Linq.Core.umbracoDataContext")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "umbraco", Scope = "type", Target = "umbraco.Linq.Core.umbracoDataProvider")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Scope = "member", Target = "umbraco.Linq.Core.umbracoDataProvider.#Load`1(System.Int32)")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Scope = "member", Target = "umbraco.Linq.Core.umbracoDataProvider.#LoadTree`1()")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "umbraco", Scope = "type", Target = "umbraco.Linq.Core.umbracoInfoAttribute")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Scope = "type", Target = "umbraco.Linq.Core.Node.NodeAssociationTree`1")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Scope = "member", Target = "umbraco.Linq.Core.Node.NodeDataProvider.#LoadTree`1()")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Scope = "type", Target = "umbraco.Linq.Core.Node.NodeTree`1")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Scope = "member", Target = "umbraco.Linq.Core.Node.NodeDataProvider.#Load`1(System.Int32)")] diff --git a/src/LinqToUmbraco/src/umbraco.Linq/Core/IContentTree.cs b/src/LinqToUmbraco/src/umbraco.Linq/Core/IContentTree.cs deleted file mode 100644 index eec2fee111..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/Core/IContentTree.cs +++ /dev/null @@ -1,27 +0,0 @@ - -namespace umbraco.Linq.Core -{ - /// - /// Base of an umbraco content tree - /// - public interface IContentTree - { - /// - /// Gets the Provider associated with this instance - /// - /// The provider. - UmbracoDataProvider Provider { get; } - /// - /// Gets a value indicating whether this instance is read only. - /// - /// - /// true if this instance is read only; otherwise, false. - /// - bool IsReadOnly { get; } - - /// - /// Reloads the cache for the particular tree - /// - void ReloadCache(); - } -} diff --git a/src/LinqToUmbraco/src/umbraco.Linq/Core/IDocTypeBase.cs b/src/LinqToUmbraco/src/umbraco.Linq/Core/IDocTypeBase.cs deleted file mode 100644 index 56701a65c4..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/Core/IDocTypeBase.cs +++ /dev/null @@ -1,116 +0,0 @@ -using System; -using System.ComponentModel; -namespace umbraco.Linq.Core -{ - /// - /// - /// - public interface IDocTypeBase : INotifyPropertyChanging, INotifyPropertyChanged - { - /// - /// Gets the Ancestor or Default based on type - /// - /// The type of the Ancestor. - /// - TDocType AncestorOrDefault() where TDocType : DocTypeBase; - /// - /// Gets the Ancestor or Default based on type - /// - /// The type of the Ancestor. - /// The func. - /// - TDocType AncestorOrDefault(Func func) where TDocType : DocTypeBase; - /// - /// Gets the children. - /// - /// The children. - AssociationTree Children { get; } - /// - /// Gets or sets the create date. - /// - /// The create date. - DateTime CreateDate { get; set; } - /// - /// Gets the creator user ID. - /// - /// The creator ID. - int CreatorID { get; } - /// - /// Gets the name of the creator. - /// - /// The name of the creator. - string CreatorName { get; } - /// - /// Gets the id of the item. - /// - /// The id. - int Id { get; } - /// - /// Gets a value indicating whether this instance is dirty. - /// - /// true if this instance is dirty; otherwise, false. - bool IsDirty { get; } - /// - /// Gets or sets the level of the item - /// - /// The level. - int Level { get; set; } - /// - /// Gets or sets the name. - /// - /// The name. - string NodeName { get; set; } - /// - /// Gets or sets the name. - /// - /// The name. - [Obsolete("Name property is obsolete, use NodeName instead")] //this is because most people expect NodeName not Name as the property - string Name { get; set; } - /// - /// Parent if current instance - /// - /// The type of the parent. - /// - TParent Parent() where TParent : DocTypeBase, new(); - /// - /// Gets or sets the parent node id. - /// - /// The parent node id. - int ParentNodeId { get; set; } - /// - /// Gets or sets the sort order. - /// - /// The sort order. - int SortOrder { get; set; } - /// - /// Gets or sets the template id. - /// - /// The template id. - int TemplateId { get; set; } - /// - /// Gets or sets the update date. - /// - /// The update date. - DateTime UpdateDate { get; set; } - /// - /// Gets the version. - /// - /// The version. - string Version { get; } - /// - /// Gets the writer user ID. - /// - /// The writer ID. - int WriterID { get; } - /// - /// Gets the name of the writer. - /// - /// The name of the writer. - string WriterName { get; } - /// - /// Gets or sets the path. - /// - /// The path. - string Path { get; set; } - } -} diff --git a/src/LinqToUmbraco/src/umbraco.Linq/Core/IUmbracoDataContext.cs b/src/LinqToUmbraco/src/umbraco.Linq/Core/IUmbracoDataContext.cs deleted file mode 100644 index 7f68ccff31..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/Core/IUmbracoDataContext.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -namespace umbraco.Linq.Core -{ - /// - /// Abstraction of the UmbracoDataContext - /// - public interface IUmbracoDataContext : IDisposable - { - /// - /// Gets the data provider. - /// - /// The data provider. - UmbracoDataProvider DataProvider { get; } - - /// - /// Submits the changes tracked in this data context - /// - void SubmitChanges(); - } -} diff --git a/src/LinqToUmbraco/src/umbraco.Linq/Core/Node/NodeAssociationTree.cs b/src/LinqToUmbraco/src/umbraco.Linq/Core/Node/NodeAssociationTree.cs deleted file mode 100644 index 30ecdd60cd..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/Core/Node/NodeAssociationTree.cs +++ /dev/null @@ -1,115 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -namespace umbraco.Linq.Core.Node -{ - /// - /// Represents a collection of TDocTypeBase retrieved from the umbraco XML cache which are direct children of a node - /// - /// The type of the doc type base. - public sealed class NodeAssociationTree : AssociationTree where TDocTypeBase : DocTypeBase, new() - { - private object lockObject = new object(); - private IEnumerable _nodes; - - internal NodeAssociationTree(IEnumerable nodes) - { - this._nodes = new List(); - this._nodes = nodes; - } - - /// - /// Initializes a new instance of the class for a particular tree section - /// - /// The parent node id to start from. - /// The NodeDataProvider to link the tree with. - public NodeAssociationTree(int parentNodeId, NodeDataProvider provider) - { - this.Provider = provider; - this.ParentNodeId = parentNodeId; - } - - /// - /// Gets the enumerator for this Tree collection - /// - /// - public override IEnumerator GetEnumerator() - { - if (this._nodes == null) //first access, otherwise it'd be cached - { - LoadNodes(); - } - return this._nodes.GetEnumerator(); - } - - private void LoadNodes() - { - var provider = this.Provider as NodeDataProvider; - - provider.CheckDisposed(); - - lock (lockObject) - { - var parents = provider - .Xml - .Descendants() - .Where(x => x.Attribute("id") != null && (int)x.Attribute("id") == this.ParentNodeId); - var rawNodes = parents - .Single() - .Elements() - .Where(x => x.Attribute("isDoc") != null) - ; - this._nodes = provider.DynamicNodeCreation(rawNodes).Cast(); //drop is back to the type which was asked for - } - } - - /// - /// Indicates that the NodeAssociationTree is ReadOnly - /// - /// - /// true - /// - public override bool IsReadOnly - { - get - { - return true; - } - } - - /// - /// Gets or sets the DataProvider associated with this Tree - /// - /// The provider. - public override UmbracoDataProvider Provider { get; protected set; } - - /// - /// Reloads the cache. - /// - public override void ReloadCache() - { - this.LoadNodes(); - } - - public override void InsertOnSubmit(TDocTypeBase item) - { - throw new NotImplementedException("The NodeAssociationTree does not support Inserting items"); - } - - public override void InsertAllOnSubmit(IEnumerable items) - { - throw new NotImplementedException("The NodeAssociationTree does not support Inserting items"); - } - - public override void DeleteOnSubmit(TDocTypeBase itemm) - { - throw new NotImplementedException("The NodeAssociationTree does not support Deleting items"); - } - - public override void DeleteAllOnSubmit(IEnumerable items) - { - throw new NotImplementedException("The NodeAssociationTree does not support Deleting items"); - } - } -} diff --git a/src/LinqToUmbraco/src/umbraco.Linq/Core/Node/NodeDataProvider.cs b/src/LinqToUmbraco/src/umbraco.Linq/Core/Node/NodeDataProvider.cs deleted file mode 100644 index c372c56f95..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/Core/Node/NodeDataProvider.cs +++ /dev/null @@ -1,395 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.IO; -using System.Xml.Linq; -using System.Reflection; -using umbraco.presentation; -using umbraco.cms.helpers; -using umbraco.BusinessLogic.Utils; - -namespace umbraco.Linq.Core.Node -{ - /// - /// Data Provider for LINQ to umbraco via umbraco ndoes - /// - /// - /// This class provides a data access model for the umbraco XML cache. - /// It is responsible for the access to the XML and construction of nodes from it. - /// The is capable of reading the XML cache from either the path provided in the umbraco settings or from a specified location on the file system. - /// - public sealed class NodeDataProvider : UmbracoDataProvider - { - private object lockObject = new object(); - private string _xmlPath; - private Dictionary _trees; - private XDocument _xml; - private Dictionary _knownTypes; - - private bool _tryMemoryCache = false; - - internal XDocument Xml - { - get - { - if (this._xml == null) - { - if (this._tryMemoryCache) - { - var doc = UmbracoContext.Current.Server.ContentXml; - if (doc != null) - { - this._xml = doc; - } - else - { - this._xml = XDocument.Load(this._xmlPath); - } - } - else - { - this._xml = XDocument.Load(this._xmlPath); - } - } - - return this._xml; //cache the XML in memory to increase performance and force the disposable pattern - } - } - - /// - /// Initializes the NodeDataProvider, performing validation - /// - /// The XML path. - /// if set to true [new schema mode]. - protected void Init(string xmlPath, bool newSchemaMode) - { - if (!newSchemaMode) - throw new NotSupportedException(this.Name + " only supports the new XML schema. Change the umbracoSettings.config to implement this and republish"); - - if (string.IsNullOrEmpty(xmlPath)) - throw new ArgumentNullException("xmlPath"); - - if (!File.Exists(xmlPath)) - throw new FileNotFoundException("The XML used by the provider must exist", xmlPath); - - this._xmlPath = xmlPath; - this._trees = new Dictionary(); - } - - /// - /// Initializes a new instance of the class using umbraco settings as XML path - /// - public NodeDataProvider() - : this(UmbracoContext.Current.Server.MapPath(UmbracoContext.Current.Server.ContentXmlPath), UmbracoContext.Current.NewSchemaMode) - { - this._tryMemoryCache = true; - } - - /// - /// Initializes a new instance of the class - /// - /// The path of the umbraco XML - /// Indicates which Schema mode is used for the XML file - /// - /// This constructor is ideal for unit testing as it allows for the XML to be located anywhere - /// - public NodeDataProvider(string xmlPath, bool newSchemaMode) - { - this.Init(xmlPath, newSchemaMode); - } - - #region IDisposable Members - - /// - /// Releases unmanaged and - optionally - managed resources - /// - /// true to release both managed and unmanaged resources; false to release only unmanaged resources. - protected internal override void Dispose(bool disposing) - { - if (disposing) - { - this._xmlPath = null; - } - - base.Dispose(disposing); - } - - #endregion - - /// - /// Gets the name of the provider - /// - /// The name of the provider. - public override string Name - { - get - { - return "NodeDataProvider"; - } - } - - /// - /// Loads the tree with the relivent DocTypes from the XML - /// - /// The type of the DocType to load. - /// representation of the content tree - /// When the data provider has been disposed of - public override Tree LoadTree() - { - CheckDisposed(); - - var attr = ReflectionAssistance.GetUmbracoInfoAttribute(typeof(TDocType)); - - if (!this._trees.ContainsKey(attr)) - SetupNodeTree(attr); - - return (NodeTree)this._trees[attr]; - } - - internal void SetupNodeTree(UmbracoInfoAttribute attr) where TDocType : DocTypeBase, new() - { - var tree = new NodeTree(this); - if (!this._trees.ContainsKey(attr)) - { - lock (lockObject) - { - this._trees.Add(attr, tree); //cache so it's faster to get next time - } - } - else - { - this._trees[attr] = tree; - } - } - - /// - /// Loads the specified id. - /// - /// The type of the doc type. - /// The id. - /// - /// If the type of the parent does not match the provided type - /// No node found matching the provided ID for the parent - /// When the data provider has been disposed of - public override TDocType Load(int id) - { - CheckDisposed(); - - var parentXml = this.Xml.Descendants().SingleOrDefault(d => d.Attribute("isDoc") != null && (int)d.Attribute("id") == id); - - if (!ReflectionAssistance.CompareByAlias(typeof(TDocType), parentXml)) - throw new DocTypeMissMatchException(parentXml.Name.LocalName, ReflectionAssistance.GetUmbracoInfoAttribute(typeof(TDocType)).Alias); - - if (parentXml == null) //really shouldn't happen! - throw new ArgumentException("Parent ID \"" + id + "\" cannot be found in the loaded XML. Ensure that the umbracoDataContext is being disposed of once it is no longer needed"); - - var parent = new TDocType(); - this.LoadFromXml(parentXml, parent); - - return parent; - } - - /// - /// Loads the associated (children) nodes with the relivent DocTypes - /// - /// The parent node id. - /// - /// When the data provider has been disposed of - public override AssociationTree LoadAssociation(int parentNodeId) - { - CheckDisposed(); - - NodeAssociationTree associationTree = new NodeAssociationTree(parentNodeId, this); - - return associationTree; - } - - - /// - /// Loads the associated nodes with the relivent DocTypes - /// - /// The type of the DocType to load. - /// The nodes. - /// - /// When the data provider has been disposed of - public override AssociationTree LoadAssociation(IEnumerable nodes) - { - CheckDisposed(); - - return new NodeAssociationTree(nodes); - } - - /// - /// Loads the ancestors for a node - /// - /// The start node id. - /// - /// When the data provider has been disposed of - public override IEnumerable LoadAncestors(int startNodeId) - { - CheckDisposed(); - - var startElement = this.Xml.Descendants().Single(x => x.Attribute("isDoc") != null && (int)x.Attribute("id") == startNodeId); - var ancestorElements = startElement.Ancestors(); - - IEnumerable ancestors = DynamicNodeCreation(ancestorElements); - - return ancestors; - } - - /// - /// Creates a collection of nodes with the type specified from the XML - /// - /// The elements. - /// Collecton of .NET types from the XML - internal IEnumerable DynamicNodeCreation(IEnumerable elements) - { - // TODO: investigate this method for performance bottlenecks - // TODO: dataContext knows the types, maybe can load from there? - List ancestors = new List(); - - foreach (var ancestor in elements) - { - var alias = Casing.SafeAlias(ancestor.Name.LocalName); - var t = KnownTypes[alias]; - var instaceOfT = (DocTypeBase)Activator.CreateInstance(t); //create an instance of the type and down-cast so we can use it - this.LoadFromXml(ancestor, instaceOfT); - instaceOfT.Provider = this; - ancestors.Add(instaceOfT); - yield return instaceOfT; - } - } - - internal Dictionary KnownTypes - { - get - { - if (this._knownTypes == null) - { - this._knownTypes = new Dictionary(); - var types = TypeFinder - .FindClassesOfType() - .Where(t => t != typeof(DocTypeBase)) - .ToDictionary(k => - { - return ((UmbracoInfoAttribute)k.GetCustomAttributes(typeof(UmbracoInfoAttribute), true)[0]).Alias; - }); - - foreach (var type in types) - this._knownTypes.Add(Casing.SafeAlias(type.Key), type.Value); - - } - - return this._knownTypes; - } - } - - /// - /// Flushes the cache for this provider - /// - public void Flush() - { - this.CheckDisposed(); - - this._xml = null; - this._trees.Clear(); - } - - /// - /// Loads from XML. - /// - /// - /// The XML. - /// The node. - public void LoadFromXml(XElement xml, T node) where T : DocTypeBase - { - if (!ReflectionAssistance.CompareByAlias(node.GetType(), xml)) - { - throw new DocTypeMissMatchException(xml.Name.LocalName, ReflectionAssistance.GetUmbracoInfoAttribute(node.GetType()).Alias); - } - - node.Id = (int)xml.Attribute("id"); - node.ParentNodeId = (int)xml.Attribute("parentID"); - node.NodeName = (string)xml.Attribute("nodeName"); - node.Version = (string)xml.Attribute("version"); - node.CreateDate = (DateTime)xml.Attribute("createDate"); - node.SortOrder = (int)xml.Attribute("sortOrder"); - node.UpdateDate = (DateTime)xml.Attribute("updateDate"); - node.CreatorID = (int)xml.Attribute("creatorID"); - node.CreatorName = (string)xml.Attribute("creatorName"); - node.WriterID = (int)xml.Attribute("writerID"); - node.WriterName = (string)xml.Attribute("writerName"); - node.Level = (int)xml.Attribute("level"); - node.TemplateId = (int)xml.Attribute("template"); - - var properties = node.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(p => p.GetCustomAttributes(typeof(PropertyAttribute), true).Count() > 0); - foreach (var p in properties) - { - var attr = ReflectionAssistance.GetUmbracoInfoAttribute(p); - - XElement propertyXml = xml.Element(Casing.SafeAlias(attr.Alias)); - string data = null; - //if the XML doesn't contain the property it means that the node hasn't been re-published with the property - //so then we'll leave the data at null, otherwise let's grab it - //Check if the propertyXml and propertyXml.FirstNode aren't null. If they are we don't need to set the value. - if (propertyXml != null && propertyXml.FirstNode != null) - { - //If the FirstNode is an XElement it means the property contains inner xml and we should return it. Otherwise just return the normal value. - if (propertyXml.FirstNode is XElement) - { - var reader = propertyXml.CreateReader(); - reader.MoveToContent(); - data = reader.ReadInnerXml(); - } - else - { - data = propertyXml.Value; - } - } - - if (p.PropertyType.IsValueType && p.PropertyType.GetGenericArguments().Length > 0 && typeof(Nullable<>).IsAssignableFrom(p.PropertyType.GetGenericTypeDefinition())) - { - if (string.IsNullOrEmpty(data)) - { - //non-mandatory structs which have no value will be null - try - { - p.SetValue(node, null, null); - } - catch (FormatException ex) - { - throw new FormatException( - string.Format("Unable to cast '{0}' to the appropriate type ({1}) for node `{2}`. The alias of the property being parsed is {3}. Refer to inner exception for more details", data, p.PropertyType.FullName, node.Id, attr.Alias), ex); - } - } - else - { - //non-mandatory structs which do have a value have to be cast based on the type of their Nullable, found from the first (well, only) GenericArgument - try - { - p.SetValue(node, Convert.ChangeType(data, p.PropertyType.GetGenericArguments()[0]), null); - } - catch (FormatException ex) - { - throw new FormatException( - string.Format("Unable to cast '{0}' to the appropriate type ({1}) for node `{2}`. The alias of the property being parsed is {3}. Refer to inner exception for more details", data, p.PropertyType.FullName, node.Id, attr.Alias), ex); - } - } - } - else - { - // TODO: Address how Convert.ChangeType works in globalisation - try - { - p.SetValue(node, Convert.ChangeType(data, p.PropertyType), null); - } - catch (FormatException ex) - { - throw new FormatException( - string.Format("Unable to cast '{0}' to the appropriate type ({1}) for node `{2}`. The alias of the property being parsed is {3}. Refer to inner exception for more details", data, p.PropertyType.FullName, node.Id, attr.Alias), ex); - } - } - } - } - } -} diff --git a/src/LinqToUmbraco/src/umbraco.Linq/Core/Node/NodeTree.cs b/src/LinqToUmbraco/src/umbraco.Linq/Core/Node/NodeTree.cs deleted file mode 100644 index 8d4248ce53..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/Core/Node/NodeTree.cs +++ /dev/null @@ -1,119 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Xml.Linq; - -namespace umbraco.Linq.Core.Node -{ - /// - /// Represents a collection of TDocTypeBase retrieved from the umbraco XML cache - /// - /// The type of the doc type base. - public sealed class NodeTree : Tree where TDocTypeBase : DocTypeBase, new() - { - private object lockObject = new object(); - - private NodeDataProvider _provider; - - private List _nodes; - - internal NodeTree(NodeDataProvider provider) - { - this._provider = provider; - } - - /// - /// Gets or sets the provider. - /// - /// The provider. - public override UmbracoDataProvider Provider - { - get - { - return this._provider; - } - protected set - { - var nodeProvider = value as NodeDataProvider; - if (nodeProvider == null) - { - throw new ArgumentException("Value must be of type NodeDataProvider"); - } - this._provider = nodeProvider; - } - } - - /// - /// Indicates that the NodeTree is ReadOnly - /// - /// - /// true - /// - public override bool IsReadOnly - { - get - { - return true; - } - } - - /// - /// Gets the enumerator. - /// - /// - public override IEnumerator GetEnumerator() - { - if (this._nodes == null) - { - this._nodes = new List(); - var rawNodes = this._provider.Xml.Descendants().Where(x => ReflectionAssistance.CompareByAlias(typeof(TDocTypeBase), x)); - - lock (lockObject) - { - foreach (XElement n in rawNodes) - { - var dt = new TDocTypeBase(); - this._provider.LoadFromXml(n, dt); - - dt.IsDirty = false; - dt.Provider = this._provider; - - this._nodes.Add(dt); - } - } - } - return this._nodes.GetEnumerator(); - } - - /// - /// Reloads the cache for the particular NodeTree - /// - public override void ReloadCache() - { - this._provider.CheckDisposed(); - - var attr = ReflectionAssistance.GetUmbracoInfoAttribute(typeof(TDocTypeBase)); - this._provider.SetupNodeTree(attr); - } - - public override void InsertOnSubmit(TDocTypeBase item) - { - throw new NotImplementedException("The NodeTree does not support Inserting items"); - } - - public override void InsertAllOnSubmit(IEnumerable items) - { - throw new NotImplementedException("The NodeTree does not support Inserting items"); - } - - public override void DeleteOnSubmit(TDocTypeBase itemm) - { - throw new NotImplementedException("The NodeTree does not support Deleting items"); - } - - public override void DeleteAllOnSubmit(IEnumerable items) - { - throw new NotImplementedException("The NodeTree does not support Deleting items"); - } - } -} diff --git a/src/LinqToUmbraco/src/umbraco.Linq/Core/Properties/AssemblyInfo.cs b/src/LinqToUmbraco/src/umbraco.Linq/Core/Properties/AssemblyInfo.cs deleted file mode 100644 index 2e78b3fe48..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/Core/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// 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("Core")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyProduct("Core")] -[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("umbraco.Linq.Core.Tests")] -[assembly: ComVisible(false)] \ No newline at end of file diff --git a/src/LinqToUmbraco/src/umbraco.Linq/Core/ReflectionAssistance.cs b/src/LinqToUmbraco/src/umbraco.Linq/Core/ReflectionAssistance.cs deleted file mode 100644 index 56a50449db..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/Core/ReflectionAssistance.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System; -using System.Linq; -using System.Reflection; -using System.Xml.Linq; -using umbraco.cms.helpers; - -namespace umbraco.Linq.Core -{ - /// - /// Class containing helpers when doing reflection against nodes - /// - public sealed class ReflectionAssistance - { - private ReflectionAssistance() { } - - /// - /// Prebuilt function for getting the custom properites of the class - /// - /// This is a Lambda function which will return all the properties of the current class which are custom DocType properties - internal static Func CustomDocTypeProperties = p => p.GetCustomAttributes(typeof(UmbracoInfoAttribute), false).Count() != 0 && p.GetCustomAttributes(typeof(PropertyAttribute), false).Count() != 0; - - /// - /// Prebuild function for getting the mandatory properites of the class - /// - /// This is a Lambda function which will return all the properties of the current class which are custom DocType properties and mandatory - internal static Func MandatoryDocTypeProperties = p => p.GetCustomAttributes(typeof(UmbracoInfoAttribute), false).Count() != 0 && ((UmbracoInfoAttribute)p.GetCustomAttributes(typeof(UmbracoInfoAttribute), false)[0]).Mandatory; - - /// - /// Compares a .NET type to an Xml representation - /// - internal static Func CompareByAlias = (t, x) => x.Name.LocalName == Casing.SafeAlias(ReflectionAssistance.GetUmbracoInfoAttribute(t).Alias); - - /// - /// Get the for a object - /// - /// The methodInfo to get the for. - /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "umbraco")] - public static UmbracoInfoAttribute GetUmbracoInfoAttribute(MemberInfo member) - { - return member.GetCustomAttributes(typeof(UmbracoInfoAttribute), true).Cast().SingleOrDefault(); - } - - /// - /// Get the for a type - /// - /// The type to get the for. - /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")] - public static UmbracoInfoAttribute GetUmbracoInfoAttribute(Type type) - { - return type.GetCustomAttributes(typeof(UmbracoInfoAttribute), true).Cast().SingleOrDefault(); - } - } -} diff --git a/src/LinqToUmbraco/src/umbraco.Linq/Core/Switch.cs b/src/LinqToUmbraco/src/umbraco.Linq/Core/Switch.cs deleted file mode 100644 index 154e4f0b99..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/Core/Switch.cs +++ /dev/null @@ -1,109 +0,0 @@ -using System; - -namespace umbraco.Linq.Core -{ - /// - /// Typed switch implementation from Bart De Smet: http://community.bartdesmet.net/blogs/bart/archive/2008/03/30/a-functional-c-type-switch.aspx - /// - public class Switch - { - /// - /// Initializes a new instance of the class. - /// - /// The o. - public Switch(object o) - { - Obj = o; - } - - /// - /// Gets or sets the object being operated against - /// - /// The obj. - public object Obj { get; private set; } - - /// - /// Case statement - /// - /// Type of object - /// Action method to execute for case evaluation - /// - public Switch Case(Action a) - { - return Case(o => true, a, false); - } - - /// - /// Case statement - /// - /// Type of object - /// Action method to execute for case evaluation - /// if set to true fall through to next case statement. - /// - public Switch Case(Action a, bool fallThrough) - { - return Case(o => true, a, fallThrough); - } - - /// - /// Case statement - /// - /// Type of object - /// The funcation to eveluate against to object. - /// Action method to execute for case evaluation - /// - public Switch Case(Func c, Action a) - { - return Case(c, a, false); - } - - /// - /// Case statement - /// - /// Type of object - /// The funcation to eveluate against to object. - /// Action method to execute for case evaluation - /// if set to true fall through to next case statement. - /// - public Switch Case(Func c, Action a, bool fallThrough) - { - if (this == null) - { - return null; - } - else - { - if (this.Obj is T) - { - T t = (T)this.Obj; - if (c(t)) - { - a(t); - return fallThrough ? this : null; - } - } - } - - return this; - } - - /// - /// Defaults case - /// - /// Type of object - /// Action to perform - /// - public Switch Default(Action a) - { - if (this == null) - { - return null; - } - else - { - a((T)this.Obj); - return this; - } - } - } -} diff --git a/src/LinqToUmbraco/src/umbraco.Linq/Core/Tree.cs b/src/LinqToUmbraco/src/umbraco.Linq/Core/Tree.cs deleted file mode 100644 index 285c42cfee..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/Core/Tree.cs +++ /dev/null @@ -1,88 +0,0 @@ -using System.Collections.Generic; -using System.Collections; - -namespace umbraco.Linq.Core -{ - /// - /// Represents a collection within DataProvider of a DocType - /// - /// - /// Similar to the implementation of , - /// providing a single collection which represents all instances of the given type within the DataProvider. - /// - /// Implementers of this type will need to provide a manner of retrieving the TDocType from the DataProvider - /// - /// The type of the DocType. - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix")] - public abstract class Tree : IContentTree, IEnumerable, IEnumerable - where TDocType : DocTypeBase, new() - { - #region IContentTree Members - - /// - /// Gets the Provider associated with this instance - /// - /// The provider. - public abstract UmbracoDataProvider Provider { get; protected set; } - - /// - /// Gets a value indicating whether this instance is read only. The collection is not ReadOnly by default - /// - /// - /// false to indicate that this collection isn't read-only - /// - public virtual bool IsReadOnly - { - get - { - return false; - } - } - - public abstract void ReloadCache(); - - #endregion - - #region IEnumerable Members - - /// - /// Returns an enumerator that iterates through the collection. - /// - /// - /// A that can be used to iterate through the collection. - /// - public abstract IEnumerator GetEnumerator(); - - #endregion - - #region IEnumerable Members - - IEnumerator IEnumerable.GetEnumerator() - { - return this.GetEnumerator(); - } - - #endregion - - /// - /// Insert an item on submit of the DataContext - /// - /// The item. - public abstract void InsertOnSubmit(TDocType item); - /// - /// Insert a collection of items on submit of the DataContext - /// - /// The items. - public abstract void InsertAllOnSubmit(IEnumerable items); - /// - /// Deletes an item on submit of the DataContext - /// - /// The itemm. - public abstract void DeleteOnSubmit(TDocType itemm); - /// - /// Deletes a collection of items on submit of the DataContext - /// - /// The items. - public abstract void DeleteAllOnSubmit(IEnumerable items); - } -} diff --git a/src/LinqToUmbraco/src/umbraco.Linq/Core/UmbracoDataContext.cs b/src/LinqToUmbraco/src/umbraco.Linq/Core/UmbracoDataContext.cs deleted file mode 100644 index 77cc382d95..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/Core/UmbracoDataContext.cs +++ /dev/null @@ -1,114 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Xml.Linq; -using umbraco.Linq.Core.Node; - -namespace umbraco.Linq.Core -{ - /// - /// The umbracoDataContext which handles the interaction with an - /// - public abstract class UmbracoDataContext : IUmbracoDataContext - { - #region Privates - private UmbracoDataProvider _dataProvider; - #endregion - - /// - /// Loads the tree of umbraco items. - /// - /// The type of the DocTypeBase. - /// Collection of umbraco items - /// If the DataContext has been disposed of - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter")] - protected Tree LoadTree() where TDocTypeBase : DocTypeBase, new() - { - CheckDisposed(); - return this._dataProvider.LoadTree(); - } - - /// - /// Gets the data provider. - /// - /// The data provider. - public UmbracoDataProvider DataProvider - { - get - { - return this._dataProvider; - } - } - - /// - /// Submits the changes within the UmbracoDataContext through the - /// - public void SubmitChanges() - { - this.CheckDisposed(); - - this._dataProvider.SubmitChanges(); - } - - #region Constructors - - /// - /// Initializes a new instance of the class, using a data provider with the connection string from the umbraco config - /// - protected UmbracoDataContext() : this(new NodeDataProvider()) - { - } - - /// - /// Initializes a new instance of the class. - /// - /// The data provider to use within the DataContext. - protected UmbracoDataContext(UmbracoDataProvider dataProvider) - { - this._dataProvider = dataProvider; - } - - #endregion - - #region IDisposable Members - - private bool _disposed; - - /// - /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - /// - public void Dispose() - { - this.Dispose(true); - GC.SuppressFinalize(this); - } - - /// - /// Releases unmanaged and - optionally - managed resources - /// - /// true to release both managed and unmanaged resources; false to release only unmanaged resources. - protected virtual void Dispose(bool disposing) - { - if (!this._disposed && disposing) - { - if (this._dataProvider != null) - { - this._dataProvider.Dispose(true); - } - - this._disposed = true; - } - } - - private void CheckDisposed() - { - if (this._disposed) - { - throw new ObjectDisposedException(null); - } - } - - #endregion - } -} diff --git a/src/LinqToUmbraco/src/umbraco.Linq/Core/UmbracoDataProvider.cs b/src/LinqToUmbraco/src/umbraco.Linq/Core/UmbracoDataProvider.cs deleted file mode 100644 index ed99fcc5f0..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/Core/UmbracoDataProvider.cs +++ /dev/null @@ -1,106 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace umbraco.Linq.Core -{ - /// - /// Provides the methods required for a data access model within the LINQ to Umbraco project - /// - /// - /// This base class is used when defining how a DataProvider operates against a data source (such as the umbraco.config). - /// - /// It provides abstractions for all the useful operations of the DataProvider - /// - public abstract class UmbracoDataProvider : IDisposable - { - /// - /// Indicates the disposal status of the current provider - /// - protected bool _disposed; - - /// - /// Gets the name of the provider - /// - /// The name of the provider. - public abstract string Name { get; } - - /// - /// Loads the tree with the relevant DocTypes - /// - /// The type of the DocType to load. - /// - public abstract Tree LoadTree() where TDocType : DocTypeBase, new(); - - /// - /// Loads the associated nodes with the relevant DocTypes - /// - /// The parent node id. - /// - public abstract AssociationTree LoadAssociation(int parentNodeId); - - /// - /// Loads the associated nodes with the relevant DocTypes - /// - /// The type of the DocType to load. - /// The nodes. - /// - public abstract AssociationTree LoadAssociation(IEnumerable nodes) where TDocType : DocTypeBase, new(); - - /// - /// Loads the specified id. - /// - /// The type of the doc type. - /// The id. - /// - public abstract TDocType Load(int id) where TDocType : DocTypeBase, new(); - - /// - /// Loads the ancestors. - /// - /// The start node id. - /// - public abstract IEnumerable LoadAncestors(int startNodeId); - - #region IDisposable Members - - /// - /// Checks if the provider has been disposed - /// - protected internal void CheckDisposed() - { - if (this._disposed) - throw new ObjectDisposedException(null); - } - - /// - /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - /// - public void Dispose() - { - this.Dispose(true); - GC.SuppressFinalize(this); - } - - /// - /// Releases unmanaged and - optionally - managed resources - /// - /// true to release both managed and unmanaged resources; false to release only unmanaged resources. - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1063:ImplementIDisposableCorrectly")] - protected internal virtual void Dispose(bool disposing) - { - this._disposed = true; - } - - #endregion - - /// - /// Submits the changes tracked by the UmbracoDataProvider - /// - /// It is up to the implementor of the UmbracoDataProvider to decide whether or not they are supporting change submission in their provider. This will thrown an exception unless it is explicitly implemented. - /// Thrown unless the method is implemented in a custom UmbracoDataProvider. - protected internal virtual void SubmitChanges() - { - throw new NotImplementedException("Provider \"" + this.Name + "\" does not implement a submittable pattern"); - } - } -} diff --git a/src/LinqToUmbraco/src/umbraco.Linq/Core/umbraco.Linq.Core.csproj b/src/LinqToUmbraco/src/umbraco.Linq/Core/umbraco.Linq.Core.csproj deleted file mode 100644 index 86f1299329..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/Core/umbraco.Linq.Core.csproj +++ /dev/null @@ -1,154 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {31CAEC36-0C3D-4D69-B092-84866811EA07} - Library - Properties - umbraco.Linq.Core - umbraco.Linq.Core - v4.0 - 512 - - - - - - - - - ..\..\..\..\..\umbraco\presentation\bin - - - 3.5 - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - bin\Debug\umbraco.Linq.Core.xml - AllRules.ruleset - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - bin\Release\umbraco.Linq.Core.XML - AllRules.ruleset - - - - - 3.5 - - - 3.5 - - - 3.0 - - - - False - ..\..\..\..\lib\System.Web.Abstractions.dll - 3.5 - - - - 3.5 - - - - - Properties\SolutionInfo.cs - - - - - - - - - - - - - - - - - - - - - - - - - {E469A9CE-1BEC-423F-AC44-713CD72457EA} - umbraco.businesslogic - - - {CCD75EC3-63DB-4184-B49D-51C1DD337230} - umbraco.cms - - - {651E1350-91B6-44B7-BD60-7207006D7003} - umbraco.presentation - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - - - XCOPY "$(TargetPath)" "$(SolutionDir)\umbraco\presentation\bin" /Y - - \ No newline at end of file diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal Installer/DTMetal Installer.vdproj b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal Installer/DTMetal Installer.vdproj deleted file mode 100644 index 33744a1e62..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal Installer/DTMetal Installer.vdproj +++ /dev/null @@ -1,3165 +0,0 @@ -"DeployProject" -{ -"VSVersion" = "3:800" -"ProjectType" = "8:{978C614F-708E-4E1A-B201-565925725DBA}" -"IsWebType" = "8:FALSE" -"ProjectName" = "8:DTMetal Installer" -"LanguageId" = "3:1033" -"CodePage" = "3:1252" -"UILanguageId" = "3:1033" -"SccProjectName" = "8:SAK" -"SccLocalPath" = "8:SAK" -"SccAuxPath" = "8:SAK" -"SccProvider" = "8:SAK" - "Hierarchy" - { - "Entry" - { - "MsmKey" = "8:_0DBC69ED86E489240A48D6BB5AEC193C" - "OwnerKey" = "8:_A30C1F9054564E5692E22D1D82E217A9" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_0DBC69ED86E489240A48D6BB5AEC193C" - "OwnerKey" = "8:_B13BAC326D99486C99A5569F3BC4AC9C" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_1345F0C5CA8CA7CDCE26FBA2F8DCA740" - "OwnerKey" = "8:_AD9348DC4493A66504DB02526E419114" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_1345F0C5CA8CA7CDCE26FBA2F8DCA740" - "OwnerKey" = "8:_5DAD23E86B2CB7C44E2EE68DE2A47591" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_1345F0C5CA8CA7CDCE26FBA2F8DCA740" - "OwnerKey" = "8:_AC86EBB7EFACB032EBD5C428EDE600A9" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_1345F0C5CA8CA7CDCE26FBA2F8DCA740" - "OwnerKey" = "8:_6D30E9F6F22443EAB03C704C2A95705C" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_1345F0C5CA8CA7CDCE26FBA2F8DCA740" - "OwnerKey" = "8:_F0A1398309CD846D7B9EF833FDA170D4" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_18974CA0323081B05C02A067773C66BA" - "OwnerKey" = "8:_7AD29F9D90E7E4F304805783AA91CFA3" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_1F50885CEA0B84CE97664D528172DCFE" - "OwnerKey" = "8:_A30C1F9054564E5692E22D1D82E217A9" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_1F50885CEA0B84CE97664D528172DCFE" - "OwnerKey" = "8:_B13BAC326D99486C99A5569F3BC4AC9C" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_21FB5B4A9F560AB80F430D06AE334DDF" - "OwnerKey" = "8:_0DBC69ED86E489240A48D6BB5AEC193C" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_22887730B62E97CB0C6E0169030D63FF" - "OwnerKey" = "8:_D04C94D3BAE248ADBB65968A9C8BAD7C" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_22887730B62E97CB0C6E0169030D63FF" - "OwnerKey" = "8:_5DAD23E86B2CB7C44E2EE68DE2A47591" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_250AEA8A0EFC212367261856B7876F48" - "OwnerKey" = "8:_A30C1F9054564E5692E22D1D82E217A9" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_250AEA8A0EFC212367261856B7876F48" - "OwnerKey" = "8:_22887730B62E97CB0C6E0169030D63FF" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_250AEA8A0EFC212367261856B7876F48" - "OwnerKey" = "8:_D04C94D3BAE248ADBB65968A9C8BAD7C" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_250AEA8A0EFC212367261856B7876F48" - "OwnerKey" = "8:_B13BAC326D99486C99A5569F3BC4AC9C" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_250AEA8A0EFC212367261856B7876F48" - "OwnerKey" = "8:_EC3894ACAC9518C25134898C6B0C084B" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_250AEA8A0EFC212367261856B7876F48" - "OwnerKey" = "8:_A7593823FCCBA8A5CAD30AA20291CB19" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_250AEA8A0EFC212367261856B7876F48" - "OwnerKey" = "8:_346312464B96ED5A061BFE1ADA11045A" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_250AEA8A0EFC212367261856B7876F48" - "OwnerKey" = "8:_32AE725CC2E4AC9FE49EB2605898BB66" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_250AEA8A0EFC212367261856B7876F48" - "OwnerKey" = "8:_FBFD62A14CE6FCD6E76FF5CE8FFEE4AE" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_250AEA8A0EFC212367261856B7876F48" - "OwnerKey" = "8:_885E4C7F15BDEEC36B67AA9563BB2B51" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_25E31B9A8A4FA965D5000BB7E406C597" - "OwnerKey" = "8:_A30C1F9054564E5692E22D1D82E217A9" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_25E31B9A8A4FA965D5000BB7E406C597" - "OwnerKey" = "8:_22887730B62E97CB0C6E0169030D63FF" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_25E31B9A8A4FA965D5000BB7E406C597" - "OwnerKey" = "8:_D04C94D3BAE248ADBB65968A9C8BAD7C" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_25E31B9A8A4FA965D5000BB7E406C597" - "OwnerKey" = "8:_B13BAC326D99486C99A5569F3BC4AC9C" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_304342044AC9601D481E8C63EC728F70" - "OwnerKey" = "8:_AD9348DC4493A66504DB02526E419114" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_304342044AC9601D481E8C63EC728F70" - "OwnerKey" = "8:_AC86EBB7EFACB032EBD5C428EDE600A9" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_304342044AC9601D481E8C63EC728F70" - "OwnerKey" = "8:_6D30E9F6F22443EAB03C704C2A95705C" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_304342044AC9601D481E8C63EC728F70" - "OwnerKey" = "8:_F0A1398309CD846D7B9EF833FDA170D4" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_32AE725CC2E4AC9FE49EB2605898BB66" - "OwnerKey" = "8:_FBFD62A14CE6FCD6E76FF5CE8FFEE4AE" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_32AE725CC2E4AC9FE49EB2605898BB66" - "OwnerKey" = "8:_22887730B62E97CB0C6E0169030D63FF" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_32AE725CC2E4AC9FE49EB2605898BB66" - "OwnerKey" = "8:_D04C94D3BAE248ADBB65968A9C8BAD7C" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_32AE725CC2E4AC9FE49EB2605898BB66" - "OwnerKey" = "8:_B13BAC326D99486C99A5569F3BC4AC9C" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_32AE725CC2E4AC9FE49EB2605898BB66" - "OwnerKey" = "8:_A30C1F9054564E5692E22D1D82E217A9" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_32AE725CC2E4AC9FE49EB2605898BB66" - "OwnerKey" = "8:_885E4C7F15BDEEC36B67AA9563BB2B51" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_32AE725CC2E4AC9FE49EB2605898BB66" - "OwnerKey" = "8:_EC3894ACAC9518C25134898C6B0C084B" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_32AE725CC2E4AC9FE49EB2605898BB66" - "OwnerKey" = "8:_A7593823FCCBA8A5CAD30AA20291CB19" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_346312464B96ED5A061BFE1ADA11045A" - "OwnerKey" = "8:_32AE725CC2E4AC9FE49EB2605898BB66" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_346312464B96ED5A061BFE1ADA11045A" - "OwnerKey" = "8:_D04C94D3BAE248ADBB65968A9C8BAD7C" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_346312464B96ED5A061BFE1ADA11045A" - "OwnerKey" = "8:_B13BAC326D99486C99A5569F3BC4AC9C" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_346312464B96ED5A061BFE1ADA11045A" - "OwnerKey" = "8:_A30C1F9054564E5692E22D1D82E217A9" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_346312464B96ED5A061BFE1ADA11045A" - "OwnerKey" = "8:_885E4C7F15BDEEC36B67AA9563BB2B51" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_346312464B96ED5A061BFE1ADA11045A" - "OwnerKey" = "8:_EC3894ACAC9518C25134898C6B0C084B" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_346312464B96ED5A061BFE1ADA11045A" - "OwnerKey" = "8:_FBFD62A14CE6FCD6E76FF5CE8FFEE4AE" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_346312464B96ED5A061BFE1ADA11045A" - "OwnerKey" = "8:_A7593823FCCBA8A5CAD30AA20291CB19" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_45DB6D2FFD04A5ED29F47F95435F56F3" - "OwnerKey" = "8:_E67BBC8865F3231DBE18645E50209C79" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_56613DAEE3C3F18649E5B0A5C4566517" - "OwnerKey" = "8:_1345F0C5CA8CA7CDCE26FBA2F8DCA740" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_56613DAEE3C3F18649E5B0A5C4566517" - "OwnerKey" = "8:_69D16AE7E5E1E71B1BC0C4500EDE8476" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_56613DAEE3C3F18649E5B0A5C4566517" - "OwnerKey" = "8:_6D30E9F6F22443EAB03C704C2A95705C" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_5DAD23E86B2CB7C44E2EE68DE2A47591" - "OwnerKey" = "8:_D04C94D3BAE248ADBB65968A9C8BAD7C" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_69D16AE7E5E1E71B1BC0C4500EDE8476" - "OwnerKey" = "8:_D04C94D3BAE248ADBB65968A9C8BAD7C" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_6D30E9F6F22443EAB03C704C2A95705C" - "OwnerKey" = "8:_UNDEFINED" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_7AD29F9D90E7E4F304805783AA91CFA3" - "OwnerKey" = "8:_A30C1F9054564E5692E22D1D82E217A9" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_7AD29F9D90E7E4F304805783AA91CFA3" - "OwnerKey" = "8:_22887730B62E97CB0C6E0169030D63FF" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_7AD29F9D90E7E4F304805783AA91CFA3" - "OwnerKey" = "8:_D04C94D3BAE248ADBB65968A9C8BAD7C" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_7AD29F9D90E7E4F304805783AA91CFA3" - "OwnerKey" = "8:_B13BAC326D99486C99A5569F3BC4AC9C" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_7AD29F9D90E7E4F304805783AA91CFA3" - "OwnerKey" = "8:_1F50885CEA0B84CE97664D528172DCFE" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_7AD29F9D90E7E4F304805783AA91CFA3" - "OwnerKey" = "8:_89C47BE8196A61202AC166EE517FC092" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_7CB5C3513243EE61087C97DB7E7EB562" - "OwnerKey" = "8:_6D30E9F6F22443EAB03C704C2A95705C" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_7CB5C3513243EE61087C97DB7E7EB562" - "OwnerKey" = "8:_AC86EBB7EFACB032EBD5C428EDE600A9" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_7CB5C3513243EE61087C97DB7E7EB562" - "OwnerKey" = "8:_F0A1398309CD846D7B9EF833FDA170D4" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_885E4C7F15BDEEC36B67AA9563BB2B51" - "OwnerKey" = "8:_A30C1F9054564E5692E22D1D82E217A9" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_885E4C7F15BDEEC36B67AA9563BB2B51" - "OwnerKey" = "8:_22887730B62E97CB0C6E0169030D63FF" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_885E4C7F15BDEEC36B67AA9563BB2B51" - "OwnerKey" = "8:_D04C94D3BAE248ADBB65968A9C8BAD7C" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_885E4C7F15BDEEC36B67AA9563BB2B51" - "OwnerKey" = "8:_B13BAC326D99486C99A5569F3BC4AC9C" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_89C47BE8196A61202AC166EE517FC092" - "OwnerKey" = "8:_A30C1F9054564E5692E22D1D82E217A9" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_89C47BE8196A61202AC166EE517FC092" - "OwnerKey" = "8:_B13BAC326D99486C99A5569F3BC4AC9C" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_89C47BE8196A61202AC166EE517FC092" - "OwnerKey" = "8:_1F50885CEA0B84CE97664D528172DCFE" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_91B110ECD9B3A3EED8C259AA69206910" - "OwnerKey" = "8:_D04C94D3BAE248ADBB65968A9C8BAD7C" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_91B110ECD9B3A3EED8C259AA69206910" - "OwnerKey" = "8:_A7593823FCCBA8A5CAD30AA20291CB19" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_91B110ECD9B3A3EED8C259AA69206910" - "OwnerKey" = "8:_B13BAC326D99486C99A5569F3BC4AC9C" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_91B110ECD9B3A3EED8C259AA69206910" - "OwnerKey" = "8:_A30C1F9054564E5692E22D1D82E217A9" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_96FE95C5ED97685D8A35E945EEBFF16A" - "OwnerKey" = "8:_A30C1F9054564E5692E22D1D82E217A9" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_96FE95C5ED97685D8A35E945EEBFF16A" - "OwnerKey" = "8:_22887730B62E97CB0C6E0169030D63FF" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_96FE95C5ED97685D8A35E945EEBFF16A" - "OwnerKey" = "8:_D04C94D3BAE248ADBB65968A9C8BAD7C" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_96FE95C5ED97685D8A35E945EEBFF16A" - "OwnerKey" = "8:_B13BAC326D99486C99A5569F3BC4AC9C" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_A30C1F9054564E5692E22D1D82E217A9" - "OwnerKey" = "8:_UNDEFINED" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_A7593823FCCBA8A5CAD30AA20291CB19" - "OwnerKey" = "8:_FBFD62A14CE6FCD6E76FF5CE8FFEE4AE" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_A7593823FCCBA8A5CAD30AA20291CB19" - "OwnerKey" = "8:_D04C94D3BAE248ADBB65968A9C8BAD7C" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_A7593823FCCBA8A5CAD30AA20291CB19" - "OwnerKey" = "8:_B13BAC326D99486C99A5569F3BC4AC9C" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_A7593823FCCBA8A5CAD30AA20291CB19" - "OwnerKey" = "8:_A30C1F9054564E5692E22D1D82E217A9" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_AA37555C7C0469F8074E8EADC0B775B1" - "OwnerKey" = "8:_D04C94D3BAE248ADBB65968A9C8BAD7C" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_AC86EBB7EFACB032EBD5C428EDE600A9" - "OwnerKey" = "8:_6D30E9F6F22443EAB03C704C2A95705C" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_AD9348DC4493A66504DB02526E419114" - "OwnerKey" = "8:_6D30E9F6F22443EAB03C704C2A95705C" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_AD9348DC4493A66504DB02526E419114" - "OwnerKey" = "8:_AC86EBB7EFACB032EBD5C428EDE600A9" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_AD9348DC4493A66504DB02526E419114" - "OwnerKey" = "8:_F0A1398309CD846D7B9EF833FDA170D4" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_AEB6A1C9040B405D879808139EB0D378" - "OwnerKey" = "8:_UNDEFINED" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_B13BAC326D99486C99A5569F3BC4AC9C" - "OwnerKey" = "8:_UNDEFINED" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_B914C40F58C09277BB8493610F624BA7" - "OwnerKey" = "8:_1F50885CEA0B84CE97664D528172DCFE" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_BFDA41D2B373F97ADE98202496895FD8" - "OwnerKey" = "8:_A30C1F9054564E5692E22D1D82E217A9" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_BFDA41D2B373F97ADE98202496895FD8" - "OwnerKey" = "8:_D04C94D3BAE248ADBB65968A9C8BAD7C" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_BFDA41D2B373F97ADE98202496895FD8" - "OwnerKey" = "8:_B13BAC326D99486C99A5569F3BC4AC9C" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_BFDA41D2B373F97ADE98202496895FD8" - "OwnerKey" = "8:_885E4C7F15BDEEC36B67AA9563BB2B51" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_D04C94D3BAE248ADBB65968A9C8BAD7C" - "OwnerKey" = "8:_UNDEFINED" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_E67BBC8865F3231DBE18645E50209C79" - "OwnerKey" = "8:_A30C1F9054564E5692E22D1D82E217A9" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_E67BBC8865F3231DBE18645E50209C79" - "OwnerKey" = "8:_22887730B62E97CB0C6E0169030D63FF" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_E67BBC8865F3231DBE18645E50209C79" - "OwnerKey" = "8:_D04C94D3BAE248ADBB65968A9C8BAD7C" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_E67BBC8865F3231DBE18645E50209C79" - "OwnerKey" = "8:_B13BAC326D99486C99A5569F3BC4AC9C" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_E67BBC8865F3231DBE18645E50209C79" - "OwnerKey" = "8:_25E31B9A8A4FA965D5000BB7E406C597" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_E67BBC8865F3231DBE18645E50209C79" - "OwnerKey" = "8:_885E4C7F15BDEEC36B67AA9563BB2B51" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_E67BBC8865F3231DBE18645E50209C79" - "OwnerKey" = "8:_0DBC69ED86E489240A48D6BB5AEC193C" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_EC3894ACAC9518C25134898C6B0C084B" - "OwnerKey" = "8:_885E4C7F15BDEEC36B67AA9563BB2B51" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_EC3894ACAC9518C25134898C6B0C084B" - "OwnerKey" = "8:_D04C94D3BAE248ADBB65968A9C8BAD7C" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_EC3894ACAC9518C25134898C6B0C084B" - "OwnerKey" = "8:_B13BAC326D99486C99A5569F3BC4AC9C" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_EC3894ACAC9518C25134898C6B0C084B" - "OwnerKey" = "8:_A30C1F9054564E5692E22D1D82E217A9" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_F0A1398309CD846D7B9EF833FDA170D4" - "OwnerKey" = "8:_6D30E9F6F22443EAB03C704C2A95705C" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_F0A1398309CD846D7B9EF833FDA170D4" - "OwnerKey" = "8:_AC86EBB7EFACB032EBD5C428EDE600A9" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_FBFD62A14CE6FCD6E76FF5CE8FFEE4AE" - "OwnerKey" = "8:_885E4C7F15BDEEC36B67AA9563BB2B51" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_FBFD62A14CE6FCD6E76FF5CE8FFEE4AE" - "OwnerKey" = "8:_22887730B62E97CB0C6E0169030D63FF" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_FBFD62A14CE6FCD6E76FF5CE8FFEE4AE" - "OwnerKey" = "8:_D04C94D3BAE248ADBB65968A9C8BAD7C" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_FBFD62A14CE6FCD6E76FF5CE8FFEE4AE" - "OwnerKey" = "8:_B13BAC326D99486C99A5569F3BC4AC9C" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_FBFD62A14CE6FCD6E76FF5CE8FFEE4AE" - "OwnerKey" = "8:_A30C1F9054564E5692E22D1D82E217A9" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_FBFD62A14CE6FCD6E76FF5CE8FFEE4AE" - "OwnerKey" = "8:_EC3894ACAC9518C25134898C6B0C084B" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_91B110ECD9B3A3EED8C259AA69206910" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_D04C94D3BAE248ADBB65968A9C8BAD7C" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_5DAD23E86B2CB7C44E2EE68DE2A47591" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_69D16AE7E5E1E71B1BC0C4500EDE8476" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_AA37555C7C0469F8074E8EADC0B775B1" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_22887730B62E97CB0C6E0169030D63FF" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_B13BAC326D99486C99A5569F3BC4AC9C" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_A30C1F9054564E5692E22D1D82E217A9" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_25E31B9A8A4FA965D5000BB7E406C597" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_96FE95C5ED97685D8A35E945EEBFF16A" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_885E4C7F15BDEEC36B67AA9563BB2B51" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_EC3894ACAC9518C25134898C6B0C084B" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_FBFD62A14CE6FCD6E76FF5CE8FFEE4AE" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_A7593823FCCBA8A5CAD30AA20291CB19" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_32AE725CC2E4AC9FE49EB2605898BB66" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_346312464B96ED5A061BFE1ADA11045A" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_BFDA41D2B373F97ADE98202496895FD8" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_250AEA8A0EFC212367261856B7876F48" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_1F50885CEA0B84CE97664D528172DCFE" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_89C47BE8196A61202AC166EE517FC092" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_7AD29F9D90E7E4F304805783AA91CFA3" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_0DBC69ED86E489240A48D6BB5AEC193C" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_E67BBC8865F3231DBE18645E50209C79" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_6D30E9F6F22443EAB03C704C2A95705C" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_AC86EBB7EFACB032EBD5C428EDE600A9" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_F0A1398309CD846D7B9EF833FDA170D4" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_AD9348DC4493A66504DB02526E419114" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_1345F0C5CA8CA7CDCE26FBA2F8DCA740" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_56613DAEE3C3F18649E5B0A5C4566517" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_304342044AC9601D481E8C63EC728F70" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_7CB5C3513243EE61087C97DB7E7EB562" - "MsmSig" = "8:_UNDEFINED" - } - } - "Configurations" - { - "Debug" - { - "DisplayName" = "8:Debug" - "IsDebugOnly" = "11:TRUE" - "IsReleaseOnly" = "11:FALSE" - "OutputFilename" = "8:Debug\\DTMetal Installer.msi" - "PackageFilesAs" = "3:2" - "PackageFileSize" = "3:-2147483648" - "CabType" = "3:1" - "Compression" = "3:2" - "SignOutput" = "11:FALSE" - "CertificateFile" = "8:" - "PrivateKeyFile" = "8:" - "TimeStampServer" = "8:" - "InstallerBootstrapper" = "3:2" - "BootstrapperCfg:{63ACBE69-63AA-4F98-B2B6-99F9E24495F2}" - { - "Enabled" = "11:TRUE" - "PromptEnabled" = "11:TRUE" - "PrerequisitesLocation" = "2:1" - "Url" = "8:" - "ComponentsUrl" = "8:" - "Items" - { - "{EDC2488A-8267-493A-A98E-7D9C3B36CDF3}:Microsoft.Net.Framework.3.5.SP1" - { - "Name" = "8:.NET Framework 3.5 SP1" - "ProductCode" = "8:Microsoft.Net.Framework.3.5.SP1" - } - "{EDC2488A-8267-493A-A98E-7D9C3B36CDF3}:Microsoft.Windows.Installer.3.1" - { - "Name" = "8:Windows Installer 3.1" - "ProductCode" = "8:Microsoft.Windows.Installer.3.1" - } - } - } - } - "Debug - Fixed Version" - { - "DisplayName" = "8:Debug - Fixed Version" - "IsDebugOnly" = "11:FALSE" - "IsReleaseOnly" = "11:FALSE" - "OutputFilename" = "8:Debug - Fixed Version\\DTMetal Installer.msi" - "PackageFilesAs" = "3:2" - "PackageFileSize" = "3:-2147483648" - "CabType" = "3:1" - "Compression" = "3:2" - "SignOutput" = "11:FALSE" - "CertificateFile" = "8:" - "PrivateKeyFile" = "8:" - "TimeStampServer" = "8:" - "InstallerBootstrapper" = "3:2" - "BootstrapperCfg:{63ACBE69-63AA-4F98-B2B6-99F9E24495F2}" - { - "Enabled" = "11:TRUE" - "PromptEnabled" = "11:TRUE" - "PrerequisitesLocation" = "2:1" - "Url" = "8:" - "ComponentsUrl" = "8:" - "Items" - { - "{EDC2488A-8267-493A-A98E-7D9C3B36CDF3}:Microsoft.Net.Framework.3.5.SP1" - { - "Name" = "8:.NET Framework 3.5 SP1" - "ProductCode" = "8:Microsoft.Net.Framework.3.5.SP1" - } - "{EDC2488A-8267-493A-A98E-7D9C3B36CDF3}:Microsoft.Windows.Installer.3.1" - { - "Name" = "8:Windows Installer 3.1" - "ProductCode" = "8:Microsoft.Windows.Installer.3.1" - } - } - } - } - "Release" - { - "DisplayName" = "8:Release" - "IsDebugOnly" = "11:FALSE" - "IsReleaseOnly" = "11:TRUE" - "OutputFilename" = "8:Release\\DTMetal Installer.msi" - "PackageFilesAs" = "3:2" - "PackageFileSize" = "3:-2147483648" - "CabType" = "3:1" - "Compression" = "3:2" - "SignOutput" = "11:FALSE" - "CertificateFile" = "8:" - "PrivateKeyFile" = "8:" - "TimeStampServer" = "8:" - "InstallerBootstrapper" = "3:2" - "BootstrapperCfg:{63ACBE69-63AA-4F98-B2B6-99F9E24495F2}" - { - "Enabled" = "11:TRUE" - "PromptEnabled" = "11:TRUE" - "PrerequisitesLocation" = "2:1" - "Url" = "8:" - "ComponentsUrl" = "8:" - "Items" - { - "{EDC2488A-8267-493A-A98E-7D9C3B36CDF3}:Microsoft.Net.Framework.3.5.SP1" - { - "Name" = "8:.NET Framework 3.5 SP1" - "ProductCode" = "8:Microsoft.Net.Framework.3.5.SP1" - } - "{EDC2488A-8267-493A-A98E-7D9C3B36CDF3}:Microsoft.Windows.Installer.3.1" - { - "Name" = "8:Windows Installer 3.1" - "ProductCode" = "8:Microsoft.Windows.Installer.3.1" - } - } - } - } - } - "Deployable" - { - "CustomAction" - { - "{4AA51A2D-7D85-4A59-BA75-B0809FC8B380}:_9504839B6F01461F9C3D4E1F22631EDA" - { - "Name" = "8:Primary output from DTMetal.CodeBuilder (Active)" - "Condition" = "8:" - "Object" = "8:_B13BAC326D99486C99A5569F3BC4AC9C" - "FileType" = "3:1" - "InstallAction" = "3:1" - "Arguments" = "8:" - "EntryPoint" = "8:" - "Sequence" = "3:1" - "Identifier" = "8:_03571BDC_087D_4D70_B37D_0BF0788B9FD1" - "InstallerClass" = "11:TRUE" - "CustomActionData" = "8:/TargetDir=\"[TARGETDIR]\\\"" - } - "{4AA51A2D-7D85-4A59-BA75-B0809FC8B380}:_A1F955FBDFC343CB88E8DB55C1E5A1D1" - { - "Name" = "8:Primary output from DTMetal.CodeBuilder (Active)" - "Condition" = "8:" - "Object" = "8:_B13BAC326D99486C99A5569F3BC4AC9C" - "FileType" = "3:1" - "InstallAction" = "3:4" - "Arguments" = "8:" - "EntryPoint" = "8:" - "Sequence" = "3:1" - "Identifier" = "8:_02E35048_B81F_46FF_9030_97F9CBD0A495" - "InstallerClass" = "11:TRUE" - "CustomActionData" = "8:/TargetDir=\"[TARGETDIR]\\\"" - } - } - "DefaultFeature" - { - "Name" = "8:DefaultFeature" - "Title" = "8:" - "Description" = "8:" - } - "ExternalPersistence" - { - "LaunchCondition" - { - "{A06ECF26-33A3-4562-8140-9B0E340D4F24}:_1C73DD266B904336BCC6591DACFD7BB2" - { - "Name" = "8:.NET Framework" - "Message" = "8:[VSDNETMSG]" - "Version" = "8:3.5.30729" - "AllowLaterVersions" = "11:FALSE" - "InstallUrl" = "8:http://go.microsoft.com/fwlink/?LinkId=76617" - } - } - } - "File" - { - "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_0DBC69ED86E489240A48D6BB5AEC193C" - { - "AssemblyRegister" = "3:1" - "AssemblyIsInGAC" = "11:FALSE" - "AssemblyAsmDisplayName" = "8:EnvDTE80, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" - "ScatterAssemblies" - { - "_0DBC69ED86E489240A48D6BB5AEC193C" - { - "Name" = "8:EnvDTE80.dll" - "Attributes" = "3:512" - } - } - "SourcePath" = "8:EnvDTE80.dll" - "TargetName" = "8:" - "Tag" = "8:" - "Folder" = "8:_73B0C616A8BB4F9C8EAA121307B00A0E" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:TRUE" - "IsDependency" = "11:TRUE" - "IsolateTo" = "8:" - } - "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_1345F0C5CA8CA7CDCE26FBA2F8DCA740" - { - "AssemblyRegister" = "3:1" - "AssemblyIsInGAC" = "11:FALSE" - "AssemblyAsmDisplayName" = "8:umbraco.DataLayer, Version=0.3.0.0, Culture=neutral, processorArchitecture=MSIL" - "ScatterAssemblies" - { - "_1345F0C5CA8CA7CDCE26FBA2F8DCA740" - { - "Name" = "8:umbraco.DataLayer.dll" - "Attributes" = "3:512" - } - } - "SourcePath" = "8:umbraco.DataLayer.dll" - "TargetName" = "8:" - "Tag" = "8:" - "Folder" = "8:_9CEFC880051C415E8D84F1B285EB78FA" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:FALSE" - "IsDependency" = "11:TRUE" - "IsolateTo" = "8:" - } - "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_18974CA0323081B05C02A067773C66BA" - { - "SourcePath" = "8:vslangproj.olb" - "TargetName" = "8:vslangproj.olb" - "Tag" = "8:" - "Folder" = "8:_9CEFC880051C415E8D84F1B285EB78FA" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:TRUE" - "IsDependency" = "11:TRUE" - "IsolateTo" = "8:" - } - "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_1F50885CEA0B84CE97664D528172DCFE" - { - "AssemblyRegister" = "3:1" - "AssemblyIsInGAC" = "11:FALSE" - "AssemblyAsmDisplayName" = "8:VSLangProj80, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" - "ScatterAssemblies" - { - "_1F50885CEA0B84CE97664D528172DCFE" - { - "Name" = "8:VSLangProj80.dll" - "Attributes" = "3:512" - } - } - "SourcePath" = "8:VSLangProj80.dll" - "TargetName" = "8:" - "Tag" = "8:" - "Folder" = "8:_73B0C616A8BB4F9C8EAA121307B00A0E" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:TRUE" - "IsDependency" = "11:TRUE" - "IsolateTo" = "8:" - } - "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_21FB5B4A9F560AB80F430D06AE334DDF" - { - "SourcePath" = "8:dte80.olb" - "TargetName" = "8:dte80.olb" - "Tag" = "8:" - "Folder" = "8:_73B0C616A8BB4F9C8EAA121307B00A0E" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:TRUE" - "IsDependency" = "11:TRUE" - "IsolateTo" = "8:" - } - "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_22887730B62E97CB0C6E0169030D63FF" - { - "AssemblyRegister" = "3:1" - "AssemblyIsInGAC" = "11:FALSE" - "AssemblyAsmDisplayName" = "8:Umbraco.Linq.DTMetal.CodeBuilder, Version=0.0.1.35131, Culture=neutral, PublicKeyToken=a1619d9c35575289, processorArchitecture=MSIL" - "ScatterAssemblies" - { - "_22887730B62E97CB0C6E0169030D63FF" - { - "Name" = "8:Umbraco.Linq.DTMetal.CodeBuilder.dll" - "Attributes" = "3:512" - } - } - "SourcePath" = "8:Umbraco.Linq.DTMetal.CodeBuilder.dll" - "TargetName" = "8:" - "Tag" = "8:" - "Folder" = "8:_9CEFC880051C415E8D84F1B285EB78FA" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:FALSE" - "IsDependency" = "11:TRUE" - "IsolateTo" = "8:" - } - "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_250AEA8A0EFC212367261856B7876F48" - { - "AssemblyRegister" = "3:1" - "AssemblyIsInGAC" = "11:FALSE" - "AssemblyAsmDisplayName" = "8:Microsoft.VisualStudio.OLE.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" - "ScatterAssemblies" - { - "_250AEA8A0EFC212367261856B7876F48" - { - "Name" = "8:Microsoft.VisualStudio.OLE.Interop.dll" - "Attributes" = "3:512" - } - } - "SourcePath" = "8:Microsoft.VisualStudio.OLE.Interop.dll" - "TargetName" = "8:" - "Tag" = "8:" - "Folder" = "8:_9CEFC880051C415E8D84F1B285EB78FA" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:TRUE" - "IsDependency" = "11:TRUE" - "IsolateTo" = "8:" - } - "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_25E31B9A8A4FA965D5000BB7E406C597" - { - "AssemblyRegister" = "3:1" - "AssemblyIsInGAC" = "11:FALSE" - "AssemblyAsmDisplayName" = "8:Microsoft.VisualStudio.TemplateWizardInterface, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" - "ScatterAssemblies" - { - "_25E31B9A8A4FA965D5000BB7E406C597" - { - "Name" = "8:Microsoft.VisualStudio.TemplateWizardInterface.dll" - "Attributes" = "3:512" - } - } - "SourcePath" = "8:Microsoft.VisualStudio.TemplateWizardInterface.dll" - "TargetName" = "8:" - "Tag" = "8:" - "Folder" = "8:_9CEFC880051C415E8D84F1B285EB78FA" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:FALSE" - "IsDependency" = "11:TRUE" - "IsolateTo" = "8:" - } - "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_304342044AC9601D481E8C63EC728F70" - { - "AssemblyRegister" = "3:1" - "AssemblyIsInGAC" = "11:FALSE" - "AssemblyAsmDisplayName" = "8:interfaces, Version=1.0.3317.32686, Culture=neutral, processorArchitecture=MSIL" - "ScatterAssemblies" - { - "_304342044AC9601D481E8C63EC728F70" - { - "Name" = "8:interfaces.DLL" - "Attributes" = "3:512" - } - } - "SourcePath" = "8:interfaces.DLL" - "TargetName" = "8:" - "Tag" = "8:" - "Folder" = "8:_9CEFC880051C415E8D84F1B285EB78FA" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:FALSE" - "IsDependency" = "11:TRUE" - "IsolateTo" = "8:" - } - "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_32AE725CC2E4AC9FE49EB2605898BB66" - { - "AssemblyRegister" = "3:1" - "AssemblyIsInGAC" = "11:FALSE" - "AssemblyAsmDisplayName" = "8:Microsoft.VisualStudio.Shell.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" - "ScatterAssemblies" - { - "_32AE725CC2E4AC9FE49EB2605898BB66" - { - "Name" = "8:Microsoft.VisualStudio.Shell.Interop.dll" - "Attributes" = "3:512" - } - } - "SourcePath" = "8:Microsoft.VisualStudio.Shell.Interop.dll" - "TargetName" = "8:" - "Tag" = "8:" - "Folder" = "8:_9CEFC880051C415E8D84F1B285EB78FA" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:TRUE" - "IsDependency" = "11:TRUE" - "IsolateTo" = "8:" - } - "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_346312464B96ED5A061BFE1ADA11045A" - { - "AssemblyRegister" = "3:1" - "AssemblyIsInGAC" = "11:FALSE" - "AssemblyAsmDisplayName" = "8:Microsoft.VisualStudio.TextManager.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" - "ScatterAssemblies" - { - "_346312464B96ED5A061BFE1ADA11045A" - { - "Name" = "8:Microsoft.VisualStudio.TextManager.Interop.dll" - "Attributes" = "3:512" - } - } - "SourcePath" = "8:Microsoft.VisualStudio.TextManager.Interop.dll" - "TargetName" = "8:" - "Tag" = "8:" - "Folder" = "8:_9CEFC880051C415E8D84F1B285EB78FA" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:TRUE" - "IsDependency" = "11:TRUE" - "IsolateTo" = "8:" - } - "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_45DB6D2FFD04A5ED29F47F95435F56F3" - { - "SourcePath" = "8:dte80a.olb" - "TargetName" = "8:dte80a.olb" - "Tag" = "8:" - "Folder" = "8:_9CEFC880051C415E8D84F1B285EB78FA" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:TRUE" - "IsDependency" = "11:TRUE" - "IsolateTo" = "8:" - } - "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_56613DAEE3C3F18649E5B0A5C4566517" - { - "AssemblyRegister" = "3:1" - "AssemblyIsInGAC" = "11:FALSE" - "AssemblyAsmDisplayName" = "8:Microsoft.ApplicationBlocks.Data, Version=1.0.1559.20655, Culture=neutral" - "ScatterAssemblies" - { - "_56613DAEE3C3F18649E5B0A5C4566517" - { - "Name" = "8:Microsoft.ApplicationBlocks.Data.dll" - "Attributes" = "3:512" - } - } - "SourcePath" = "8:Microsoft.ApplicationBlocks.Data.dll" - "TargetName" = "8:" - "Tag" = "8:" - "Folder" = "8:_9CEFC880051C415E8D84F1B285EB78FA" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:FALSE" - "IsDependency" = "11:TRUE" - "IsolateTo" = "8:" - } - "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_5DAD23E86B2CB7C44E2EE68DE2A47591" - { - "AssemblyRegister" = "3:1" - "AssemblyIsInGAC" = "11:FALSE" - "AssemblyAsmDisplayName" = "8:Umbraco.Linq.DTMetal.Engine, Version=0.0.1.35133, Culture=neutral, processorArchitecture=MSIL" - "ScatterAssemblies" - { - "_5DAD23E86B2CB7C44E2EE68DE2A47591" - { - "Name" = "8:Umbraco.Linq.DTMetal.Engine.dll" - "Attributes" = "3:512" - } - } - "SourcePath" = "8:Umbraco.Linq.DTMetal.Engine.dll" - "TargetName" = "8:" - "Tag" = "8:" - "Folder" = "8:_9CEFC880051C415E8D84F1B285EB78FA" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:FALSE" - "IsDependency" = "11:TRUE" - "IsolateTo" = "8:" - } - "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_69D16AE7E5E1E71B1BC0C4500EDE8476" - { - "AssemblyRegister" = "3:1" - "AssemblyIsInGAC" = "11:FALSE" - "AssemblyAsmDisplayName" = "8:umbraco.DataLayer, Version=0.3.0.0, Culture=neutral, processorArchitecture=MSIL" - "ScatterAssemblies" - { - "_69D16AE7E5E1E71B1BC0C4500EDE8476" - { - "Name" = "8:umbraco.DataLayer.dll" - "Attributes" = "3:512" - } - } - "SourcePath" = "8:umbraco.DataLayer.dll" - "TargetName" = "8:" - "Tag" = "8:" - "Folder" = "8:_9CEFC880051C415E8D84F1B285EB78FA" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:FALSE" - "IsDependency" = "11:TRUE" - "IsolateTo" = "8:" - } - "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_7AD29F9D90E7E4F304805783AA91CFA3" - { - "AssemblyRegister" = "3:1" - "AssemblyIsInGAC" = "11:FALSE" - "AssemblyAsmDisplayName" = "8:VSLangProj, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" - "ScatterAssemblies" - { - "_7AD29F9D90E7E4F304805783AA91CFA3" - { - "Name" = "8:VSLangProj.dll" - "Attributes" = "3:512" - } - } - "SourcePath" = "8:VSLangProj.dll" - "TargetName" = "8:" - "Tag" = "8:" - "Folder" = "8:_9CEFC880051C415E8D84F1B285EB78FA" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:TRUE" - "IsDependency" = "11:TRUE" - "IsolateTo" = "8:" - } - "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_7CB5C3513243EE61087C97DB7E7EB562" - { - "AssemblyRegister" = "3:1" - "AssemblyIsInGAC" = "11:FALSE" - "AssemblyAsmDisplayName" = "8:System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" - "ScatterAssemblies" - { - "_7CB5C3513243EE61087C97DB7E7EB562" - { - "Name" = "8:System.Web.Extensions.dll" - "Attributes" = "3:512" - } - } - "SourcePath" = "8:System.Web.Extensions.dll" - "TargetName" = "8:" - "Tag" = "8:" - "Folder" = "8:_9CEFC880051C415E8D84F1B285EB78FA" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:TRUE" - "IsDependency" = "11:TRUE" - "IsolateTo" = "8:" - } - "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_885E4C7F15BDEEC36B67AA9563BB2B51" - { - "AssemblyRegister" = "3:1" - "AssemblyIsInGAC" = "11:FALSE" - "AssemblyAsmDisplayName" = "8:Microsoft.VisualStudio.Shell.9.0, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" - "ScatterAssemblies" - { - "_885E4C7F15BDEEC36B67AA9563BB2B51" - { - "Name" = "8:Microsoft.VisualStudio.Shell.9.0.dll" - "Attributes" = "3:512" - } - } - "SourcePath" = "8:Microsoft.VisualStudio.Shell.9.0.dll" - "TargetName" = "8:" - "Tag" = "8:" - "Folder" = "8:_9CEFC880051C415E8D84F1B285EB78FA" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:TRUE" - "IsDependency" = "11:TRUE" - "IsolateTo" = "8:" - } - "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_89C47BE8196A61202AC166EE517FC092" - { - "AssemblyRegister" = "3:1" - "AssemblyIsInGAC" = "11:FALSE" - "AssemblyAsmDisplayName" = "8:VSLangProj2, Version=7.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" - "ScatterAssemblies" - { - "_89C47BE8196A61202AC166EE517FC092" - { - "Name" = "8:VSLangProj2.dll" - "Attributes" = "3:512" - } - } - "SourcePath" = "8:VSLangProj2.dll" - "TargetName" = "8:" - "Tag" = "8:" - "Folder" = "8:_73B0C616A8BB4F9C8EAA121307B00A0E" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:TRUE" - "IsDependency" = "11:TRUE" - "IsolateTo" = "8:" - } - "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_91B110ECD9B3A3EED8C259AA69206910" - { - "AssemblyRegister" = "3:1" - "AssemblyIsInGAC" = "11:TRUE" - "AssemblyAsmDisplayName" = "8:Microsoft.MSXML, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" - "ScatterAssemblies" - { - "_91B110ECD9B3A3EED8C259AA69206910" - { - "Name" = "8:Microsoft.MSXML.dll" - "Attributes" = "3:512" - } - } - "SourcePath" = "8:Microsoft.MSXML.dll" - "TargetName" = "8:" - "Tag" = "8:" - "Folder" = "8:_9CEFC880051C415E8D84F1B285EB78FA" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:TRUE" - "IsDependency" = "11:TRUE" - "IsolateTo" = "8:" - } - "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_96FE95C5ED97685D8A35E945EEBFF16A" - { - "AssemblyRegister" = "3:1" - "AssemblyIsInGAC" = "11:FALSE" - "AssemblyAsmDisplayName" = "8:Microsoft.VisualStudio.Designer.Interfaces, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" - "ScatterAssemblies" - { - "_96FE95C5ED97685D8A35E945EEBFF16A" - { - "Name" = "8:Microsoft.VisualStudio.Designer.Interfaces.dll" - "Attributes" = "3:512" - } - } - "SourcePath" = "8:Microsoft.VisualStudio.Designer.Interfaces.dll" - "TargetName" = "8:" - "Tag" = "8:" - "Folder" = "8:_9CEFC880051C415E8D84F1B285EB78FA" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:TRUE" - "IsDependency" = "11:TRUE" - "IsolateTo" = "8:" - } - "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_A7593823FCCBA8A5CAD30AA20291CB19" - { - "AssemblyRegister" = "3:1" - "AssemblyIsInGAC" = "11:FALSE" - "AssemblyAsmDisplayName" = "8:Microsoft.VisualStudio.TextManager.Interop.8.0, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" - "ScatterAssemblies" - { - "_A7593823FCCBA8A5CAD30AA20291CB19" - { - "Name" = "8:Microsoft.VisualStudio.TextManager.Interop.8.0.dll" - "Attributes" = "3:512" - } - } - "SourcePath" = "8:Microsoft.VisualStudio.TextManager.Interop.8.0.dll" - "TargetName" = "8:" - "Tag" = "8:" - "Folder" = "8:_9CEFC880051C415E8D84F1B285EB78FA" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:TRUE" - "IsDependency" = "11:TRUE" - "IsolateTo" = "8:" - } - "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_AA37555C7C0469F8074E8EADC0B775B1" - { - "AssemblyRegister" = "3:1" - "AssemblyIsInGAC" = "11:FALSE" - "AssemblyAsmDisplayName" = "8:Microsoft.ApplicationBlocks.Data, Version=1.0.1559.20655, Culture=neutral" - "ScatterAssemblies" - { - "_AA37555C7C0469F8074E8EADC0B775B1" - { - "Name" = "8:Microsoft.ApplicationBlocks.Data.dll" - "Attributes" = "3:512" - } - } - "SourcePath" = "8:Microsoft.ApplicationBlocks.Data.dll" - "TargetName" = "8:" - "Tag" = "8:" - "Folder" = "8:_9CEFC880051C415E8D84F1B285EB78FA" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:FALSE" - "IsDependency" = "11:TRUE" - "IsolateTo" = "8:" - } - "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_AC86EBB7EFACB032EBD5C428EDE600A9" - { - "AssemblyRegister" = "3:1" - "AssemblyIsInGAC" = "11:FALSE" - "AssemblyAsmDisplayName" = "8:umbraco, Version=1.0.3317.32692, Culture=neutral, processorArchitecture=MSIL" - "ScatterAssemblies" - { - "_AC86EBB7EFACB032EBD5C428EDE600A9" - { - "Name" = "8:umbraco.dll" - "Attributes" = "3:512" - } - } - "SourcePath" = "8:umbraco.dll" - "TargetName" = "8:" - "Tag" = "8:" - "Folder" = "8:_9CEFC880051C415E8D84F1B285EB78FA" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:FALSE" - "IsDependency" = "11:TRUE" - "IsolateTo" = "8:" - } - "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_AD9348DC4493A66504DB02526E419114" - { - "AssemblyRegister" = "3:1" - "AssemblyIsInGAC" = "11:FALSE" - "AssemblyAsmDisplayName" = "8:businesslogic, Version=1.0.3317.17186, Culture=neutral, processorArchitecture=MSIL" - "ScatterAssemblies" - { - "_AD9348DC4493A66504DB02526E419114" - { - "Name" = "8:businesslogic.dll" - "Attributes" = "3:512" - } - } - "SourcePath" = "8:businesslogic.dll" - "TargetName" = "8:" - "Tag" = "8:" - "Folder" = "8:_9CEFC880051C415E8D84F1B285EB78FA" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:FALSE" - "IsDependency" = "11:TRUE" - "IsolateTo" = "8:" - } - "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_AEB6A1C9040B405D879808139EB0D378" - { - "SourcePath" = "8:..\\..\\..\\dep\\Imagery\\umbraco.ico" - "TargetName" = "8:umbraco.ico" - "Tag" = "8:" - "Folder" = "8:_9CEFC880051C415E8D84F1B285EB78FA" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:FALSE" - "IsDependency" = "11:FALSE" - "IsolateTo" = "8:" - } - "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_B914C40F58C09277BB8493610F624BA7" - { - "SourcePath" = "8:vslangproj80.olb" - "TargetName" = "8:vslangproj80.olb" - "Tag" = "8:" - "Folder" = "8:_73B0C616A8BB4F9C8EAA121307B00A0E" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:TRUE" - "IsDependency" = "11:TRUE" - "IsolateTo" = "8:" - } - "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_BFDA41D2B373F97ADE98202496895FD8" - { - "AssemblyRegister" = "3:1" - "AssemblyIsInGAC" = "11:FALSE" - "AssemblyAsmDisplayName" = "8:Microsoft.VisualStudio.ProjectAggregator, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" - "ScatterAssemblies" - { - "_BFDA41D2B373F97ADE98202496895FD8" - { - "Name" = "8:Microsoft.VisualStudio.ProjectAggregator.dll" - "Attributes" = "3:512" - } - } - "SourcePath" = "8:Microsoft.VisualStudio.ProjectAggregator.dll" - "TargetName" = "8:" - "Tag" = "8:" - "Folder" = "8:_9CEFC880051C415E8D84F1B285EB78FA" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:TRUE" - "IsDependency" = "11:TRUE" - "IsolateTo" = "8:" - } - "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_E67BBC8865F3231DBE18645E50209C79" - { - "AssemblyRegister" = "3:1" - "AssemblyIsInGAC" = "11:FALSE" - "AssemblyAsmDisplayName" = "8:EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" - "ScatterAssemblies" - { - "_E67BBC8865F3231DBE18645E50209C79" - { - "Name" = "8:EnvDTE.dll" - "Attributes" = "3:512" - } - } - "SourcePath" = "8:EnvDTE.dll" - "TargetName" = "8:" - "Tag" = "8:" - "Folder" = "8:_9CEFC880051C415E8D84F1B285EB78FA" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:TRUE" - "IsDependency" = "11:TRUE" - "IsolateTo" = "8:" - } - "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_EC3894ACAC9518C25134898C6B0C084B" - { - "AssemblyRegister" = "3:1" - "AssemblyIsInGAC" = "11:FALSE" - "AssemblyAsmDisplayName" = "8:Microsoft.VisualStudio.Shell.Interop.9.0, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" - "ScatterAssemblies" - { - "_EC3894ACAC9518C25134898C6B0C084B" - { - "Name" = "8:Microsoft.VisualStudio.Shell.Interop.9.0.dll" - "Attributes" = "3:512" - } - } - "SourcePath" = "8:Microsoft.VisualStudio.Shell.Interop.9.0.dll" - "TargetName" = "8:" - "Tag" = "8:" - "Folder" = "8:_9CEFC880051C415E8D84F1B285EB78FA" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:TRUE" - "IsDependency" = "11:TRUE" - "IsolateTo" = "8:" - } - "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_F0A1398309CD846D7B9EF833FDA170D4" - { - "AssemblyRegister" = "3:1" - "AssemblyIsInGAC" = "11:FALSE" - "AssemblyAsmDisplayName" = "8:cms, Version=1.0.3317.32688, Culture=neutral, processorArchitecture=MSIL" - "ScatterAssemblies" - { - "_F0A1398309CD846D7B9EF833FDA170D4" - { - "Name" = "8:cms.dll" - "Attributes" = "3:512" - } - } - "SourcePath" = "8:cms.dll" - "TargetName" = "8:" - "Tag" = "8:" - "Folder" = "8:_9CEFC880051C415E8D84F1B285EB78FA" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:FALSE" - "IsDependency" = "11:TRUE" - "IsolateTo" = "8:" - } - "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_FBFD62A14CE6FCD6E76FF5CE8FFEE4AE" - { - "AssemblyRegister" = "3:1" - "AssemblyIsInGAC" = "11:FALSE" - "AssemblyAsmDisplayName" = "8:Microsoft.VisualStudio.Shell.Interop.8.0, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" - "ScatterAssemblies" - { - "_FBFD62A14CE6FCD6E76FF5CE8FFEE4AE" - { - "Name" = "8:Microsoft.VisualStudio.Shell.Interop.8.0.dll" - "Attributes" = "3:512" - } - } - "SourcePath" = "8:Microsoft.VisualStudio.Shell.Interop.8.0.dll" - "TargetName" = "8:" - "Tag" = "8:" - "Folder" = "8:_9CEFC880051C415E8D84F1B285EB78FA" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:TRUE" - "IsDependency" = "11:TRUE" - "IsolateTo" = "8:" - } - } - "FileType" - { - } - "Folder" - { - "{1525181F-901A-416C-8A58-119130FE478E}:_2052EE8191F54B088969D30273A196D9" - { - "Name" = "8:#1919" - "AlwaysCreate" = "11:FALSE" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Property" = "8:ProgramMenuFolder" - "Folders" - { - } - } - "{C7E34266-2C30-44B9-A9A3-4E394ABD6E18}:_73B0C616A8BB4F9C8EAA121307B00A0E" - { - "Name" = "8:#1927" - "AlwaysCreate" = "11:FALSE" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Property" = "8:GAC" - "Folders" - { - } - } - "{3C67513D-01DD-4637-8A68-80971EB9504F}:_9CEFC880051C415E8D84F1B285EB78FA" - { - "DefaultLocation" = "8:[ProgramFilesFolder][Manufacturer]\\[ProductName]" - "Name" = "8:#1925" - "AlwaysCreate" = "11:FALSE" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Property" = "8:TARGETDIR" - "Folders" - { - } - } - "{1525181F-901A-416C-8A58-119130FE478E}:_FC771D075C8D495E998E793C808B4766" - { - "Name" = "8:#1916" - "AlwaysCreate" = "11:FALSE" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Property" = "8:DesktopFolder" - "Folders" - { - } - } - } - "LaunchCondition" - { - } - "Locator" - { - } - "MsiBootstrapper" - { - "LangId" = "3:1033" - "RequiresElevation" = "11:FALSE" - } - "Product" - { - "Name" = "8:Microsoft Visual Studio" - "ProductName" = "8:LINQ to Umbraco" - "ProductCode" = "8:{CB9A0CCF-BAB3-41F2-BEEF-CBBA78688CC9}" - "PackageCode" = "8:{3CAD9FDE-244D-4887-BFC4-3A38AFCBDED8}" - "UpgradeCode" = "8:{9333E29A-16A1-4E64-BA1C-841E709FF479}" - "RestartWWWService" = "11:FALSE" - "RemovePreviousVersions" = "11:FALSE" - "DetectNewerInstalledVersion" = "11:TRUE" - "InstallAllUsers" = "11:FALSE" - "ProductVersion" = "8:0.0.1" - "Manufacturer" = "8:Umbraco" - "ARPHELPTELEPHONE" = "8:" - "ARPHELPLINK" = "8:http://umbraco.codeplex.com" - "Title" = "8:LINQ to Umbraco" - "Subject" = "8:" - "ARPCONTACT" = "8:Umbraco" - "Keywords" = "8:" - "ARPCOMMENTS" = "8:LINQ to Umbraco VS Plugin" - "ARPURLINFOABOUT" = "8:http://umbraco.org" - "ARPPRODUCTICON" = "8:_AEB6A1C9040B405D879808139EB0D378" - "ARPIconIndex" = "3:0" - "SearchPath" = "8:" - "UseSystemSearchPath" = "11:TRUE" - "TargetPlatform" = "3:0" - "PreBuildEvent" = "8:" - "PostBuildEvent" = "8:" - "RunPostBuildEvent" = "3:0" - } - "Registry" - { - "HKLM" - { - "Keys" - { - "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_6DCD2A80019F4D2D9AE0AE5F495A6C0C" - { - "Name" = "8:Software" - "Condition" = "8:" - "AlwaysCreate" = "11:FALSE" - "DeleteAtUninstall" = "11:FALSE" - "Transitive" = "11:FALSE" - "Keys" - { - "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_C4DB2D81ADC8401A91A9C387E45FBC52" - { - "Name" = "8:Microsoft" - "Condition" = "8:" - "AlwaysCreate" = "11:FALSE" - "DeleteAtUninstall" = "11:FALSE" - "Transitive" = "11:FALSE" - "Keys" - { - "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_16A8FDD7717E4BEF86E70F8614957C12" - { - "Name" = "8:.NETFramework" - "Condition" = "8:" - "AlwaysCreate" = "11:FALSE" - "DeleteAtUninstall" = "11:FALSE" - "Transitive" = "11:FALSE" - "Keys" - { - "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_4E9DD339AD374936BC5D51BAEA46F7F8" - { - "Name" = "8:v4.0" - "Condition" = "8:" - "AlwaysCreate" = "11:FALSE" - "DeleteAtUninstall" = "11:FALSE" - "Transitive" = "11:FALSE" - "Keys" - { - "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_4411497D8D0A4D96AED2464EC5AA882F" - { - "Name" = "8:AssemblyFoldersEx" - "Condition" = "8:" - "AlwaysCreate" = "11:FALSE" - "DeleteAtUninstall" = "11:FALSE" - "Transitive" = "11:FALSE" - "Keys" - { - "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_6AE5BAFBC57544B5B985CC389A38CF74" - { - "Name" = "8:LINQtoUmbracoGenerator" - "Condition" = "8:" - "AlwaysCreate" = "11:FALSE" - "DeleteAtUninstall" = "11:FALSE" - "Transitive" = "11:FALSE" - "Keys" - { - } - "Values" - { - "{ADCFDA98-8FDD-45E4-90BC-E3D20B029870}:_F6530CAB2B544FE094B2F388A04CB065" - { - "Name" = "8:" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "ValueTypes" = "3:1" - "Value" = "8:[TARGETDIR]" - } - } - } - } - "Values" - { - } - } - } - "Values" - { - } - } - "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_55E2FA10871549D7951D3F0FD94865F2" - { - "Name" = "8:v3.5" - "Condition" = "8:" - "AlwaysCreate" = "11:FALSE" - "DeleteAtUninstall" = "11:FALSE" - "Transitive" = "11:FALSE" - "Keys" - { - "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_9CC567803B0640278311B080195B7058" - { - "Name" = "8:AssemblyFoldersEx" - "Condition" = "8:" - "AlwaysCreate" = "11:FALSE" - "DeleteAtUninstall" = "11:FALSE" - "Transitive" = "11:FALSE" - "Keys" - { - "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_7C0449C0145E4787ABD0617D227E56B9" - { - "Name" = "8:LINQtoUmbracoGenerator" - "Condition" = "8:" - "AlwaysCreate" = "11:FALSE" - "DeleteAtUninstall" = "11:FALSE" - "Transitive" = "11:FALSE" - "Keys" - { - } - "Values" - { - "{ADCFDA98-8FDD-45E4-90BC-E3D20B029870}:_0FC774523CF84E8C99436F29DC418133" - { - "Name" = "8:(Default)" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "ValueTypes" = "3:2" - "Value" = "8:[TARGETDIR]" - } - } - } - } - "Values" - { - } - } - } - "Values" - { - } - } - } - "Values" - { - } - } - "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_A45494E9904849718D2A53C9FBE4C0B9" - { - "Name" = "8:VisualStudio" - "Condition" = "8:" - "AlwaysCreate" = "11:FALSE" - "DeleteAtUninstall" = "11:FALSE" - "Transitive" = "11:FALSE" - "Keys" - { - "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_1222982D03B849989351846564B7D102" - { - "Name" = "8:9.0" - "Condition" = "8:" - "AlwaysCreate" = "11:FALSE" - "DeleteAtUninstall" = "11:FALSE" - "Transitive" = "11:FALSE" - "Keys" - { - "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_2BFBF326494A4406904762D5E6D90C81" - { - "Name" = "8:Generators" - "Condition" = "8:" - "AlwaysCreate" = "11:FALSE" - "DeleteAtUninstall" = "11:FALSE" - "Transitive" = "11:FALSE" - "Keys" - { - "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_3CB272C04F464CDE86AD0059ECA043F8" - { - "Name" = "8:{164B10B9-B200-11D0-8C61-00A0C91E29D5}" - "Condition" = "8:" - "AlwaysCreate" = "11:FALSE" - "DeleteAtUninstall" = "11:FALSE" - "Transitive" = "11:FALSE" - "Keys" - { - "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_47113B8234AA42FD82ADE61FE9A0BDA8" - { - "Name" = "8:LINQtoUmbracoGenerator" - "Condition" = "8:" - "AlwaysCreate" = "11:FALSE" - "DeleteAtUninstall" = "11:FALSE" - "Transitive" = "11:FALSE" - "Keys" - { - } - "Values" - { - "{ADCFDA98-8FDD-45E4-90BC-E3D20B029870}:_2C3FDC3DD0B04281BBCAAA39F55C75B2" - { - "Name" = "8:GeneratesDesignTimeSource" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "ValueTypes" = "3:3" - "Value" = "3:1" - } - "{ADCFDA98-8FDD-45E4-90BC-E3D20B029870}:_AF104CE35E1C4377AA837573AD15E664" - { - "Name" = "8:" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "ValueTypes" = "3:1" - "Value" = "8:VB LINQ to Umbraco Code Generator" - } - "{ADCFDA98-8FDD-45E4-90BC-E3D20B029870}:_DC8494EE8B314FB9A6A7237865340B2C" - { - "Name" = "8:CLSID" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "ValueTypes" = "3:1" - "Value" = "8:{52B316AA-1997-4c81-9969-95404C09EEB4}" - } - } - } - } - "Values" - { - } - } - "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_F08FDD1344684FFFA597AC41A50E20D7" - { - "Name" = "8:{FAE04EC1-301F-11D3-BF4B-00C04F79EFBC}" - "Condition" = "8:" - "AlwaysCreate" = "11:FALSE" - "DeleteAtUninstall" = "11:FALSE" - "Transitive" = "11:FALSE" - "Keys" - { - "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_939839EC2AEF45FFB0C73AF693CD8FEA" - { - "Name" = "8:LINQtoUmbracoGenerator" - "Condition" = "8:" - "AlwaysCreate" = "11:FALSE" - "DeleteAtUninstall" = "11:FALSE" - "Transitive" = "11:FALSE" - "Keys" - { - } - "Values" - { - "{ADCFDA98-8FDD-45E4-90BC-E3D20B029870}:_56017447FB084A97BCB380CE8D1AFD6F" - { - "Name" = "8:" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "ValueTypes" = "3:1" - "Value" = "8:C# LINQ to Umbraco Code Generator" - } - "{ADCFDA98-8FDD-45E4-90BC-E3D20B029870}:_A20B18D9F5A743B3A53AB7DEE84D8241" - { - "Name" = "8:CLSID" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "ValueTypes" = "3:1" - "Value" = "8:{52B316AA-1997-4c81-9969-95404C09EEB4}" - } - "{ADCFDA98-8FDD-45E4-90BC-E3D20B029870}:_A46535DEB7B74040B1DB8D4746B99B3F" - { - "Name" = "8:GeneratesDesignTimeSource" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "ValueTypes" = "3:3" - "Value" = "3:1" - } - } - } - } - "Values" - { - } - } - } - "Values" - { - } - } - } - "Values" - { - } - } - "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_CCC18AE33B484D4EA2FC9771DCA126F1" - { - "Name" = "8:10.0" - "Condition" = "8:" - "AlwaysCreate" = "11:FALSE" - "DeleteAtUninstall" = "11:FALSE" - "Transitive" = "11:FALSE" - "Keys" - { - "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_6C6BD23CFA4C4873BD1F2AB322A9E2B8" - { - "Name" = "8:Generators" - "Condition" = "8:" - "AlwaysCreate" = "11:FALSE" - "DeleteAtUninstall" = "11:FALSE" - "Transitive" = "11:FALSE" - "Keys" - { - "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_8CD6463DD52743ACBCE577562CD12F38" - { - "Name" = "8:{FAE04EC1-301F-11D3-BF4B-00C04F79EFBC}" - "Condition" = "8:" - "AlwaysCreate" = "11:FALSE" - "DeleteAtUninstall" = "11:FALSE" - "Transitive" = "11:FALSE" - "Keys" - { - "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_40A497F821FE4AECB8DD2B6AE7D3D17F" - { - "Name" = "8:LINQtoUmbracoGenerator" - "Condition" = "8:" - "AlwaysCreate" = "11:FALSE" - "DeleteAtUninstall" = "11:FALSE" - "Transitive" = "11:FALSE" - "Keys" - { - } - "Values" - { - "{ADCFDA98-8FDD-45E4-90BC-E3D20B029870}:_568E476991E54ADD882C95F2A1E17217" - { - "Name" = "8:" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "ValueTypes" = "3:1" - "Value" = "8:C# LINQ to Umbraco Code Generator" - } - "{ADCFDA98-8FDD-45E4-90BC-E3D20B029870}:_7C7885DC0A3B4B12B8572793170198CC" - { - "Name" = "8:GeneratesDesignTimeSource" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "ValueTypes" = "3:3" - "Value" = "3:1" - } - "{ADCFDA98-8FDD-45E4-90BC-E3D20B029870}:_9DA2C4C85E744EC08223EF56BEBB66C9" - { - "Name" = "8:CLSID" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "ValueTypes" = "3:1" - "Value" = "8:{52B316AA-1997-4c81-9969-95404C09EEB4}" - } - } - } - } - "Values" - { - } - } - "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_DADC75A91B0A4DB19B62DD525978CAC5" - { - "Name" = "8:{164B10B9-B200-11D0-8C61-00A0C91E29D5}" - "Condition" = "8:" - "AlwaysCreate" = "11:FALSE" - "DeleteAtUninstall" = "11:FALSE" - "Transitive" = "11:FALSE" - "Keys" - { - "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_8A2844B9F7E046B49CA3B5874DC61758" - { - "Name" = "8:LINQtoUmbracoGenerator" - "Condition" = "8:" - "AlwaysCreate" = "11:FALSE" - "DeleteAtUninstall" = "11:FALSE" - "Transitive" = "11:FALSE" - "Keys" - { - } - "Values" - { - "{ADCFDA98-8FDD-45E4-90BC-E3D20B029870}:_1AD0AC573DF448359D4927AB9BC330DD" - { - "Name" = "8:" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "ValueTypes" = "3:1" - "Value" = "8:VB LINQ to Umbraco Code Generator" - } - "{ADCFDA98-8FDD-45E4-90BC-E3D20B029870}:_E94CCEB18EB14E8BB5B09EE6F29E71A9" - { - "Name" = "8:CLSID" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "ValueTypes" = "3:1" - "Value" = "8:{52B316AA-1997-4c81-9969-95404C09EEB4}" - } - "{ADCFDA98-8FDD-45E4-90BC-E3D20B029870}:_F19FDB317C274318B0CC4E78425E3FC8" - { - "Name" = "8:GeneratesDesignTimeSource" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "ValueTypes" = "3:3" - "Value" = "3:1" - } - } - } - } - "Values" - { - } - } - } - "Values" - { - } - } - } - "Values" - { - } - } - } - "Values" - { - } - } - } - "Values" - { - } - } - } - "Values" - { - } - } - } - } - "HKCU" - { - "Keys" - { - } - } - "HKCR" - { - "Keys" - { - } - } - "HKU" - { - "Keys" - { - } - } - "HKPU" - { - "Keys" - { - } - } - } - "Sequences" - { - } - "Shortcut" - { - } - "UserInterface" - { - "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_1B628D6B95D34589ACD6C20AEA00FDF1" - { - "Name" = "8:#1900" - "Sequence" = "3:1" - "Attributes" = "3:1" - "Dialogs" - { - "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_1F21BEC99A9648938695332D87AEA600" - { - "Sequence" = "3:320" - "DisplayName" = "8:Confirm Installation" - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:\\VsdConfirmDlg.wid" - "Properties" - { - "BannerBitmap" - { - "Name" = "8:BannerBitmap" - "DisplayName" = "8:#1001" - "Description" = "8:#1101" - "Type" = "3:8" - "ContextData" = "8:Bitmap" - "Attributes" = "3:4" - "Setting" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - } - } - "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_7317CC181B254A0B96ED8E4CB00565AE" - { - "Sequence" = "3:210" - "DisplayName" = "8:License Agreement" - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:\\VsdLicenseDlg.wid" - "Properties" - { - "BannerBitmap" - { - "Name" = "8:BannerBitmap" - "DisplayName" = "8:#1001" - "Description" = "8:#1101" - "Type" = "3:8" - "ContextData" = "8:Bitmap" - "Attributes" = "3:4" - "Setting" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - "EulaText" - { - "Name" = "8:EulaText" - "DisplayName" = "8:#1008" - "Description" = "8:#1108" - "Type" = "3:6" - "ContextData" = "8:" - "Attributes" = "3:0" - "Setting" = "3:0" - "UsePlugInResources" = "11:TRUE" - } - "Sunken" - { - "Name" = "8:Sunken" - "DisplayName" = "8:#1007" - "Description" = "8:#1107" - "Type" = "3:5" - "ContextData" = "8:4;True=4;False=0" - "Attributes" = "3:0" - "Setting" = "3:0" - "Value" = "3:4" - "DefaultValue" = "3:4" - "UsePlugInResources" = "11:TRUE" - } - } - } - "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_7DABC7EEFC164918AAF48DE3FE660CE3" - { - "Sequence" = "3:310" - "DisplayName" = "8:Installation Folder" - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:\\VsdFolderDlg.wid" - "Properties" - { - "BannerBitmap" - { - "Name" = "8:BannerBitmap" - "DisplayName" = "8:#1001" - "Description" = "8:#1101" - "Type" = "3:8" - "ContextData" = "8:Bitmap" - "Attributes" = "3:4" - "Setting" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - "InstallAllUsersVisible" - { - "Name" = "8:InstallAllUsersVisible" - "DisplayName" = "8:#1059" - "Description" = "8:#1159" - "Type" = "3:5" - "ContextData" = "8:1;True=1;False=0" - "Attributes" = "3:0" - "Setting" = "3:0" - "Value" = "3:1" - "DefaultValue" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - } - } - "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_9277CD1C7BFF49FABA8F6605BA24D32C" - { - "Sequence" = "3:100" - "DisplayName" = "8:Welcome" - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:\\VsdWelcomeDlg.wid" - "Properties" - { - "BannerBitmap" - { - "Name" = "8:BannerBitmap" - "DisplayName" = "8:#1001" - "Description" = "8:#1101" - "Type" = "3:8" - "ContextData" = "8:Bitmap" - "Attributes" = "3:4" - "Setting" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - "CopyrightWarning" - { - "Name" = "8:CopyrightWarning" - "DisplayName" = "8:#1002" - "Description" = "8:#1102" - "Type" = "3:3" - "ContextData" = "8:" - "Attributes" = "3:0" - "Setting" = "3:1" - "Value" = "8:#1202" - "DefaultValue" = "8:#1202" - "UsePlugInResources" = "11:TRUE" - } - "Welcome" - { - "Name" = "8:Welcome" - "DisplayName" = "8:#1003" - "Description" = "8:#1103" - "Type" = "3:3" - "ContextData" = "8:" - "Attributes" = "3:0" - "Setting" = "3:1" - "Value" = "8:#1203" - "DefaultValue" = "8:#1203" - "UsePlugInResources" = "11:TRUE" - } - } - } - } - } - "{2479F3F5-0309-486D-8047-8187E2CE5BA0}:_33512CDDE856438390A31BE7A04388D2" - { - "UseDynamicProperties" = "11:FALSE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:\\VsdBasicDialogs.wim" - } - "{2479F3F5-0309-486D-8047-8187E2CE5BA0}:_38E55C707A2147A6B3A4CAA0E0140585" - { - "UseDynamicProperties" = "11:FALSE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:\\VsdUserInterface.wim" - } - "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_3A8B4B82014A414DACF26D176DB012C7" - { - "Name" = "8:#1901" - "Sequence" = "3:2" - "Attributes" = "3:2" - "Dialogs" - { - "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_D238F2CE01B243D38C2788240466AB87" - { - "Sequence" = "3:100" - "DisplayName" = "8:Progress" - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:\\VsdAdminProgressDlg.wid" - "Properties" - { - "BannerBitmap" - { - "Name" = "8:BannerBitmap" - "DisplayName" = "8:#1001" - "Description" = "8:#1101" - "Type" = "3:8" - "ContextData" = "8:Bitmap" - "Attributes" = "3:4" - "Setting" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - "ShowProgress" - { - "Name" = "8:ShowProgress" - "DisplayName" = "8:#1009" - "Description" = "8:#1109" - "Type" = "3:5" - "ContextData" = "8:1;True=1;False=0" - "Attributes" = "3:0" - "Setting" = "3:0" - "Value" = "3:1" - "DefaultValue" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - } - } - } - } - "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_482F9F590E6F4A3F92776F874A338FA7" - { - "Name" = "8:#1902" - "Sequence" = "3:2" - "Attributes" = "3:3" - "Dialogs" - { - "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_20C13BC47DF44DA4B468224F84C87604" - { - "Sequence" = "3:100" - "DisplayName" = "8:Finished" - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:\\VsdAdminFinishedDlg.wid" - "Properties" - { - "BannerBitmap" - { - "Name" = "8:BannerBitmap" - "DisplayName" = "8:#1001" - "Description" = "8:#1101" - "Type" = "3:8" - "ContextData" = "8:Bitmap" - "Attributes" = "3:4" - "Setting" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - } - } - } - } - "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_50676D0814984405A46C2D4B224B7AD2" - { - "Name" = "8:#1900" - "Sequence" = "3:2" - "Attributes" = "3:1" - "Dialogs" - { - "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_31B9C8D5274D4E249754477985EA44BA" - { - "Sequence" = "3:200" - "DisplayName" = "8:Installation Folder" - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:\\VsdAdminFolderDlg.wid" - "Properties" - { - "BannerBitmap" - { - "Name" = "8:BannerBitmap" - "DisplayName" = "8:#1001" - "Description" = "8:#1101" - "Type" = "3:8" - "ContextData" = "8:Bitmap" - "Attributes" = "3:4" - "Setting" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - } - } - "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_A4F62A0FC6374584B05D992FBFE000D9" - { - "Sequence" = "3:300" - "DisplayName" = "8:Confirm Installation" - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:\\VsdAdminConfirmDlg.wid" - "Properties" - { - "BannerBitmap" - { - "Name" = "8:BannerBitmap" - "DisplayName" = "8:#1001" - "Description" = "8:#1101" - "Type" = "3:8" - "ContextData" = "8:Bitmap" - "Attributes" = "3:4" - "Setting" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - } - } - "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_BFFD0FA47291402B9387BAAB5D4F2DA9" - { - "Sequence" = "3:100" - "DisplayName" = "8:Welcome" - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:\\VsdAdminWelcomeDlg.wid" - "Properties" - { - "BannerBitmap" - { - "Name" = "8:BannerBitmap" - "DisplayName" = "8:#1001" - "Description" = "8:#1101" - "Type" = "3:8" - "ContextData" = "8:Bitmap" - "Attributes" = "3:4" - "Setting" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - "CopyrightWarning" - { - "Name" = "8:CopyrightWarning" - "DisplayName" = "8:#1002" - "Description" = "8:#1102" - "Type" = "3:3" - "ContextData" = "8:" - "Attributes" = "3:0" - "Setting" = "3:1" - "Value" = "8:#1202" - "DefaultValue" = "8:#1202" - "UsePlugInResources" = "11:TRUE" - } - "Welcome" - { - "Name" = "8:Welcome" - "DisplayName" = "8:#1003" - "Description" = "8:#1103" - "Type" = "3:3" - "ContextData" = "8:" - "Attributes" = "3:0" - "Setting" = "3:1" - "Value" = "8:#1203" - "DefaultValue" = "8:#1203" - "UsePlugInResources" = "11:TRUE" - } - } - } - } - } - "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_8E65F6A5BC084E63B55A3721513E49D6" - { - "Name" = "8:#1901" - "Sequence" = "3:1" - "Attributes" = "3:2" - "Dialogs" - { - "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_0231BB90814540FF8F3D99232AD2FB5E" - { - "Sequence" = "3:100" - "DisplayName" = "8:Progress" - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:\\VsdProgressDlg.wid" - "Properties" - { - "BannerBitmap" - { - "Name" = "8:BannerBitmap" - "DisplayName" = "8:#1001" - "Description" = "8:#1101" - "Type" = "3:8" - "ContextData" = "8:Bitmap" - "Attributes" = "3:4" - "Setting" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - "ShowProgress" - { - "Name" = "8:ShowProgress" - "DisplayName" = "8:#1009" - "Description" = "8:#1109" - "Type" = "3:5" - "ContextData" = "8:1;True=1;False=0" - "Attributes" = "3:0" - "Setting" = "3:0" - "Value" = "3:1" - "DefaultValue" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - } - } - } - } - "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_C5C9D6AD4FE54EE3A6D2777D042E401A" - { - "Name" = "8:#1902" - "Sequence" = "3:1" - "Attributes" = "3:3" - "Dialogs" - { - "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_767C3EC3F9514911B77B74D015AAFBBE" - { - "Sequence" = "3:100" - "DisplayName" = "8:Finished" - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:\\VsdFinishedDlg.wid" - "Properties" - { - "BannerBitmap" - { - "Name" = "8:BannerBitmap" - "DisplayName" = "8:#1001" - "Description" = "8:#1101" - "Type" = "3:8" - "ContextData" = "8:Bitmap" - "Attributes" = "3:4" - "Setting" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - "UpdateText" - { - "Name" = "8:UpdateText" - "DisplayName" = "8:#1058" - "Description" = "8:#1158" - "Type" = "3:15" - "ContextData" = "8:" - "Attributes" = "3:0" - "Setting" = "3:1" - "Value" = "8:#1258" - "DefaultValue" = "8:#1258" - "UsePlugInResources" = "11:TRUE" - } - } - } - } - } - } - "MergeModule" - { - } - "ProjectOutput" - { - "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_6D30E9F6F22443EAB03C704C2A95705C" - { - "SourcePath" = "8:..\\Core\\obj\\Debug\\Umbraco.Linq.Core.dll" - "TargetName" = "8:" - "Tag" = "8:" - "Folder" = "8:_9CEFC880051C415E8D84F1B285EB78FA" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:FALSE" - "IsDependency" = "11:FALSE" - "IsolateTo" = "8:" - "ProjectOutputGroupRegister" = "3:1" - "OutputConfiguration" = "8:" - "OutputGroupCanonicalName" = "8:Built" - "OutputProjectGuid" = "8:{31CAEC36-0C3D-4D69-B092-84866811EA07}" - "ShowKeyOutput" = "11:TRUE" - "ExcludeFilters" - { - } - } - "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_A30C1F9054564E5692E22D1D82E217A9" - { - "SourcePath" = "8:..\\DTMetal.CodeBuilder\\obj\\Debug\\Umbraco.Linq.DTMetal.CodeBuilder.dll" - "TargetName" = "8:" - "Tag" = "8:" - "Folder" = "8:_73B0C616A8BB4F9C8EAA121307B00A0E" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:FALSE" - "IsDependency" = "11:FALSE" - "IsolateTo" = "8:" - "ProjectOutputGroupRegister" = "3:1" - "OutputConfiguration" = "8:" - "OutputGroupCanonicalName" = "8:Built" - "OutputProjectGuid" = "8:{461089E7-008E-4737-BA17-E1FCD1CC3D0E}" - "ShowKeyOutput" = "11:TRUE" - "ExcludeFilters" - { - } - } - "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_A8E59A7104A9450FBC9C4FFE80AE474C" - { - "SourcePath" = "8:" - "TargetName" = "8:" - "Tag" = "8:" - "Folder" = "8:_9CEFC880051C415E8D84F1B285EB78FA" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:FALSE" - "IsDependency" = "11:FALSE" - "IsolateTo" = "8:" - "ProjectOutputGroupRegister" = "3:1" - "OutputConfiguration" = "8:" - "OutputGroupCanonicalName" = "8:ContentFiles" - "OutputProjectGuid" = "8:{B151A571-D2F7-47DD-AFD6-C2C34ECA845B}" - "ShowKeyOutput" = "11:TRUE" - "ExcludeFilters" - { - } - } - "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_B13BAC326D99486C99A5569F3BC4AC9C" - { - "SourcePath" = "8:..\\DTMetal.CodeBuilder\\obj\\Debug\\Umbraco.Linq.DTMetal.CodeBuilder.dll" - "TargetName" = "8:" - "Tag" = "8:" - "Folder" = "8:_9CEFC880051C415E8D84F1B285EB78FA" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:FALSE" - "IsDependency" = "11:FALSE" - "IsolateTo" = "8:" - "ProjectOutputGroupRegister" = "3:1" - "OutputConfiguration" = "8:" - "OutputGroupCanonicalName" = "8:Built" - "OutputProjectGuid" = "8:{461089E7-008E-4737-BA17-E1FCD1CC3D0E}" - "ShowKeyOutput" = "11:TRUE" - "ExcludeFilters" - { - } - } - "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_D04C94D3BAE248ADBB65968A9C8BAD7C" - { - "SourcePath" = "8:..\\DTMetal\\obj\\Debug\\DTMetal.exe" - "TargetName" = "8:" - "Tag" = "8:" - "Folder" = "8:_9CEFC880051C415E8D84F1B285EB78FA" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:FALSE" - "IsDependency" = "11:FALSE" - "IsolateTo" = "8:" - "ProjectOutputGroupRegister" = "3:1" - "OutputConfiguration" = "8:" - "OutputGroupCanonicalName" = "8:Built" - "OutputProjectGuid" = "8:{11939510-3CFD-4781-9E00-22D23F418908}" - "ShowKeyOutput" = "11:TRUE" - "ExcludeFilters" - { - } - } - "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_FCF81B3DB64748709DE0B4B360282466" - { - "SourcePath" = "8:" - "TargetName" = "8:" - "Tag" = "8:" - "Folder" = "8:_9CEFC880051C415E8D84F1B285EB78FA" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:FALSE" - "IsDependency" = "11:FALSE" - "IsolateTo" = "8:" - "ProjectOutputGroupRegister" = "3:1" - "OutputConfiguration" = "8:" - "OutputGroupCanonicalName" = "8:ContentFiles" - "OutputProjectGuid" = "8:{461089E7-008E-4737-BA17-E1FCD1CC3D0E}" - "ShowKeyOutput" = "11:TRUE" - "ExcludeFilters" - { - } - } - } - } -} diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder.Installer/DTMetal.CodeBuilder.Installer.csproj b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder.Installer/DTMetal.CodeBuilder.Installer.csproj deleted file mode 100644 index 7be8bfecb2..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder.Installer/DTMetal.CodeBuilder.Installer.csproj +++ /dev/null @@ -1,93 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {4872D945-97E8-4C30-8EDC-64E424645979} - Library - Properties - Umbraco.Linq.DTMetal.CodeBuilder.Installer - Umbraco.Linq.DTMetal.CodeBuilder.Installer - v3.5 - 512 - SAK - SAK - SAK - SAK - true - ..\Solution Items\umbraco-key.snk - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - 3.5 - - - - - - - - - Properties\SolutionInfo.cs - - - Component - - - Form - - - InstallerProgress.cs - - - - - - InstallerProgress.cs - - - - - - - - - Properties\umbraco-key.snk - - - - - {461089E7-008E-4737-BA17-E1FCD1CC3D0E} - DTMetal.CodeBuilder - - - - - \ No newline at end of file diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder.Installer/InstallerHandler.cs b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder.Installer/InstallerHandler.cs deleted file mode 100644 index 5deb41fb8c..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder.Installer/InstallerHandler.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System.ComponentModel; -using Microsoft.Win32; -using System.Windows.Forms; -using System.Globalization; - -namespace Umbraco.Linq.DTMetal.CodeBuilder.Installer -{ - [RunInstaller(true)] - public class InstallerHandler : System.Configuration.Install.Installer - { - public override void Install(System.Collections.IDictionary stateSaver) - { - base.Install(stateSaver); - - var vsPath = GetVsPath(); - var targetPath = Context.Parameters["TargetDir"]; - - if (vsPath != null && targetPath != null) - { - var progress = new InstallerProgress(InstallMode.Install, vsPath, targetPath); - MessageBoxOptions options = CultureInfo.CurrentUICulture.TextInfo.IsRightToLeft ? MessageBoxOptions.RightAlign | MessageBoxOptions.RtlReading : 0; - if (progress.ShowDialog() != DialogResult.OK) - { - MessageBox.Show("VS 2008 Setup Failed", "LINQ to Umbraco Setup", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1, options); - MessageBox.Show(progress.Error.ToString()); - } - } - } - - private static string GetVsPath() - { - RegistryKey key = Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\VisualStudio\9.0", false); - if (key != null) - return (string)key.GetValue("InstallDir"); - return null; - } - - public override void Uninstall(System.Collections.IDictionary savedState) - { - base.Uninstall(savedState); - - var vsPath = GetVsPath(); - if (vsPath != null) - { - var progress = new InstallerProgress(InstallMode.Uninstall, vsPath, null); - progress.ShowDialog(); - } - } - } -} diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder.Installer/InstallerProgress.Designer.cs b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder.Installer/InstallerProgress.Designer.cs deleted file mode 100644 index de7a076113..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder.Installer/InstallerProgress.Designer.cs +++ /dev/null @@ -1,84 +0,0 @@ -namespace Umbraco.Linq.DTMetal.CodeBuilder.Installer -{ - partial class InstallerProgress - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(InstallerProgress)); - this.label1 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.progressBar1 = new System.Windows.Forms.ProgressBar(); - this.installWorker = new System.ComponentModel.BackgroundWorker(); - this.SuspendLayout(); - // - // label1 - // - resources.ApplyResources(this.label1, "label1"); - this.label1.Name = "label1"; - // - // label2 - // - resources.ApplyResources(this.label2, "label2"); - this.label2.Name = "label2"; - // - // progressBar1 - // - resources.ApplyResources(this.progressBar1, "progressBar1"); - this.progressBar1.Name = "progressBar1"; - this.progressBar1.Style = System.Windows.Forms.ProgressBarStyle.Marquee; - // - // installWorker - // - this.installWorker.DoWork += new System.ComponentModel.DoWorkEventHandler(this.installWorker_DoWork); - this.installWorker.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.installWorker_RunWorkerCompleted); - // - // InstallerProgress - // - resources.ApplyResources(this, "$this"); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ControlBox = false; - this.Controls.Add(this.progressBar1); - this.Controls.Add(this.label2); - this.Controls.Add(this.label1); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "InstallerProgress"; - this.Load += new System.EventHandler(this.InstallerProgress_Load); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.ProgressBar progressBar1; - private System.ComponentModel.BackgroundWorker installWorker; - } -} \ No newline at end of file diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder.Installer/InstallerProgress.cs b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder.Installer/InstallerProgress.cs deleted file mode 100644 index d37126cacd..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder.Installer/InstallerProgress.cs +++ /dev/null @@ -1,287 +0,0 @@ -using System; -using System.ComponentModel; -using System.Text; -using System.Windows.Forms; -using System.IO; -using System.Diagnostics; -using System.Reflection; -using System.Globalization; -using Microsoft.Win32; -using System.Linq; - -namespace Umbraco.Linq.DTMetal.CodeBuilder.Installer -{ - public partial class InstallerProgress : Form - { - private const string generatorKey = "{52B316AA-1997-4c81-9969-95404C09EEB4}"; - private const string dtml = ".dtml"; - private const string clas = "LINQtoUmbraco.DTML.1.0"; - private const string desc = "LINQ to Umbraco Entity Mapping"; - - private InstallMode _mode; - private string _vsPath; - private string _targetPath; - - public InstallerProgress(InstallMode mode, string vsPath, string targetPath) - { - InitializeComponent(); - - _mode = mode; - _vsPath = vsPath; - _targetPath = targetPath; - } - - #region Events - private void installWorker_DoWork(object sender, DoWorkEventArgs e) - { - - switch (_mode) - { - case InstallMode.Install: - InstallVsTemplates(); - SetupRegistry(); - InstallDtmlXsd(); - ConfigVs(); - break; - case InstallMode.Uninstall: - UninstallVsTemplates(); - TearDownRegistry(); - UninstallDtmlXsd(); - ConfigVs(); - break; - default: - break; - } - } - - private void installWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) - { - if (e.Error != null) - { - this.DialogResult = DialogResult.Cancel; - this.Error = e.Error; - } - else - { - this.DialogResult = DialogResult.OK; - } - } - public Exception Error { get; set; } - - private void InstallerProgress_Load(object sender, EventArgs e) - { - installWorker.RunWorkerAsync(); - } - #endregion - - #region Uninstall - private void UninstallDtmlXsd() - { - try - { - File.Delete(GetDtmlXsdPath()); - } - catch { } - } - - private void TearDownRegistry() - { - if(Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\VisualStudio\9.0\CLSID\" + generatorKey) != null) - { - Registry.LocalMachine.DeleteSubKey(@"Software\Microsoft\VisualStudio\9.0\CLSID\" + generatorKey); - } - - if (Registry.ClassesRoot.OpenSubKey(dtml) != null) - { - Registry.ClassesRoot.DeleteSubKeyTree(dtml); - } - - if (Registry.ClassesRoot.OpenSubKey(clas) != null) - { - Registry.ClassesRoot.DeleteSubKeyTree(clas); - } - } - - private void UninstallVsTemplates() - { - string csTgt = Path.Combine(_vsPath, @"ItemTemplates\CSharp\1033\LINQtoUmbracoCS.zip"); - string vbTgt = Path.Combine(_vsPath, @"ItemTemplates\VisualBasic\1033\LINQtoUmbracoVB.zip"); - - try - { - File.Delete(csTgt); - File.Delete(vbTgt); - } - catch { } - } - #endregion - - #region Install - private void InstallDtmlXsd() - { - //string assemblyName = GetCodeBuilderAssemblyName(); - //Assembly assembly = Assembly.Load(assemblyName); - - //it seems that it runs this before the GAC is deployed, so the above code deosn't work - //I have to embed the XSD in this assembly instead - var assembly = Assembly.GetExecutingAssembly(); - - // Load the XSD for DocTypeML. - string xsd; - using (Stream s = ClassGenerator.GetXsd()) - { - using (StreamReader sr = new StreamReader(s)) - { - xsd = sr.ReadToEnd(); - } - } - - // Write the XSD to the Visual Studio folder with XML schemas. - using (StreamWriter sw = File.CreateText(GetDtmlXsdPath())) - { - sw.Write(xsd); - } - } - - private void SetupRegistry() - { - #region LINQtoUmbracoGenerator Key - RegistryKey genKey = Registry.LocalMachine.CreateSubKey(@"Software\Microsoft\VisualStudio\9.0\CLSID\" + generatorKey); - genKey.SetValue("Assembly", GetCodeBuilderAssemblyName()); //full name of the assembly which the generator is in - genKey.SetValue("Class", "Umbraco.Linq.DTMetal.CodeBuilder.LINQtoUmbracoGenerator"); //generator class - genKey.SetValue("InprocServer32", Path.Combine(Environment.GetEnvironmentVariable("SystemRoot"), @"system32\mscoree.dll")); - genKey.SetValue("ThreadingModel", "Both"); - genKey.Close(); - #endregion - - #region HKEY_CLASSES_ROOT\.dtml - { - RegistryKey dtmlKey = Registry.ClassesRoot.CreateSubKey(dtml, RegistryKeyPermissionCheck.ReadWriteSubTree); - dtmlKey.SetValue(null, clas); - dtmlKey.Close(); - } - #endregion - - #region HKEY_CLASSES_ROOT\LINQtoUmbraco.DTML.1.0 - { - RegistryKey kClas = Registry.ClassesRoot.CreateSubKey(clas, RegistryKeyPermissionCheck.ReadWriteSubTree); - kClas.SetValue(null, desc); - kClas.SetValue("AlwaysShowExt", "1"); - - #region HKEY_CLASSES_ROOT\LINQtoUmbraco.DTML.1.0\DefaultIcon - { - RegistryKey kIcon = kClas.CreateSubKey("DefaultIcon"); - kIcon.SetValue(null, Path.Combine(_targetPath, @"DTMetal.exe") + ",0"); - kIcon.Close(); - } - #endregion - - #region HKEY_CLASSES_ROOT\LINQtoUmbraco.DTML.1.0\shell - { - RegistryKey kShel = kClas.CreateSubKey("shell"); - - #region HKEY_CLASSES_ROOT\LINQtoUmbraco.DTML.1.0\shell\Open - { - RegistryKey kOpen = kShel.CreateSubKey("Open"); - - #region HKEY_CLASSES_ROOT\LINQtoUmbraco.DTML.1.0\shell\Open\Command - { - RegistryKey kComm = kOpen.CreateSubKey("Command"); - kComm.SetValue(null, "\"" + Path.Combine(_vsPath, "devenv.exe") + "\" /dde \"%1\""); - kComm.Close(); - } - #endregion - - #region HKEY_CLASSES_ROOT\LINQtoUmbraco.DTML.1.0\shell\Open\ddeexec - { - RegistryKey kDdex = kOpen.CreateSubKey("ddeexec"); - kDdex.SetValue(null, "Open(\"%1\")"); - - #region HKEY_CLASSES_ROOT\LINQtoUmbraco.DTML.1.0\shell\Open\ddeexec\Application - { - RegistryKey kAppn = kDdex.CreateSubKey("Application"); - kAppn.SetValue(null, "VisualStudio.9.0"); - kAppn.Close(); - } - #endregion - - #region HKEY_CLASSES_ROOT\LINQtoUmbraco.DTML.1.0\shell\Open\ddeexec\Topic - { - RegistryKey kTopc = kDdex.CreateSubKey("Topic"); - kTopc.SetValue(null, "system"); - kTopc.Close(); - } - #endregion - - kDdex.Close(); - } - #endregion - - kOpen.Close(); - } - #endregion - - kShel.Close(); - } - #endregion - - kClas.Close(); - } - #endregion - } - - private void InstallVsTemplates() - { - string csSrc = Path.Combine(_targetPath, @"Item packages\LINQtoUmbracoCS.zip"); - string vbSrc = Path.Combine(_targetPath, @"Item packages\LINQtoUmbracoVB.zip"); - string csTgt = Path.Combine(_vsPath, @"ItemTemplates\CSharp\1033\LINQtoUmbracoCS.zip"); - string vbTgt = Path.Combine(_vsPath, @"ItemTemplates\VisualBasic\1033\LINQtoUmbracoVB.zip"); - - if (!File.Exists(csTgt)) - File.Copy(csSrc, csTgt); - if (!File.Exists(vbTgt)) - File.Copy(vbSrc, vbTgt); - } - #endregion - - private static string GetCodeBuilderAssemblyName() - { - //get the assembly version info - AssemblyName current = Assembly.GetExecutingAssembly().GetName(); - - StringBuilder sb = new StringBuilder(); - foreach (byte b in current.GetPublicKeyToken()) - sb.AppendFormat("{0:x2}", b); - - string publicKeyToken = sb.ToString(); - string version = current.Version.ToString(); - - return String.Format(CultureInfo.InvariantCulture, "Umbraco.Linq.DTMetal.CodeBuilder, Version={0}, Culture=neutral, PublicKeyToken={1}", version, publicKeyToken); - } - - private string GetDtmlXsdPath() - { - string path = _vsPath; //%ProgramFiles%\Microsoft Visual Studio 9.0\Common7\IDE\ - path = path.TrimEnd('\\'); //%ProgramFiles%\Microsoft Visual Studio 9.0\Common7\IDE - path = path.Substring(0, path.LastIndexOf('\\')); //%ProgramFiles%\Microsoft Visual Studio 9.0\Common7 - path = path.Substring(0, path.LastIndexOf('\\')); //%ProgramFiles%\Microsoft Visual Studio 9.0 - path = Path.Combine(path, "Xml"); //%ProgramFiles%\Microsoft Visual Studio 9.0\Xml - path = Path.Combine(path, "Schemas"); //%ProgramFiles%\Microsoft Visual Studio 9.0\Xml\Schemas - path = Path.Combine(path, "DocTypeML.xsd"); //%ProgramFiles%\Microsoft Visual Studio 9.0\Xml\Schemas\DocTypeML.xsd - return path; - } - - private void ConfigVs() - { - string devenv = Path.Combine(_vsPath, "devenv.exe"); - Process p = Process.Start(devenv, "/InstallVSTemplates"); - p.WaitForExit(); - } - } - - public enum InstallMode - { - Install, - Uninstall - } -} diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder.Installer/InstallerProgress.resx b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder.Installer/InstallerProgress.resx deleted file mode 100644 index 35832e825c..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder.Installer/InstallerProgress.resx +++ /dev/null @@ -1,228 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 - - - - True - - - - 13, 13 - - - 246, 13 - - - 0 - - - LINQ to Umbraco is configuring Visual Studio 2008 - - - label1 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 2 - - - True - - - 25, 30 - - - 221, 13 - - - 1 - - - This may take a few minutes, please stand by - - - label2 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 1 - - - 16, 61 - - - 243, 27 - - - 2 - - - progressBar1 - - - System.Windows.Forms.ProgressBar, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 0 - - - 17, 17 - - - True - - - 6, 13 - - - 275, 100 - - - - CenterParent - - - LINQ to Umbraco Installer Progress - - - installWorker - - - System.ComponentModel.BackgroundWorker, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - InstallerProgress - - - System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder.Installer/Item packages/LINQtoUmbracoCS.zip b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder.Installer/Item packages/LINQtoUmbracoCS.zip deleted file mode 100644 index 84638a138a..0000000000 Binary files a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder.Installer/Item packages/LINQtoUmbracoCS.zip and /dev/null differ diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder.Installer/Item packages/LINQtoUmbracoCS/LINQtoUmbracoCS.vstemplate b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder.Installer/Item packages/LINQtoUmbracoCS/LINQtoUmbracoCS.vstemplate deleted file mode 100644 index 599aed3ec2..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder.Installer/Item packages/LINQtoUmbracoCS/LINQtoUmbracoCS.vstemplate +++ /dev/null @@ -1,31 +0,0 @@ - - - LINQ to Umbraco File - An empty LINQ to Umbraco file - umbraco.ico - CSharp - 100 - DataClasses.dtml - 1 - Umbraco.Linq.Core.Designer - 3.5 - - - - - System - - - System.Core - - - Umbraco.Linq.Core - - - dtml.dtml - - - - - - \ No newline at end of file diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder.Installer/Item packages/LINQtoUmbracoCS/dtml.dtml b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder.Installer/Item packages/LINQtoUmbracoCS/dtml.dtml deleted file mode 100644 index a75fd32030..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder.Installer/Item packages/LINQtoUmbracoCS/dtml.dtml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder.Installer/Item packages/LINQtoUmbracoCS/umbraco.ico b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder.Installer/Item packages/LINQtoUmbracoCS/umbraco.ico deleted file mode 100644 index 402cf9594e..0000000000 Binary files a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder.Installer/Item packages/LINQtoUmbracoCS/umbraco.ico and /dev/null differ diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder.Installer/Item packages/LINQtoUmbracoVB.zip b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder.Installer/Item packages/LINQtoUmbracoVB.zip deleted file mode 100644 index d3d60ca34d..0000000000 Binary files a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder.Installer/Item packages/LINQtoUmbracoVB.zip and /dev/null differ diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder.Installer/Item packages/LINQtoUmbracoVB/LINQtoUmbracoVB.vstemplate b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder.Installer/Item packages/LINQtoUmbracoVB/LINQtoUmbracoVB.vstemplate deleted file mode 100644 index 60845a7256..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder.Installer/Item packages/LINQtoUmbracoVB/LINQtoUmbracoVB.vstemplate +++ /dev/null @@ -1,31 +0,0 @@ - - - LINQ to Umbraco File - An empty LINQ to Umbraco file - umbraco.ico - VisualBasic - 100 - DataClasses.dtml - 1 - Umbraco.Linq.Core.Designer - 3.5 - - - - - System - - - System.Core - - - Umbraco.Linq.Core - - - dtml.dtml - - - - - - \ No newline at end of file diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder.Installer/Item packages/LINQtoUmbracoVB/dtml.dtml b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder.Installer/Item packages/LINQtoUmbracoVB/dtml.dtml deleted file mode 100644 index a75fd32030..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder.Installer/Item packages/LINQtoUmbracoVB/dtml.dtml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder.Installer/Item packages/LINQtoUmbracoVB/umbraco.ico b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder.Installer/Item packages/LINQtoUmbracoVB/umbraco.ico deleted file mode 100644 index 402cf9594e..0000000000 Binary files a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder.Installer/Item packages/LINQtoUmbracoVB/umbraco.ico and /dev/null differ diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder.Installer/Properties/AssemblyInfo.cs b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder.Installer/Properties/AssemblyInfo.cs deleted file mode 100644 index 05dd8b56f1..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder.Installer/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System.Reflection; - -// 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("DTMetal.CodeBuilder.Installer")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyProduct("DTMetal.CodeBuilder.Installer")] \ No newline at end of file diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Code Builder/BaseCodeGenerator.cs b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Code Builder/BaseCodeGenerator.cs deleted file mode 100644 index 6cd5b4f793..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Code Builder/BaseCodeGenerator.cs +++ /dev/null @@ -1,185 +0,0 @@ - -/*************************************************************************** - -Copyright (c) Microsoft Corporation. All rights reserved. -This code is licensed under the Visual Studio SDK license terms. -THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY -IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR -PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. - -***************************************************************************/ - -using System; -using System.Diagnostics; -using System.IO; -using System.Runtime.InteropServices; -using Microsoft.VisualStudio.Shell.Interop; -using Microsoft.VisualStudio; - -namespace umbraco.Linq.DTMetal.CodeBuilder -{ - /// - /// A managed wrapper for VS's concept of an IVsSingleFileGenerator which is - /// a custom tool invoked at design time which can take any file as an input - /// and provide any file as output. - /// - public abstract class BaseCodeGenerator : IVsSingleFileGenerator - { - private IVsGeneratorProgress codeGeneratorProgress; - private string codeFileNameSpace = String.Empty; - private string codeFilePath = String.Empty; - - #region IVsSingleFileGenerator Members - - /// - /// Implements the IVsSingleFileGenerator.DefaultExtension method. - /// Returns the extension of the generated file - /// - /// Out parameter, will hold the extension that is to be given to the output file name. The returned extension must include a leading period - /// S_OK if successful, E_FAIL if not - int IVsSingleFileGenerator.DefaultExtension(out string pbstrDefaultExtension) - { - try - { - pbstrDefaultExtension = GetDefaultExtension(); - return VSConstants.S_OK; - } - catch (Exception e) - { - Trace.WriteLine(Strings.GetDefaultExtensionFailed); - Trace.WriteLine(e.ToString()); - pbstrDefaultExtension = string.Empty; - return VSConstants.E_FAIL; - } - } - - /// - /// Implements the IVsSingleFileGenerator.Generate method. - /// Executes the transformation and returns the newly generated output file, whenever a custom tool is loaded, or the input file is saved - /// - /// The full path of the input file. May be a null reference (Nothing in Visual Basic) in future releases of Visual Studio, so generators should not rely on this value - /// The contents of the input file. This is either a UNICODE BSTR (if the input file is text) or a binary BSTR (if the input file is binary). If the input file is a text file, the project system automatically converts the BSTR to UNICODE - /// This parameter is meaningful only for custom tools that generate code. It represents the namespace into which the generated code will be placed. If the parameter is not a null reference (Nothing in Visual Basic) and not empty, the custom tool can use the following syntax to enclose the generated code - /// [out] Returns an array of bytes to be written to the generated file. You must include UNICODE or UTF-8 signature bytes in the returned byte array, as this is a raw stream. The memory for rgbOutputFileContents must be allocated using the .NET Framework call, System.Runtime.InteropServices.AllocCoTaskMem, or the equivalent Win32 system call, CoTaskMemAlloc. The project system is responsible for freeing this memory - /// [out] Returns the count of bytes in the rgbOutputFileContent array - /// A reference to the IVsGeneratorProgress interface through which the generator can report its progress to the project system - /// If the method succeeds, it returns S_OK. If it fails, it returns E_FAIL - int IVsSingleFileGenerator.Generate(string wszInputFilePath, string bstrInputFileContents, string wszDefaultNamespace, IntPtr[] rgbOutputFileContents, out uint pcbOutput, IVsGeneratorProgress pGenerateProgress) - { - if (bstrInputFileContents == null) - { - throw new ArgumentNullException(bstrInputFileContents); - } - - codeFilePath = wszInputFilePath; - codeFileNameSpace = wszDefaultNamespace; - codeGeneratorProgress = pGenerateProgress; - - byte[] bytes = GenerateCode(bstrInputFileContents); - - if (bytes == null) - { - // This signals that GenerateCode() has failed. Tasklist items have been put up in GenerateCode() - rgbOutputFileContents = null; - pcbOutput = 0; - - // Return E_FAIL to inform Visual Studio that the generator has failed (so that no file gets generated) - return VSConstants.E_FAIL; - } - else - { - // The contract between IVsSingleFileGenerator implementors and consumers is that - // any output returned from IVsSingleFileGenerator.Generate() is returned through - // memory allocated via CoTaskMemAlloc(). Therefore, we have to convert the - // byte[] array returned from GenerateCode() into an unmanaged blob. - - int outputLength = bytes.Length; - rgbOutputFileContents[0] = Marshal.AllocCoTaskMem(outputLength); - Marshal.Copy(bytes, 0, rgbOutputFileContents[0], outputLength); - pcbOutput = (uint)outputLength; - return VSConstants.S_OK; - } - } - - #endregion - - /// - /// Namespace for the file - /// - protected string FileNameSpace - { - get - { - return codeFileNameSpace; - } - } - - /// - /// File-path for the input file - /// - protected string InputFilePath - { - get - { - return codeFilePath; - } - } - - /// - /// Interface to the VS shell object we use to tell our progress while we are generating - /// - internal IVsGeneratorProgress CodeGeneratorProgress - { - get - { - return codeGeneratorProgress; - } - } - - /// - /// Gets the default extension for this generator - /// - /// String with the default extension for this generator - protected abstract string GetDefaultExtension(); - - /// - /// The method that does the actual work of generating code given the input file - /// - /// File contents as a string - /// The generated code file as a byte-array - protected abstract byte[] GenerateCode(string inputFileContent); - - /// - /// Method that will communicate an error via the shell callback mechanism - /// - /// Level or severity - /// Text displayed to the user - /// Line number of error - /// Column number of error - protected virtual void GeneratorError(uint level, string message, uint line, uint column) - { - IVsGeneratorProgress progress = CodeGeneratorProgress; - if (progress != null) - { - progress.GeneratorError(0, level, message, line, column); - } - } - - /// - /// Method that will communicate a warning via the shell callback mechanism - /// - /// Level or severity - /// Text displayed to the user - /// Line number of warning - /// Column number of warning - protected virtual void GeneratorWarning(uint level, string message, uint line, uint column) - { - IVsGeneratorProgress progress = CodeGeneratorProgress; - if (progress != null) - { - progress.GeneratorError(1, level, message, line, column); - } - } - } -} \ No newline at end of file diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Code Builder/BaseCodeGeneratorWithSite.cs b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Code Builder/BaseCodeGeneratorWithSite.cs deleted file mode 100644 index ad6dc43e17..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Code Builder/BaseCodeGeneratorWithSite.cs +++ /dev/null @@ -1,199 +0,0 @@ - -/*************************************************************************** - -Copyright (c) Microsoft Corporation. All rights reserved. -This code is licensed under the Visual Studio SDK license terms. -THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY -IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR -PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. - -***************************************************************************/ - -using System; -using System.CodeDom.Compiler; -using System.Diagnostics; -using System.Runtime.InteropServices; -using EnvDTE; -using EnvDTE80; -using VSLangProj; -using VSOLE = Microsoft.VisualStudio.OLE.Interop; -using Microsoft.VisualStudio; -using Microsoft.VisualStudio.Shell; -using Microsoft.VisualStudio.Shell.Interop; -using Microsoft.VisualStudio.Designer.Interfaces; - -namespace umbraco.Linq.DTMetal.CodeBuilder -{ - /// - /// Base code generator with site implementation - /// - public abstract class BaseCodeGeneratorWithSite : BaseCodeGenerator, VSOLE.IObjectWithSite - { - private object site = null; - private CodeDomProvider codeDomProvider = null; - private ServiceProvider serviceProvider = null; - - #region IObjectWithSite Members - - /// - /// GetSite method of IOleObjectWithSite - /// - /// interface to get - /// IntPtr in which to stuff return value - void VSOLE.IObjectWithSite.GetSite(ref Guid riid, out IntPtr ppvSite) - { - if (site == null) - { - throw new COMException("object is not sited", VSConstants.E_FAIL); - } - - IntPtr pUnknownPointer = Marshal.GetIUnknownForObject(site); - IntPtr intPointer = IntPtr.Zero; - Marshal.QueryInterface(pUnknownPointer, ref riid, out intPointer); - - if (intPointer == IntPtr.Zero) - { - throw new COMException("site does not support requested interface", VSConstants.E_NOINTERFACE); - } - - ppvSite = intPointer; - } - - /// - /// SetSite method of IOleObjectWithSite - /// - /// site for this object to use - void VSOLE.IObjectWithSite.SetSite(object pUnkSite) - { - site = pUnkSite; - codeDomProvider = null; - serviceProvider = null; - } - - #endregion - - /// - /// Demand-creates a ServiceProvider - /// - private ServiceProvider SiteServiceProvider - { - get - { - if (serviceProvider == null) - { - serviceProvider = new ServiceProvider(site as VSOLE.IServiceProvider); - Debug.Assert(serviceProvider != null, "Unable to get ServiceProvider from site object."); - } - return serviceProvider; - } - } - - /// - /// Method to get a service by its GUID - /// - /// GUID of service to retrieve - /// An object that implements the requested service - protected object GetService(Guid serviceGuid) - { - return SiteServiceProvider.GetService(serviceGuid); - } - - /// - /// Method to get a service by its Type - /// - /// Type of service to retrieve - /// An object that implements the requested service - protected object GetService(Type serviceType) - { - return SiteServiceProvider.GetService(serviceType); - } - - /// - /// Returns a CodeDomProvider object for the language of the project containing - /// the project item the generator was called on - /// - /// A CodeDomProvider object - protected virtual CodeDomProvider GetCodeProvider() - { - if (codeDomProvider == null) - { - //Query for IVSMDCodeDomProvider/SVSMDCodeDomProvider for this project type - IVSMDCodeDomProvider provider = GetService(typeof(SVSMDCodeDomProvider)) as IVSMDCodeDomProvider; - if (provider != null) - { - codeDomProvider = provider.CodeDomProvider as CodeDomProvider; - } - else - { - //In the case where no language specific CodeDom is available, fall back to C# - codeDomProvider = CodeDomProvider.CreateProvider("C#"); - } - } - return codeDomProvider; - } - - /// - /// Gets the default extension of the output file from the CodeDomProvider - /// - /// - protected override string GetDefaultExtension() - { - CodeDomProvider codeDom = GetCodeProvider(); - Debug.Assert(codeDom != null, "CodeDomProvider is NULL."); - string extension = codeDom.FileExtension; - if (extension != null && extension.Length > 0) - { - extension = "." + extension.TrimStart(".".ToCharArray()); - } - return extension; - } - - /// - /// Returns the EnvDTE.ProjectItem object that corresponds to the project item the code - /// generator was called on - /// - /// The EnvDTE.ProjectItem of the project item the code generator was called on - protected ProjectItem GetProjectItem() - { - object p = GetService(typeof(ProjectItem)); - Debug.Assert(p != null, "Unable to get Project Item."); - return (ProjectItem)p; - } - - /// - /// Returns the EnvDTE.Project object of the project containing the project item the code - /// generator was called on - /// - /// - /// The EnvDTE.Project object of the project containing the project item the code generator was called on - /// - protected Project GetProject() - { - return GetProjectItem().ContainingProject; - } - - /// - /// Returns the VSLangProj.VSProjectItem object that corresponds to the project item the code - /// generator was called on - /// - /// The VSLangProj.VSProjectItem of the project item the code generator was called on - protected VSProjectItem GetVSProjectItem() - { - return (VSProjectItem)GetProjectItem().Object; - } - - /// - /// Returns the VSLangProj.VSProject object of the project containing the project item the code - /// generator was called on - /// - /// - /// The VSLangProj.VSProject object of the project containing the project item - /// the code generator was called on - /// - protected VSProject GetVSProject() - { - return (VSProject)GetProject().Object; - } - } -} \ No newline at end of file diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Code Builder/ClassDiagram.cd b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Code Builder/ClassDiagram.cd deleted file mode 100644 index ebf6d5a831..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Code Builder/ClassDiagram.cd +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - AAAAAAAAAAAAAAAIAAAAAAAgAAAEAAAAAAAAAAACAAA= - DtmlCodeGenerator.cs - - - - - - AAAAABAAAAAAAAAIAAQAIAAEAAAAMABAABAAABACAIA= - BaseCodeGenerator.cs - - - - - - - AAAAAABAAAAAQQAAAIAAAAAAQAAFACAABgAAAEACAEA= - BaseCodeGeneratorWithSite.cs - - - - - \ No newline at end of file diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Code Builder/ClassGenerator.cs b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Code Builder/ClassGenerator.cs deleted file mode 100644 index 3c6430bcd1..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Code Builder/ClassGenerator.cs +++ /dev/null @@ -1,810 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.CodeDom.Compiler; -using System.CodeDom; -using System.Runtime.Serialization; -using System.IO; -using System.Xml.Linq; -using System.Xml.Schema; -using Microsoft.VisualBasic; -using Microsoft.CSharp; -using System.Globalization; -using System.Reflection; -using umbraco.Linq.DTMetal.CodeBuilder.DataType; -using VB = Microsoft.VisualBasic; -using System.Text.RegularExpressions; - -namespace umbraco.Linq.DTMetal.CodeBuilder -{ - public enum GenerationLanguage - { - CSharp, - VB - } - - internal enum SerializationMode - { - None, Unidirectional - } - - internal sealed class ClassGeneratorArgs - { - public string Namespace { get; set; } - public CodeDomProvider Provider { get; set; } - public string DtmlPath { get; set; } - public XDocument Dtml { get; set; } - public bool IsInterface { get; set; } - public bool GenerateInterfaceInheritance { get; set; } - } - - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling")] - public sealed class ClassGenerator - { - internal ClassGeneratorArgs Args { get; set; } - internal bool PluralizeCollections { get; set; } - internal SerializationMode SerializationMode { get; set; } - private CodeCompileUnit Code { get; set; } - - internal bool IsCSharpCodeProvider() - { - return (string.Compare(this.Args.Provider.FileExtension, "CS", StringComparison.OrdinalIgnoreCase) == 0); - } - - /// - /// Creates a new CodeBuilder. - /// - /// The path to the DTML file - /// The language to generate with. - /// - public static ClassGenerator CreateBuilder(string xmlPath, string ns, GenerationLanguage lang) - { - var args = new ClassGeneratorArgs() - { - DtmlPath = xmlPath, - Namespace = ns, - }; - switch (lang) - { - case GenerationLanguage.VB: - args.Provider = new VBCodeProvider(); - break; - - case GenerationLanguage.CSharp: - default: - args.Provider = new CSharpCodeProvider(); - break; - } - - return new ClassGenerator(args); - } - - public static ClassGenerator CreateBuilder(string ns, GenerationLanguage lang, XDocument dtml, bool isInterface, bool interfaceInheritance) - { - var args = new ClassGeneratorArgs() - { - Dtml = dtml, - Namespace = ns, - IsInterface = isInterface, - GenerateInterfaceInheritance = interfaceInheritance - }; - switch (lang) - { - case GenerationLanguage.VB: - args.Provider = new VBCodeProvider(); - break; - - case GenerationLanguage.CSharp: - default: - args.Provider = new CSharpCodeProvider(); - break; - } - - return new ClassGenerator(args); - } - - internal ClassGenerator(ClassGeneratorArgs args) - { - this.Args = args; - } - - public void Save() - { - if (this.Code == null) - { - this.GenerateCode(); - } - - var dtml = new FileInfo(this.Args.DtmlPath); - - CodeGeneratorOptions options = new CodeGeneratorOptions(); - options.BracingStyle = "C"; - using (StreamWriter sourceWriter = new StreamWriter(dtml.FullName.Replace("dtml", "designer." + this.Args.Provider.FileExtension))) - { - this.Args.Provider.GenerateCodeFromCompileUnit(this.Code, sourceWriter, options); - } - } - - public void Save(Stream stream) - { - if (this.Code == null) - { - this.GenerateCode(); - } - - CodeGeneratorOptions options = new CodeGeneratorOptions() - { - BracingStyle = "C" - }; - - using (var sw = new StreamWriter(stream)) - { - this.Args.Provider.GenerateCodeFromCompileUnit(this.Code, sw, options); - } - } - - internal byte[] SaveForVs() - { - if (this.Code == null) - { - this.GenerateCode(); - } - - CodeGeneratorOptions options = new CodeGeneratorOptions(); - options.BracingStyle = "C"; - - StringBuilder code = new StringBuilder(); - TextWriter tw = new StringWriter(code, CultureInfo.InvariantCulture); - this.Args.Provider.GenerateCodeFromCompileUnit(this.Code, tw, null); - tw.Flush(); - - Encoding enc = Encoding.GetEncoding(tw.Encoding.WindowsCodePage); - byte[] preamble = enc.GetPreamble(); - int preambleLength = preamble.Length; - byte[] body = enc.GetBytes(code.ToString()); - Array.Resize(ref preamble, preambleLength + body.Length); - Array.Copy(body, 0, preamble, preambleLength, body.Length); - - // Return generated code. - return preamble; - } - - public void GenerateCode() - { - if (Args == null) - { - throw new ArgumentNullException("Args"); - } - - if (!string.IsNullOrEmpty(this.Args.DtmlPath)) - { - var dtml = new FileInfo(this.Args.DtmlPath); - if (!dtml.Exists) - { - throw new FileNotFoundException(String.Format(Strings.DtmlNotFound, this.Args.DtmlPath)); - } - else - { - this.Args.Dtml = XDocument.Load(this.Args.DtmlPath); - } - } - - ValidateSchema(); - - this.PluralizeCollections = (bool)this.Args.Dtml.Root.Attribute("PluralizeCollections"); - this.SerializationMode = (SerializationMode)Enum.Parse(typeof(SerializationMode), (string)this.Args.Dtml.Root.Attribute("Serialization")); - - IEnumerable docTypes = XmlToClasses(this.Args.Dtml); - - this.Code = new CodeCompileUnit(); - CodeNamespace ns = GenerateNamespace(this.Args.Namespace); - - if (!Args.IsInterface) - { - CodeTypeDeclaration dataContext = CreateDataContext(this.Args.Dtml, docTypes); - - ns.Types.Add(dataContext); - } - - CreateDocTypes(docTypes, ns); - - this.Code.Namespaces.Add(ns); - } - - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling")] - private CodeTypeDeclaration CreateDataContext(XDocument dtmlXml, IEnumerable docTypes) - { - string methodName = "OnCreated"; - CodeExpressionStatement statement = new CodeExpressionStatement(new CodeMethodInvokeExpression(null, methodName, new CodeExpression[0])); - - string dataContextName = dtmlXml.Root.Attribute("DataContextName").Value; - //ensure the naming is standard - if (!dataContextName.ToUpper().Contains("DATACONTEXT")) - { - dataContextName += "DataContext"; - } - CodeTypeDeclaration dataContext = new CodeTypeDeclaration(dataContextName); - dataContext.BaseTypes.Add("UmbracoDataContext"); - dataContext.IsClass = true; - dataContext.IsPartial = true; - - string partialOnCreated = string.Empty; - if (IsCSharpCodeProvider()) - { - partialOnCreated = " partial void " + methodName + "();\r\n"; - } - else - { - partialOnCreated = " Partial Private Void " + methodName + "()\r\nEnd Sub\r\n"; - } - CodeSnippetTypeMember onCreated = new CodeSnippetTypeMember(partialOnCreated); - CodeRegionDirective region = new CodeRegionDirective(CodeRegionMode.Start, "Partials"); - onCreated.StartDirectives.Add(region); - onCreated.EndDirectives.Add(new CodeRegionDirective(CodeRegionMode.End, "Partials")); - dataContext.Members.Add(onCreated); - - //constructor with no arguments - CodeConstructor ctor = new CodeConstructor(); - ctor.Attributes = MemberAttributes.Public; - ctor.BaseConstructorArgs.Add(new CodePropertyReferenceExpression()); - ctor.Statements.Add(statement); - dataContext.Members.Add(ctor); - - //constructor that takes an umbracoDataProvider - ctor = new CodeConstructor(); - ctor.Attributes = MemberAttributes.Public; - ctor.Parameters.Add(new CodeParameterDeclarationExpression("UmbracoDataProvider", "provider")); - ctor.BaseConstructorArgs.Add(new CodePropertyReferenceExpression(null, "provider")); - ctor.Statements.Add(statement); - dataContext.Members.Add(ctor); - - //Generate the Tree for each docType - foreach (var dt in docTypes) - { - string name = dt.TypeName; - if (this.PluralizeCollections) - { - name = PluraliseName(dt.TypeName); - } - var t = new CodeTypeReference("Tree"); - t.TypeArguments.Add(dt.TypeName); - - CodeMemberProperty p = new CodeMemberProperty(); - p.Name = name; - p.Type = t; - p.Attributes = MemberAttributes.Public | MemberAttributes.Final; - p.HasGet = true; - p.HasSet = false; - - if (!Args.IsInterface) - { - p.GetStatements.Add( - new CodeMethodReturnStatement( - new CodeMethodInvokeExpression( - new CodeMethodReferenceExpression( - new CodeThisReferenceExpression(), - "LoadTree", - new CodeTypeReference[] { - new CodeTypeReference(dt.TypeName) - }), - new CodeExpression[0]) - ) - ); - } - - dataContext.Members.Add(p); - } - return dataContext; - } - - internal IEnumerable XmlToClasses(XDocument dtmlXml) - { - return dtmlXml.Descendants("DocumentType").Select(x => new DocType - { - Alias = (string)x.Element("Alias"), - Description = (string)x.Element("Description"), - Id = (int)x.Element("Id"), - Name = (string)x.Element("Name"), - ParentId = (int)x.Attribute("ParentId"), - TypeName = Normalise((string)x.Element("Alias")), - Properties = x.Descendants("Property").Select(p => new DocTypeProperty - { - Alias = (string)p.Element("Alias"), - ControlId = new Guid((string)p.Element("ControlId")), - DatabaseType = Type.GetType((string)p.Element("Type")), - Description = (string)p.Element("Description"), - Id = (int)p.Element("Id"), - Name = (string)p.Element("Name"), - Mandatory = (bool)p.Element("Mandatory"), - RegularExpression = (string)p.Element("RegularExpression"), - TypeName = Normalise((string)p.Element("Alias")) - }).ToList(), - Associations = x.Descendants("Association").Select(a => new DocTypeAssociation - { - AllowedId = (int)a - }).ToList() - }); - } - - private void ValidateSchema() - { - XmlSchemaSet schemas = new XmlSchemaSet(); - //read the resorce for the XSD to validate against - Assembly assembly = Assembly.GetExecutingAssembly(); - schemas.Add("", System.Xml.XmlReader.Create(assembly.GetManifestResourceStream(assembly.GetName().Name + ".DocTypeML.xsd"))); - - //we'll have a list of all validation exceptions to put them to the screen - List exList = new List(); - - //some funky in-line event handler. Lambda loving goodness ;) - this.Args.Dtml.Validate(schemas, (o, e) => { exList.Add(e.Exception); }); - - if (exList.Count > 0) - { - //dump out the exception list - StringBuilder sb = new StringBuilder(); - sb.AppendLine(umbraco.Linq.DTMetal.CodeBuilder.Strings.XsdValidationFailureHeading); - foreach (var item in exList) - { - sb.AppendLine(" * " + item.Message + " - " + item.StackTrace); - } - throw new XmlSchemaException(sb.ToString()); - } - } - - private void CreateDocTypes(IEnumerable docTypes, CodeNamespace ns) - { - foreach (var docType in docTypes) - { - string genName = docType.TypeName; - - CodeCompileUnit currUnit = new CodeCompileUnit(); - - currUnit.Namespaces.Add(ns); - - //create class - CodeTypeDeclaration currClass = new CodeTypeDeclaration(genName); - //create the custom attribute - CodeAttributeDeclarationCollection classAttributes = new CodeAttributeDeclarationCollection( - new CodeAttributeDeclaration[] { - new CodeAttributeDeclaration("UmbracoInfo", - new CodeAttributeArgument(new CodePrimitiveExpression(docType.Alias)) - ), - new CodeAttributeDeclaration("DocType") - }); - - if (!Args.IsInterface) - { - classAttributes.Add(new CodeAttributeDeclaration(new CodeTypeReference(typeof(DataContractAttribute)))); - } - - //add the address to the class - currClass.CustomAttributes.AddRange(classAttributes); - - currClass.IsClass = true; - //add the summary decoration - currClass.Comments.AddRange(GenerateSummary(docType.Description)); - //set up the type - currClass.TypeAttributes = TypeAttributes.Public; - if (docType.ParentId > 0) - { - string typeName = docTypes.Single(d => d.Id == docType.ParentId).TypeName; - - if (!Args.IsInterface) - { - currClass.BaseTypes.Add(new CodeTypeReference(typeName)); //docType inheritance - } - else - { - currClass.BaseTypes.Add(new CodeTypeReference("I" + typeName)); //docType inheritance of interface type - } - } - else - { - if (!Args.IsInterface) - { - currClass.BaseTypes.Add(new CodeTypeReference("DocTypeBase")); //base class - } - else - { - currClass.BaseTypes.Add(new CodeTypeReference("IDocTypeBase")); //base interface - } - } - if (!Args.IsInterface) - { - currClass.IsPartial = true; - } - else - { - currClass.IsInterface = true; - currClass.Name = "I" + currClass.Name; - } - - currClass.Members.AddRange(GenerateConstructors()); - - #region Doc Type Properties - foreach (var docTypeProperty in docType.Properties) - { - CodeMemberField valueField = new CodeMemberField(); - valueField.Attributes = MemberAttributes.Private; - valueField.Name = "_" + docTypeProperty.TypeName; - valueField.Type = new CodeTypeReference(docTypeProperty.DatabaseType); - currClass.Members.Add(valueField); - - //store the umbraco data in an attribute. - CodeMemberProperty p = new CodeMemberProperty(); - p.CustomAttributes.AddRange(GenerateDocTypePropertyAttributes(docTypeProperty)); - - p.Name = docTypeProperty.TypeName; - p.Type = new CodeTypeReference(docTypeProperty.DatabaseType); - p.Attributes = MemberAttributes.Public; - p.HasGet = true; - p.HasSet = false; - p.GetStatements.Add(new CodeMethodReturnStatement( - new CodeFieldReferenceExpression( - new CodeThisReferenceExpression(), valueField.Name)) - ); - - #region Set statement - //have a conditional statment so we can use the INotifyChanging and INotifyChanged events - CodeExpression left = new CodeFieldReferenceExpression(new CodeThisReferenceExpression(), valueField.Name); - CodeExpression right = new CodePropertySetValueReferenceExpression(); - - CodeExpression cond = GenerateInequalityConditionalStatement(left, right); - - //Build the statements to execute when we are changing the property value - //The order is: - // - RaisePropertyChanging event - // - Assign the property - // - RaisePropertyChanged event - var trues = new CodeStatement[] { - new CodeExpressionStatement(new CodeMethodInvokeExpression( - new CodeThisReferenceExpression(), - "RaisePropertyChanging" - ) - ), - new CodeAssignStatement( - new CodeFieldReferenceExpression( - new CodeThisReferenceExpression(), valueField.Name), - new CodePropertySetValueReferenceExpression() - ), - new CodeExpressionStatement( - new CodeMethodInvokeExpression( - new CodeThisReferenceExpression(), - "RaisePropertyChanged", - new CodePrimitiveExpression(docTypeProperty.TypeName) - ) - ) - }; - - CodeConditionStatement condition = new CodeConditionStatement(cond, trues); - //enforce the validation from umbraco. It's there for a reason ;) - if (!string.IsNullOrEmpty(docTypeProperty.RegularExpression)) - { - p.SetStatements.Add(new CodeExpressionStatement(new CodeMethodInvokeExpression( - null, - "ValidateProperty", - new CodePrimitiveExpression(docTypeProperty.RegularExpression), - new CodePropertySetValueReferenceExpression()) - ) - ); - } - p.SetStatements.Add(condition); - #endregion - - //comment the property with the description from umbraco - p.Comments.AddRange(GenerateSummary(docTypeProperty.Description)); - currClass.Members.Add(p); - - CodeMemberProperty retypedProperty = CreateCustomProperty(docTypeProperty, valueField.Name); - if (retypedProperty != null) - { - currClass.Members.Add(retypedProperty); - } - } - #endregion - - #region Child Associations - foreach (var child in docType.Associations) - { - var realDocType = docTypes.SingleOrDefault(dt => dt.Id == child.AllowedId); - - //put a check that a docType is actually returned - //This will cater for the bug of when you don't select to generate a - //docType but it is a child of the current - if (realDocType != null) - { - string name = realDocType.TypeName; - if (this.PluralizeCollections) - { - name = PluraliseName(realDocType.TypeName); - } - var t = new CodeTypeReference("AssociationTree"); - t.TypeArguments.Add(realDocType.TypeName); - - CodeMemberProperty p = new CodeMemberProperty(); - p.Name = name; - p.Type = t; - p.Attributes = MemberAttributes.Public | MemberAttributes.Final; - p.HasGet = true; - p.HasSet = true; - - if (!Args.IsInterface) - { - CodeMemberField childMember = new CodeMemberField(); - childMember.Attributes = MemberAttributes.Private; - childMember.Name = "_" + name; - childMember.Type = t; - currClass.Members.Add(childMember); - - CodeExpression left = new CodeFieldReferenceExpression(new CodeThisReferenceExpression(), childMember.Name); - CodeExpression right = new CodePrimitiveExpression(null); - - CodeExpression cond = GenerateEqualityConditionalStatement(left, right); - - var trues = new CodeConditionStatement(cond, new CodeAssignStatement( - new CodeFieldReferenceExpression(new CodeThisReferenceExpression(), childMember.Name), - new CodeMethodInvokeExpression( - new CodeMethodReferenceExpression( - new CodeThisReferenceExpression(), - "ChildrenOfType", - new CodeTypeReference[] { - new CodeTypeReference(realDocType.TypeName) - }) - ) - ) - ); - - p.GetStatements.Add(trues); - p.GetStatements.Add(new CodeMethodReturnStatement( - new CodeFieldReferenceExpression( - new CodeThisReferenceExpression(), childMember.Name)) - ); - - p.SetStatements.Add( - new CodeAssignStatement( - new CodeFieldReferenceExpression( - new CodeThisReferenceExpression(), childMember.Name), - new CodePropertySetValueReferenceExpression() - ) - ); - } - - currClass.Members.Add(p); - } - } - #endregion - - ns.Types.Add(currClass); - } - } - - private CodeMemberProperty CreateCustomProperty(DocTypeProperty docTypeProperty, string privateVariableName) - { - var internalTypes = Assembly.GetExecutingAssembly().GetTypes().Where(t => typeof(DataTypeRetyper).IsAssignableFrom(t) && t.GetCustomAttributes(typeof(DataTypeAttribute), true).Length == 1); - - var currType = internalTypes.SingleOrDefault(t => t.GetCustomAttributes(typeof(DataTypeAttribute), true).Cast().First().ControlId == docTypeProperty.ControlId); - if (currType != null) - { - var retyper = (DataTypeRetyper)Activator.CreateInstance(currType); - - CodeMemberProperty p = new CodeMemberProperty(); - p.Type = new CodeTypeReference(retyper.MemberType); - p.Name = retyper.MemberName(docTypeProperty.TypeName); - p.Attributes = MemberAttributes.Public; - p.HasGet = true; - p.HasSet = false; - - new Switch(retyper) - .Case(b => - { - p.GetStatements.Add(new CodeMethodReturnStatement( - GenerateEqualityConditionalStatement( - new CodeFieldReferenceExpression( - new CodeThisReferenceExpression(), privateVariableName) - , new CodePrimitiveExpression(0) - ) - ) - ); - }, true) - ; - - return p; - } - - return null; - } - - private CodeExpression GenerateInequalityConditionalStatement(CodeExpression left, CodeExpression right) - { - //Build a binary conditional operation (an IF) - CodeExpression cond; - //if (GenerationLanaguage == Language.CSharp) - //{ - cond = new CodeBinaryOperatorExpression( - left, - CodeBinaryOperatorType.IdentityInequality, - right - ); - //} - //else - //{ - // cond = new CodeBinaryOperatorExpression( - // new CodeBinaryOperatorExpression( - // left, - // CodeBinaryOperatorType.IdentityEquality, - // right - // ), - // CodeBinaryOperatorType.ValueEquality, - // new CodePrimitiveExpression(false) - // ); - //} - return cond; - } - - private CodeExpression GenerateEqualityConditionalStatement(CodeExpression left, CodeExpression right) - { - //Build a binary conditional operation (an IF) - CodeExpression cond; - //if (GenerationLanaguage == Language.CSharp) - //{ - cond = new CodeBinaryOperatorExpression( - left, - CodeBinaryOperatorType.IdentityEquality, - right - ); - //} - //else - //{ - // cond = new CodeBinaryOperatorExpression( - // new CodeBinaryOperatorExpression( - // left, - // CodeBinaryOperatorType.IdentityInequality, - // right - // ), - // CodeBinaryOperatorType.ValueEquality, - // new CodePrimitiveExpression(false) - // ); - //} - return cond; - } - - private CodeAttributeDeclaration[] GenerateDocTypePropertyAttributes(DocTypeProperty docTypeProperty) - { - List attrs = new List(); - - CodeAttributeDeclaration umbInfoAtt = new CodeAttributeDeclaration("UmbracoInfo", - new CodeAttributeArgument(new CodePrimitiveExpression(docTypeProperty.Alias)), - new CodeAttributeArgument("DisplayName", new CodePrimitiveExpression(docTypeProperty.Name)), - new CodeAttributeArgument("Mandatory", new CodePrimitiveExpression(docTypeProperty.Mandatory)) - ); - - attrs.Add(umbInfoAtt); - attrs.Add(new CodeAttributeDeclaration("Property")); - if (this.SerializationMode == SerializationMode.Unidirectional) - { - CodeAttributeDeclaration dataMemberAtt = new CodeAttributeDeclaration(new CodeTypeReference(typeof(DataMemberAttribute)), - new CodeAttributeArgument("Name", new CodePrimitiveExpression(docTypeProperty.TypeName)) - ); - } - - return attrs.ToArray(); - } - - private static CodeTypeMember[] GenerateConstructors() - { - CodeConstructor defaultConstructor = new CodeConstructor(); - defaultConstructor.Attributes = MemberAttributes.Public; - - return new CodeTypeMember[] { defaultConstructor }; - } - - private static CodeNamespace GenerateNamespace(string name) - { - CodeNamespace ns = new CodeNamespace(name); - //ns.Imports.Add(new CodeNamespaceImport("System")); - ns.Imports.Add(new CodeNamespaceImport("umbraco.Linq.Core")); - ns.Imports.Add(new CodeNamespaceImport("umbraco.Linq.Core.Node")); - ns.Imports.Add(new CodeNamespaceImport("System.Linq")); - return ns; - } - - private static CodeCommentStatement[] GenerateSummary(string summaryBody) - { - return new CodeCommentStatement[] { - new CodeCommentStatement("", true), - new CodeCommentStatement(summaryBody, true), - new CodeCommentStatement("", true) - }; - } - - private static bool IsVowel(char c) - { - switch (c) - { - case 'O': - case 'U': - case 'Y': - case 'A': - case 'E': - case 'I': - case 'o': - case 'u': - case 'y': - case 'a': - case 'e': - case 'i': - return true; - } - return false; - } - - internal static string PluraliseName(string name) - { - if ((name.EndsWith("x", StringComparison.OrdinalIgnoreCase) || name.EndsWith("ch", StringComparison.OrdinalIgnoreCase)) || (name.EndsWith("ss", StringComparison.OrdinalIgnoreCase) || name.EndsWith("sh", StringComparison.OrdinalIgnoreCase))) - { - name = name + "es"; - return name; - } - if ((name.EndsWith("y", StringComparison.OrdinalIgnoreCase) && (name.Length > 1)) && !IsVowel(name[name.Length - 2])) - { - name = name.Remove(name.Length - 1, 1); - name = name + "ies"; - return name; - } - if (!name.EndsWith("s", StringComparison.OrdinalIgnoreCase)) - { - name = name + "s"; - } - return name; - } - - internal string Normalise(string input) - { - if (string.IsNullOrEmpty(input)) - { - throw new ArgumentNullException("input"); - } - - var invalids = new string[] { "_", "-", ".", "$", "@", "*" }; - - input = Regex.Replace(input, "([A-Z])", " $1", RegexOptions.Compiled); - input = input.Trim().ToLower(); - - foreach (var i in invalids) - { - input = input.Replace(i, " "); - } - - var correctCasedInput = VB.Strings.StrConv(input, VB.VbStrConv.ProperCase, 0); - - var correctCasedAsArray = correctCasedInput.Split(' ').Where(s => !string.IsNullOrEmpty(s)); - - StringBuilder ret = new StringBuilder(); - var foundChar = false; - foreach (var item in correctCasedAsArray) - { - foreach (var c in item) - { - if (Char.IsLetter(c)) - { - ret.Append(c); - foundChar = true; - } - else if (Char.IsDigit(c) && foundChar) - { - ret.Append(c); - } - } - } - - if (string.IsNullOrEmpty(ret.ToString())) - { - throw new IndexOutOfRangeException("No valid characters found within the string being normalised"); - } - - return ret.ToString(); - } - } -} diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Code Builder/LINQtoUmbracoGenerator.cs b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Code Builder/LINQtoUmbracoGenerator.cs deleted file mode 100644 index 56740458f2..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Code Builder/LINQtoUmbracoGenerator.cs +++ /dev/null @@ -1,75 +0,0 @@ - -/*************************************************************************** - -Copyright (c) Microsoft Corporation. All rights reserved. -This code is licensed under the Visual Studio SDK license terms. -THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY -IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR -PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. - -***************************************************************************/ - -using System; -using System.Runtime.InteropServices; -using System.CodeDom.Compiler; -using System.CodeDom; -using System.IO; -using System.Text; -using System.Xml; -using System.Xml.Schema; -using Microsoft.Win32; -using Microsoft.VisualStudio.Shell; -using VSLangProj80; -using System.Xml.Linq; - -namespace umbraco.Linq.DTMetal.CodeBuilder -{ - /// - /// This is the generator class. - /// When setting the 'Custom Tool' property of a C# or VB project item to "LINQtoumbracoGenerator", - /// the GenerateCode function will get called and will return the contents of the generated file - /// to the project system - /// - [ComVisible(true)] - [Guid("52B316AA-1997-4c81-9969-95404C09EEB4")] - [CodeGeneratorRegistration(typeof(LINQtoumbracoGenerator), "C# LINQ to umbraco Class Generator", vsContextGuids.vsContextGuidVCSProject, GeneratesDesignTimeSource = true)] - [CodeGeneratorRegistration(typeof(LINQtoumbracoGenerator), "VB LINQ to umbraco Class Generator", vsContextGuids.vsContextGuidVBProject, GeneratesDesignTimeSource = true)] - [ProvideObject(typeof(LINQtoumbracoGenerator))] - public class LINQtoumbracoGenerator : BaseCodeGeneratorWithSite - { -#pragma warning disable 0414 - //The name of this generator (use for 'Custom Tool' property of project item) - internal static string name = "LINQtoumbracoGenerator"; -#pragma warning restore 0414 - - /// - /// Function that builds the contents of the generated file based on the contents of the input file - /// - /// Content of the input file - /// Generated file as a byte array - protected override byte[] GenerateCode(string inputFileContent) - { - var args = new ClassGeneratorArgs() - { - Namespace = this.FileNameSpace, - Dtml = XDocument.Parse(inputFileContent), - Provider = this.GetCodeProvider() - }; - - var builder = new ClassGenerator(args); - - //this.GetVSProject().References.Add("umbraco.Linq.Core"); - //this.GetVSProject().References.Add("System.Core"); - //this.GetVSProject().References.Add("umbraco"); - - builder.GenerateCode(); - return builder.SaveForVs(); - } - - protected override string GetDefaultExtension() - { - return ".designer" + base.GetDefaultExtension(); - } - } -} \ No newline at end of file diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/DTMetal.CodeBuilder.csproj b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/DTMetal.CodeBuilder.csproj deleted file mode 100644 index b12e830319..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/DTMetal.CodeBuilder.csproj +++ /dev/null @@ -1,159 +0,0 @@ - - - Debug - 9.0.30729 - 2.0 - {461089E7-008E-4737-BA17-E1FCD1CC3D0E} - Library - umbraco.Linq.DTMetal.CodeBuilder - umbraco.Linq.DTMetal.CodeBuilder - $(VSSDK90Install)VisualStudioIntegration\Common\Source\CSharp\RegistrationAttributes - SAK - SAK - SAK - SAK - v3.5 - true - ..\Solution Items\umbraco-key.snk - - - true - false - .\bin\Debug\ - false - DEBUG;TRACE - 4 - bin\Debug\umbraco.Linq.DTMetal.CodeBuilder.xml - - - false - true - .\bin\Release\ - false - TRACE - 4 - - - - False - - - False - - - - - - - - - - - System - - - - 3.5 - - - System.Data - - - 3.0 - - - - System.XML - - - 3.5 - - - - - $(DevEnvDir)\VSLangProj2.dll - - - $(DevEnvDir)\VSLangProj80.dll - - - - - Properties\SolutionInfo.cs - - - - - - - - - - - - Component - - - Form - - - InstallerProgress.cs - - - - - True - True - Strings.resx - - - - - - DocTypeML.xsd - - - Properties\umbraco-key.snk - - - - - - - - - - - Designer - ResXFileCodeGenerator - Strings.Designer.cs - Umbraco.Linq.DTMetal.CodeBuilder - - - InstallerProgress.cs - - - - - true - true - - - true - bin\Debug - Fixed Version\ - DEBUG;TRACE;FIXEDVERSION - bin\Debug\Umbraco.Linq.DTMetal.CodeBuilder.xml - AnyCPU - true - GlobalSuppressions.cs - - - - - - - \ No newline at end of file diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/DataType/DataTypeAttribute.cs b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/DataType/DataTypeAttribute.cs deleted file mode 100644 index c0869ae225..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/DataType/DataTypeAttribute.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace umbraco.Linq.DTMetal.CodeBuilder.DataType -{ - [global::System.AttributeUsage(AttributeTargets.Class, Inherited = true, AllowMultiple = false)] - public sealed class DataTypeAttribute : Attribute - { - public DataTypeAttribute(string controlId) - { - this.ControlId = new Guid(controlId); - } - - public Guid ControlId { get; private set; } - } -} diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/DataType/DataTypeRetyper.cs b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/DataType/DataTypeRetyper.cs deleted file mode 100644 index dbacd3a49e..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/DataType/DataTypeRetyper.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace umbraco.Linq.DTMetal.CodeBuilder.DataType -{ - public abstract class DataTypeRetyper - { - /// - /// Gets the .NET type of the DataType - /// - /// The type of the member. - public abstract Type MemberType { get; } - - /// - /// Creates the name for the retyped member. Overload if custom naming is required - /// - /// Name used for the standard implementation - /// baseName + MemberType.Name - public virtual string MemberName(string baseName) - { - return baseName + this.MemberType.Name; - } - } -} diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/DataType/YesNoRetyper.cs b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/DataType/YesNoRetyper.cs deleted file mode 100644 index 7ee0e04f4c..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/DataType/YesNoRetyper.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace umbraco.Linq.DTMetal.CodeBuilder.DataType -{ - /// - /// A converter for the Yes/ No DataType - /// - [DataType("38b352c1-e9f8-4fd8-9324-9a2eab06d97a")] - public sealed class YesNoRetyper : DataTypeRetyper - { - public override Type MemberType - { - get { return typeof(bool); } - } - } -} diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/DocType.cs b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/DocType.cs deleted file mode 100644 index 9c57016517..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/DocType.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace umbraco.Linq.DTMetal.CodeBuilder -{ - public sealed class DocType - { - public int Id { get; set; } - public int ParentId { get; set; } - public string Name { get; set; } - public string Alias { get; set; } - public string Description { get; set; } - public string TypeName { get; set; } - - public List Properties { get; set; } - public List Associations { get; set; } - } -} diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/DocTypeAssociation.cs b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/DocTypeAssociation.cs deleted file mode 100644 index a79d9b3789..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/DocTypeAssociation.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace umbraco.Linq.DTMetal.CodeBuilder -{ - public sealed class DocTypeAssociation - { - public int AllowedId { get; set; } - } -} diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/DocTypeProperty.cs b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/DocTypeProperty.cs deleted file mode 100644 index 3ba515d987..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/DocTypeProperty.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace umbraco.Linq.DTMetal.CodeBuilder -{ - public sealed class DocTypeProperty - { - public int Id { get; set; } - public string Name { get; set; } - public string Alias { get; set; } - public string Description { get; set; } - public bool Mandatory { get; set; } - public string RegularExpression { get; set; } - public Type DatabaseType { get; set; } - public Guid ControlId { get; set; } - public string TypeName { get; set; } - } -} diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Installer/InstallerHandler.cs b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Installer/InstallerHandler.cs deleted file mode 100644 index c25a35e563..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Installer/InstallerHandler.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System.ComponentModel; -using Microsoft.Win32; -using System.Windows.Forms; -using System.Globalization; - -namespace umbraco.Linq.DTMetal.CodeBuilder.Installer -{ - [RunInstaller(true)] - public class InstallerHandler : System.Configuration.Install.Installer - { - public override void Install(System.Collections.IDictionary stateSaver) - { - base.Install(stateSaver); - - var vsPath9 = GetVsPath9(); - var vsPath10 = GetVsPath10(); - var targetPath = Context.Parameters["TargetDir"]; - - if ((vsPath9 != null || vsPath10 != null) && targetPath != null) - { - var progress = new InstallerProgress(InstallMode.Install, vsPath9, vsPath10, targetPath); - MessageBoxOptions options = CultureInfo.CurrentUICulture.TextInfo.IsRightToLeft ? MessageBoxOptions.RightAlign | MessageBoxOptions.RtlReading : 0; - if (progress.ShowDialog() != DialogResult.OK) - { - MessageBox.Show(Strings.InstallFailureMessage, "LINQ to umbraco Setup", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1, options); - MessageBox.Show(progress.Error.ToString()); - } - } - } - - private static string GetVsPath9() - { - RegistryKey key = Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\VisualStudio\9.0", false); - if (key != null) - return (string)key.GetValue("InstallDir"); - return null; - } - - private static string GetVsPath10() - { - RegistryKey key = Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\VisualStudio\10.0", false); - if (key != null) - return (string)key.GetValue("InstallDir"); - return null; - } - - public override void Uninstall(System.Collections.IDictionary savedState) - { - base.Uninstall(savedState); - - var vsPath9 = GetVsPath9(); - var vsPath10 = GetVsPath10(); - if (vsPath9 != null || vsPath10 != null) - { - var progress = new InstallerProgress(InstallMode.Uninstall, vsPath9, vsPath10, null); - progress.ShowDialog(); - } - } - } -} diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Installer/InstallerProgress.Designer.cs b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Installer/InstallerProgress.Designer.cs deleted file mode 100644 index 545ae7ba00..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Installer/InstallerProgress.Designer.cs +++ /dev/null @@ -1,84 +0,0 @@ -namespace umbraco.Linq.DTMetal.CodeBuilder.Installer -{ - partial class InstallerProgress - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(InstallerProgress)); - this.label1 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.progressBar1 = new System.Windows.Forms.ProgressBar(); - this.installWorker = new System.ComponentModel.BackgroundWorker(); - this.SuspendLayout(); - // - // label1 - // - resources.ApplyResources(this.label1, "label1"); - this.label1.Name = "label1"; - // - // label2 - // - resources.ApplyResources(this.label2, "label2"); - this.label2.Name = "label2"; - // - // progressBar1 - // - resources.ApplyResources(this.progressBar1, "progressBar1"); - this.progressBar1.Name = "progressBar1"; - this.progressBar1.Style = System.Windows.Forms.ProgressBarStyle.Marquee; - // - // installWorker - // - this.installWorker.DoWork += new System.ComponentModel.DoWorkEventHandler(this.installWorker_DoWork); - this.installWorker.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.installWorker_RunWorkerCompleted); - // - // InstallerProgress - // - resources.ApplyResources(this, "$this"); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ControlBox = false; - this.Controls.Add(this.progressBar1); - this.Controls.Add(this.label2); - this.Controls.Add(this.label1); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "InstallerProgress"; - this.Load += new System.EventHandler(this.InstallerProgress_Load); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.ProgressBar progressBar1; - private System.ComponentModel.BackgroundWorker installWorker; - } -} \ No newline at end of file diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Installer/InstallerProgress.cs b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Installer/InstallerProgress.cs deleted file mode 100644 index 592958c4f7..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Installer/InstallerProgress.cs +++ /dev/null @@ -1,358 +0,0 @@ -using System; -using System.ComponentModel; -using System.Text; -using System.Windows.Forms; -using System.IO; -using System.Diagnostics; -using System.Reflection; -using System.Globalization; -using Microsoft.Win32; -using System.Linq; - -namespace umbraco.Linq.DTMetal.CodeBuilder.Installer -{ - public partial class InstallerProgress : Form - { - private const string generatorKey = "{52B316AA-1997-4c81-9969-95404C09EEB4}"; - private const string dtml = ".dtml"; - private const string clas = "LINQtoumbraco.DTML.1.0"; - private const string desc = "LINQ to umbraco Entity Mapping"; - - private InstallMode _mode; - private string _vs9Path; - private string _vs10Path; - private string _targetPath; - - internal InstallerProgress(InstallMode mode, string vs9Path, string vs10Path, string targetPath) - { - InitializeComponent(); - - _mode = mode; - _vs9Path = vs9Path; - _vs10Path = vs10Path; - _targetPath = targetPath; - } - - #region Events - private void installWorker_DoWork(object sender, DoWorkEventArgs e) - { - - switch (_mode) - { - case InstallMode.Install: - InstallVsTemplates(); - SetupRegistry(); - InstallDtmlXsd(); - ConfigVs(); - break; - case InstallMode.Uninstall: - UninstallVsTemplates(); - TearDownRegistry(); - UninstallDtmlXsd(); - ConfigVs(); - break; - default: - break; - } - } - - private void installWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) - { - if (e.Error != null) - { - this.DialogResult = DialogResult.Cancel; - this.Error = e.Error; - } - else - { - this.DialogResult = DialogResult.OK; - } - } - public Exception Error { get; set; } - - private void InstallerProgress_Load(object sender, EventArgs e) - { - installWorker.RunWorkerAsync(); - } - #endregion - - #region Uninstall - private void UninstallDtmlXsd() - { - try - { - File.Delete(GetDtmlXsdPathVs9()); - } - catch { } - - try - { - File.Delete(GetDtmlXsdPathVs10()); - } - catch { } - } - - private void TearDownRegistry() - { - if(Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\VisualStudio\9.0\CLSID\" + generatorKey) != null) - { - Registry.LocalMachine.DeleteSubKey(@"Software\Microsoft\VisualStudio\9.0\CLSID\" + generatorKey); - } - - if (Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\VisualStudio\10.0\CLSID\" + generatorKey) != null) - { - Registry.LocalMachine.DeleteSubKey(@"Software\Microsoft\VisualStudio\10.0\CLSID\" + generatorKey); - } - - if (Registry.ClassesRoot.OpenSubKey(dtml) != null) - { - Registry.ClassesRoot.DeleteSubKeyTree(dtml); - } - - if (Registry.ClassesRoot.OpenSubKey(clas) != null) - { - Registry.ClassesRoot.DeleteSubKeyTree(clas); - } - } - - private void UninstallVsTemplates() - { - if (!string.IsNullOrEmpty(_vs9Path)) - { - string csTgt = Path.Combine(_vs9Path, @"ItemTemplates\CSharp\1033\LINQtoumbracoCS.zip"); - string vbTgt = Path.Combine(_vs9Path, @"ItemTemplates\VisualBasic\1033\LINQtoumbracoVB.zip"); - - try - { - File.Delete(csTgt); - File.Delete(vbTgt); - } - catch { } - } - - if (!string.IsNullOrEmpty(_vs10Path)) - { - string csTgt = Path.Combine(_vs10Path, @"ItemTemplates\CSharp\1033\LINQtoumbracoCS.zip"); - string vbTgt = Path.Combine(_vs10Path, @"ItemTemplates\VisualBasic\1033\LINQtoumbracoVB.zip"); - - try - { - File.Delete(csTgt); - File.Delete(vbTgt); - } - catch { } - } - } - #endregion - - #region Install - private void InstallDtmlXsd() - { - var assembly = Assembly.GetExecutingAssembly(); - - // Load the XSD for DocTypeML. - string xsd; - using (Stream s = assembly.GetManifestResourceStream(assembly.GetName().Name + ".DocTypeML.xsd")) - { - using (StreamReader sr = new StreamReader(s)) - { - xsd = sr.ReadToEnd(); - } - } - - // Write the XSD to the Visual Studio folder with XML schemas. - if (!string.IsNullOrEmpty(_vs9Path)) - { - using (StreamWriter sw = File.CreateText(GetDtmlXsdPathVs9())) - { - sw.Write(xsd); - } - } - - if (!string.IsNullOrEmpty(_vs10Path)) - { - using (StreamWriter sw = File.CreateText(GetDtmlXsdPathVs10())) - { - sw.Write(xsd); - } - } - } - - private void SetupRegistry() - { - #region LINQtoumbracoGenerator Key - if (!string.IsNullOrEmpty(_vs9Path)) - { - RegistryKey genKey = Registry.LocalMachine.CreateSubKey(@"Software\Microsoft\VisualStudio\9.0\CLSID\" + generatorKey); - genKey.SetValue("Assembly", Assembly.GetExecutingAssembly().FullName); //full name of the assembly which the generator is in - genKey.SetValue("Class", "umbraco.Linq.DTMetal.CodeBuilder.LINQtoumbracoGenerator"); //generator class - genKey.SetValue("InprocServer32", Path.Combine(Environment.GetEnvironmentVariable("SystemRoot"), @"system32\mscoree.dll")); - genKey.SetValue("ThreadingModel", "Both"); - genKey.Close(); - } - - if (!string.IsNullOrEmpty(_vs10Path)) - { - RegistryKey genKey = Registry.LocalMachine.CreateSubKey(@"Software\Microsoft\VisualStudio\10.0\CLSID\" + generatorKey); - genKey.SetValue("Assembly", Assembly.GetExecutingAssembly().FullName); //full name of the assembly which the generator is in - genKey.SetValue("Class", "umbraco.Linq.DTMetal.CodeBuilder.LINQtoumbracoGenerator"); //generator class - genKey.SetValue("InprocServer32", Path.Combine(Environment.GetEnvironmentVariable("SystemRoot"), @"system32\mscoree.dll")); - genKey.SetValue("ThreadingModel", "Both"); - genKey.Close(); - } - #endregion - - #region HKEY_CLASSES_ROOT\.dtml - { - RegistryKey dtmlKey = Registry.ClassesRoot.CreateSubKey(dtml, RegistryKeyPermissionCheck.ReadWriteSubTree); - dtmlKey.SetValue(null, clas); - dtmlKey.Close(); - } - #endregion - - #region HKEY_CLASSES_ROOT\LINQtoumbraco.DTML.1.0 - { - RegistryKey kClas = Registry.ClassesRoot.CreateSubKey(clas, RegistryKeyPermissionCheck.ReadWriteSubTree); - kClas.SetValue(null, desc); - kClas.SetValue("AlwaysShowExt", "1"); - - #region HKEY_CLASSES_ROOT\LINQtoumbraco.DTML.1.0\DefaultIcon - { - RegistryKey kIcon = kClas.CreateSubKey("DefaultIcon"); - kIcon.SetValue(null, Path.Combine(_targetPath, @"DTMetal.exe") + ",0"); - kIcon.Close(); - } - #endregion - - #region HKEY_CLASSES_ROOT\LINQtoumbraco.DTML.1.0\shell - { - RegistryKey kShel = kClas.CreateSubKey("shell"); - - #region HKEY_CLASSES_ROOT\LINQtoumbraco.DTML.1.0\shell\Open - { - RegistryKey kOpen = kShel.CreateSubKey("Open"); - - #region HKEY_CLASSES_ROOT\LINQtoumbraco.DTML.1.0\shell\Open\Command - { - RegistryKey kComm = kOpen.CreateSubKey("Command"); - kComm.SetValue(null, "\"" + Path.Combine(_vs9Path, "devenv.exe") + "\" /dde \"%1\""); - kComm.Close(); - } - #endregion - - #region HKEY_CLASSES_ROOT\LINQtoumbraco.DTML.1.0\shell\Open\ddeexec - { - RegistryKey kDdex = kOpen.CreateSubKey("ddeexec"); - kDdex.SetValue(null, "Open(\"%1\")"); - - #region HKEY_CLASSES_ROOT\LINQtoumbraco.DTML.1.0\shell\Open\ddeexec\Application - { - RegistryKey kAppn = kDdex.CreateSubKey("Application"); - kAppn.SetValue(null, "VisualStudio.9.0"); - kAppn.Close(); - } - #endregion - - #region HKEY_CLASSES_ROOT\LINQtoumbraco.DTML.1.0\shell\Open\ddeexec\Topic - { - RegistryKey kTopc = kDdex.CreateSubKey("Topic"); - kTopc.SetValue(null, "system"); - kTopc.Close(); - } - #endregion - - kDdex.Close(); - } - #endregion - - kOpen.Close(); - } - #endregion - - kShel.Close(); - } - #endregion - - kClas.Close(); - } - #endregion - } - - private void InstallVsTemplates() - { - if (!string.IsNullOrEmpty(_vs9Path)) - { - string csSrc = Path.Combine(_targetPath, @"Item packages\LINQtoumbracoCS.zip"); - string vbSrc = Path.Combine(_targetPath, @"Item packages\LINQtoumbracoVB.zip"); - string csTgt = Path.Combine(_vs9Path, @"ItemTemplates\CSharp\1033\LINQtoumbracoCS.zip"); - string vbTgt = Path.Combine(_vs9Path, @"ItemTemplates\VisualBasic\1033\LINQtoumbracoVB.zip"); - - if (!File.Exists(csTgt)) - File.Copy(csSrc, csTgt); - if (!File.Exists(vbTgt)) - File.Copy(vbSrc, vbTgt); - } - - if (!string.IsNullOrEmpty(_vs10Path)) - { - string csSrc = Path.Combine(_targetPath, @"Item packages\LINQtoumbracoCS.zip"); - string vbSrc = Path.Combine(_targetPath, @"Item packages\LINQtoumbracoVB.zip"); - string csTgt = Path.Combine(_vs10Path, @"ItemTemplates\CSharp\1033\LINQtoumbracoCS.zip"); - string vbTgt = Path.Combine(_vs10Path, @"ItemTemplates\VisualBasic\1033\LINQtoumbracoVB.zip"); - - if (!File.Exists(csTgt)) - File.Copy(csSrc, csTgt); - if (!File.Exists(vbTgt)) - File.Copy(vbSrc, vbTgt); - } - } - #endregion - - private string GetDtmlXsdPathVs9() - { - string path = _vs9Path; //%ProgramFiles%\Microsoft Visual Studio 9.0\Common7\IDE\ - path = path.TrimEnd('\\'); //%ProgramFiles%\Microsoft Visual Studio 9.0\Common7\IDE - path = path.Substring(0, path.LastIndexOf('\\')); //%ProgramFiles%\Microsoft Visual Studio 9.0\Common7 - path = path.Substring(0, path.LastIndexOf('\\')); //%ProgramFiles%\Microsoft Visual Studio 9.0 - path = Path.Combine(path, "Xml"); //%ProgramFiles%\Microsoft Visual Studio 9.0\Xml - path = Path.Combine(path, "Schemas"); //%ProgramFiles%\Microsoft Visual Studio 9.0\Xml\Schemas - path = Path.Combine(path, "DocTypeML.xsd"); //%ProgramFiles%\Microsoft Visual Studio 9.0\Xml\Schemas\DocTypeML.xsd - return path; - } - - private string GetDtmlXsdPathVs10() - { - string path = _vs10Path; //%ProgramFiles%\Microsoft Visual Studio 10.0\Common7\IDE\ - path = path.TrimEnd('\\'); //%ProgramFiles%\Microsoft Visual Studio 10.0\Common7\IDE - path = path.Substring(0, path.LastIndexOf('\\')); //%ProgramFiles%\Microsoft Visual Studio 10.0\Common7 - path = path.Substring(0, path.LastIndexOf('\\')); //%ProgramFiles%\Microsoft Visual Studio 10.0 - path = Path.Combine(path, "Xml"); //%ProgramFiles%\Microsoft Visual Studio 10.0\Xml - path = Path.Combine(path, "Schemas"); //%ProgramFiles%\Microsoft Visual Studio 10.0\Xml\Schemas - path = Path.Combine(path, "DocTypeML.xsd"); //%ProgramFiles%\Microsoft Visual Studio 10.0\Xml\Schemas\DocTypeML.xsd - return path; - } - - private void ConfigVs() - { - if (!string.IsNullOrEmpty(_vs9Path)) - { - string devenv = Path.Combine(_vs9Path, "devenv.exe"); - Process p = Process.Start(devenv, "/InstallVSTemplates"); - p.WaitForExit(); - } - - if (!string.IsNullOrEmpty(_vs10Path)) - { - string devenv = Path.Combine(_vs10Path, "devenv.exe"); - Process p = Process.Start(devenv, "/InstallVSTemplates"); - p.WaitForExit(); - } - } - } - - internal enum InstallMode - { - Install, - Uninstall - } -} diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Installer/InstallerProgress.resx b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Installer/InstallerProgress.resx deleted file mode 100644 index 326ed3486f..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Installer/InstallerProgress.resx +++ /dev/null @@ -1,228 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 - - - - True - - - - 13, 13 - - - 278, 13 - - - 0 - - - LINQ to umbraco is configuring Visual Studio 2008/ 2010 - - - label1 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 2 - - - True - - - 38, 30 - - - 221, 13 - - - 1 - - - This may take a few minutes, please stand by - - - label2 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 1 - - - 16, 61 - - - 271, 27 - - - 2 - - - progressBar1 - - - System.Windows.Forms.ProgressBar, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 0 - - - 17, 17 - - - True - - - 6, 13 - - - 299, 100 - - - - CenterParent - - - LINQ to umbraco Installer Progress - - - installWorker - - - System.ComponentModel.BackgroundWorker, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - InstallerProgress - - - System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Item packages/LINQtoUmbracoCS.zip b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Item packages/LINQtoUmbracoCS.zip deleted file mode 100644 index 10551ab2bc..0000000000 Binary files a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Item packages/LINQtoUmbracoCS.zip and /dev/null differ diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Item packages/LINQtoUmbracoCS/LINQtoUmbracoCS.vstemplate b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Item packages/LINQtoUmbracoCS/LINQtoUmbracoCS.vstemplate deleted file mode 100644 index fe487812d2..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Item packages/LINQtoUmbracoCS/LINQtoUmbracoCS.vstemplate +++ /dev/null @@ -1,31 +0,0 @@ - - - LINQ to Umbraco File - An empty LINQ to Umbraco file - umbraco.ico - CSharp - 100 - DataClasses.dtml - 1 - Umbraco.Linq.Core.Designer - 3.5 - - - - - System - - - System.Core - - - Umbraco.Linq.Core - - - dtml.dtml - - - - - - \ No newline at end of file diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Item packages/LINQtoUmbracoCS/dtml.dtml b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Item packages/LINQtoUmbracoCS/dtml.dtml deleted file mode 100644 index a75fd32030..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Item packages/LINQtoUmbracoCS/dtml.dtml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Item packages/LINQtoUmbracoCS/umbraco.ico b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Item packages/LINQtoUmbracoCS/umbraco.ico deleted file mode 100644 index 402cf9594e..0000000000 Binary files a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Item packages/LINQtoUmbracoCS/umbraco.ico and /dev/null differ diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Item packages/LINQtoUmbracoVB.zip b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Item packages/LINQtoUmbracoVB.zip deleted file mode 100644 index ee946fe0d7..0000000000 Binary files a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Item packages/LINQtoUmbracoVB.zip and /dev/null differ diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Item packages/LINQtoUmbracoVB/LINQtoUmbracoVB.vstemplate b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Item packages/LINQtoUmbracoVB/LINQtoUmbracoVB.vstemplate deleted file mode 100644 index 500ae504da..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Item packages/LINQtoUmbracoVB/LINQtoUmbracoVB.vstemplate +++ /dev/null @@ -1,31 +0,0 @@ - - - LINQ to Umbraco File - An empty LINQ to Umbraco file - umbraco.ico - VisualBasic - 100 - DataClasses.dtml - 1 - Umbraco.Linq.Core.Designer - 3.5 - - - - - System - - - System.Core - - - Umbraco.Linq.Core - - - dtml.dtml - - - - - - \ No newline at end of file diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Item packages/LINQtoUmbracoVB/dtml.dtml b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Item packages/LINQtoUmbracoVB/dtml.dtml deleted file mode 100644 index a75fd32030..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Item packages/LINQtoUmbracoVB/dtml.dtml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Item packages/LINQtoUmbracoVB/umbraco.ico b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Item packages/LINQtoUmbracoVB/umbraco.ico deleted file mode 100644 index 402cf9594e..0000000000 Binary files a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Item packages/LINQtoUmbracoVB/umbraco.ico and /dev/null differ diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Properties/AssemblyInfo.cs b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Properties/AssemblyInfo.cs deleted file mode 100644 index 30a478a8b4..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// 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("DTMetal.CodeBuilder")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyProduct("DTMetal.CodeBuilder")] -[assembly: AssemblyDelaySign(false)] diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/RegistrationAttributes/CodeGeneratorRegistrationAttribute.cs b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/RegistrationAttributes/CodeGeneratorRegistrationAttribute.cs deleted file mode 100644 index 1ae8830d41..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/RegistrationAttributes/CodeGeneratorRegistrationAttribute.cs +++ /dev/null @@ -1,158 +0,0 @@ -/*************************************************************************** - -Copyright (c) Microsoft Corporation. All rights reserved. -This code is licensed under the Visual Studio SDK license terms. -THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY -IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR -PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. - -***************************************************************************/ - -using System; -using System.Globalization; - -namespace Microsoft.VisualStudio.Shell -{ - /// - /// This attribute adds a custom file generator registry entry for specific file - /// type. - /// For Example: - /// [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\Generators\ - /// {fae04ec1-301f-11d3-bf4b-00c04f79efbc}\MyGenerator] - /// "CLSID"="{AAAA53CC-3D4F-40a2-BD4D-4F3419755476}" - /// "GeneratesDesignTimeSource" = d'1' - /// - /// - [AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)] - public sealed class CodeGeneratorRegistrationAttribute : RegistrationAttribute - { - private string _contextGuid; - private Type _generatorType; - private Guid _generatorGuid; - private string _generatorName; - private string _generatorRegKeyName; - private bool _generatesDesignTimeSource = false; - private bool _generatesSharedDesignTimeSource = false; - /// - /// Creates a new CodeGeneratorRegistrationAttribute attribute to register a custom - /// code generator for the provided context. - /// - /// The type of Code generator. Type that implements IVsSingleFileGenerator - /// The generator name - /// The context GUID this code generator would appear under. - public CodeGeneratorRegistrationAttribute(Type generatorType, string generatorName, string contextGuid) - { - if (generatorType == null) - throw new ArgumentNullException("generatorType"); - if (generatorName == null) - throw new ArgumentNullException("generatorName"); - if (contextGuid == null) - throw new ArgumentNullException("contextGuid"); - - _contextGuid = contextGuid; - _generatorType = generatorType; - _generatorName = generatorName; - _generatorRegKeyName = generatorType.Name; - _generatorGuid = generatorType.GUID; - } - - /// - /// Get the generator Type - /// - public Type GeneratorType - { - get { return _generatorType; } - } - - /// - /// Get the Guid representing the project type - /// - public string ContextGuid - { - get { return _contextGuid; } - } - - /// - /// Get the Guid representing the generator type - /// - public Guid GeneratorGuid - { - get { return _generatorGuid; } - } - - /// - /// Get or Set the GeneratesDesignTimeSource value - /// - public bool GeneratesDesignTimeSource - { - get { return _generatesDesignTimeSource; } - set { _generatesDesignTimeSource = value; } - } - - /// - /// Get or Set the GeneratesSharedDesignTimeSource value - /// - public bool GeneratesSharedDesignTimeSource - { - get { return _generatesSharedDesignTimeSource; } - set { _generatesSharedDesignTimeSource = value; } - } - - - /// - /// Gets the Generator name - /// - public string GeneratorName - { - get { return _generatorName; } - } - - /// - /// Gets the Generator reg key name under - /// - public string GeneratorRegKeyName - { - get { return _generatorRegKeyName; } - set { _generatorRegKeyName = value; } - } - - /// - /// Property that gets the generator base key name - /// - private string GeneratorRegKey - { - get { return string.Format(CultureInfo.InvariantCulture, @"Generators\{0}\{1}", ContextGuid, GeneratorRegKeyName); } - } - /// - /// Called to register this attribute with the given context. The context - /// contains the location where the registration inforomation should be placed. - /// It also contains other information such as the type being registered and path information. - /// - public override void Register(RegistrationContext context) - { - using (Key childKey = context.CreateKey(GeneratorRegKey)) - { - childKey.SetValue(string.Empty, GeneratorName); - childKey.SetValue("CLSID", GeneratorGuid.ToString("B")); - - if (GeneratesDesignTimeSource) - childKey.SetValue("GeneratesDesignTimeSource", 1); - - if (GeneratesSharedDesignTimeSource) - childKey.SetValue("GeneratesSharedDesignTimeSource", 1); - - } - - } - - /// - /// Unregister this file extension. - /// - /// - public override void Unregister(RegistrationContext context) - { - context.RemoveKey(GeneratorRegKey); - } - } -} diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Strings.Designer.cs b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Strings.Designer.cs deleted file mode 100644 index 5a0e899499..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Strings.Designer.cs +++ /dev/null @@ -1,99 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:2.0.50727.3074 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace umbraco.Linq.DTMetal.CodeBuilder { - 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", "2.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Strings { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Strings() { - } - - /// - /// 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("umbraco.Linq.DTMetal.CodeBuilder.Strings", typeof(Strings).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; - } - } - - /// - /// Looks up a localized string similar to Dtml file could not be located at \"{0}\". - /// - internal static string DtmlNotFound { - get { - return ResourceManager.GetString("DtmlNotFound", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The call to GetDefaultExtension() has failed due to the exception:. - /// - internal static string GetDefaultExtensionFailed { - get { - return ResourceManager.GetString("GetDefaultExtensionFailed", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to VS 2008 Setup Failed. - /// - internal static string InstallFailureMessage { - get { - return ResourceManager.GetString("InstallFailureMessage", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The following validation errors occuring with the XML:. - /// - internal static string XsdValidationFailureHeading { - get { - return ResourceManager.GetString("XsdValidationFailureHeading", resourceCulture); - } - } - } -} diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Strings.resx b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Strings.resx deleted file mode 100644 index 3ffa0e3f56..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Strings.resx +++ /dev/null @@ -1,135 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 - - - The call to GetDefaultExtension() has failed due to the exception: - - - Dtml file could not be located at \"{0}\" - DtmlNotFound description - - - The following validation errors occuring with the XML: - XsdValidationFailureHeading description - - - VS 2008 Setup Failed - InstallFailureMessage description - - \ No newline at end of file diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Switch.cs b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Switch.cs deleted file mode 100644 index ff04115ae2..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Switch.cs +++ /dev/null @@ -1,98 +0,0 @@ -using System; - -namespace umbraco.Linq.DTMetal.CodeBuilder -{ - public class Switch - { - public Switch(object o) - { - Obj = o; - } - - public object Obj { get; private set; } - - /// - /// Case statement - /// - /// Type of object - /// Action method to execute for case evaluation - /// - public Switch Case(Action a) - { - return Case(o => true, a, false); - } - - /// - /// Case statement - /// - /// Type of object - /// Action method to execute for case evaluation - /// if set to true fall through to next case statement. - /// - public Switch Case(Action a, bool fallThrough) - { - return Case(o => true, a, fallThrough); - } - - /// - /// Case statement - /// - /// Type of object - /// The funcation to eveluate against to object. - /// Action method to execute for case evaluation - /// - public Switch Case(Func c, Action a) - { - return Case(c, a, false); - } - - /// - /// Case statement - /// - /// Type of object - /// The funcation to eveluate against to object. - /// Action method to execute for case evaluation - /// if set to true fall through to next case statement. - /// - public Switch Case(Func c, Action a, bool fallThrough) - { - if (this == null) - { - return null; - } - else - { - if (this.Obj is T) - { - T t = (T)this.Obj; - if (c(t)) - { - a(t); - return fallThrough ? this : null; - } - } - } - - return this; - } - - /// - /// Defaults case - /// - /// Type of object - /// Action to perform - /// - public Switch Default(Action a) - { - if (this == null) - { - return null; - } - else - { - a((T)this.Obj); - return this; - } - } - } -} diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Wizard/CreateDtmlWizard.cs b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Wizard/CreateDtmlWizard.cs deleted file mode 100644 index c43740e11a..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.CodeBuilder/Wizard/CreateDtmlWizard.cs +++ /dev/null @@ -1,96 +0,0 @@ -using System; -using System.Collections.Generic; -using Microsoft.VisualStudio.TemplateWizard; -using EnvDTE; -using System.Windows.Forms; - -namespace umbraco.Linq.DTMetal.CodeBuilder -{ - public class CreateDtmlWizard : IWizard - { - private string _tool; - private bool _ok; - - #region IWizard Members - - public void BeforeOpeningFile(EnvDTE.ProjectItem projectItem) - { - } - - public void ProjectFinishedGenerating(EnvDTE.Project project) - { - } - - public void ProjectItemFinishedGenerating(EnvDTE.ProjectItem projectItem) - { - if (projectItem == null) - { - throw new ArgumentNullException("projectitem"); - } - - projectItem.Properties.Item("CustomTool").Value = _tool; - } - - public void RunFinished() - { - } - - public void RunStarted(object automationObject, Dictionary replacementsDictionary, WizardRunKind runKind, object[] customParams) - { - if (runKind == WizardRunKind.AsNewItem) - { - var dte = automationObject as _DTE; - var owner = new IDEWindow(new IntPtr(dte.MainWindow.HWnd)); - - _tool = replacementsDictionary["$CustomTool$"]; - string dataContextName = null; - if (replacementsDictionary.ContainsKey("$rootname$")) - { - dataContextName = replacementsDictionary["$rootname$"]; - if (dataContextName.EndsWith(".dtml", StringComparison.OrdinalIgnoreCase)) - { - dataContextName = dataContextName.Substring(0, dataContextName.Length - ".dtml".Length); - } - } - } - - throw new NotImplementedException(); - } - - public bool ShouldAddProjectItem(string filePath) - { - return _ok; - } - - #endregion - } - - - /// - /// Helper class for the Visual Studio IDE window. - /// - internal class IDEWindow : IWin32Window - { - /// - /// Handle to the IDE window. - /// - private IntPtr _handle; - - /// - /// Creates a new Visual Studio IDE window wrapper. - /// - /// Handle to the IDE window. - public IDEWindow(IntPtr handle) - { - _handle = handle; - } - - /// - /// Gets the handle to the IDE window. - /// - public IntPtr Handle - { - get { return _handle; } - } - } -} diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.Engine.Tests/AuthoringTests.txt b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.Engine.Tests/AuthoringTests.txt deleted file mode 100644 index 64bab9481d..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.Engine.Tests/AuthoringTests.txt +++ /dev/null @@ -1,136 +0,0 @@ -========================================================================== - Visual Studio Team System: Overview of Authoring and Running Tests -========================================================================== - -This overview describes the features for authoring and running tests in -Visual Studio Team System and Visual Studio Team Edition for Software Testers. - -Opening Tests -------------- -To open a test, open a test project or a test metadata file (a file with -extension .vsmdi) that contains the definition of the test. You can find -test projects and metadata files in Solution Explorer. - -Viewing Tests -------------- -To see which tests are available to you, open the Test View window. Or, -if you have installed Team Edition for Software Testers, you can also open -the Test List Editor window to view tests. - -To open the Test View window, click the Test menu, point to Windows, and -then click Test View. To open the Test List Editor window (if you have -installed Team Edition for Software Testers), click Test, point to Windows, -and then click Test List Editor. - -Running Tests -------------- -You can run tests from the Test View window and the Test List Editor window. -See Viewing Tests to learn how to open these windows. To run one or more -tests displayed in the Test View window, first select the tests in that -window; to select multiple tests, hold either the Shift or CTRL key while -clicking tests. Then click the Run Tests button in the Test View window -toolbar. - -If you have installed Visual Studio Team Edition for Software Testers, you can -also use the Test List Editor window to run tests. To run tests in Test List Editor, -select the check box next to each test that you want to run. Then click the -Run Tests button in the Test List Editor window toolbar. - -Viewing Test Results --------------------- -When you run a test or a series of tests, the results of the test run will be -shown in the Test Results window. Each individual test in the run is shown on -a separate line so that you can see its status. The window contains an -embedded status bar in the top half of the window that provides you with -summary details of the complete test run. - -To see more detailed results for a particular test result, double-click it in -the Test Results window. This opens a window that provides more information -about the particular test result, such as any specific error messages returned -by the test. - -Changing the way that tests are run ------------------------------------ -Each time you run one or more tests, a collection of settings is used to -determine how those tests are run. These settings are contained in a “test -run configuration” file. - -Here is a partial list of the changes you can make with a test run -configuration file: - - - Change the naming scheme for each test run. - - Change the test controller that the tests are run on so that you can run - tests remotely. - - Gather code coverage data for the code being tested so that you can see - which lines of code are covered by your tests. - - Enable and disable test deployment. - - Specify additional files to deploy before tests are run. - - Select a different host, ASP.NET, for running ASP.NET unit tests. - - Select a different host, the smart device test host, for running smart device unit tests. - - Set various properties for the test agents that run your tests. - - Run custom scripts at the start and end of each test run so that you can - set up the test environment exactly as required each time tests are run. - - Set time limits for tests and test runs. - - Set the browser mix and the number of times to repeat Web tests in the - test run. - -By default, a test run configuration file is created whenever you create a -new test project. You make changes to this file by double-clicking it in -Solution Explorer and then changing its settings. (Test run configuration -files have the extension .testrunconfig.) - -A solution can contain multiple test run configuration files. Only one of -those files, known as the “Active” test run configuration file, is used to -determine the settings that are currently used for test runs. You select -the active test run configuration by clicking Select Active Test Run -Configuration on the Test menu. - -------------------------------------------------------------------------------- - -Test Types ----------- -Using Visual Studio Team Edition for Software Testers, you can create a number -of different test types: - -Unit test: Use a unit test to create a programmatic test in C++, Visual C# or -Visual Basic that exercises source code. A unit test calls the methods of a -class, passing suitable parameters, and verifies that the returned value is -what you expect. -There are three specialized variants of unit tests: - - Data-driven unit tests are created when you configure a unit test to be - called repeatedly for each row of a data source. The data from each row - is used by the unit test as input data. - - ASP.NET unit tests are unit tests that exercise code in an ASP.NET Web - application. - - Smart device unit tests are unit tests that are deployed to a smart device - or emulator and then executed by the smart device test host. - -Web Test: Web tests consist of an ordered series of HTTP requests that you -record in a browser session using Microsoft Internet Explorer. You can have -the test report specific details about the pages or sites it requests, such -as whether a particular page contains a specified string. - -Load Test: You use a load test to encapsulate non-manual tests, such as -unit, Web, and generic tests, and then run them simultaneously by using -virtual users. Running these tests under load generates test results, -including performance and other counters, in tables and in graphs. - -Generic test: A generic test is an existing program wrapped to function as a -test in Visual Studio. The following are examples of tests or programs that -you can turn into generic tests: - - An existing test that uses process exit codes to communicate whether the - test passed or failed. 0 indicates passing and any other value indicates - a failure. - - A general program to obtain specific functionality during a test scenario. - - A test or program that uses a special XML file (called a “summary results - file”), to communicate detailed results. - -Manual test: The manual test type is used when the test tasks are to be -completed by a test engineer as opposed to an automated script. - -Ordered test: Use an ordered test to execute a set of tests in an order you -specify. - -------------------------------------------------------------------------------- - - diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.Engine.Tests/DTMetal.Engine.Tests.csproj b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.Engine.Tests/DTMetal.Engine.Tests.csproj deleted file mode 100644 index e00a467fad..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.Engine.Tests/DTMetal.Engine.Tests.csproj +++ /dev/null @@ -1,108 +0,0 @@ - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {85CA72D8-7095-4EB1-8997-A190667C723C} - Library - Properties - umbraco.Linq.DTMetal.Engine.Tests - umbraco.Linq.DTMetal.Engine.Tests - v3.5 - 512 - {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - SAK - SAK - SAK - SAK - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - true - bin\Debug - Fixed Version\ - DEBUG;TRACE - full - AnyCPU - true - GlobalSuppressions.cs - prompt - - - - - - 3.5 - - - - 3.5 - - - - 3.5 - - - False - ..\..\..\dep\Reference Assemblies\Mocking\TypeMock.dll - - - False - ..\..\..\dep\Reference Assemblies\Mocking\Typemock.ArrangeActAssert.Dll - - - False - ..\..\..\..\umbraco\datalayer\bin\Debug\umbraco.DataLayer.dll - - - - - Properties\SolutionInfo.cs - - - - - - - - - - - - {31CAEC36-0C3D-4D69-B092-84866811EA07} - umbraco.Linq.Core - - - {461089E7-008E-4737-BA17-E1FCD1CC3D0E} - DTMetal.CodeBuilder - - - {B151A571-D2F7-47DD-AFD6-C2C34ECA845B} - DTMetal.Engine - - - - - \ No newline at end of file diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.Engine.Tests/DocTypeMarkupLanguageBuilderTests.cs b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.Engine.Tests/DocTypeMarkupLanguageBuilderTests.cs deleted file mode 100644 index a98d790347..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.Engine.Tests/DocTypeMarkupLanguageBuilderTests.cs +++ /dev/null @@ -1,194 +0,0 @@ -using System; -using System.Text; -using System.Collections.Generic; -using System.Linq; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using TypeMock.ArrangeActAssert; -using System.Xml.Linq; -using umbraco.Linq.DTMetal.CodeBuilder; - -namespace umbraco.Linq.DTMetal.Engine.Tests -{ - /// - /// Summary description for DocTypeMarkupLanguageBuilderTests - /// - [TestClass] - public class DocTypeMarkupLanguageBuilderTests - { - [TestMethod] - [Isolated] - [ExpectedException(typeof(ArgumentNullException))] - public void DocTypeMarkupLanguageBuilderTest_Constructor() - { - var dtmlGen = new DocTypeMarkupLanguageBuilder(null, string.Empty, false); - } - - [TestMethod, Isolated] - public void DocTypeMarkupLanguageBuilderTest_XmlValidates() - { - var dtob = Isolate.Fake.Instance(Members.MustSpecifyReturnValues); - - Isolate.WhenCalled(() => dtob.DocumentTypes).WillReturn(new List - { - new DocType{ - Alias = "DocType1", - Name = "Document Type 1", - Description = "Document type 1 description", - Id = 1, - ParentId = -1, - Associations= new List(), - Properties = new List(), - } - }); - - var dtmlGen = new DocTypeMarkupLanguageBuilder(dtob.DocumentTypes, string.Empty, false); - - dtmlGen.BuildXml(); - - Assert.IsTrue(true); - } - - [TestMethod, Isolated] - public void DocTypeMarkupLanguageBuilderTest_DataContextName() - { - var dtob = Isolate.Fake.Instance(Members.MustSpecifyReturnValues); - - Isolate.WhenCalled(() => dtob.DocumentTypes).WillReturn(new List - { - new DocType{ - Alias = "DocType1", - Name = "Document Type 1", - Description = "Document Type 1 description", - Id = 1, - ParentId = -1, - Associations= null, - Properties = null, - } - }); - - var dtmlGen = new DocTypeMarkupLanguageBuilder(dtob.DocumentTypes, string.Empty, false); - dtmlGen.BuildXml(); - Assert.AreEqual("umbraco", (string)dtmlGen.DocTypeMarkupLanguage.Root.Attribute("DataContextName")); - - dtmlGen = new DocTypeMarkupLanguageBuilder(dtob.DocumentTypes, "Myumbraco", false); - dtmlGen.BuildXml(); - Assert.AreEqual("Myumbraco", (string)dtmlGen.DocTypeMarkupLanguage.Root.Attribute("DataContextName")); - } - - [TestMethod] - [Isolated] - public void DocTypeMarkupLanguageBuilderTest_SingleDocType() - { - var xmlDoc = XDocument.Parse(@" - - - 1 - Document Type 1 - DocType1 - Document Type 1 description - - - -"); - - var dtob = Isolate.Fake.Instance(Members.MustSpecifyReturnValues); - - Isolate.WhenCalled(() => dtob.DocumentTypes).WillReturn(new List - { - new DocType{ - Alias = "DocType1", - Name = "Document Type 1", - Description = "Document Type 1 description", - Id = 1, - ParentId = -1, - Associations= null, - Properties = null, - } - }); - - var dtmlGen = new DocTypeMarkupLanguageBuilder(dtob.DocumentTypes, string.Empty, false); - - Isolate.Verify.WasCalledWithAnyArguments(() => dtob.DocumentTypes.GetEnumerator()); - - dtmlGen.BuildXml(); - - Assert.AreEqual(xmlDoc.ToString(SaveOptions.None), dtmlGen.DocTypeMarkupLanguage.ToString(SaveOptions.None)); - } - - [TestMethod, Isolated] - public void DocTypeMarkupLanguageBuilderTest_DocTypeWithProperties() - { - var dtob = Isolate.Fake.Instance(Members.ReturnRecursiveFakes); - - Isolate.WhenCalled(() => dtob.DocumentTypes).WillReturn(new List - { - new DocType{ - Alias = "DocType1", - Name = "Document Type 1", - Description = "Document Type 1 description", - Id = 1, - ParentId = -1, - Associations= null, - Properties = new List{ - new DocTypeProperty{ - Alias = "Property1", - ControlId = new Guid("15e66384-3fb6-435e-8fc0-fa63b47f0f4c"), - DatabaseType= typeof(int), - Description = string.Empty, - Id = 1, - Mandatory = false, - Name = "Property 1" - } - }, - } - }); - - var dtmlGen = new DocTypeMarkupLanguageBuilder(dtob.DocumentTypes, string.Empty, false); - - dtmlGen.BuildXml(); - - Assert.IsNotNull(dtmlGen.DocTypeMarkupLanguage); - Assert.AreEqual(1, dtmlGen.DocTypeMarkupLanguage.Descendants("Properties").Count()); - - var propertiesXml = dtmlGen.DocTypeMarkupLanguage.Descendants("Properties").First(); - Assert.AreEqual("Property1", propertiesXml.Element("Property").Element("Alias").Value); - Assert.AreEqual(new Guid("15e66384-3fb6-435e-8fc0-fa63b47f0f4c").ToString(), propertiesXml.Element("Property").Element("ControlId").Value); - Assert.AreEqual(typeof(int).ToString(), propertiesXml.Element("Property").Element("Type").Value); - Assert.AreEqual(string.Empty, propertiesXml.Element("Property").Element("Description").Value); - Assert.AreEqual(1, (int)propertiesXml.Element("Property").Element("Id")); - Assert.AreEqual(false, (bool)propertiesXml.Element("Property").Element("Mandatory")); - Assert.AreEqual("Property 1", propertiesXml.Element("Property").Element("Name").Value); - } - - [TestMethod, Isolated] - public void DocTypeMarkupLanguageBuilderTest_DocTypeWithAssociations() - { - var dtob = Isolate.Fake.Instance(Members.MustSpecifyReturnValues); - - Isolate.WhenCalled(() => dtob.DocumentTypes).WillReturn(new List - { - new DocType{ - Alias = "DocType1", - Name = "Document Type 1", - Description = "Document Type 1 description", - Id = 1, - ParentId = -1, - Associations = new List{ - new DocTypeAssociation{ - AllowedId = 1 - } - }, - Properties = null, - } - }); - - var dtmlGen = new DocTypeMarkupLanguageBuilder(dtob.DocumentTypes, string.Empty, false); - dtmlGen.BuildXml(); - - Assert.AreEqual(1, dtmlGen.DocTypeMarkupLanguage.Descendants("Associations").Count()); - - var association = dtmlGen.DocTypeMarkupLanguage.Descendants("Associations").First(); - Assert.AreEqual(1, (int)association.Element("Association")); - } - } -} diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.Engine.Tests/DocTypeObjectBuilderTest.cs b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.Engine.Tests/DocTypeObjectBuilderTest.cs deleted file mode 100644 index fc781e932a..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.Engine.Tests/DocTypeObjectBuilderTest.cs +++ /dev/null @@ -1,362 +0,0 @@ -using umbraco.Linq.DTMetal.Engine; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using TypeMock.ArrangeActAssert; -using umbraco.DataLayer; -using System; -using TypeMock; -using System.Linq; -using umbraco.Linq.DTMetal.CodeBuilder; -namespace umbraco.Linq.DTMetal.Engine.Tests -{ - - - /// - ///This is a test class for DocTypeObjectBuilderTest and is intended - ///to contain all CodeCreatorTest Unit Tests - /// - [TestClass()] - public class DocTypeObjectBuilderTest - { - [TestMethod] - [Isolated] - public void LoadDocTypesTest_DbCalled() - { - ISqlHelper sql = Isolate.Fake.Instance(Members.ReturnRecursiveFakes); - - DocTypeObjectBuilder target = new DocTypeObjectBuilder(string.Empty); - Isolate.WhenCalled(() => target.SqlHelper).WillReturn(sql); - target.LoadDocTypes(); - Isolate.Verify.WasCalledWithAnyArguments(() => target.SqlHelper); - Isolate.Verify.WasCalledWithAnyArguments(() => sql.ExecuteReader(string.Empty)); - } - - [TestMethod] - [Isolated] - public void LoadDocTypesTest_ReaderAccessed() - { - var sql = Isolate.Fake.Instance(); - var reader = Isolate.Fake.Instance(); - - Isolate.WhenCalled(() => reader.HasRecords).WillReturn(true); - Isolate.WhenCalled(() => reader.Read()).WillReturn(false); - Isolate.WhenCalled(() => sql.ExecuteReader(string.Empty)).WillReturn(reader); - - DocTypeObjectBuilder target = new DocTypeObjectBuilder(string.Empty); - Isolate.WhenCalled(() => target.SqlHelper).WillReturn(sql); - target.LoadDocTypes(); - - Isolate.Verify.WasCalledWithAnyArguments(() => reader.HasRecords); - Isolate.Verify.WasCalledWithExactArguments(() => reader.Read()); - } - - [TestMethod()] - [Isolated] - public void LoadDocTypesTest_CreateDocType() - { - ISqlHelper fakeSql = Isolate.Fake.Instance(Members.CallOriginal); - - IRecordsReader fakeReader = Isolate.Fake.Instance(); - - var dtGuid = Guid.NewGuid(); - - //get the data for the DT - Isolate.WhenCalled(() => fakeReader.HasRecords).WillReturn(true); - Isolate.WhenCalled(() => fakeReader.Read()).WillReturn(true); - Isolate.WhenCalled(() => fakeReader.Read()).CallOriginal(); - Isolate.WhenCalled(() => fakeReader.GetId()).WillReturn(1); - Isolate.WhenCalled(() => fakeReader.GetName()).WillReturn("Name"); - Isolate.WhenCalled(() => fakeReader.GetDescription()).WillReturn("Description"); - Isolate.WhenCalled(() => fakeReader.GetAlias()).WillReturn("Alias"); - Isolate.WhenCalled(() => fakeReader.GetParentId()).WillReturn(-1); - Isolate.WhenCalled(() => fakeSql.ExecuteReader(string.Empty)).WillReturn(fakeReader); - - DocTypeObjectBuilder target = new DocTypeObjectBuilder(string.Empty); - Isolate.WhenCalled(() => target.SqlHelper).WillReturn(fakeSql); - target.LoadDocTypes(); - - Assert.IsNotNull(target.DocumentTypes); - Assert.AreEqual(target.DocumentTypes.Count, 1); - - Isolate.Verify.WasCalledWithExactArguments(() => target.BuildDocumentType(fakeReader)); - Isolate.Verify.WasCalledWithExactArguments(() => fakeReader.GetAlias()); - Isolate.Verify.WasCalledWithExactArguments(() => fakeReader.GetParentId()); - Isolate.Verify.WasCalledWithExactArguments(() => fakeReader.GetDescription()); - Isolate.Verify.WasCalledWithExactArguments(() => fakeReader.GetName()); - Isolate.Verify.WasCalledWithExactArguments(() => fakeReader.GetId()); - - var dt = target.DocumentTypes[0]; - Assert.AreEqual("Alias", dt.Alias); - Assert.AreEqual("Description", dt.Description); - Assert.AreEqual(1, dt.Id); - Assert.AreEqual("Name", dt.Name); - Assert.AreEqual(-1, dt.ParentId); - Assert.AreEqual(0, dt.Properties.Count); - } - - [TestMethod] - [Isolated] - public void LoadDocTypesTest_IntPropertyMapping() - { - DocTypeObjectBuilder target = new DocTypeObjectBuilder(string.Empty); - - var intReader = Isolate.Fake.Instance(); - Isolate.WhenCalled(() => intReader.GetDbType()).WillReturn("Integer"); - var intProp = target.BuildProperty(intReader); - Assert.AreEqual(typeof(int), intProp.DatabaseType); - } - - [TestMethod, Isolated] - public void LoadDocTypesTest_NtextPropertyMapping() - { - DocTypeObjectBuilder target = new DocTypeObjectBuilder(string.Empty); - var ntextReader = Isolate.Fake.Instance(); - Isolate.WhenCalled(() => ntextReader.GetDbType()).WillReturn("Ntext"); - var ntextProp = target.BuildProperty(ntextReader); - Assert.AreEqual(typeof(string), ntextProp.DatabaseType); - } - - [TestMethod, Isolated] - public void LoadDocTypesTest_NvarcharPropertyMapping() - { - DocTypeObjectBuilder target = new DocTypeObjectBuilder(string.Empty); - var varcharReader = Isolate.Fake.Instance(); - Isolate.WhenCalled(() => varcharReader.GetDbType()).WillReturn("Nvarchar"); - var varcharProp = target.BuildProperty(varcharReader); - Assert.AreEqual(typeof(string), varcharProp.DatabaseType); - } - - [TestMethod, Isolated] - public void LoadDocTypesTest_DatePropertyMapping() - { - DocTypeObjectBuilder target = new DocTypeObjectBuilder(string.Empty); - var dateReader = Isolate.Fake.Instance(); - Isolate.WhenCalled(() => dateReader.GetDbType()).WillReturn("Date"); - var dateProp = target.BuildProperty(dateReader); - Assert.AreEqual(typeof(DateTime), dateProp.DatabaseType); - } - - [TestMethod, Isolated] - public void LoadDocTypesTest_ObjectPropertyMapping() - { - DocTypeObjectBuilder target = new DocTypeObjectBuilder(string.Empty); - var objReader = Isolate.Fake.Instance(); - Isolate.WhenCalled(() => objReader.GetDbType()).WillReturn("Something undefined"); - var objProp = target.BuildProperty(objReader); - Assert.AreEqual(typeof(object), objProp.DatabaseType); - } - - [TestMethod] - [Isolated] - public void LoadDocTypesTest_DocTypeProperties() - { - ISqlHelper fakeSql = Isolate.Fake.Instance(Members.ReturnRecursiveFakes); - - IRecordsReader fakeReader = Isolate.Fake.Instance(); - - var dtGuid = Guid.NewGuid(); - - //get the data for the DT - Isolate.WhenCalled(() => fakeReader.HasRecords).WillReturn(true); - Isolate.WhenCalled(() => fakeReader.Read()).WillReturn(true); - Isolate.WhenCalled(() => fakeSql.ExecuteReader(string.Empty)).WillReturn(fakeReader); - Isolate.WhenCalled(() => fakeReader.GetId()).WillReturn(0); - Isolate.WhenCalled(() => fakeReader.Read()).WillReturnRepeat(true, 4).AndThen().CallOriginal(); - Isolate.WhenCalled(() => fakeReader.GetParentId()).WillReturn(-1); - - Isolate.WhenCalled(() => fakeReader.GetAlias()).WillReturn("Property1 Alias"); - Isolate.WhenCalled(() => fakeReader.GetString("RegularExpression")).WillReturn(string.Empty); - Isolate.WhenCalled(() => fakeReader.GetDbType()).WillReturn("Integer"); - Isolate.WhenCalled(() => fakeReader.GetDescription()).WillReturn("Property1 Description"); - Isolate.WhenCalled(() => fakeReader.GetId()).WillReturn(1); - Isolate.WhenCalled(() => fakeReader.GetName()).WillReturn("Property1"); - - Isolate.WhenCalled(() => fakeReader.GetString("RegularExpression")).WillReturn(string.Empty); - Isolate.WhenCalled(() => fakeReader.GetDbType()).WillReturn("Ntext"); - - Isolate.WhenCalled(() => fakeReader.GetString("RegularExpression")).WillReturn(string.Empty); - Isolate.WhenCalled(() => fakeReader.GetDbType()).WillReturn("Nvarchar"); - - Isolate.WhenCalled(() => fakeReader.GetString("RegularExpression")).WillReturn(string.Empty); - Isolate.WhenCalled(() => fakeReader.GetDbType()).WillReturn("Date"); - - DocTypeObjectBuilder target = new DocTypeObjectBuilder(string.Empty); - Isolate.WhenCalled(() => target.SqlHelper).WillReturn(fakeSql); - target.LoadDocTypes(); - - Isolate.Verify.WasCalledWithExactArguments(() => target.GetProperties(0)); - Isolate.Verify.WasCalledWithExactArguments(() => target.BuildProperty(fakeReader)); - - Isolate.Verify.WasCalledWithAnyArguments(() => fakeSql.ExecuteReader(string.Empty)); - Isolate.Verify.WasCalledWithExactArguments(() => fakeReader.GetAlias()); - Isolate.Verify.WasCalledWithExactArguments(() => fakeReader.GetDbType()); - Isolate.Verify.WasCalledWithExactArguments(() => fakeReader.GetDescription()); - Isolate.Verify.WasCalledWithExactArguments(() => fakeReader.GetName()); - Isolate.Verify.WasCalledWithExactArguments(() => fakeReader.GetString("RegularExpression")); - Isolate.Verify.WasCalledWithExactArguments(() => fakeReader.GetId()); - - var dt = target.DocumentTypes[0]; - - Assert.IsNotNull(dt.Properties); - Assert.AreEqual(4, dt.Properties.Count); - - Assert.AreEqual("Property1 Alias", dt.Properties[0].Alias); - Assert.AreEqual(typeof(int), dt.Properties[0].DatabaseType); - Assert.AreEqual("Property1 Description", dt.Properties[0].Description); - Assert.AreEqual(1, dt.Properties[0].Id); - Assert.AreEqual(false, dt.Properties[0].Mandatory); - Assert.AreEqual("Property1", dt.Properties[0].Name); - Assert.AreEqual(string.Empty, dt.Properties[0].RegularExpression); - Assert.AreEqual(typeof(string), dt.Properties[1].DatabaseType); - Assert.AreEqual(typeof(string), dt.Properties[2].DatabaseType); - Assert.AreEqual(typeof(DateTime), dt.Properties[3].DatabaseType); - - } - - [TestMethod] - [Isolated] - public void LoadDocTypesTest_ParentIncluded() - { - ISqlHelper fakeSql = Isolate.Fake.Instance(Members.CallOriginal); - - IRecordsReader fakeReader = Isolate.Fake.Instance(); - - Isolate.WhenCalled(() => fakeReader.HasRecords).WillReturn(true); - Isolate.WhenCalled(() => fakeReader.Read()).WillReturnRepeat(true, 2).AndThen().CallOriginal(); - - Isolate.WhenCalled(() => fakeReader.GetId()).WillReturn(1); - Isolate.WhenCalled(() => fakeReader.GetParentId()).WillReturn(-1); - Isolate.WhenCalled(() => fakeReader.GetId()).WillReturn(2); - Isolate.WhenCalled(() => fakeReader.GetParentId()).WillReturn(1); - - Isolate.WhenCalled(() => fakeSql.ExecuteReader(string.Empty)).WillReturn(fakeReader); - - DocTypeObjectBuilder target = new DocTypeObjectBuilder(string.Empty); - Isolate.WhenCalled(() => target.SqlHelper).WillReturn(fakeSql); - Isolate.WhenCalled(() => target.GetProperties(0)).WillReturn(new System.Collections.Generic.List()); - Isolate.WhenCalled(() => target.BuildAssociations(0)).WillReturn(new System.Collections.Generic.List()); - - target.LoadDocTypes(); - - Assert.AreEqual(2, target.DocumentTypes.Count); - Assert.AreEqual(target.DocumentTypes[0].Id, target.DocumentTypes[1].ParentId); - } - - [TestMethod] - [Isolated] - public void LoadDocTypesTest_ParentNotIncluded() - { - ISqlHelper fakeSql = Isolate.Fake.Instance(Members.CallOriginal); - - IRecordsReader reader = Isolate.Fake.Instance(); - - Isolate.WhenCalled(() => reader.HasRecords).WillReturnRepeat(true, 2).AndThen().CallOriginal(); - Isolate.WhenCalled(() => reader.Read()).WillReturnRepeat(true, 2).AndThen().CallOriginal(); - Isolate.WhenCalled(() => reader.GetId()).WillReturn(2); - Isolate.WhenCalled(() => reader.GetParentId()).WillReturn(1); - - Isolate.WhenCalled(() => reader.GetId()).WillReturn(1); - Isolate.WhenCalled(() => reader.GetParentId()).WillReturn(-1); - - Isolate.WhenCalled(() => fakeSql.ExecuteReader(string.Empty)).WillReturn(reader); - - DocTypeObjectBuilder target = new DocTypeObjectBuilder(string.Empty); - Isolate.WhenCalled(() => target.SqlHelper).WillReturn(fakeSql); - Isolate.WhenCalled(() => target.GetProperties(0)).WillReturn(new System.Collections.Generic.List()); - Isolate.WhenCalled(() => target.BuildAssociations(0)).WillReturn(new System.Collections.Generic.List()); - - target.LoadDocTypes(); - - Assert.AreEqual(2, target.DocumentTypes.Count); - Assert.AreEqual(target.DocumentTypes[0].Id, target.DocumentTypes[1].ParentId); - - Isolate.Verify.WasCalledWithExactArguments(() => target.LoadParentDocType(1)); - } - - [TestMethod] - [Isolated] - [ExpectedException(typeof(IndexOutOfRangeException))] - public void LoadDocTypesTest_ParentNotExists() - { - ISqlHelper fakeSql = Isolate.Fake.Instance(Members.CallOriginal); - - IRecordsReader fakeReader = Isolate.Fake.Instance(); - - Isolate.WhenCalled(() => fakeReader.HasRecords).WillReturn(true); - Isolate.WhenCalled(() => fakeReader.HasRecords).CallOriginal(); - Isolate.WhenCalled(() => fakeReader.GetParentId()).WillReturn(1); - Isolate.WhenCalled(() => fakeReader.Read()).WillReturn(true); - Isolate.WhenCalled(() => fakeReader.Read()).CallOriginal(); - - Isolate.WhenCalled(() => fakeSql.ExecuteReader(string.Empty)).WillReturn(fakeReader); - - DocTypeObjectBuilder target = new DocTypeObjectBuilder(string.Empty); - Isolate.WhenCalled(() => target.SqlHelper).WillReturn(fakeSql); - - target.LoadDocTypes(); - - Isolate.Verify.WasCalledWithAnyArguments(() => target.LoadParentDocType(1)); - } - - [TestMethod] - [Isolated] - public void LoadDocTypesTest_GenerateAssociations() - { - var sql = Isolate.Fake.Instance(); - var reader = Isolate.Fake.Instance(); - - DocTypeObjectBuilder target = new DocTypeObjectBuilder(string.Empty); - Isolate.WhenCalled(() => target.SqlHelper).WillReturn(sql); - Isolate.WhenCalled(() => target.GetProperties(0)).WillReturn(new System.Collections.Generic.List()); - - Isolate.WhenCalled(() => sql.ExecuteReader(string.Empty)).WillReturn(reader); - - Isolate.WhenCalled(() => reader.HasRecords).WillReturn(true); - Isolate.WhenCalled(() => reader.Read()).WillReturnRepeat(true, 2); - Isolate.WhenCalled(() => reader.Read()).WillReturn(false); - - Isolate.WhenCalled(() => reader.GetInt("AllowedId")).WillReturn(1); - - target.LoadDocTypes(); - - Isolate.Verify.WasCalledWithExactArguments(() => target.BuildAssociations(1)); - - Assert.AreEqual(1, target.DocumentTypes.Count); - Assert.AreEqual(1, target.DocumentTypes[0].Associations.Count); - Assert.AreEqual(1, target.DocumentTypes[0].Associations[0].AllowedId); - } - - [TestMethod] - [Isolated] - public void LoadDocTypesTest_RecursiveParent() - { - ISqlHelper fakeSql = Isolate.Fake.Instance(Members.CallOriginal); - - IRecordsReader reader = Isolate.Fake.Instance(); - - Isolate.WhenCalled(() => reader.HasRecords).WillReturnRepeat(true, 3).AndThen().CallOriginal(); - Isolate.WhenCalled(() => reader.Read()).WillReturnRepeat(true, 3).AndThen().CallOriginal(); - Isolate.WhenCalled(() => reader.GetId()).WillReturn(2); - Isolate.WhenCalled(() => reader.GetParentId()).WillReturn(1); - - Isolate.WhenCalled(() => reader.GetId()).WillReturn(1); - Isolate.WhenCalled(() => reader.GetParentId()).WillReturn(3); - - Isolate.WhenCalled(() => reader.GetId()).WillReturn(3); - Isolate.WhenCalled(() => reader.GetParentId()).WillReturn(-1); - - Isolate.WhenCalled(() => fakeSql.ExecuteReader(string.Empty)).WillReturn(reader); - - DocTypeObjectBuilder target = new DocTypeObjectBuilder(string.Empty); - Isolate.WhenCalled(() => target.SqlHelper).WillReturn(fakeSql); - Isolate.WhenCalled(() => target.GetProperties(0)).WillReturn(new System.Collections.Generic.List()); - Isolate.WhenCalled(() => target.BuildAssociations(0)).WillReturn(new System.Collections.Generic.List()); - - target.LoadDocTypes(); - - Assert.AreEqual(3, target.DocumentTypes.Count); - Assert.AreEqual(target.DocumentTypes[0].Id, target.DocumentTypes[1].ParentId); - - Isolate.Verify.WasCalledWithExactArguments(() => target.LoadParentDocType(3)); - } - } -} diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.Engine.Tests/Extensions.cs b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.Engine.Tests/Extensions.cs deleted file mode 100644 index 311ea18235..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.Engine.Tests/Extensions.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using TypeMock.ArrangeActAssert; - -namespace umbraco.Linq.DTMetal.Engine.Tests -{ - public static class Extensions - { - public static ActionRepeater WillReturnRepeat(this IPublicNonVoidMethodHandler ret, TReturn value, int numberOfReturns) - { - for (var i = 0; i < numberOfReturns; i++) - ret.WillReturn(value); - - return new ActionRepeater(ret); - } - - public static ActionRepeater CallOriginalRepeat(this IPublicNonVoidMethodHandler ret, int numberOfReturns) - { - for (var i = 0; i < numberOfReturns; i++) - ret.CallOriginal(); - - return new ActionRepeater(ret); - } - } - - public class ActionRepeater - { - private IPublicNonVoidMethodHandler _actionRepeater; - public ActionRepeater(IPublicNonVoidMethodHandler actionRepeater) - { - _actionRepeater = actionRepeater; - } - - public IPublicNonVoidMethodHandler AndThen() - { - return _actionRepeater; - } - } -} - diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.Engine.Tests/Properties/AssemblyInfo.cs b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.Engine.Tests/Properties/AssemblyInfo.cs deleted file mode 100644 index ad7442479a..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.Engine.Tests/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System.Reflection; - -// 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("Core")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyProduct("Core")] \ No newline at end of file diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.Engine/DTMLGenerator.cs b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.Engine/DTMLGenerator.cs deleted file mode 100644 index 5fad34334d..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.Engine/DTMLGenerator.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.IO; - -namespace umbraco.Linq.DTMetal.Engine -{ - public sealed class DTMLGenerator - { - private string fileExtension = ".dtml"; - - public string SavePath { get; private set; } - public string umbracoConnectionString { get; private set; } - public string DataContextName { get; private set; } - public bool DisablePluralization { get; set; } - - public DTMLGenerator(string savePath, string umbracoConnectionString, string dataContextName, bool disablePluralization) - { - if (string.IsNullOrEmpty(savePath)) - { - throw new ArgumentNullException("savePath"); - } - if (string.IsNullOrEmpty(umbracoConnectionString)) - { - throw new ArgumentNullException("umbracoConnectionString"); - } - - this.SavePath = savePath; - this.umbracoConnectionString = umbracoConnectionString; - this.DataContextName = dataContextName; - } - - public DTMLGenerator(string umbracoConnectionString, string dataContextName, bool disablePluralization) - { - if (string.IsNullOrEmpty(umbracoConnectionString)) - { - throw new ArgumentNullException("umbracoConnectionString"); - } - - this.umbracoConnectionString = umbracoConnectionString; - this.DataContextName = dataContextName; - } - - public void GenerateDTMLFile() - { - using (var objBuilder = new DocTypeObjectBuilder(this.umbracoConnectionString)) - { - objBuilder.LoadDocTypes(); - - var dtmlGen = new DocTypeMarkupLanguageBuilder(objBuilder.DocumentTypes, this.DataContextName, this.DisablePluralization); - - dtmlGen.BuildXml(); - - dtmlGen.Save(Path.Combine(this.SavePath, (string.IsNullOrEmpty(this.DataContextName) ? "umbraco" : this.DataContextName) + fileExtension)); - } - } - - internal DocTypeMarkupLanguageBuilder GenerateDTMLStream() - { - using (var objBuilder = new DocTypeObjectBuilder(this.umbracoConnectionString)) - { - objBuilder.LoadDocTypes(); - - var dtmlGen = new DocTypeMarkupLanguageBuilder(objBuilder.DocumentTypes, this.DataContextName, this.DisablePluralization); - - dtmlGen.BuildXml(); - - return dtmlGen; - } - } - } -} diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.Engine/DTMetal.Engine.csproj b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.Engine/DTMetal.Engine.csproj deleted file mode 100644 index 189541fdde..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.Engine/DTMetal.Engine.csproj +++ /dev/null @@ -1,115 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {B151A571-D2F7-47DD-AFD6-C2C34ECA845B} - Library - Properties - umbraco.Linq.DTMetal.Engine - umbraco.Linq.DTMetal.Engine - v3.5 - 512 - SAK - SAK - SAK - SAK - false - - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - true - bin\Debug - Fixed Version\ - DEBUG;TRACE - full - AnyCPU - true - GlobalSuppressions.cs - prompt - - - - False - ..\..\..\..\lib\Microsoft.ApplicationBlocks.Data.dll - - - - 3.5 - - - 3.5 - - - - - False - ..\..\..\..\umbraco\datalayer\bin\Debug\umbraco.DataLayer.dll - - - - - Properties\SolutionInfo.cs - - - - - - - - - True - True - Settings.settings - - - - - DocTypeML.xsd - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - - - {461089E7-008E-4737-BA17-E1FCD1CC3D0E} - DTMetal.CodeBuilder - - - - - - true - true - - - - \ No newline at end of file diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.Engine/DocTypeMarkupLanguageBuilder.cs b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.Engine/DocTypeMarkupLanguageBuilder.cs deleted file mode 100644 index 4320a12d9a..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.Engine/DocTypeMarkupLanguageBuilder.cs +++ /dev/null @@ -1,145 +0,0 @@ -using System.Collections.Generic; -using System.Xml.Linq; -using System; -using System.Linq; -using System.Text; -using System.Xml.Schema; -using umbraco.Linq.DTMetal.CodeBuilder; - -namespace umbraco.Linq.DTMetal.Engine -{ - internal sealed class DocTypeMarkupLanguageBuilder - { - private IEnumerable _theList; - private XDocument _theXml; - private const string DTML_XSD_PATH = "umbraco.Linq.DTMetal.Engine.DocTypeML.xsd"; - private string _dataContextName; - private bool _disablePluralization; - - public DocTypeMarkupLanguageBuilder(IEnumerable docTypes, string dataContextName, bool disablePluralization) - { - - if (docTypes == null) - { - throw new ArgumentNullException("docTypes"); - } - if (string.IsNullOrEmpty(dataContextName)) - { - dataContextName = "umbraco"; - } - - this._dataContextName = dataContextName; - this._theList = docTypes; - this._disablePluralization = disablePluralization; - } - - internal void BuildXml() - { - var root = new XElement("DocumentTypes", - new XAttribute("Serialization", "None"), - new XAttribute("DataContextName", this._dataContextName), - new XAttribute("PluralizeCollections", !this._disablePluralization), - this._theList.Select(dt => BuildDocTypeXml(dt)) - ); - - this._theXml = new XDocument(root); - - this.ValidateSchema(); - } - - private XElement BuildDocTypeXml(DocType dt) - { - var dtXml = new XElement("DocumentType", - new XAttribute("ParentId", dt.ParentId), - new XElement("Id", dt.Id), - new XElement("Name", dt.Name), - new XElement("Alias", dt.Alias), - new XElement("Description", dt.Description), - BuildPropertiesXml(dt.Properties), - BuildAssociationsXml(dt.Associations) - ); - - return dtXml; - } - - private XElement BuildAssociationsXml(List list) - { - var associationsNode = new XElement("Associations"); - if (list != null) - { - foreach (var item in list) - { - associationsNode.Add(new XElement("Association", item.AllowedId)); - } - } - return associationsNode; - } - - private XElement BuildPropertiesXml(List list) - { - var propertiesNode = new XElement("Properties"); - - if (list != null) - { - - propertiesNode.Add(list.Select(p => new XElement("Property", - new XElement("Id", p.Id), - new XElement("Name", p.Name), - new XElement("Alias", p.Alias), - new XElement("Mandatory", p.Mandatory), - new XElement("RegularExpression", p.RegularExpression), - new XElement("Type", p.DatabaseType), - new XElement("ControlId", p.ControlId.ToString()), - new XElement("Description", p.Description) - ) - ) - ); - } - - return propertiesNode; - } - - internal XDocument DocTypeMarkupLanguage - { - get - { - return this._theXml; - } - } - - internal void ValidateSchema() - { - if (this._theXml == null) - { - throw new NullReferenceException("DTML has not be generated yet"); - } - - XmlSchemaSet schemas = new XmlSchemaSet(); - //read the resorce for the XSD to validate against - schemas.Add("", System.Xml.XmlReader.Create(this.GetType().Assembly.GetManifestResourceStream(DTML_XSD_PATH))); - - //we'll have a list of all validation exceptions to put them to the screen - List exList = new List(); - - //some funky in-line event handler. Lambda loving goodness ;) - this._theXml.Validate(schemas, (o, e) => { exList.Add(e.Exception); }); - - if (exList.Count > 0) - { - //dump out the exception list - StringBuilder sb = new StringBuilder(); - sb.AppendLine("The following validation errors occuring with the XML:"); - foreach (var item in exList) - { - sb.AppendLine(" * " + item.Message + " - " + item.StackTrace); - } - throw new XmlSchemaException(sb.ToString()); - } - } - - public void Save(string outputFilePath) - { - this.DocTypeMarkupLanguage.Save(outputFilePath); - } - } -} diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.Engine/DocTypeObjectBuilder.cs b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.Engine/DocTypeObjectBuilder.cs deleted file mode 100644 index d494a08e5a..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.Engine/DocTypeObjectBuilder.cs +++ /dev/null @@ -1,203 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using umbraco.DataLayer; -using umbraco.Linq.DTMetal.CodeBuilder; - -namespace umbraco.Linq.DTMetal.Engine -{ - internal sealed class DocTypeObjectBuilder : IDisposable - { - private string queryDocTypes = @"SELECT [t0].[id] AS [Id], [t0].[uniqueID] AS [UniqueID], [t0].[text] AS [Name], [t1].[alias] AS [Alias], [t1].[description] AS [Description], [t1].[masterContentType] AS [ParentID] - FROM [umbracoNode] AS [t0] - INNER JOIN [cmsContentType] AS [t1] ON [t0].[id] = [t1].[nodeId] - WHERE [t0].[NodeObjectType] = @objectType "; - - private string queryProperty = @"SELECT [t0].[id] AS [Id], [t0].[Alias], [t0].[Name], [t0].[mandatory] AS [Mandatory], [t0].[validationRegExp] AS [RegularExpression], [t0].[Description], [t1].[dbType] AS [DbType], [t1].[controlId] AS [ControlId] - FROM [cmsPropertyType] AS [t0] - LEFT OUTER JOIN [cmsDataType] AS [t1] ON [t1].[nodeId] = [t0].[dataTypeId] - WHERE [t0].[contentTypeId] = @docTypeId - ORDER BY [t0].[id], [t1].[pk] "; - - private ISqlHelper _sqlHelper; - public ISqlHelper SqlHelper - { - get - { - if (_sqlHelper == null) - { - try - { - _sqlHelper = DataLayerHelper.CreateSqlHelper(this.connectionString); - } - catch - { - } - } - return _sqlHelper; - } - } - - private string connectionString; - - public List DocumentTypes { get; set; } - - public DocTypeObjectBuilder(string connString) - { - this.connectionString = connString; - this.DocumentTypes = new List(); - } - - internal void LoadDocTypes() - { - var docTypes = SqlHelper.ExecuteReader(queryDocTypes + "ORDER BY [t0].[id]", SqlHelper.CreateParameter("@objectType", umbraco.Linq.DTMetal.Engine.Properties.Settings.Default.DocTypeId)); - - if (docTypes.HasRecords) - { - while (docTypes.Read()) - { - DocType newDocType = BuildDocumentType(docTypes); - if (newDocType.ParentId > 0 && this.DocumentTypes.SingleOrDefault(p => p.Id == newDocType.ParentId) == null) - { - LoadParentDocType(newDocType.ParentId); - } - this.DocumentTypes.Add(newDocType); - } - } - - docTypes.Dispose(); - } - - internal DocType BuildDocumentType(IRecordsReader docTypes) - { - DocType newDocType = new DocType - { - Id = docTypes.GetId(), - Alias = docTypes.GetAlias(), - Description = docTypes.GetDescription(), - Name = docTypes.GetName(), - ParentId = docTypes.GetParentId(), - }; - - newDocType.Properties = GetProperties(newDocType.Id); - newDocType.Associations = BuildAssociations(newDocType.Id); - - return newDocType; - } - - internal void LoadParentDocType(int parentId) - { - var docType = - SqlHelper.ExecuteReader(queryDocTypes + " AND [t1].[MasterContentType] == @parentID", - SqlHelper.CreateParameter("@parentID", parentId), - SqlHelper.CreateParameter("@objectType", umbraco.Linq.DTMetal.Engine.Properties.Settings.Default.DocTypeId) - ); - - if (docType.HasRecords) - { - while (docType.Read()) - { - var dt = BuildDocumentType(docType); - if (dt.ParentId != -1 && this.DocumentTypes.SingleOrDefault(p => p.Id == dt.ParentId) == null) - { - LoadParentDocType(dt.ParentId); - } - this.DocumentTypes.Add(dt); - } - } - else - { - throw new IndexOutOfRangeException("ParentId of \'" + parentId + "\' does not exist within the database"); - } - - docType.Dispose(); - } - - internal List GetProperties(int docTypeId) - { - var properties = SqlHelper.ExecuteReader(queryProperty, SqlHelper.CreateParameter("@docTypeId", docTypeId)); - var builtProperties = new List(); - - if (properties.HasRecords) - { - while (properties.Read()) - { - var p = BuildProperty(properties); - builtProperties.Add(p); - } - } - - properties.Dispose(); - - return builtProperties; - } - - internal DocTypeProperty BuildProperty(IRecordsReader reader) - { - var p = new DocTypeProperty - { - Alias = reader.GetAlias(), - Description = reader.GetDescription(), - Id = reader.GetId(), - Mandatory = reader.GetBoolean("Mandatory"), - Name = reader.GetName(), - RegularExpression = reader.GetString("RegularExpression"), - ControlId = reader.GetGuid("ControlId") - }; - - switch (reader.GetDbType()) - { - case "Date": - p.DatabaseType = typeof(DateTime); - break; - case "Integer": - p.DatabaseType = typeof(int); - break; - case "Ntext": - case "Nvarchar": - p.DatabaseType = typeof(string); - break; - default: - p.DatabaseType = typeof(object); - break; - } - - return p; - } - - internal List BuildAssociations(int docTypeId) - { - var reader = - SqlHelper.ExecuteReader(@"SELECT [t0].[AllowedId] - FROM [cmsContentTypeAllowedContentType] AS [t0] - WHERE [t0].[Id] = @docTypeId", - SqlHelper.CreateParameter("@docTypeId", docTypeId) - ); - - var allowedChildren = new List(); - - if (reader.HasRecords) - { - while (reader.Read()) - { - allowedChildren.Add(new DocTypeAssociation - { - AllowedId = reader.GetInt("AllowedId") - }); - } - } - - return allowedChildren; - } - - #region IDisposable Members - - public void Dispose() - { - this.SqlHelper.Dispose(); - } - - #endregion - } -} diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.Engine/Extensions.cs b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.Engine/Extensions.cs deleted file mode 100644 index 68666d7d06..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.Engine/Extensions.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using umbraco.DataLayer; -using System.Data.SqlTypes; - -namespace umbraco.Linq.DTMetal.Engine -{ - public static class Extensions - { - public static string GetAlias(this IRecordsReader reader) - { - return reader.GetString("Alias"); - } - - public static string GetName(this IRecordsReader reader) - { - return reader.GetString("Name"); - } - - public static int GetId(this IRecordsReader reader) - { - return reader.GetInt("Id"); - } - - public static string GetDescription(this IRecordsReader reader) - { - return reader.GetString("Description"); - } - - public static string GetDbType(this IRecordsReader reader) - { - return reader.GetString("DbType"); - } - - public static int GetParentId(this IRecordsReader reader) - { - try - { - return reader.GetInt("ParentId"); - } - catch (SqlNullValueException) - { - return 0; - } - } - } -} diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.Engine/GlobalSuppressions.cs b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.Engine/GlobalSuppressions.cs deleted file mode 100644 index 1dd02f1836..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.Engine/GlobalSuppressions.cs +++ /dev/null @@ -1,11 +0,0 @@ -// This file is used by Code Analysis to maintain SuppressMessage -// attributes that are applied to this project. -// Project-level suppressions either have no target or are given -// a specific target and scoped to a namespace, type, member, etc. -// -// To add a suppression to this file, right-click the message in the -// Error List, point to "Suppress Message(s)", and click -// "In Project Suppression File". -// You do not need to add suppressions to this file manually. - -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "umbraco")] diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.Engine/Properties/AssemblyInfo.cs b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.Engine/Properties/AssemblyInfo.cs deleted file mode 100644 index ba47bbe059..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.Engine/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System; - -// 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("DTMetal.Engine")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyProduct("DTMetal.Engine")] -[assembly: CLSCompliant(false)] -[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("umbraco.Linq.DTMetal.Engine.Tests")] -[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("umbraco")] \ No newline at end of file diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.Engine/Properties/Settings.Designer.cs b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.Engine/Properties/Settings.Designer.cs deleted file mode 100644 index 7672f86595..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.Engine/Properties/Settings.Designer.cs +++ /dev/null @@ -1,35 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:2.0.50727.3074 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace umbraco.Linq.DTMetal.Engine.Properties { - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.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; - } - } - - [global::System.Configuration.ApplicationScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("a2cb7800-f571-4787-9638-bc48539a0efb")] - public string DocTypeId { - get { - return ((string)(this["DocTypeId"])); - } - } - } -} diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.Engine/Properties/Settings.settings b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.Engine/Properties/Settings.settings deleted file mode 100644 index 1aa3ccae26..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.Engine/Properties/Settings.settings +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - a2cb7800-f571-4787-9638-bc48539a0efb - - - \ No newline at end of file diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.Engine/app.config b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.Engine/app.config deleted file mode 100644 index 0703f4a7ca..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal.Engine/app.config +++ /dev/null @@ -1,15 +0,0 @@ - - - - -
- - - - - - a2cb7800-f571-4787-9638-bc48539a0efb - - - - \ No newline at end of file diff --git a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal/ArgsParser.cs b/src/LinqToUmbraco/src/umbraco.Linq/DTMetal/ArgsParser.cs deleted file mode 100644 index 9b28c022cf..0000000000 --- a/src/LinqToUmbraco/src/umbraco.Linq/DTMetal/ArgsParser.cs +++ /dev/null @@ -1,116 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text.RegularExpressions; -using System.IO; -using umbraco.Linq.DTMetal.CodeBuilder; - -namespace umbraco.Linq.DTMetal -{ - enum RunMode - { - Xml, Class, Help - } - - internal sealed class ArgsParser - { - public ArgsParser(string[] args) - { - Dictionary res = new Dictionary(); - - Regex r = new Regex(@"[-/](?