Esempio n. 1
0
        public static Product GetInstance(eProduct productType)
        {
            Product p = null;

            switch (productType)
            {
            case eProduct.A:
            {
                p = new ProductA();
            }
            break;

            case eProduct.B:
            {
                p = new ProductB();
            }
            break;

            case eProduct.C:
            {
                p = new ProductC();
            }
            break;

            default:
            {
                p = new Product();
            }
            break;
            }

            return(p);
        }
Esempio n. 2
0
 public CopyleaksProcess(LoginToken authorizationToken, eProduct product, CreateResourceResponse response, Dictionary <string, string> customFields)
 {
     this.PID             = response.ProcessId;
     this.CreationTimeUtc = response.CreationTimeUTC;
     this.SecurityToken   = authorizationToken;
     this.CustomFields    = customFields;
     this.Product         = product;
 }
Esempio n. 3
0
 public CopyleaksProcess(LoginToken authorizationToken, eProduct product, ProcessInList rawProcess)
 {
     this.PID                       = rawProcess.ProcessId;
     this.CreationTimeUtc           = rawProcess.CreationTimeUTC;
     this.SecurityToken             = authorizationToken;
     this.CustomFields              = rawProcess.CustomFields;
     this.ListProcesses_IsCompleted = rawProcess.Status.ToLower() == "finished";
     this.Product                   = product;
 }
        public static string ToName(this eProduct product)
        {
            switch (product)
            {
            case eProduct.Businesses:
                return(Resources.BusinessesServicePage);

            case eProduct.Academic:
                return(Resources.AcademicServicePage);

            case eProduct.Websites:
                return(Resources.WebsitesServicePage);

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Esempio n. 5
0
        public static string ToName(this eProduct product)
        {
            switch (product)
            {
            case eProduct.Businesses:
                return(Consts.BusinessesServicePage);

            case eProduct.Education:
                return(Consts.EducationServicePage);

            case eProduct.Websites:
                return(Consts.WebsitesServicePage);

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Esempio n. 6
0
 /// <summary>
 /// Connection to Copyleaks cloud.
 /// </summary>
 /// <param name="product">The product for scanning the documents</param>
 public CopyleaksCloud(eProduct product)
 {
     this.Product = product;
 }
Esempio n. 7
0
        /// <summary>
        /// Receives the client's choice
        /// and retrieves the product's price.
        /// </summary>
        /// <returns>Price of selected product.</returns>
        /// <exception cref="VendingMachine.Exceptions.SoldOutException">Thrown when product is sold out.</exception>
        /// <param name="i_VendingMachine">Vending machine instance.</param>
        /// <param name="i_Product">Selected product.</param>
        private static int selectProductAndGetPrice(NewVendingMachine i_VendingMachine, eProduct i_Product)
        {
            bool isAvailable = true;

            do
            {
                try
                {
                    if (i_VendingMachine.ProductInventory.getQuantity(i_Product) > 0)
                    {
                        i_VendingMachine.CurrentProduct = i_Product;
                    }
                    else
                    {
                        isAvailable = false;
                        throw new SoldOutException();
                    }
                }
                catch (SoldOutException SoldOut)
                {
                    UIInterface.PrintToCMD(SoldOut.Message);
                }
            }while (!isAvailable);

            return((int)i_Product);
        }