public CWTEDetails(HolderBase<CWTEObject> holder, string id, string url)
 {
     this.holder = holder;
     this.id = id;
     this.SetUrl(url);
     this.AddHeader("X-Requested-With", "XMLHttpRequest");
 }
 public CWTEInitial(HolderBase<CWTEObject> holder, int page = 0)
 {
     this.page = page;
     this.holder = holder;
     this.SetUrl(string.Format("http://ces16.mapyourshow.com/7_0/search/_search-results.cfm?searchType=exhibitor&exhibitor=%2A&getMoreResults=true&startRow={0}&endRow={1}", 
         ((page * 100) + 1), ((page + 1) * 100)));
     this.AddHeader("X-Requested-With","XMLHttpRequest");
 }
 public FurnitureVillageList(HolderBase<Sofa> holder, string url, string category, int page = 1)
 {
     this.holder = holder;
     this.category = category;
     this.page = page;
     this.url = url;
     this.SetUrl(string.Format(url + "?page={0}&startPage={0}", page));
 }
Beispiel #4
0
    // --------------------------------------- User test validation ---------------------------------------

    public void PerformUserMove(HolderBase holder)
    {
        // Check if the user moved the element to a new holder,         TODO: in case of mistake -> avoid new error when fixing the mistake
        if (holder.HolderID != prevHolderID)
        {
            //CurrentStandingOn = holder; // already set
            userMove++;
            holder.HasPermission = true;

            if (validatedUserMove < userMove)
            {
                string validation = IsCorrectlyPlaced();
                switch (validation)
                {
                case Util.INIT_OK:
                    standingInCorrectHolder = true;
                    break;

                case UtilSort.CORRECT_HOLDER:
                case UtilSort.CORRECT_BUCKET:
                    standingInCorrectHolder = true;
                    break;

                case Util.INIT_ERROR:
                case UtilSort.WRONG_HOLDER:
                case UtilSort.WRONG_BUCKET:
                    standingInCorrectHolder = false;
                    parent.GetComponent <UserTestManager>().Mistake();
                    break;

                default: Debug.Log("Add '" + validation + "' case, or ignore"); break;
                }

                // Mark instruction as executed if correct
                if (standingInCorrectHolder && !IntermediateMove)
                {
                    Instruction.Status = Util.EXECUTED_INST;
                    status             = Util.EXECUTED_INST;

                    // Check if ready for next round
                    if (NextMove)
                    {
                        parent.GetComponent <UserTestManager>().IncrementTotalCorrect();
                        parent.GetComponent <UserTestManager>().ReadyForNext += 1;
                        NextMove = false;
                    }
                }

                validatedUserMove++;
                elementInteraction.PickedUp = false; // Reset (comparison pick up added)
            }
        }
        else
        {
            CurrentStandingOn = holder; // Back to the same
        }
        //standingInCorrectHolder = true;
    }
Beispiel #5
0
 public void Set(Project project, HolderBase <PIMDiagram> h)
 {
     Project = project;
     if (h == null)
     {
         h = new HolderBase <PIMDiagram>();
     }
     DiagramHolder = h;
 }
Beispiel #6
0
        protected virtual void Dispose(bool disposing)
        {
            int currentInstanceIndex = this.m_currentInstanceIndex;

            if ((currentInstanceIndex > -1) && (Interlocked.CompareExchange(ref this.m_currentInstanceIndex, -1, currentInstanceIndex) == currentInstanceIndex))
            {
                ThreadLocal <T> .s_availableIndices.Push(currentInstanceIndex);
            }
            this.m_holder = null;
        }
Beispiel #7
0
        /// <summary>
        /// Releases the resources used by this <see cref="T:System.Threading.ThreadLocal{T}" /> instance.
        /// </summary>
        /// <param name="disposing">
        /// A Boolean value that indicates whether this method is being called due to a call to <see cref="Dispose()"/>.
        /// </param>
        /// <remarks>
        /// Unlike most of the members of <see cref="T:System.Threading.ThreadLocal{T}"/>, this method is not thread-safe.
        /// </remarks>
        protected virtual void Dispose(bool disposing)
        {
            int index = this.m_currentInstanceIndex;

            // if the current instance was using the fast path, we should return its combinations type index to the pool to allow reusing it later
            if (index > -1 && Interlocked.CompareExchange(ref m_currentInstanceIndex, -1, index) == index) // reset the index to -1 to avoid multiple dispose call
            {
                s_availableIndices.Push(index);
            }
            m_holder = null;
        }
Beispiel #8
0
    public void CreateObjects(int numberOfElements, Vector3[] positions, bool allowDuplicates, string sortingCase)
    {
        if (containsElements)
        {
            return;
        }

        sortingElements = new GameObject[numberOfElements];

        //Debug.Log("OBS!!!!! Fix back to random here <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
        //int val = 8;

        for (int x = 0; x < numberOfElements; x++)
        {
            int newValue = GenerateValue();
            while (!allowDuplicates && usedValues.Contains(newValue))
            {
                newValue = GenerateValue();
            }
            usedValues.Add(newValue);

            sortingElements[x] = Instantiate(sortingElementPrefab, positions[x] + UtilSort.ABOVE_HOLDER_VR, Quaternion.identity);
            switch (superElement.GetTeachingAlgorithm().AlgorithmName)
            {
            case Util.BUBBLE_SORT: sortingElements[x].AddComponent <BubbleSortElement>(); break;

            case Util.INSERTION_SORT: sortingElements[x].AddComponent <InsertionSortElement>(); break;

            case Util.BUCKET_SORT: sortingElements[x].AddComponent <BucketSortElement>(); break;

            case Util.MERGE_SORT: sortingElements[x].AddComponent <MergeSortElement>(); break;

            default: Debug.LogError("Add subclass for sorting element!"); break;
            }
            sortingElements[x].GetComponent <SortingElementBase>().Value     = newValue;
            sortingElements[x].GetComponent <ISortSubElement>().SuperElement = superElement;
            sortingElements[x].GetComponent <ElementInteraction>().SetParent(sortingTableElementsObj.transform);
        }

        if (sortingCase != UtilSort.NONE)
        {
            ElementsBasedOnCase(sortingElements, sortingCase);
        }

        // Hotfix (sorting element currentHolding / prevHolding problem)
        for (int x = 0; x < sortingElements.Length; x++)
        {
            HolderBase holder = GetComponent <HolderManager>().Holders[x].GetComponent <HolderBase>();
            sortingElements[x].GetComponent <SortingElementBase>().PlaceManuallySortingElementOn(holder);
        }

        containsElements = true;
    }
Beispiel #9
0
        public CTAPage(HolderBase<CTAObject> holder, string viewState, string button, string generator)
        {
            this.AddHeader("X-MicrosoftAjax:Delta", "true");
            this.AddHeader("X-Requested-With", "XMLHttpRequest");
            this.AddHeader("__EVENTTARGET", button);
            this.AddHeader("lng", "en-US");
            this.AddHeader("__VIEWSTATE", viewState);
            this.AddHeader("manScript", "p$lt$zoneTopWideColumn$wP$p$lt$zoneLeft$MembershipDirectory$pnlUpdate|" + button);
            this.AddHeader("__VIEWSTATEGENERATOR", generator);
            this.AddHeader("__SCROLLPOSITIONX", "0");
            this.AddHeader("__SCROLLPOSITIONY", "0");
            this.AddHeader("__ASYNCPOST", "true");

            this.SetUrl("https://www.cta.tech/Membership/Membership-Directory.aspx");
        }
Beispiel #10
0
 public ThreadLocal()
 {
     if (this.FindNextTypeIndex())
     {
         Type[] typesFromIndex = this.GetTypesFromIndex();
         new PermissionSet(PermissionState.Unrestricted).Assert();
         try
         {
             this.m_holder = (HolderBase <T>)Activator.CreateInstance(typeof(GenericHolder).MakeGenericType(typesFromIndex));
         }
         finally
         {
             PermissionSet.RevertAssert();
         }
     }
     else
     {
         this.m_holder = new TLSHolder <T>();
     }
 }
Beispiel #11
0
        public LogInFinalJob(HolderBase<ParticipantData> holderParticipants, HolderBase<CompanyData> holderCompanies, Dictionary<string, string> fields)
        {
            this.holderParticipants = holderParticipants;
            this.holderCompanies = holderCompanies;

            this.SetUrl("http://my.mipimuk.co.uk/en/online-database/user-login/");
            this.AddForm("PAGE_NovaObjectRef", fields["PAGE_NovaObjectRef"]);
            this.AddForm("PAGELANG", "en");
            this.AddForm("BUILDNUMBER", fields["BUILDNUMBER"]);
            this.AddForm("PAGEID", fields["PAGEID"]);
            this.AddForm("ADCONTEXT", fields["ADCONTEXT"]);
            this.AddForm("__EVENTTARGET", "");
            this.AddForm("__EVENTARGUMENT", "");
            this.AddForm("__VIEWSTATE", "");
            this.AddForm("__VIEWSTATEENCRYPTED", "");
            this.AddForm("ctl00$searchControlHeader$ctlAutoComplete$txtSearch", "");
            this.AddForm("ctl00$searchControlHeader$ctlAutoComplete$hidObjectId", "");
            this.AddForm("ctl00$centreContentPlaceHolder$txtUsername", "*****@*****.**");
            this.AddForm("ctl00$centreContentPlaceHolder$txtPassword", "Robert18");
            this.AddForm("ctl00$centreContentPlaceHolder$btnLogin", "Login");
        }
Beispiel #12
0
        /// <summary>
        /// Sets this command for execution
        /// </summary>
        /// <param name="c">PIMClass to be derived from</param>
        /// <param name="d">Diagram to which to add the PSM Class as one of roots</param>
        /// <param name="h">Optional Element holder where the final PSMClass will be placed</param>
        public void Set(PIMClass c, PSMDiagram d, ElementHolder <PSMClass> h)
        {
            Class = c;
            HolderBase <PSMDiagram> DiagramHolder = new HolderBase <PSMDiagram>()
            {
                Element = d
            };

            if (h != null)
            {
                pSMClassHolder = h;
            }
            else
            {
                pSMClassHolder = new ElementHolder <PSMClass>();
            }

            NewPSMClassCommand c1 = NewPSMClassCommandFactory.Factory().Create(Controller) as NewPSMClassCommand;

            c1.RepresentedClass = Class;
            c1.CreatedClass     = pSMClassHolder;
            Commands.Add(c1);

            PSMClassToDiagram_ModelCommand c3 = PSMClassToDiagram_ModelCommandFactory.Factory().Create(Controller) as PSMClassToDiagram_ModelCommand;

            c3.Set(pSMClassHolder, DiagramHolder);
            Commands.Add(c3);

            AddPSMClassToRoots_ModelCommand c4 = AddPSMClassToRoots_ModelCommandFactory.Factory().Create(Controller) as AddPSMClassToRoots_ModelCommand;

            c4.Set(pSMClassHolder, DiagramHolder);
            Commands.Add(c4);

            ActivateDiagramCommand c5 = ActivateDiagramCommandFactory.Factory().Create(Controller) as ActivateDiagramCommand;

            c5.Set(d);
            Commands.Add(c5);
        }
        /// <summary>
        /// Sets this command for execution
        /// </summary>
        /// <param name="c">PIMClass to be derived from</param>
        /// <param name="h">Optional Element holder where the final PSMClass will be placed</param>
        public void Set(PIMClass c, ElementHolder <PSMClass> h)
        {
            Class = c;
            if (h != null)
            {
                pSMClassHolder = h;
            }
            else
            {
                pSMClassHolder = new ElementHolder <PSMClass>();
            }

            NewPSMClassCommand c1 = NewPSMClassCommandFactory.Factory().Create(Controller) as NewPSMClassCommand;

            c1.RepresentedClass = Class;
            c1.CreatedClass     = pSMClassHolder;
            Commands.Add(c1);

            AddPSMDiagramCommand c2 = AddPSMDiagramCommandFactory.Factory().Create(Controller) as AddPSMDiagramCommand;

            if (DiagramHolder == null)
            {
                DiagramHolder = new HolderBase <PSMDiagram>();
            }
            c2.Set(Controller.Project, DiagramHolder);
            Commands.Add(c2);

            PSMClassToDiagram_ModelCommand c3 = PSMClassToDiagram_ModelCommandFactory.Factory().Create(Controller) as PSMClassToDiagram_ModelCommand;

            c3.Set(pSMClassHolder, DiagramHolder);
            Commands.Add(c3);

            AddPSMClassToRoots_ModelCommand c4 = AddPSMClassToRoots_ModelCommandFactory.Factory().Create(Controller) as AddPSMClassToRoots_ModelCommand;

            c4.Set(pSMClassHolder, DiagramHolder);
            Commands.Add(c4);
        }
Beispiel #14
0
 public ThreadLocal()
 {
     // Find a combination index if available, and set the m_currentInstanceIndex to that index
     if (FindNextTypeIndex())
     {
         // If there is an index available, use the fast path and get the genertic parameter types
         Type[]        genericTypes = GetTypesFromIndex();
         PermissionSet permission   = new PermissionSet(PermissionState.Unrestricted);
         permission.Assert();
         try
         {
             m_holder = (HolderBase)Activator.CreateInstance(typeof(GenericHolder <, ,>).MakeGenericType(genericTypes));
         }
         finally
         {
             PermissionSet.RevertAssert();
         }
     }
     else
     {
         // all indices are being used, go with the slow path
         m_holder = new TLSHolder();
     }
 }
Beispiel #15
0
 public void Set(ElementHolder <PSMClass> ch, HolderBase <PSMDiagram> dh)
 {
     pSMClassHolder = ch;
     DiagramHolder  = dh;
 }
Beispiel #16
0
 public GetCompanyDataJob(HolderBase<CompanyData> holder, string url)
 {
     this.holder = holder;
     this.SetUrl(url);
 }
Beispiel #17
0
 public SCSInital(HolderBase<Sofa> holder, int page = 0)
 {
     this.currentPage = page;
     this.SetUrl("http://www.scs.co.uk/our-sofas/?sz="+ perPage + "&start=" + page * perPage + "&format=page-element");
     this.holder = holder;
 }
Beispiel #18
0
 public CTAInitial(HolderBase<CTAObject> holder)
 {
     this.holder = holder;
     this.SetUrl("https://www.cta.tech/Membership/Membership-Directory.aspx");
 }
 public FurnitureVillageSofa(HolderBase<Sofa> holder, string url, string category)
 {
     this.holder = holder;
     this.category = category;
     this.SetUrl(url);
 }
Beispiel #20
0
 public void Set(ElementHolder <PSMClass> c, HolderBase <PSMDiagram> d)
 {
     pSMClassHolder = c;
     DiagramHolder  = d;
 }
Beispiel #21
0
    public override HolderBase GetCorrectHolder(int index)
    {
        HolderBase getHolder = sortMain.HolderManager.GetHolder(index);

        return((getHolder != null) ? getHolder : insertionSort.PivotHolder);
    }
Beispiel #22
0
 public LoginJob(HolderBase<ParticipantData> holderParticipants, HolderBase<CompanyData> holderCompanies)
 {
     this.SetUrl("http://my.mipimuk.co.uk/en/online-database/user-login/");
     this.holderParticipants = holderParticipants;
     this.holderCompanies = holderCompanies;
 }
        public HarveysFurnitureSofaGetDimensions(HolderBase<Sofa> sofaHolder, Sofa sofa, string variantId, string productId)
        {
            this.holder = sofaHolder;
            this.sofa = sofa;

            this.SetUrl(string.Format(
                "http://www.harveysfurniture.co.uk/collection/tab/dimensions?variant_id={0}&product_id={1}&is_bundle=false",
                variantId, productId));
        }
 public HarveysFurnitureSofas(HolderBase<Sofa> sofaHolder)
 {
     this.sofaHolder = sofaHolder;
     this.SetUrl(string.Format("http://www.harveysfurniture.co.uk/fredhopper/request/listing/?sortby=-relevance&"
         + "view_size=all&view_mode=3-wide&page=1&include=items%2Cfacets&id=12"));
 }
Beispiel #25
0
 public GetParticipantsDataJob(HolderBase<ParticipantData> holder, string url)
 {
     this.holder = holder;
     this.SetUrl(url);
 }
 public HarveysFurnitureSofaProduct(HolderBase<Sofa> sofaHolder, string url)
 {
     this.sofaHolder = sofaHolder;
     this.SetUrl(url);
 }
Beispiel #27
0
 public CWTEDetailsAbout(HolderBase<CWTEObject> holder, string id, CWTEObject cwteObject)
 {
     this.holder = holder;
     this.obj = cwteObject;
     this.SetUrl(string.Format("http://ces16.mapyourshow.com/7_0/exhibitor/exhibitor-details.cfm?ExhID={0}", id));
 }
 public FurnitureVillageInital(HolderBase<Sofa> holder)
 {
     this.holder = holder;
     this.SetUrl("http://www.furniturevillage.co.uk/Living-Room/Sofas.aspx");
 }
Beispiel #29
0
 public void PlaceManuallySortingElementOn(HolderBase holder)
 {
     CurrentStandingOn = holder;
 }
Beispiel #30
0
 public SCSSofa(HolderBase<Sofa> holder, string url)
 {
     this.SetUrl(url);
     this.holder = holder;
 }
Beispiel #31
0
 public GetParticipantsJob(HolderBase<ParticipantData> holder, int start = 1)
 {
     this.start = start;
     this.holder = holder;
     this.SetUrl(String.Format("http://my.mipimuk.co.uk/en/online-database/mipimuk/participants/?startRecord={0}&rpp={1}", start, itemsPerpage));
 }