Exemple #1
0
        public async Task CallAtlasApiAsync(Message message, ProcessType processType)
        {
            var token = await _tokenProvider.GetBearerTokenAsync("AtlasApiOAuth2");

            _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);

            var requestUri = new Uri(message.CompanyId != null ? processType.EndPoint.Replace("{company}", message.CompanyId, StringComparison.InvariantCultureIgnoreCase) : processType.EndPoint);

            //string json = JsonConvert.SerializeObject(message, Formatting.Indented, new JsonSerializerSettings
            //{
            //    ContractResolver = new Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver()
            //});

            string             json           = message.Content;
            HttpRequestMessage requestMessage = new HttpRequestMessage
            {
                Method     = new HttpMethod(processType.Verb),
                RequestUri = requestUri,
                Content    = new StringContent(json, Encoding.UTF8, "application/json")
            };

            _logger.LogInformation($"Calling Atlas API {requestUri.ToString()}.");

            var response = await _client.SendAsync(requestMessage);

            if (!response.IsSuccessStatusCode)
            {
                var content = await response.Content.ReadAsStringAsync();

                _logger.LogError("Calling Atlas API failed with status code {Atlas_HttpResponseStatusCode} and content {Atlas_HttpResponseContent}.", response.StatusCode, content);

                throw new Exception(content);
            }
        }
    public void ChangeScene(ProcessType type)
    {
        mCurrentProcess.SceneEnd();

        switch (type)
        {
        case ProcessType.Battle:
            mCurrentProcess = mProcessBattle;
            break;

        case ProcessType.CardDetail:
            mCurrentProcess = mProcessCardDetail;
            break;

        case ProcessType.CardSelect:
            mCurrentProcess = mProcessCardSelect;
            break;

        case ProcessType.Loading:
            mCurrentProcess = mProcessLoading;
            break;

        case ProcessType.Dump:
            mCurrentProcess = mProcessDump;
            break;
        }

        mCurrentProcess.SceneStart();
    }
 public Process(string name, ProcessType type)
 {
     this.Name = name;
     this.Type = type;
     this.ID   = 0;
     Running   = false;
 }
Exemple #4
0
    //Change the process type
    public void SetHandleProcess(ProcessType newType)
    {
        // The process has changed
        if (newType != m_processType)
        {
            if (m_instancedHandles != null)
            {
                Destroy(m_instancedHandles);
            }

            // Display Handles
            switch (newType)
            {
            case ProcessType.Translate:
                m_instancedHandles = Instantiate(m_translateHandles, transform.position, transform.rotation) as GameObject;
                m_instancedHandles.transform.SetParent(transform);
                break;

            case ProcessType.Rotate:
                m_instancedHandles = Instantiate(m_rotateHandles, transform.position, transform.rotation) as GameObject;
                m_instancedHandles.transform.SetParent(transform);
                break;
            }

            m_instancedHandles.transform.localScale = m_colourView.transform.localScale;

            m_processType = newType;
        }
    }
Exemple #5
0
 public Common(ProcessType processType, int pollingInterval, int timeout, int responseTimeout)
 {
     _processType = processType;
     _pollingInterval = pollingInterval;
     _responseTimeout = responseTimeout;
     Timeout = timeout;
 }
Exemple #6
0
    public void Initialise(ProductType product, int delayModifier)
    {
        Product = product;
        recipe  = IngredientDataLookupManager.Instance.GetRecipeForProductType(Product);

        int counter = 0;

        foreach (var rd in recipe.RequiredIngredients)
        {
            IngredientType ingredient = rd.Item1;
            ProcessType    process    = rd.Item2;

            ingredientImages[counter].sprite = IngredientDataLookupManager.Instance.GetSpriteForIngredient(ingredient);
            if (process != ProcessType.NONE && process != ProcessType.GARBAGE)
            {
                processImages[counter].enabled = true;
                processImages[counter].sprite  = IngredientDataLookupManager.Instance.GetSpriteForProcess(process);
            }
            else
            {
                processImages[counter].enabled = false;
            }

            counter++;
        }

        GameObject prefab  = IngredientDataLookupManager.Instance.GetPrefabForProductType(Product);
        GameObject spawned = Instantiate(prefab, finalProductPreviewParent);

        spawned.transform.localScale = Vector3.one * finalProductScale;
        spawned.transform.rotation   = Quaternion.Euler(finalProductRotation);
        SetLayerRecursively(spawned, LayerMask.NameToLayer("UI"));
    }
Exemple #7
0
 public Process()
 {
     FlowElements      = new FlowElementCollection(this);
     this.processType  = ProcessType.None;
     this.isClosed     = false;
     this.isExecutable = false;
 }
Exemple #8
0
 public DataSource(ProcessType processType, string serviceUrl, int pollingInterval, int timeout, int postPollingInterval, int responseTimeout, int ontogratorTab)
     : base(processType, pollingInterval, timeout, responseTimeout)
 {
     PostPollingInterval = postPollingInterval;
     _serviceUrl = serviceUrl;
     _ontogratorTab = ontogratorTab;
 }
Exemple #9
0
    public void SettingPagePesmission(Page page, ProcessType type)
    {
        CurrentType = type;
        string enableControl = type.ToString();

        foreach (Control control in page.Form.Controls)
        {
            if (control is WebControl)
            {
                if (((WebControl)control).Attributes[enableControl] != null)
                {
                    SetControlStatus(control, ((WebControl)control).Attributes[enableControl]);
                    //control.Visible = false;
                }
                else
                {
                    if (control.HasControls())
                    {
                        SettingControlPesmission(control);
                    }
                }
            }
            else
            {
                if (control.HasControls())
                {
                    SettingControlPesmission(control);
                }
            }
        }
    }
Exemple #10
0
        public TestComponent(ProcessType processTypeIn, TestComponentSocket socketIn, bool readOn, bool writeOn, bool exportOn)
        {
            if (processTypeIn == ProcessType.NULL || socketIn == null)
            {
                Debug.WriteLine("TestComponent > INVALID CONSTRUCTOR PARAMS"); return;
            }

            socket         = socketIn;
            processType    = processTypeIn;
            processHandler = new ProcessHandler(processType);
            InitializeComponent();
            loadLogo(processType);
            if (!readOn)
            {
                readButton.Visibility = Visibility.Hidden;
            }
            if (!writeOn)
            {
                writeButton.Visibility = Visibility.Hidden;
            }
            if (!exportOn)
            {
                exportButton.Visibility = Visibility.Hidden;
            }
        }
Exemple #11
0
 /// <summary>
 /// Constructs a new instance of the bus
 /// </summary>
 /// <param name="source">The process declaration</param>
 /// <param name="process">The resolved process definition</param>
 /// <param name="type">The process type</param>
 public Process(AST.InstanceDeclaration source, AST.Process process, ProcessType type)
 {
     Source            = source ?? throw new ArgumentNullException(nameof(source));
     ProcessDefinition = process ?? throw new ArgumentNullException(nameof(process));
     Type       = type;
     Statements = ProcessDefinition.Statements.Select(x => x.Clone()).ToArray();
 }
Exemple #12
0
        /// <summary>
        /// Unregister an app install's push notification registration.
        /// This includes removing the registration table entry and removing it from the notification hub service.
        /// </summary>
        /// <param name="processType">not needed (ignored)</param>
        /// <param name="userHandle">uniquely identifies the user</param>
        /// <param name="appHandle">uniquely identifies the app</param>
        /// <param name="pushRegistrationFeedEntity">Push registration table entry</param>
        /// <returns>Delete registration task</returns>
        public async Task DeleteRegistration(
            ProcessType processType,
            string userHandle,
            string appHandle,
            IPushRegistrationFeedEntity pushRegistrationFeedEntity)
        {
            // check inputs
            if (string.IsNullOrWhiteSpace(userHandle))
            {
                this.log.LogException("got empty user handle");
            }

            if (string.IsNullOrWhiteSpace(appHandle))
            {
                this.log.LogException("got empty app handle");
            }

            // get the push notification hub interface for this app
            IPushNotificationsHub pushNotificationsHub = await this.GetPushNotificationsHub(pushRegistrationFeedEntity.PlatformType, appHandle);

            if (pushNotificationsHub == null)
            {
                this.log.LogException("did not find push notification hub for this app:" + appHandle);
            }

            // delete from the hub first, then delete from the table
            await pushNotificationsHub.DeleteRegistration(pushRegistrationFeedEntity.HubRegistrationId);

            await this.pushRegistrationsStore.DeletePushRegistration(
                StorageConsistencyMode.Strong,
                userHandle,
                appHandle,
                pushRegistrationFeedEntity.OSRegistrationId);
        }
Exemple #13
0
        internal override void VisitProcess(Process process, ProcessType pipCategory)
        {
            string friendlyQualifier = Context.QualifierTable.GetCanonicalDisplayString(process.Provenance.QualifierId);

            switch (pipCategory)
            {
            case ProcessType.XUnit:
                WriteXunitDiscoverPackage();
                ExtractOutputPathFromUnitTest(process, friendlyQualifier, 1);
                break;

            case ProcessType.VsTest:
                ExtractOutputPathFromUnitTest(process, friendlyQualifier, 0);
                break;

            case ProcessType.Csc:
                Project project = CreateProject(process);

                // For now, if there is another csc process from the same spec file, ignore it.
                if (ProjectsByQualifier.Count == 0)
                {
                    ProjectsByQualifier[friendlyQualifier] = project;
                    PopulatePropertiesAndItems(project, process);
                }

                break;

            case ProcessType.ResGen:
                ExtractResourceFromResGen(process, friendlyQualifier);
                break;
            }
        }
Exemple #14
0
        /// <summary>
        /// Delete user profile
        /// </summary>
        /// <param name="processType">Process type</param>
        /// <param name="userHandle">User handle</param>
        /// <param name="appHandle">App handle</param>
        /// <returns>Delete user task</returns>
        public async Task DeleteUserProfile(
            ProcessType processType,
            string userHandle,
            string appHandle)
        {
            await this.usersStore.DeleteUserProfile(StorageConsistencyMode.Strong, userHandle, appHandle);

            var appFeedEntities = await this.ReadUserApps(userHandle);

            if (appFeedEntities.Count == 0)
            {
                var linkedAccountFeedEntities = await this.ReadLinkedAccounts(userHandle);

                foreach (var linkedAccountFeedEntity in linkedAccountFeedEntities)
                {
                    await this.DeleteLinkedAccount(processType, userHandle, linkedAccountFeedEntity.IdentityProviderType, linkedAccountFeedEntity.AccountId);
                }
            }

            await this.searchQueue.SendSearchRemoveUserMessage(userHandle, appHandle);

            await this.popularUsersManager.DeletePopularUser(processType, userHandle, appHandle);

            await this.pushNotificationsManager.DeleteUserRegistrations(processType, userHandle, appHandle);
        }
Exemple #15
0
        public void Process(ProcessType processType)
        {
            int            successCount = 0;
            IList <string> files;

            switch (processType)
            {
            case ProcessType.File:
                files = this.options.File;
                break;

            case ProcessType.Directory:
                var searchOption = this.options.IsRecursive
                        ? SearchOption.AllDirectories
                        : SearchOption.TopDirectoryOnly;
                files = (File.GetAttributes(this.options.Directory).HasFlag(FileAttributes.Directory))
                        ? Directory.GetFiles(this.options.Directory, "*.xaml", searchOption).ToList()
                        : new List <string>();
                break;

            default:
                throw new ArgumentException("Invalid ProcessType");
            }

            foreach (string file in files)
            {
                if (this.TryProcessFile(file))
                {
                    successCount++;
                }
            }

            this.Log($"Processed {successCount} of {files.Count} files.", LogLevel.Minimal);
        }
Exemple #16
0
        /// <summary>
        /// Categorizes a process
        /// </summary>
        public static ProcessWithType Categorize(Context context, Process process)
        {
            ProcessType type        = ProcessType.None;
            var         stringTable = context.StringTable;

            var toolName = process.GetToolName(context.PathTable);

            if (toolName.CaseInsensitiveEquals(stringTable, context.CscExeName))
            {
                type = ProcessType.Csc;
            }
            else if (toolName.CaseInsensitiveEquals(stringTable, context.VsTestExeName))
            {
                type = ProcessType.VsTest;
            }
            else if (toolName.CaseInsensitiveEquals(stringTable, context.ResgenExeName))
            {
                type = ProcessType.ResGen;
            }
            else if (toolName.CaseInsensitiveEquals(stringTable, context.ClExeName))
            {
                type = ProcessType.Cl;
            }
            else if (toolName.CaseInsensitiveEquals(stringTable, context.LinkExeName))
            {
                type = ProcessType.Link;
            }

            return(new ProcessWithType(type, process));
        }
        void OnGUI()
        {
            _blocker.OnGUIStart();

            if (GUILayout.Button("Find Scripts"))
            {
                foreach (var a in Pipeline.GetAssets("t:Script"))
                {
                    Debug.Log("Script: " + a.name);
                }
            }

            EditorGUILayout.LabelField("Process Settings");
            _scriptNameContains = EditorGUILayout.TextField("Script name contains: ", _scriptNameContains);
            _abortOnScript      = EditorGUILayout.TextField("Abort on this script: ", _abortOnScript);
            _processType        = (ProcessType)EditorGUILayout.EnumPopup("Process type:", _processType);
            if (_processType == ProcessType.ASYNC)
            {
                _allowCancel = EditorGUILayout.Toggle("Allow async cancel?", _allowCancel);
                _tickTime    = EditorGUILayout.Slider("Max time per operation:", _tickTime, 0.0001f, 0.1f);
            }

            if (GUILayout.Button("Process Scripts (dummy)"))
            {
                StartProcess();
            }

            _blocker.OnGUIEnd();

            _guiProgress.Draw();
        }
Exemple #18
0
        public static void findProcess2(Process process, String processName, ProcessType processType)
        {
            if (processName == null)
            {
                return;
            }

            //if (process_current != null) return;

            Console.WriteLine("DEBUG > Searching process: " + processName);

            process = Process.GetProcessesByName(processName).FirstOrDefault();
            if (process == null)
            {
                return;
            }

            ProcessModule mainModule = process.MainModule;

            Console.WriteLine("DEBUG > Found process: " + process.ProcessName);
            Console.WriteLine("DEBUG > Found process's main module: " + mainModule);
            if (mainModule != null)
            {
                long mainModuleAddress = process.MainModule.BaseAddress.ToInt64();
                Console.WriteLine("DEBUG > Found process's Base address: " + mainModuleAddress + " / 0x" + mainModuleAddress.ToString("X12"));
            }

            process_current      = process;
            process_current_Type = processType;
        }
Exemple #19
0
    /// <summary> Obtains company's process types</summary>
    /// <param name="company">Company to search process types</param>
    /// <returns>List of company's process types</returns>
    private string ProccessTypeList(Company company)
    {
        var  processTypeList  = new StringBuilder("[");
        bool firstProcessType = true;

        foreach (var processType in ProcessType.ObtainByCompany(company.Id, this.dictionary))
        {
            if (processType.Active)
            {
                if (firstProcessType)
                {
                    firstProcessType = false;
                }
                else
                {
                    processTypeList.Append(",");
                }

                processTypeList.Append(Environment.NewLine).Append("    ").Append(processType.Json);
            }
        }

        processTypeList.Append(Environment.NewLine).Append("]");
        return(processTypeList.ToString());
    }
Exemple #20
0
        /// <summary>
        /// Process message
        /// </summary>
        /// <param name="message">Queue message</param>
        /// <returns>Process message task</returns>
        protected override async Task Process(IMessage message)
        {
            if (message is LikeMessage)
            {
                LikeMessage likeMessage = message as LikeMessage;
                ProcessType processType = ProcessType.Backend;
                if (likeMessage.DequeueCount > 1)
                {
                    processType = ProcessType.BackendRetry;
                }

                var likeLookupEntity = await this.likesManager.ReadLike(likeMessage.ContentHandle, likeMessage.UserHandle);

                if (likeLookupEntity != null && likeLookupEntity.LastUpdatedTime > likeMessage.LastUpdatedTime)
                {
                    return;
                }

                await this.likesManager.UpdateLike(
                    processType,
                    likeMessage.LikeHandle,
                    likeMessage.ContentType,
                    likeMessage.ContentHandle,
                    likeMessage.UserHandle,
                    likeMessage.Liked,
                    likeMessage.ContentPublisherType,
                    likeMessage.ContentUserHandle,
                    likeMessage.ContentCreatedTime,
                    likeMessage.AppHandle,
                    likeMessage.LastUpdatedTime,
                    likeLookupEntity);
            }
        }
Exemple #21
0
        public object Handle(Mode modePrePost, ProcessType processType, object model, Db db)
        {
            if (modePrePost == Mode.Pre)
            {
                switch (processType)
                {
                case ProcessType.Add:
                    StatusFieldUpdate(model);
                    break;

                case ProcessType.Update:
                    StatusFieldUpdate(model);
                    break;

                case ProcessType.Delete:
                    break;

                case ProcessType.Get:
                    break;

                default:
                    break;
                }
            }

            return(model);
        }
Exemple #22
0
        /// <summary>
        /// Create user linked account and profile
        /// </summary>
        /// <param name="processType">Process type</param>
        /// <param name="userHandle">User handle</param>
        /// <param name="identityProviderType">Identity provider type</param>
        /// <param name="accountId">Account id</param>
        /// <param name="appHandle">App handle</param>
        /// <param name="firstName">First name</param>
        /// <param name="lastName">Last name</param>
        /// <param name="bio">User bio</param>
        /// <param name="photoHandle">Photo handle</param>
        /// <param name="createdTime">Created time</param>
        /// <param name="requestId">Request id</param>
        /// <returns>Create user task</returns>
        public async Task CreateUserAndUserProfile(
            ProcessType processType,
            string userHandle,
            IdentityProviderType identityProviderType,
            string accountId,
            string appHandle,
            string firstName,
            string lastName,
            string bio,
            string photoHandle,
            DateTime createdTime,
            string requestId)
        {
            await this.usersStore.InsertUser(
                StorageConsistencyMode.Strong,
                userHandle,
                identityProviderType,
                accountId,
                appHandle,
                firstName,
                lastName,
                bio,
                photoHandle,
                UserVisibilityStatus.Public,
                createdTime,
                requestId);

            await this.usersStore.InsertLinkedAccountIndex(
                StorageConsistencyMode.Strong,
                userHandle,
                identityProviderType,
                accountId);

            await this.searchQueue.SendSearchIndexUserMessage(userHandle, appHandle, createdTime);
        }
Exemple #23
0
    public async Task <PurchaseResult> PurchaseUpgrade(string userId, ProcessType process)
    {
        await Task.Delay(MockLag);

        UserData       user;
        PurchaseResult result = new PurchaseResult();

        if ((int)process < (int)ProcessType.COUNT && (int)process >= 0)
        {
            result.processType = process;
            if (userData.TryGetValue(userId, out user))
            {
                int level = user.processData[(int)process].level;
                if (level < configData.configData[(int)process].levels.Length - 1)
                {
                    long cost = configData.configData[(int)process].levels[level + 1].cost;
                    if (user.cookieCount >= cost)
                    {
                        user.cookieCount -= cost;
                        ++user.processData[(int)process].level;
                    }
                }
                result.buildingCount = user.processData[(int)process].count;
                result.cookieCount   = user.cookieCount;
            }
        }
        return(result);
    }
Exemple #24
0
        public static ReviewProcess Start(string fileName, string arguments, ProcessType processType = ProcessType.Other)
        {
            var proc = new ReviewProcess(fileName, arguments, processType);

            proc.Start();
            return(proc);
        }
Exemple #25
0
 private void SetInitialProcessType(ProcessType processType)
 {
     if (Name.Split('|').Count() <= 1)
     {
         Name = string.Format("{0}|{1}", EnumToString(processType), Name);
     }
 }
Exemple #26
0
        /// <summary>
        /// Inicia um processo com um intervalo de tempo especificado e sincronizado com o objeto SynchronizedLock
        /// </summary>
        private void startProcess(int ms, ProcessType processType, Action del, bool sleepFirst = true)
        {
            while (true)
            {
                if (!sleepFirst)
                {
                    lock (SynchronizedLock)
                        del.Invoke();
                }
                try
                {
                    Thread.Sleep(ms);
                }
                catch (Exception ex)
                {
                    _log.error(ex, processType);
                }

                if (sleepFirst)
                {
                    lock (SynchronizedLock)
                        del.Invoke();
                }
            }
        }
Exemple #27
0
        public BrowserCommandResult <bool> CreateProcess(string name, ProcessType type, string entity, int thinkTime = Constants.DefaultThinkTime)
        {
            Browser.ThinkTime(thinkTime);

            return(this.Execute(GetOptions("Create Process"), driver =>
            {
                SwitchToDialogFrame();

                driver.ClickWhenAvailable(By.XPath(Elements.Xpath[Reference.Process.Name]))
                .SendKeys(name);

                SetValue(new OptionSet()
                {
                    Name = Elements.ElementId[Reference.Process.Category], Value = type.ToString()
                });
                SetValue(new OptionSet()
                {
                    Name = Elements.ElementId[Reference.Process.Entity], Value = entity
                });

                driver.ClickWhenAvailable(By.XPath(Elements.Xpath[Reference.Process.BlankWorkflow]));

                driver.ClickWhenAvailable(By.XPath(Elements.Xpath[Reference.Process.Create]));

                return true;
            }));
        }
Exemple #28
0
 private void ReadTransitions(ProcessType processType)
 {
     if (processType.Transitions?.Transition == null)
     {
         return;
     }
     foreach (var transition in processType.Transitions.Transition)
     {
         var         from        = transition.From;
         var         to          = transition.To;
         PoolElement poolElement = null;
         var         guid        = Guid.Parse(processType.Id);
         if (_poolByProcessDictionary.TryGetValue(guid, out poolElement))
         {
             try
             {
                 IBaseElement      fromElement = _elements[Guid.Parse(from)];
                 IBaseElement      toElement   = _elements[Guid.Parse(to)];
                 ConnectionElement connection  = new ConnectionElement(fromElement, toElement);
                 connection.Guid = Guid.Parse(transition.Id);
                 List <Point> points = GetPoints(transition.ConnectorGraphicsInfos);
                 connection.Points = points;
                 poolElement.Connections.Add(connection);
             }
             catch (KeyNotFoundException ex)
             {
                 throw new BaseElementNotFoundException(ex);
             }
         }
     }
 }
Exemple #29
0
        /// <summary>
        /// Initializes a new instance of the <see cref="FormProcess"/> class.
        /// </summary>
        /// <param name="processType">Type of the process.</param>
        public FormProcess(ProcessType processType)
        {
            _processType = processType;

            InitializeComponent();

            switch (processType)
            {
            case ProcessType.FileWriter:
                progressMeter.Style = ProgressBarStyle.Marquee;
                _progressText       = labelStatus.Text = string.Format("{0}...", APIResources.GOREDIT_TEXT_SAVING);
                break;

            case ProcessType.FileMove:
            case ProcessType.FileCopy:
            case ProcessType.FileExporter:
            case ProcessType.FileImporter:
                progressMeter.Style = ProgressBarStyle.Continuous;
                _progressText       = labelStatus.Text = string.Empty;
                break;

            case ProcessType.FileInfo:
                progressMeter.Style = ProgressBarStyle.Marquee;
                _progressText       = labelStatus.Text = APIResources.GOREDIT_TEXT_GET_FILE_INFO;
                break;
            }
        }
Exemple #30
0
        public static string GetProcessTypeToString(ProcessType processType)
        {
            string text = "系统运转状态:";

            switch (processType)
            {
            case ProcessType.init:
                text += "正在初始化...";
                break;

            case ProcessType.Sensor:
                text += "正在采集传感器数据...";
                break;

            case ProcessType.CodCollection:
                text += "正在采集Cod数据...";
                break;

            case ProcessType.SampleWater:
                text += "正在取水样...";
                break;

            case ProcessType.StandDil:
                text += "正在稀释标定液...";
                break;

            case ProcessType.SampleDil:
                text += "正在稀释样液...";
                break;

            case ProcessType.BodStand:
                text += "正在标定BOD...";
                break;

            case ProcessType.BodSample:
                text += "正在测量BOD...";
                break;

            case ProcessType.BodSampleComplete:
                text += "测量BOD完成....";
                break;

            case ProcessType.BodWash:
                text += "正在清洗BOD...";
                break;

            case ProcessType.DrainEmpty:
                text += "正在排空溶液...";
                break;

            case ProcessType.Waitding:
                text += "系统空闲...";
                break;

            default:
                break;
            }

            return(text);
        }
Exemple #31
0
        /// <summary>
        /// Finds and creates all processes of a process type in the current situation. The function
        /// will generate the found processes and add the relevant elements in the situation description.
        /// </summary>
        /// <param name="processType">
        /// The process type of which new processes will be searched in the situation
        /// </param>
        /// <param name="mappingRules">
        /// A collection of all objects mapping rules from the domain theory
        /// </param>
        /// <returns>A collection of the found NEW processes of this type</returns>
        public ICollection <Process> CreateProcesses(ProcessType processType, ICollection <ObjectMappingRule> mappingRules)
        {
            List <Process>        newProcesses             = new List <Process>();
            List <ObjectRelation> situationObjectRelations = ObjectRelations.Distinct().ToList();
            List <ObjectInstance> situationObjects         = Objects.Distinct().ToList();
            // Each item in the collection can be used as a base for a new process.
            ICollection <ProcessRolesMap> possibleProcessRoleMaps = processType.Precondition.GetPossibleRoleMaps(situationObjects, situationObjectRelations);

            foreach (ProcessRolesMap rolesMap in possibleProcessRoleMaps)
            {
                var newProcess = new Process(processType, rolesMap);

                // Add the process in the situation if not already existing
                if (this.Processes.All(pr => !pr.IsSameAs(newProcess)))
                {
                    this.Processes.Add(newProcess);
                    // Creating the process effect elements and adding them in the process and the
                    // situation descriptions
                    CreateEffectElements(newProcess, mappingRules);

                    newProcesses.Add(newProcess);
                }
            }

            return(newProcesses);
        }
Exemple #32
0
        public async Task <string> GetProcessNumber(ProcessType processType, int id)
        {
            string prefix  = string.Empty;
            string process = processType.ToString();

            for (int i = 0; i < process.Length; i++)
            {
                if (char.IsUpper(process[i]))
                {
                    prefix += process[i];
                }
            }

            StringBuilder consecutiveNumberBuilder = new StringBuilder(id.ToString());

            for (int i = 0; i < 5 - consecutiveNumberBuilder.Length; i++)
            {
                consecutiveNumberBuilder.Insert(0, "0");
            }

            string prefixPart = _random.Next(100, 999).ToString();
            string bodyPart   = _random.Next(100, 999).ToString();

            return($"{prefix}{prefixPart}-{bodyPart}-{consecutiveNumberBuilder}");
        }
 public void Save()
 {
     var type = new ProcessType(TYPENAME
         , new ProcessType.WorkflowDefinition("")
         , Taobao.Workflow.Activities.Test.Stub.WorkflowParser.GetActivitySettings().ToArray()) { Group = "test" };
     this._processTypeService.Create(type);
     Assert.AreNotEqual(Guid.Empty, type.ID);
 }
 public Section(byte[] id, ProcessType type, string name, string name2, int imageIndex)
 {
     this.id = id;
     this.type = type;
     this.name = name;
     this.name2 = name2;
     this.imageIndex = imageIndex;
 }
Exemple #35
0
	public IProcess CreateNextProcess(ProcessType prevProcessType) {
		IProcess nextProcess = null;
		switch (prevProcessType) {
			case ProcessType.Default: nextProcess = new PerformanceProcess(); break;
			case ProcessType.End: break;
		}

		return nextProcess;
	}
Exemple #36
0
        public IXPathNavigable GetAllProcessRuns(int processId, ProcessType processType) {

            DataTable subComponents = this.m_model.GetChildComponents(processId);

            XmlDocument doc = new XmlDocument();
            XmlDeclaration declaration = doc.CreateXmlDeclaration("1.0", "UTF-8", String.Empty);
            doc.AppendChild(declaration);

            String rootName = String.Empty;
            String runName = String.Empty;
            switch (processType) {
                case ProcessType.OPTIMIZATION:
                    rootName = "Optimization";
                    runName = "OptRun";
                    break;
                case ProcessType.SIMULATION:
                    rootName = "Simulation";
                    runName = "SimRun";
                    break;
                default:
                    throw new Exception("The Process Type is not defined in the ProcessControllType enum");
            }

            XmlElement root = doc.CreateElement(rootName);
            root.SetAttribute("id", processId.ToString());
            doc.AppendChild(root);

            int id;
            String name;
            DataTable parameters;
            XmlElement runNode;
            foreach (DataRow simRunRows in subComponents.Rows) {
                id = (int)simRunRows[SchemaConstants.Id];
                runNode = doc.CreateElement(runName);
                runNode.SetAttribute("id", id.ToString());

                name = simRunRows[SchemaConstants.Name].ToString();
                runNode.SetAttribute("name", name);
                root.AppendChild(runNode);

                parameters = this.m_model.GetParameterTable(id, eParamParentType.Component.ToString());
                XmlElement parameterNode;
                String parameterId, parameterName, parameterValue;
                foreach (DataRow parameterRows in parameters.Rows) {
                    parameterId = parameterRows[SchemaConstants.Id].ToString();
                    parameterName = parameterRows[SchemaConstants.Name].ToString();
                    parameterValue = parameterRows[SchemaConstants.Value].ToString();
                    parameterNode = doc.CreateElement("Parameter");
                    parameterNode.SetAttribute("name", parameterName);
                    parameterNode.SetAttribute("value", parameterValue);
                    runNode.AppendChild(parameterNode);
                }
            }

            return doc.Clone();
        }
Exemple #37
0
        private static void GenerateReport(ProcessRepository process, ProcessType type)
        {
            tracer.Info("Generating report for {0}...", type);

            var flow = process.GetFlow(type);

            var generator = new FlowIssueGenerator(type, flow);

            var body = generator.Render();
            var baseDir = GitRepo.Find(".") ?? ".";
            var output = Path.Combine(baseDir, "~" + type + ".md");
            File.WriteAllText(output, body, Encoding.UTF8);
        }
            public Process( string name, string url, Site site, ProcessType type )
            {
                this.name = name;
                this.url = url;
                this.site = site;
                this.type = type;

                Regex pattern = new Regex( @"tcp://(?<ip>.*):(?<port>\d+)/(?<servicename>\w+)" );
                Match match = pattern.Match( url );
                if ( match.Success ) {
                    ip = match.Groups[ "ip" ].Value;
                    port = match.Groups[ "port" ].Value;
                    serviceName = match.Groups[ "servicename" ].Value;
                }
            }
Exemple #39
0
 /// <summary>
 /// 实例化一道工序为指定参数
 /// </summary>
 /// <param name="stationNo">工位号</param>
 /// <param name="processType">加工类型</param>
 /// <param name="processShape">加工形状</param>
 /// <param name="number">工序号</param>
 /// <param name="startPoint">工序的起始点</param>
 public Process(ProcessType processType, ProcessShape processShape, bool isOutside, int number, Point startPoint)
     : this()
 {
     //保存加工类型
     this.ProcessType = processType;
     //保存加工形状
     this.ProcessShape = processShape;
     //保存工序号
     this.Number = number;
     //保存起始点
     setStartPoint(startPoint);
     this.IsOutside = isOutside;
     //获取加工面类型
     getSideType();
 }
Exemple #40
0
        public AssessmentToolStrip(ProcessType type) : this() {

            AMEManager cm = AMEManager.Instance;
            Controller projectController = (Controller)cm.Get("ProjectEditor");

            String typeString = null;
            switch (type) {
                case (ProcessType.SIMULATION):
                    this.config = "AssessmentEditor";
                    this.measureConfig = "SimMeasuresEditor";
                    this.assessmentController = (AssessmentController)cm.Get(this.config);
                    typeString = " for Simulation";
                    this.processButton.ToolTipText = "Simulation";
                    this.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
                        this.processComboBox,
                        this.toolStripSeparator,
                        this.graphButton,
                        this.processButton});
                    break;

                case (ProcessType.OPTIMIZATION):
                    this.config = "OptAssessmentEditor";
                    this.measureConfig = "OptMeasuresEditor";
					this.assessmentController = (AssessmentController)cm.Get(this.config);
                    typeString = " for Optimization";
                    this.processButton.ToolTipText = "Optimization";
                    this.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
                        this.processComboBox,
                        this.toolStripSeparator,
                        this.graphButton,
                        this.applyResultsButton,
						this.processButton});
                    break;

                default:
                    throw new Exception("Attempt to create an unkown type of the AssessmentToolstrip");
            }

            this.assessmentController.RegisterForUpdate(processComboBox);

            // Init Simulation Selection CustomCombo
            this.processComboBox.Controller = projectController;
            this.processComboBox.Type = assessmentController.RootComponentType;
            this.processComboBox.LinkType = projectController.RootComponentType;

            logger.Debug("Created AssessmentToolStrip" + typeString);
        }
 public void Handle( ProcessType type )
 {
     switch( type )
     {
         case ProcessType.Welcome:
             welcome.Go();
             break;
         case ProcessType.Shop:
             shop.Go();
             break;
         case ProcessType.Purchase:
             purchase.Go();
             break;
         case ProcessType.Exit:
             exit.Go();
             break;
     }
 }
Exemple #42
0
        public ProcessPanel(ProcessType type) : this() {

            //projectController = (RootController)GMEManager.Instance.Get("ProjectEditor");


            String typeStr = String.Empty;
            switch (type) {

                case ProcessType.OPTIMIZATION:
					modelingController = (ModelingController)AMEManager.Instance.Get("OptimizationEditor");
					measuresController = (MeasuresController)AMEManager.Instance.Get("OptMeasuresEditor");
                    typeStr = "Optimization";
                    break;

                case ProcessType.SIMULATION:
                    modelingController = (ModelingController)AMEManager.Instance.Get("SimulationEditor");
                    measuresController = (MeasuresController)AMEManager.Instance.Get("SimMeasuresEditor");
                    typeStr = "Simulation";
                    break;

                default:
                    throw new Exception("The Process Type is not defined in the ProcessControllType enum");
            }
            if (modelingController == null)
                return;

            this.topTabPage.Description = "Select " + typeStr + " to run";
            this.topTabPage.Text = typeStr;
            this.bottomTabPage.Description = "Configure and Run the " + typeStr + "Run";
            this.bottomTabPage.Text = typeStr + "Run";

            processCustomCombo.Controller = projectController;
            processCustomCombo.Type = modelingController.RootComponentType;
            processCustomCombo.LinkType = projectController.RootComponentType;

            parameterTable.Controller = modelingController;

            modelingController.RegisterForUpdate(this);
            modelingController.RegisterForUpdate(processCustomCombo);
            modelingController.RegisterForUpdate(parameterTable);

            customComboList = new List<CustomCombo>();
        }
 public void Send(string title, string content, ProcessType type = ProcessType.Normal)
 {
     if (type == ProcessType.Normal)
     {
         instanceMail.Send(title, content);
     }
     else
     {
         try
         {
             MailSendAdminHandler sendAdmin = new MailSendAdminHandler(instanceMail.Send);
             sendAdmin.BeginInvoke(title, content, null, null);
         }
         catch (Exception ex)
         {
             LogManager.SqlDB.Write("Asecron Mail Gönderim", ex);
         }
     }
 }
 public static void RepertoryImage(Graphics drawDestination, ProcessType type)
 {
     StringFormat itemStringFormat = new StringFormat();
     RectangleF itemBox = new RectangleF(10, 10, 60, 20);
     Pen pen = new Pen(Color.Black);
     float[] pattern = {3f,3f};
     if(MSCItem.Style == MscStyle.UML2){
         pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Custom;
         pen.DashPattern = pattern;
     }
     else if (MSCItem.Style == MscStyle.SDL){
         pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Solid;
     }
     if(type == ProcessType.Actor){
         itemBox = new RectangleF(10, 0, 60, 14);
         itemStringFormat.Alignment = StringAlignment.Center;
         itemStringFormat.LineAlignment = StringAlignment.Near;
         drawDestination.DrawString("Description",new Font("Arial",8),Brushes.Black,itemBox,itemStringFormat);
         itemStringFormat.LineAlignment = StringAlignment.Center;
         drawDestination.DrawEllipse(Pens.Black,36,14,8,8);
         drawDestination.DrawLine(Pens.Black,40,22,40,32);
         drawDestination.DrawLine(Pens.Black,32,24,48,24);
         drawDestination.DrawLine(Pens.Black,40,32,48,40);
         drawDestination.DrawLine(Pens.Black,40,32,32,40);
         itemBox = new RectangleF(10, 42, 60, 12);
         drawDestination.DrawString("Actor",new Font("Arial",8),Brushes.Black,itemBox,itemStringFormat);
         drawDestination.DrawLine(pen,40,56,40,75);
     }
     else if (type == ProcessType.Normal){
         itemBox = new RectangleF(10, 0, 60, 14);
         itemStringFormat.Alignment = StringAlignment.Center;
         itemStringFormat.LineAlignment = StringAlignment.Near;
         drawDestination.DrawString("Description",new Font("Arial",8),Brushes.Black,itemBox,itemStringFormat);
         itemStringFormat.LineAlignment = StringAlignment.Center;
         drawDestination.FillRectangle(Brushes.White,10,14,60,20);
         itemBox = new RectangleF(10, 14, 60, 20);
         drawDestination.DrawString("Process",new Font("Arial",8),Brushes.Black,itemBox,itemStringFormat);
         drawDestination.DrawRectangle(Pens.Black,10,14,60,20);
         drawDestination.DrawLine(pen,40,34,40,75);
     }
     itemStringFormat.Dispose();
     pen.Dispose();
 }
Exemple #45
0
 public Form2(PassingType pt, ProcessType proc)
 {
     InitializeComponent();
     label1.Visible = false;
     panel1.AutoScroll = true;
     previewPicture.Location = new Point(0, 0);
     previewPicture.SizeMode = PictureBoxSizeMode.Zoom;
     PassingType pts = PassingType.Denoise4;
     switch (pt)
     {
         case PassingType.Binary:
             this.Text = "二值图";
             pts = PassingType.Binary;
             break;
         case PassingType.Noise:
             this.Text = "噪声图";
             pts = PassingType.Noise;
             break;
         case PassingType.Denoise4:
             this.Text = "四邻域探测去噪图";
             pts = PassingType.Denoise4;
             break;
         case PassingType.Denoise8:
             this.Text = "八邻域探测去噪图";
             pts = PassingType.Denoise8;
             break;
         default:
             this.Text = "浏览";
             break;
     }
     if (pt >= PassingType.Denoise4)
     {
         this.Text += " (" + (proc == ProcessType.Climbing ? "爬山算法" : "模拟退火算法") + ") ";
     }
     core.passOut(pts, ref preImage);
     previewPicture.Image = preImage;
     if (pt >= PassingType.Denoise4)
     {
         label1.Text = "去噪率:" + (core.getRate() * 100).ToString("0.000") + "%";
         label1.Visible = true;
     }
 }
        public List<StrategyOrderInfo> ProcessSymbol(string StrategyId, string[] symbol, ProcessType _processType)
        {
            if (symbol == null || symbol.Count() == 0)
            {
                for (int i = 0; i < MockupManager.StrategyOrderList.Count; i++)
                {
                    StrategyOrderInfo order = MockupManager.StrategyOrderList[i];
                    ProcessOrder(_processType, order);
                }
            }
            else if (symbol != null && symbol.Count() > 0)
            {
                for (int i = 0; i < MockupManager.StrategyOrderList.Count; i++)
                {
                    StrategyOrderInfo order = MockupManager.StrategyOrderList[i];
                    if (symbol.Contains(order.Symbol))
                    {
                        ProcessOrder(_processType, order);
                    }
                }
            }

            return MockupManager.StrategyOrderList;
        }
        static void ProcessPartition(Database db, string tableName, string partitionName, ProcessType type, string sql = null)
        {
            var id = db.Dimensions.GetByName(tableName).ID;
            using (var measureGroup = db.Cubes[0].MeasureGroups[id])
            {
                using (var p = measureGroup.Partitions.GetByName(partitionName))
                {
                    try
                    {
                        if (sql == null)
                        {
                            p.Process(type);
                        }
                        else
                        {
                            p.Process(type, new QueryBinding(db.DataSourceViews[0].ID, sql));
                        }
                    }
                    catch (OperationException oe)
                    {
                        //Partition is empty
                        //TODO: Find better way to check if this is the cause of the exception. HResult just says "Unspecified error".
                        if (type == ProcessType.ProcessAdd)
                        {
                            ProcessPartition(db, tableName, partitionName, ProcessType.ProcessFull, sql);
                        }
                        else
                        {
                            throw oe;
                        }
                    }

                }
            }
        }
        public List<ImportedFileStatus> ImportedFileStatusLoadByTypeStatusFileType(ProcessType processType, ProcessStatus processStatus, ProcessFileType processFileType)
        {
            List<ImportedFileStatus> result = new List<ImportedFileStatus>();

            StoredProcedure proc = new StoredProcedure(SQLResource.ImportedFileStatusSelectByTypeStatusFileType, ConnectionString);
            proc.Parameters.AddWithValue("@ProcessTypeID", processType);
            proc.Parameters.AddWithValue("@ProcessStatusID", processStatus);
            proc.Parameters.AddWithValue("@ProcessFileTypeID", processFileType);
            DataTable table = proc.ExecuteReader();
            foreach (DataRow row in table.Rows)
            {
                ImportedFileStatus file = new ImportedFileStatus(row);
                result.Add(file);
            }
            return result;
        }
Exemple #49
0
        internal List<StrategyOrderInfo> ProcessAllSymbol(string StrategyId, ProcessType processType)
        {
            List<StrategyOrderInfo> returnStrategyOrderList = new List<StrategyOrderInfo>();
            for (int i = 0; i < StrategyOrderList.Count; i++)
            {
                if (StrategyOrderList[i].StrategyId == StrategyId)
                {
                    StrategyOrderInfo order = StrategyOrderList[i];
                    if (processType == ProcessType.START)
                    {
                        order.Status = "Trading";
                    }
                    else if (processType == ProcessType.STOP)
                    {
                        order.Status = "Stopped";
                    }
                    else if (processType == ProcessType.CANCELALL)
                    {
                        order.Status = "Cancel";
                    }
                    else if (processType == ProcessType.LOCK)
                    {
                        order.Status = "Locked";
                    }
                    else if (processType == ProcessType.UNLOCK)
                    {
                        order.Status = "Stoped";
                    }

                    returnStrategyOrderList.Add(order);
                }
            }
            return returnStrategyOrderList;
        }
Exemple #50
0
 public void AddProcess(uint fileLine, string id, string name, string description, Brush brush, uint line, ProcessType type, uint leftRand, uint rightRand)
 {
     processes.Add(new Process(id, brush,leftRand, rightRand));
     lines.Add(new ProcessLine(fileLine, name,description, line,processes.Count-1,type,null,leftRand, rightRand,null));
 }
Exemple #51
0
	public override void OnInspectorGUI()
	{
		Tools.current = Tool.View;

		EditorGUILayout.Space();
		serializedObject.Update();

		GUI.changed = false;

		// 创建格子
		folds[0] = EditorGUILayout.BeginToggleGroup("创建格子", folds[0]);
		if (folds[0])
		{
			GUILayout.Label("注意这会删除当前格子", EditorStyles.label);
			EditorGUILayout.Space();

			EditorGUILayout.PropertyField(gridWidth, new GUIContent("格子宽(米)"));
			EditorGUILayout.PropertyField(gridXNum, new GUIContent("X轴格子数"));
			EditorGUILayout.PropertyField(gridZNum, new GUIContent("Z轴格子数"));
			if (GUILayout.Button("Update"))
			{
				Target.Reset();
			}
		}
		EditorGUILayout.EndToggleGroup();

		// 刷格子
		GUILayout.Space(20f);
		folds[1] = EditorGUILayout.BeginToggleGroup("刷阻挡", folds[1]);
		if (folds[1])
		{
			EditorGUILayout.Space();

			Target.ShowGrids = EditorGUILayout.Toggle("显示格子", Target.ShowGrids);

			this.curProcessType = (ProcessType)EditorGUILayout.EnumPopup("当前操作类型", this.curProcessType);
			if (this.curProcessType == ProcessType.Set || this.curProcessType == ProcessType.Clear)
			{
				this.curTileType = (TileType)EditorGUILayout.EnumPopup("当前格子类型", this.curTileType);
				this.radius = EditorGUILayout.IntSlider("操作直径", this.radius, 1, 16);
			}
			else if (this.curProcessType == ProcessType.FindPath)
			{
				vecStart = EditorGUILayout.Vector3Field("起始点", vecStart);
				vecEnd = EditorGUILayout.Vector3Field("结束点", vecEnd);
			}
		}
		EditorGUILayout.EndToggleGroup();

		if (GUI.changed || Target.ShowGrids)
			EditorUtility.SetDirty(this.target);

		// 导出地图信息
		GUILayout.Space(20f);
		folds[2] = EditorGUILayout.BeginToggleGroup("导出地图信息", folds[2]);
		if (folds[2])
		{
			EditorGUILayout.Space();
			if (GUILayout.Button("Export"))
			{
				Export();
			}
		}
		EditorGUILayout.EndToggleGroup();

		serializedObject.ApplyModifiedProperties();
	}
Exemple #52
0
 private Client.ProcessType Parse(ProcessType processType)
 {
     var activity = this._workflowParser.Parse(WorkflowBuilder.GetCacheKey(processType)
         , processType.Workflow.Serialized
         , processType.ActivitySettings);
     return new Client.ProcessType()
     {
         CreateTime = processType.CreateTime,
         Description = processType.Description,
         Name = processType.Name,
         Version = processType.Version,
         IsCurrent = processType.IsCurrent,
         Group = processType.Group,
         ActivityNames = processType.ActivitySettings.Select(o => o.ActivityName).ToArray(),
         DataFields = activity.Variables.Select(o => o.Name).ToArray()
     };
 }
        public List<StrategyOrderInfo> ProcessSymbol(string StrategyId, string[] symbol, ProcessType _processType)
        {
            string logMessage = string.Format("Class: {0}, Method: {1}", "CommunicationManager", "ProcessSymbol(...)");
            LogUtil.WriteLog(LogLevel.DEBUG, logMessage);

            string symbolSpec = null;
            if (symbol != null)
            {
                symbolSpec = EZXWPFLibrary.Utils.StringUtils.StringListToText(symbol.ToList(), ",");
            }

            List<StrategyOrderInfo> StrategyOrderList = new List<StrategyOrderInfo>();
            strategyResultsUpdate update = new strategyResultsUpdate();
            switch (_processType)
            {
                case ProcessType.START:
                    update = Service.start(symbolSpec);
                    break;
                case ProcessType.STOP:
                    update = Service.stop(symbolSpec);
                    break;
                case ProcessType.CANCELALL:
                    Service.cancelAll(symbolSpec);
                    update = Service.getUpdates();
                    break;
                case ProcessType.LOCK:
                    update = Service.@lock(symbolSpec);
                    break;
                case ProcessType.UNLOCK:
                    update = Service.unlock(symbolSpec);
                    break;
                case ProcessType.UNWIND:
                    update = Service.getUpdates();
                    break;
                case ProcessType.BUY:
                    update = Service.buy(symbolSpec);
                    break;
                case ProcessType.SELL:
                    update = Service.sell(symbolSpec);
                    break;
                case ProcessType.BOTH:
                    update = Service.both(symbolSpec);
                    break;
            }

            symbolUpdate[] StrategyOrderSRVList = update.updates;
            CovertServiceObjectToClinetObject(StrategyOrderList, StrategyOrderSRVList, update.strategyName);
            SetServerStatus(update);
            return StrategyOrderList;
        }
        private void GetSelectedStrategyAndSymbol(Dictionary<string, List<string>> selectedStrategyAndSymbol, ProcessType _processType)
        {
            App.AppManager.DataMgr.ClearProcessSelectionIndication();
            if (fltdg.SelectedItems != null)
            {
                for (int i = 0; i < fltdg.SelectedItems.Count; i++)
                {
                    StrategyOrderInfo orderInfo = fltdg.SelectedItems[i] as StrategyOrderInfo;
                    if (orderInfo != null)
                    {
                        if (_processType == ProcessType.BUY
                            || _processType == ProcessType.SELL
                            || _processType == ProcessType.BOTH)
                        {
                            if (orderInfo.Status.Equals("Trading"))
                            {
                                if (_processType.ToString().ToLower().Equals(orderInfo.TradingMode.ToLower()))
                                {
                                    orderInfo.IsAlreadyHadSameProcess = true;
                                    //Avoid re-setting the symbol with same trading-mode as before
                                    continue;
                                }

                                orderInfo.InProcess = true;
                                if (!selectedStrategyAndSymbol.ContainsKey(orderInfo.StrategyId))
                                {
                                    selectedStrategyAndSymbol[orderInfo.StrategyId] = new List<string>();
                                }
                                selectedStrategyAndSymbol[orderInfo.StrategyId].Add(orderInfo.Symbol);
                            }
                        }
                        else if (_processType == ProcessType.UNLOCK)
                        {
                            if (orderInfo.Status.Equals("Locked"))
                            {
                                orderInfo.InProcess = true;
                                if (!selectedStrategyAndSymbol.ContainsKey(orderInfo.StrategyId))
                                {
                                    selectedStrategyAndSymbol[orderInfo.StrategyId] = new List<string>();
                                }
                                selectedStrategyAndSymbol[orderInfo.StrategyId].Add(orderInfo.Symbol);
                            }
                        }
                        else if (_processType == ProcessType.START)
                        {
                            if (!orderInfo.Status.Equals("Trading") && !orderInfo.Status.Equals("Locked"))
                            {
                                orderInfo.InProcess = true;
                                if (!selectedStrategyAndSymbol.ContainsKey(orderInfo.StrategyId))
                                {
                                    selectedStrategyAndSymbol[orderInfo.StrategyId] = new List<string>();
                                }
                                selectedStrategyAndSymbol[orderInfo.StrategyId].Add(orderInfo.Symbol);
                            }
                        }
                        else if (_processType == ProcessType.STOP)
                        {
                            if (!orderInfo.Status.Equals("Stopped") && !orderInfo.Status.Equals("Locked"))
                            {
                                orderInfo.InProcess = true;
                                if (!selectedStrategyAndSymbol.ContainsKey(orderInfo.StrategyId))
                                {
                                    selectedStrategyAndSymbol[orderInfo.StrategyId] = new List<string>();
                                }
                                selectedStrategyAndSymbol[orderInfo.StrategyId].Add(orderInfo.Symbol);
                            }
                        }
                        else if (orderInfo.Status.Equals("Locked"))
                        {
                            orderInfo.InProcess = true;
                            if (!selectedStrategyAndSymbol.ContainsKey(orderInfo.StrategyId))
                            {
                                selectedStrategyAndSymbol[orderInfo.StrategyId] = new List<string>();
                            }
                            selectedStrategyAndSymbol[orderInfo.StrategyId].Add(orderInfo.Symbol);
                        }
                        else
                        {
                            orderInfo.InProcess = true;
                            if (!selectedStrategyAndSymbol.ContainsKey(orderInfo.StrategyId))
                            {
                                selectedStrategyAndSymbol[orderInfo.StrategyId] = new List<string>();
                            }
                            selectedStrategyAndSymbol[orderInfo.StrategyId].Add(orderInfo.Symbol);
                        }
                    }
                }
            }
        }
 private string GetTradingModeValue(ProcessType _processType)
 {
     if (_processType == ProcessType.BUY)
     {
         return "Buy";
     }
     else if (_processType == ProcessType.SELL)
     {
         return "Sell";
     }
     else if (_processType == ProcessType.BOTH)
     {
         return "Both";
     }
     return "";
 }
 public ProcessClass(string ProcessInfo)
 {
     _StartInfo = new ProcessStartInfo(@ProcessInfo);
     _TypeApplication = ProcessType.Application;
 }
 public Section(byte[] id, ProcessType type, string name, int imageIndex)
     : this(id, type, name, "", imageIndex)
 {
 }
 /**
  * Example: [process] [arguments]
  *          pict.exe input.txt > output.txt
  * */
 public void AddArguments(string args)
 {
     _StartInfo.Arguments = args;
     _TypeApplication = ProcessType.ApplicationWithArguments;
 }
Exemple #59
0
 private ProcessType CreateProcessType(string name
     , string workflowDefinition
     , string activitySettingsDefinition
     , string description
     , string group
     , bool current)
 {
     var type = new ProcessType(name
         , new ProcessType.WorkflowDefinition(workflowDefinition)
         , this._workflowParser.ParseActivitySettings(workflowDefinition, activitySettingsDefinition))
     {
         Description = description,
         Group = group
     };
     this._processTypeService.Create(type, current);
     return type;
 }
        public List<StrategyOrderInfo> ProcessAllSymbol(string StrategyId, ProcessType _processType)
        {
            string logMessage = string.Format("Class: {0}, Method: {1}", "CommunicationManager", "ProcessAllSymbol(...)");
            LogUtil.WriteLog(LogLevel.DEBUG, logMessage);

            return ProcessSymbol(StrategyId, null, _processType);
        }