예제 #1
0
 public static IEnvironmentModelDataListCompiler CreateServerDataListCompiler()
 {
     if (_serverCompilerCache == null)
     {
         lock (CacheGuard)
         {
             if (_serverCompilerCache == null)
             {
                 _serverCompilerCache = CreateServerDataListCompiler(CreateDataListServer());
             }
         }
     }
     return(_serverCompilerCache);
 }
예제 #2
0
        public void Dispose()
        {
            lock (_disposeGuard)
            {
                if (_isDisposed)
                {
                    return;
                }

                _uniqueWorkflowParts.Clear();
                _uniqueWorkflowParts = null;

                _svrCompiler = null;

                _isDisposed = true;
            }
        }
예제 #3
0
 internal DataListCompiler(IEnvironmentModelDataListCompiler svrC)
 {
     // TODO : Allow IP to be sent when using the DataList compiler...
     _svrCompiler = svrC;
 }
예제 #4
0
        /// <summary>
        ///     Init the Debug Session
        /// </summary>
        /// <param name="to"></param>
        /// <returns></returns>
        public DebugTO InitDebugSession(DebugTO to)
        {
            DebugTO tmp;

            to.Error = string.Empty;

            // Bootstrap the operations
            if (to.BaseSaveDirectory != null)
            {
                BootstrapPersistence(to.BaseSaveDirectory);
                InitPersistSettings();
            }
            else if (to.BaseSaveDirectory == null && _debugPersistSettings.Count == 0)
            {
                BootstrapPersistence(_rootPath);
                InitPersistSettings();
            }

            if (to.BaseSaveDirectory == null)
            {
                // set the save location
                to.BaseSaveDirectory = _rootPath;
            }


            if (to.DataList != null)
            {
                to.DataListHash = to.DataList.GetHashCode(); // set incoming DL hash
            }
            else
            {
                to.DataListHash = -1; // default value
            }

            IEnvironmentModelDataListCompiler svrCompiler = DataListFactory.CreateServerDataListCompiler();
            ErrorResultTO errors;

            if (_debugPersistSettings.TryGetValue(to.WorkflowID, out tmp))
            {
                string convertData = tmp.XmlData;
                Guid   mergeGuid   = svrCompiler.ConvertTo(null,
                                                           DataListFormat.CreateFormat(GlobalConstants._Studio_Debug_XML), Encoding.UTF8.GetBytes(convertData),
                                                           new StringBuilder(to.DataList), out errors);
                tmp.XmlData =
                    svrCompiler.ConvertFrom(null, mergeGuid, enTranslationDepth.Data,
                                            DataListFormat.CreateFormat(GlobalConstants._Studio_Debug_XML), out errors)
                    .FetchAsString()
                    .ToString();
                to.XmlData = tmp.RememberInputs
                    ? (tmp.XmlData)
                    : (to.XmlData ?? "<DataList></DataList>");
                tmp.CleanUp();
                to.BinaryDataList = svrCompiler.FetchBinaryDataList(null, mergeGuid, out errors);
            }
            else
            {
                // if no XML data copy over the DataList
                to.XmlData = to.XmlData != null && to.XmlData == string.Empty
                    ? (to.DataList ?? "<DataList></DataList>")
                    : (to.XmlData ?? "<DataList></DataList>");

                Guid createGuid = svrCompiler.ConvertTo(null,
                                                        DataListFormat.CreateFormat(GlobalConstants._Studio_Debug_XML), Encoding.UTF8.GetBytes(to.XmlData),
                                                        new StringBuilder(to.DataList), out errors);

                to.BinaryDataList = to.BinaryDataList = svrCompiler.FetchBinaryDataList(null, createGuid, out errors);
            }

            if (tmp != null)
            {
                tmp.CleanUp();
            }
            return(to);
        }
 public static IEnvironmentModelDataListCompiler CreateServerDataListCompiler()
 {
     if(_serverCompilerCache == null)
     {
         lock(CacheGuard)
         {
             if(_serverCompilerCache == null)
             {
                 _serverCompilerCache = CreateServerDataListCompiler(CreateDataListServer());
             }
         }
     }
     return _serverCompilerCache;
 }
 public static IDataListCompiler CreateDataListCompiler(IEnvironmentModelDataListCompiler serverDataListCompiler)
 {
     return new DataListCompiler(CreateServerDataListCompiler());
 }
예제 #7
0
 public static IDataListCompiler CreateDataListCompiler(IEnvironmentModelDataListCompiler serverDataListCompiler)
 {
     return(new DataListCompiler(CreateServerDataListCompiler()));
 }