Exemplo n.º 1
0
        /// <summary>
        /// Stamp the specified collection with the CustomDll version..
        /// </summary>
        ///<param name="csm"></param>
        /// <param name="collection">The collection to stamp.</param>
        /// <param name="staticData">Data that is stored statically.</param>
        /// <returns>A string with the DLL version.</returns>
        public static string StampStationDll(ITisClientServicesModule csm, ITisCollectionData oColl, string staticData)
        {
            StringBuilder result = new StringBuilder();

            try
            {
                if (!Disabled && oColl != null)
                {
                    //-- Get previous data --\\
                    string appName = csm != null ? csm.Session.StationName : Path.GetFileNameWithoutExtension(Application.ExecutablePath);

                    result.Append(oColl.get_NamedUserTags("DLL_VERSION_" + appName));
                    if (result.Length > 0)
                    {
                        result.Append("\r\n");
                    }

                    //-- Add environment data --\\
                    result.Append(staticData ?? string.Empty);

                    result.Append(", Time=" + DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss"));

                    //-- Set DLL name and version --\\s
                    oColl.set_NamedUserTags("DLL_VERSION_" + appName, result.ToString());
                }
            }
            catch (Exception ex)
            {
                ILog.LogError(ex);
            }

            return(result.ToString());
        }