Beispiel #1
0
 /// <summary>
 ///     Shows respective controls for each mode when mode type is changed.
 /// </summary>
 /// <param name="type">Uses the enumeration 'ModeType' to identify the game type (single or multiplayer).</param>
 private void ChooseMode(ModeType type)
 {
     //Checks if the mode is multiplayer
     if (type == ModeType.Multi)
     {
         //Shows label prompt notifying user that Multiplayer has been chosen
         txtdynamic_Option2.Text = "2. Enter word for next player";
         //Hides and shows controls pertaining to multiplayer
         pnl_wordPacks.Visible = false;
         pnl_MultiDisplayer.Visible = true;
         pnl_MultiOptions.Visible = true;
         //Focuses the textbox so the user does not have to click it
         txt_CustomWord.Focus();
     }
     // Handles the only other option - that the mode is single player
     else
     {
         //Shows label prompt notifying user that Singleplayer has been chosen
         txtdynamic_Option2.Text = "2. Choose Word Pack";
         //Hides and shows controls pertaining to singleplayer
         pnl_wordPacks.Visible = true;
         pnl_MultiDisplayer.Visible = false;
         pnl_MultiOptions.Visible = false;
     }
 }
        public ModelInfo GetModel(Type type, ModeType appMode)
        {
            ModelInfo modelInfo;

            InternalStorage.TryGetValue(GetKey(type, appMode), out modelInfo);

            return modelInfo;
        }
        private ModelInfo CreateNewModelInfo(Type type, TypeMetaData metaData, ModeType appMode)
        {
            var modelGenerator = metaData == null ? 
                new ProtoBufModelGenerator(type) :
                new ProtoBufModelGenerator(type, metaData);

            var modelInfo = modelGenerator.ConfigureType(type, true, true, appMode);

            return modelInfo;
        }
 static GlobalConst()
 {
     #if LIVE
         Mode = ModeType.Live;
     #elif TEST
         Mode = ModeType.Test;
     #else
         Mode = ModeType.Local;
     #endif
 }
Beispiel #5
0
    /// <summary>
    /// モード切替関数
    /// </summary>
    void ModeChanger()
    {
        if (Input.GetKeyDown(KeyCode.LeftArrow))
            modeChanger -= (modeChanger - 1 > (int)ModeType.NONE) ? 1 : 0;

        if (Input.GetKeyDown(KeyCode.RightArrow))
            modeChanger += (modeChanger + 1 < (int)ModeType.MAX) ? 1 : 0;

        modeType = (ModeType)modeChanger;
    }
        public ModelInfo CreateModelInfo(Type type, TypeMetaData metaData, ModeType appMode)
        {
            var modelInfo = GetModelInfoFromCache(type, appMode);

            if (modelInfo == null)
            {
                modelInfo = CreateNewModelInfo(type, metaData, appMode);

                SetModelInfoIntoCache(type, modelInfo, appMode);
            }

            return modelInfo;
        }
        static void SetMode(ModeType newMode)
        {
            switch (newMode) {
                case ModeType.Local:
                    BaseSiteUrl = "http://*****:*****@"Data Source=.;Initial Catalog=zero-k_local;Integrated Security=True;MultipleActiveResultSets=true";

                    LobbyServerHost = "localhost";
                    LobbyServerPort = 8200;

                    OldSpringLobbyPort = 7000;
                    UdpHostingPortStart = 8452;
                    AutoMigrateDatabase = true;
                    break;
                case ModeType.Test:
                    BaseSiteUrl = "http://test.zero-k.info";
                    ZkDataContextConnectionString =
                        "Data Source=test.zero-k.info;Initial Catalog=zero-k_test;Persist Security Info=True;User ID=zero-k;Password=zkdevpass1;MultipleActiveResultSets=true";

                    LobbyServerHost = "test.zero-k.info";
                    LobbyServerPort = 8202;

                    OldSpringLobbyPort = 7000;

                    UdpHostingPortStart = 7452;
                    AutoMigrateDatabase = false;
                    break;
                case ModeType.Live:
                    BaseSiteUrl = "http://zero-k.info";
                    ZkDataContextConnectionString =
                        "Data Source=zero-k.info;Initial Catalog=zero-k;Persist Security Info=True;User ID=zero-k;Password=zkdevpass1;MultipleActiveResultSets=true";
                    
                    LobbyServerHost = "zero-k.info";
                    LobbyServerPort = 8200;

                    OldSpringLobbyPort = 8200;

                    UdpHostingPortStart = 8452;
                    AutoMigrateDatabase = false;
                    break;
            }

            ResourceBaseUrl = string.Format("{0}/Resources", BaseSiteUrl);
            BaseImageUrl = string.Format("{0}/img/", BaseSiteUrl);
            SelfUpdaterBaseUrl = string.Format("{0}/lobby", BaseSiteUrl);

            contentServiceFactory = new ChannelFactory<IContentService>(CreateBasicHttpBinding(), string.Format("{0}/ContentService.svc", BaseSiteUrl));
            
            mode = newMode;
        }
        static void SetMode(ModeType newMode)
        {
            switch (newMode) {
                case ModeType.Local:
                    BaseSiteUrl = "http://*****:*****@"Data Source=.\SQLEXPRESS;Initial Catalog=zero-k_local;Integrated Security=True;MultipleActiveResultSets=true";
                    SpringieNode = "alpha";

                    LobbyServerHost = "localhost";
                    LobbyServerPort = 8200;

                    OldSpringLobbyPort = 7000;
                    break;
                case ModeType.Test:
                    BaseSiteUrl = "http://test.zero-k.info";
                    ZkDataContextConnectionString =
                        "Data Source=omega.licho.eu,100;Initial Catalog=zero-k_test;Persist Security Info=True;User ID=zero-k;Password=zkdevpass1;MultipleActiveResultSets=true";
                    SpringieNode = "omega";

                    LobbyServerHost = "lobby.zero-k.info";
                    LobbyServerPort = 8202;

                    OldSpringLobbyPort = 7000;
                    break;
                case ModeType.Live:
                    BaseSiteUrl = "http://zero-k.info";
                    ZkDataContextConnectionString =
                        "Data Source=omega.licho.eu,100;Initial Catalog=zero-k_ef;Persist Security Info=True;User ID=zero-k;Password=zkdevpass1;MultipleActiveResultSets=true";
                    SpringieNode = "omega";

                    LobbyServerHost = "lobby.zero-k.info";
                    LobbyServerPort = 8200;

                    OldSpringLobbyPort = 8200;
                    break;
            }

            ResourceBaseUrl = string.Format("{0}/Resources", BaseSiteUrl);
            BaseImageUrl = string.Format("{0}/img/", BaseSiteUrl);
            SelfUpdaterBaseUrl = string.Format("{0}/lobby", BaseSiteUrl);

            contentServiceFactory = new ChannelFactory<IContentService>(CreateBasicHttpBinding(), string.Format("{0}/ContentService.svc", BaseSiteUrl));
            springieServiceFactory = new ChannelFactory<ISpringieService>(CreateBasicHttpBinding(), string.Format("{0}/SpringieService.svc", BaseSiteUrl));
            
            mode = newMode;
        }
 public ValueSerializer(ModeType modeType)
 {
     switch (modeType)
     {
         case ModeType.Numeric:
             serializer = new NumericSerializer();
             break;
         case ModeType.Alphanumeric:
             break;
         case ModeType.EightBitsByte:
             break;
         case ModeType.KANJI:
             break;
         case ModeType.GB2312:
             break;
         default:
             break;
     }
 }
Beispiel #10
0
        // Controller depending on the mode, performs the search and destroy using targets data
        public bool Destroy(TargetManager target, IMissileLauncher launcher, ModeType Mode)
        {
            int number_of_lines_per_target = 7;
            int number_of_targets = target.TargetList.Count / number_of_lines_per_target;
            int target_number = 1;

            while (target_number <= number_of_targets && !_shouldStop)
            {
                target.SetTarget(target_number);
                Converter coordinates = new Converter(target.X, target.Y, target.Z);
                switch (Mode)
                {
                    case ModeType.fireAll:
                        if (!_shouldStop)
                            launcher.MoveTo(coordinates.Phi, coordinates.Theta);
                        if (!_shouldStop)
                            launcher.Fire();
                        break;
                    case ModeType.fireFoes:
                        if (!target.Friend)
                        {
                            if (!_shouldStop)
                                launcher.MoveTo(coordinates.Phi, coordinates.Theta);
                            if (!_shouldStop)
                                launcher.Fire();
                        }
                        break;
                    case ModeType.fireFriends:
                        if (target.Friend)
                        {
                            if (!_shouldStop)
                                launcher.MoveTo(coordinates.Phi, coordinates.Theta);
                            if (!_shouldStop)
                                launcher.Fire();
                        }
                        break;
                }
                target_number++;
            }
            return true;
        }
Beispiel #11
0
 protected bool isChangingMode(ModeType current)
 {
     switch(current) {
         case ModeType.Interpreter: { return !radioModeInterpreter.Checked; }
         case ModeType.File: { return !radioModeFiles.Checked; }
         case ModeType.Script: { return !radioModeScript.Checked; }
         case ModeType.Targets: { return !radioModeTargets.Checked; }
         case ModeType.CSharp: { return !radioModeCSharp.Checked; }
         case ModeType.Operation: { return !radioModeOperation.Checked; }
     }
     return true;
 }
Beispiel #12
0
        /// <summary>
        /// 作者:Vincen
        /// 时间:2013.12.13
        /// 描述:生成缩略图
        /// </summary>
        /// <param name="img"></param>
        /// <param name="savePath"></param>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <param name="w"></param>
        /// <param name="h"></param>
        /// <param name="mode"></param>
        /// <returns></returns>
        public static void MakeThumbnail(Image img, string savePath, int x, int y, int w, int h, ModeType mode)
        {
            var towidth = w;
            var toheight = h;

            var ow = img.Width;
            var oh = img.Height;

            switch (mode)
            {
                case ModeType.HeightWidth:
                    break;
                case ModeType.Width:
                    toheight = img.Height * w / img.Width;
                    break;
                case ModeType.Height:
                    towidth = img.Width * h / img.Height;
                    break;
                case ModeType.Cut:
                    if ((float)img.Width / (float)img.Height > (float)towidth / (float)toheight)
                    {
                        oh = img.Height;
                        ow = img.Height * towidth / toheight;
                        y = 0;
                        x = (img.Width - ow) / 2;
                    }
                    else
                    {
                        ow = img.Width;
                        oh = img.Width * h / towidth;
                        x = 0;
                        y = (img.Height - oh) / 2;
                    }
                    break;
            }

            //新建一个bmp图片
            using (Image bitmap = new Bitmap(towidth, toheight))
            {
                //新建一个画板
                var g = Graphics.FromImage(bitmap);

                //设置高质量插值法
                g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.High;

                //设置高质量,低速度呈现平滑程度
                g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;

                //清空画布并以透明背景色填充
                g.Clear(Color.Transparent);

                //在指定位置并且按指定大小绘制原图片的指定部分
                g.DrawImage(img, new Rectangle(0, 0, towidth, toheight),
                    new Rectangle(x, y, ow, oh),
                    GraphicsUnit.Pixel);

                img.Dispose();
                g.Dispose();
                bitmap.Save(savePath);
                //return bitmap;
            }
        }
Beispiel #13
0
        public bool IsMatch(PhoneticShapeNode node, Direction dir, ModeType mode, VariableValues instantiatedVars)
        {
            IList <Match> matches;

            return(IsMatch(node, dir, mode, instantiatedVars, out matches));
        }
			public bool MatchEnvNonempty(IList<PhoneticShapeNode> match, Direction dir, ModeType mode,
				VariableValues instantiatedVars)
			{
				PhoneticShapeNode leftNode = null;
				PhoneticShapeNode rightNode = null;
				switch (dir)
				{
					case Direction.LEFT:
						rightNode = match[0].GetNext(Direction.RIGHT);
						leftNode = match[match.Count - 1].GetNext(Direction.LEFT);
						break;

					case Direction.RIGHT:
						rightNode = match[match.Count - 1].GetNext(Direction.RIGHT);
						leftNode = match[0].GetNext(Direction.LEFT);
						break;
				}

				if (!m_env.IsMatch(leftNode, rightNode, mode, instantiatedVars))
					return false;

				return true;
			}
Beispiel #15
0
 public GameMode GetMode(ModeType givenModeType)
 {
     return(m_mode[(int)givenModeType]);
 }
Beispiel #16
0
        public string GetPricingMarkup(PricingData pricing, List<CurrencyData> currencyList, List<ExchangeRateData> exchangeRateList, Common.EkEnumeration.CatalogEntryType entryType, bool showPricingTier, ModeType Mode)
        {
            StringBuilder sbPricing = new StringBuilder();
            bool showRemoveForDefault = false;
            string defaultCurrencyName = "";
            int defaultCurrencyId = 0;
            Ektron.Cms.Commerce.CurrencyData defaultCurrency = null;

            for (int i = 0; i <= (currencyList.Count - 1); i++)
            {
                if (currencyList[i].Id == m_CommerceSettings.DefaultCurrencyId)
                {
                    defaultCurrencyName = (string)(currencyList[i].Name);
                    defaultCurrencyId = System.Convert.ToInt32(currencyList[i].Id);
                    defaultCurrency = currencyList[i];
                    break;
                }
            }

            sbPricing.Append("             <table width=\"100%\" border=\"1\" bordercolor=\"#d8e6ff\"> ").Append(Environment.NewLine);
            sbPricing.Append("             <tr> ").Append(Environment.NewLine);
            sbPricing.Append("                 <td width=\"100%\"> ").Append(Environment.NewLine);
            sbPricing.Append(" 						    <div class=\"ektron ektron_PricingWrapper\"> ").Append(Environment.NewLine);
            sbPricing.Append("                             <h3> ").Append(Environment.NewLine);
            sbPricing.Append(" 	                            <span class=\"currencyLabel\">").Append(m_CommerceSettings.ISOCurrencySymbol).Append(m_CommerceSettings.CurrencySymbol).Append(" ").Append(defaultCurrencyName).Append("</span> ").Append(Environment.NewLine);
            sbPricing.Append(" 	                            <select onchange=\"Ektron.Commerce.Pricing.selectCurrency(this.options[this.selectedIndex].value, " + defaultCurrencyId + ");return false;\"> ").Append(Environment.NewLine);
            for (int i = 0; i <= (currencyList.Count - 1); i++)
            {
                sbPricing.Append(" 		                            <option value=\"id:ektron_Pricing_").Append(currencyList[i].Id).Append(";label:").Append(currencyList[i].Name).Append(";symbol:").Append(currencyList[i].ISOCurrencySymbol).Append(currencyList[i].CurrencySymbol).Append("\" " + ((currencyList[i].Id == m_CommerceSettings.DefaultCurrencyId) ? "selected=\"selected\"" : "") + ">").Append(currencyList[i].AlphaIsoCode).Append("</option> ").Append(Environment.NewLine);
            }
            sbPricing.Append(" 	                            </select> ").Append(Environment.NewLine);
            sbPricing.Append("                             </h3> ").Append(Environment.NewLine);
            sbPricing.Append("                             <div class=\"ektron_Pricing_InnerWrapper\"> ").Append(Environment.NewLine);
            for (int i = 0; i <= (currencyList.Count - 1); i++)
            {
                bool IsDefaultCurrency = System.Convert.ToBoolean(m_CommerceSettings.DefaultCurrencyId == currencyList[i].Id);
                //decimal actualCost = (decimal)0.0;
                decimal listPrice = (decimal)0.0;
                decimal currentPrice = (decimal)0.0;
                Ektron.Cms.Commerce.CurrencyPricingData currencyPricing = pricing.GetCurrencyById(currencyList[i].Id);
                List<Ektron.Cms.Commerce.TierPriceData> tierPrices = new List<Ektron.Cms.Commerce.TierPriceData>();
                int tierCount = 0;
                long tierId = 0;
                bool IsFloated = false;
                decimal exchangeRate = 1;
                if (currencyPricing != null)
                {
                    //actualCost = currencyPricing.ActualCost
                    listPrice = currencyPricing.ListPrice;
                    currentPrice = currencyPricing.GetSalePrice(1);
                    tierPrices = currencyPricing.TierPrices;
                    tierCount = System.Convert.ToInt32(tierPrices.Count);
                    IsFloated = System.Convert.ToBoolean(currencyPricing.PricingType == Ektron.Cms.Common.EkEnumeration.PricingType.Floating);
                    if (Mode == ModeType.Add && !IsDefaultCurrency)
                    {
                        IsFloated = true;
                    }
                    if (tierPrices.Count > 0)
                    {
                        tierId = tierPrices[0].Id;
                    }
                    if (tierPrices.Count == 0 || (tierPrices.Count == 1 && tierPrices[0].Quantity == 1))
                    {
                        tierCount = 1;
                    }
                    if (currencyPricing.CurrencyId == m_CommerceSettings.DefaultCurrencyId && tierPrices.Count > 0)
                    {
                        showRemoveForDefault = true;
                    }
                }
                else
                {
                    IsFloated = true;
                    tierCount = 1;
                }
                for (int k = 0; k <= (exchangeRateList.Count - 1); k++)
                {
                    if (exchangeRateList[k].ExchangeCurrencyId == currencyList[i].Id)
                    {
                        exchangeRate = System.Convert.ToDecimal(exchangeRateList[k].Rate);
                        break;
                    }
                }
                sbPricing.Append(" 	                            <div id=\"ektron_Pricing_").Append(currencyList[i].Id).Append("\" class=\"ektron_Pricing_CurrencyWrapper ektron_Pricing_").Append(currencyList[i].AlphaIsoCode).Append("" + ((currencyList[i].Id == m_CommerceSettings.DefaultCurrencyId) ? " ektron_Pricing_CurrencyWrapper_Active" : "") + "\"> ").Append(Environment.NewLine);
                sbPricing.Append(" 		                            <table class=\"ektron_UnitPricing_Table\" summary=\"").Append(m_WorkAreaBase.GetMessage("lbl unit pricing data")).Append("\"> ").Append(Environment.NewLine);
                sbPricing.Append(" 			                            <colgroup> ").Append(Environment.NewLine);
                sbPricing.Append(" 				                            <col class=\"narrowCol\"/> ").Append(Environment.NewLine);
                sbPricing.Append(" 				                            <col class=\"wideCol\" /> ").Append(Environment.NewLine);
                sbPricing.Append(" 			                            </colgroup> ").Append(Environment.NewLine);
                sbPricing.Append(" 			                            <thead> ").Append(Environment.NewLine);
                sbPricing.Append(" 				                            <tr> ").Append(Environment.NewLine);
                sbPricing.Append(" 					                            <th colspan=\"2\" class=\"alignLeft noBorderRight\"> ").Append(Environment.NewLine);
                sbPricing.Append(" 						                            ").Append(m_WorkAreaBase.GetMessage("lbl unit pricing")).Append(" ").Append(Environment.NewLine);
                sbPricing.Append(" 					                            </th> ").Append(Environment.NewLine);
                sbPricing.Append(" 				                            </tr> ").Append(Environment.NewLine);
                sbPricing.Append(" 			                            </thead> ").Append(Environment.NewLine);
                sbPricing.Append(" 			                            <tbody> ").Append(Environment.NewLine);

                if (!(currencyList[i].Id == m_CommerceSettings.DefaultCurrencyId))
                {
                    sbPricing.Append(" 				                            <tr> ").Append(Environment.NewLine);
                    sbPricing.Append(" 					                            <th class=\"noBorderRight\"> ").Append(Environment.NewLine);
                    sbPricing.Append(" 						                            <img src=\"").Append(m_WorkAreaBase.AppImgPath).Append("commerce/about.gif\" alt=\"").Append(m_WorkAreaBase.GetMessage("lbl price float exchange")).Append("\" title=\"").Append(m_WorkAreaBase.GetMessage("lbl price float exchange")).Append("\" class=\"moreInfo\" /> ").Append(Environment.NewLine);
                    sbPricing.Append(" 						                            <label for=\"ektron_UnitPricing_Float_").Append(currencyList[i].Id).Append("\">").Append(m_WorkAreaBase.GetMessage("lbl price float")).Append(":</label> ").Append(Environment.NewLine);
                    sbPricing.Append(" 					                            </th> ").Append(Environment.NewLine);
                    sbPricing.Append(" 					                            <td class=\"noBorderLeft\"> ").Append(Environment.NewLine);
                    sbPricing.Append(" 						                            <span class=\"currencySymbol\">").Append(Environment.NewLine);
                    sbPricing.Append("<input onclick=\"Ektron.Commerce.Pricing.floatToggle(this);\" id=\"ektron_UnitPricing_Float_").Append(currencyList[i].Id).Append("\" name=\"ektron_UnitPricing_Float_").Append(currencyList[i].Id).Append("\" class=\"actualPrice\" type=\"checkbox\" ").Append(IsFloated ? "checked=\"checked\" " : "").Append(" ").Append((!(Mode == ModeType.View)) ? "" : "disabled=\"disabled\" ").Append("/> ").Append(Environment.NewLine);
                    sbPricing.Append("</span> ").Append(Environment.NewLine);
                    sbPricing.Append(" 						                            ").Append(m_WorkAreaBase.GetMessage("lbl price current rate")).Append(": ").Append(defaultCurrency.ISOCurrencySymbol).Append(defaultCurrency.CurrencySymbol).Append("1 = ").Append(currencyList[i].ISOCurrencySymbol).Append(currencyList[i].CurrencySymbol).Append(m_WorkAreaBase.FormatCurrency(exchangeRate, "")).Append(Environment.NewLine);

                    sbPricing.Append(" 					                            </td> ").Append(Environment.NewLine);
                    sbPricing.Append(" 				                            </tr> ").Append(Environment.NewLine);
                }

                if (!(Mode == ModeType.View))
                {
                    //sbPricing.Append(" 						                            <input maxlength=""8"" id=""ektron_UnitPricing_ActualPrice_").Append(currencyList[i].Id).Append(""" onchange=""UpdateActualPrice(this);"" name=""ektron_UnitPricing_ActualPrice_").Append(currencyList[i].Id).Append(""" class=""actualPrice"" type=""text"" value=""" & m_WorkAreaBase.FormatCurrency(actualCost, "") & """ " + IIf(IsFloated, "disabled=""disabled"" ", "") + " /> ").Append(Environment.NewLine)
                }
                else
                {
                    //sbPricing.Append(" 						                            ").Append(m_WorkAreaBase.FormatCurrency(actualCost, "")).Append(Environment.NewLine)
                }
                //sbPricing.Append(" 						                            &#160;").Append(m_WorkAreaBase.GetMessage("lbl per unit")).Append(" ").Append(Environment.NewLine)
                //sbPricing.Append(" 					                            </td> ").Append(Environment.NewLine)
                //sbPricing.Append(" 				                            </tr> ").Append(Environment.NewLine)
                sbPricing.Append(" 				                            <tr class=\"stripe\"> ").Append(Environment.NewLine);
                sbPricing.Append(" 					                            <th class=\"noBorderRight\"> ").Append(Environment.NewLine);
                sbPricing.Append(" 						                            <img src=\"").Append(m_WorkAreaBase.AppImgPath).Append("commerce/about.gif\" alt=\"").Append(m_WorkAreaBase.GetMessage("lbl list price")).Append("\" title=\"").Append(m_WorkAreaBase.GetMessage("lbl list price desc")).Append("\" class=\"moreInfo\" /> ").Append(Environment.NewLine);
                sbPricing.Append(" 						                            <label for=\"ektron_UnitPricing_ListPrice_").Append(currencyList[i].Id).Append("\" class=\"listPrice\">").Append(m_WorkAreaBase.GetMessage("lbl list price")).Append(":</label> ").Append(Environment.NewLine);
                sbPricing.Append(" 					                            </th> ").Append(Environment.NewLine);
                sbPricing.Append(" 					                            <td class=\"noBorderLeft\"> ").Append(Environment.NewLine);
                sbPricing.Append(" 						                            <span class=\"currencySymbol\">").Append(currencyList[i].ISOCurrencySymbol).Append(currencyList[i].CurrencySymbol).Append("</span> ").Append(Environment.NewLine);
                if (!(Mode == ModeType.View))
                {
                    sbPricing.Append(" 						                            <input maxlength=\"8\" id=\"ektron_UnitPricing_ListPrice_").Append(currencyList[i].Id).Append(IsDefaultCurrency ? "\" onchange=\"UpdateListPrice(this);\" " : "\" ").Append(" name=\"ektron_UnitPricing_ListPrice_").Append(currencyList[i].Id).Append("\" type=\"text\" value=\"" + m_WorkAreaBase.FormatCurrency(listPrice, "") + ("\" " + (IsFloated ? "disabled=\"disabled\" " : "") + " /> ")).Append(Environment.NewLine);
                }
                else
                {
                    sbPricing.Append(" 						                            ").Append(m_WorkAreaBase.FormatCurrency(listPrice, "")).Append(Environment.NewLine);
                }
                sbPricing.Append(" 						                            &#160;").Append(m_WorkAreaBase.GetMessage("lbl per unit")).Append(" ").Append(Environment.NewLine);
                sbPricing.Append(" 					                            </td> ").Append(Environment.NewLine);
                sbPricing.Append(" 				                            </tr> ").Append(Environment.NewLine);
                sbPricing.Append(" 				                            <tr> ").Append(Environment.NewLine);
                sbPricing.Append(" 					                            <th class=\"noBorderRight\"> ").Append(Environment.NewLine);
                sbPricing.Append(" 						                            <img src=\"").Append(m_WorkAreaBase.AppImgPath).Append("commerce/about.gif\" alt=\"").Append(m_WorkAreaBase.GetMessage("lbl our sales price")).Append("\" title=\"").Append(m_WorkAreaBase.GetMessage("lbl our sales price desc")).Append("\" class=\"moreInfo\" /> ").Append(Environment.NewLine);
                sbPricing.Append(" 						                            <label for=\"ektron_UnitPricing_SalesPrice_").Append(currencyList[i].Id).Append("\">").Append(m_WorkAreaBase.GetMessage("lbl our sales price")).Append(":</label> ").Append(Environment.NewLine);
                sbPricing.Append(" 					                            </th> ").Append(Environment.NewLine);
                sbPricing.Append(" 					                            <td class=\"noBorderLeft\"> ").Append(Environment.NewLine);
                sbPricing.Append(" 						                            <span class=\"currencySymbol\">").Append(currencyList[i].ISOCurrencySymbol).Append(currencyList[i].CurrencySymbol).Append("</span> ").Append(Environment.NewLine);
                if (!(Mode == ModeType.View))
                {
                    sbPricing.Append(" 						                            <input maxlength=\"8\"  id=\"ektron_UnitPricing_SalesPrice_").Append(currencyList[i].Id).Append(IsDefaultCurrency ? "\" onchange=\"UpdateSalesPrice(this);\" " : "\" ").Append(" name=\"ektron_UnitPricing_SalesPrice_").Append(currencyList[i].Id).Append("\" type=\"text\" value=\"" + m_WorkAreaBase.FormatCurrency(currentPrice, "") + ("\" " + (IsFloated ? "disabled=\"disabled\" " : "") + " /> ")).Append(Environment.NewLine);
                }
                else
                {
                    sbPricing.Append(" 						                            ").Append(m_WorkAreaBase.FormatCurrency(currentPrice, "")).Append(Environment.NewLine);
                }
                sbPricing.Append(" 							                            <input id=\"hdn_ektron_UnitPricing_DefaultTier_").Append(currencyList[i].Id).Append("\" name=\"hdn_ektron_UnitPricing_DefaultTier_").Append(currencyList[i].Id).Append("\" class=\"noFloat\" type=\"hidden\" ");
                sbPricing.Append("value=\"").Append(tierId).Append("\"");
                sbPricing.Append("/> ").Append(Environment.NewLine);
                sbPricing.Append(" 						                            &#160;").Append(m_WorkAreaBase.GetMessage("lbl per unit")).Append(" ").Append(Environment.NewLine);
                sbPricing.Append(" 					                            </td> ").Append(Environment.NewLine);
                sbPricing.Append(" 				                            </tr> ").Append(Environment.NewLine);
                sbPricing.Append(" 			                            </tbody> ").Append(Environment.NewLine);
                sbPricing.Append(" 		                            </table> ").Append(Environment.NewLine);

                sbPricing.Append(" 		                            <div class=\"ektron_TierPricing_Wrapper\" ").Append(tierCount > 1 ? "style=\"display:block;\"" : "").Append("> ").Append(Environment.NewLine);
                sbPricing.Append(" 			                            <table class=\"ektron_TierPricing_Table\" summary=\"").Append(m_WorkAreaBase.GetMessage("lbl tier pricing data")).Append("\"> ").Append(Environment.NewLine);
                sbPricing.Append(" 				                            <colgroup> ").Append(Environment.NewLine);
                sbPricing.Append(" 					                            <col class=\"ektron_TierPricing_TierRemove\" /> ").Append(Environment.NewLine);
                sbPricing.Append(" 					                            <col class=\"ektron_TierPricing_TierQuantity\" /> ").Append(Environment.NewLine);
                sbPricing.Append(" 					                            <col class=\"ektron_TierPricing_TierPrice\" /> ").Append(Environment.NewLine);
                sbPricing.Append(" 				                            </colgroup> ").Append(Environment.NewLine);
                sbPricing.Append(" 				                            <thead> ").Append(Environment.NewLine);
                sbPricing.Append(" 					                            <tr> ").Append(Environment.NewLine);
                sbPricing.Append(" 						                            <th colspan=\"3\" class=\"alignLeft\"> ").Append(Environment.NewLine);
                sbPricing.Append(" 							                            ").Append(m_WorkAreaBase.GetMessage("lbl tier pricing")).Append(" ").Append(Environment.NewLine);
                sbPricing.Append(" 						                            </th> ").Append(Environment.NewLine);
                sbPricing.Append(" 					                            </tr> ").Append(Environment.NewLine);
                sbPricing.Append(" 					                            <tr class=\"ektron_TierPricing_HeaderLabels\"> ").Append(Environment.NewLine);
                sbPricing.Append(" 						                            <th><img class=\"ektron_TierPricing_HeaderRemoveImage\" src=\"").Append(m_WorkAreaBase.AppImgPath).Append("commerce/delete.gif\" alt=\"").Append(m_WorkAreaBase.GetMessage("lbl remove pricing tier")).Append("\" title=\"").Append(m_WorkAreaBase.GetMessage("lbl remove pricing tier")).Append("\" /></th> ").Append(Environment.NewLine);
                sbPricing.Append(" 						                            <th>").Append(m_WorkAreaBase.GetMessage("lbl if num units greater or equal")).Append("</th> ").Append(Environment.NewLine);
                sbPricing.Append(" 						                            <th>").Append(m_WorkAreaBase.GetMessage("lbl then tier price is")).Append("</th> ").Append(Environment.NewLine);
                sbPricing.Append(" 					                            </tr> ").Append(Environment.NewLine);
                sbPricing.Append(" 				                            </thead> ").Append(Environment.NewLine);
                sbPricing.Append(" 				                            <tbody> ").Append(Environment.NewLine);
                int jModifier = 0;
                for (int j = 0; j <= (tierCount - 1); j++)
                {
                    int tierQuantity = 0;
                    long tierQId = 0;
                    decimal tierSalePrice = (decimal)0.0;

                    bool bShow = true;

                    if (j == 0 && tierPrices.Count == 0) // old way
                    {
                        // do nothing
                    }
                    else if (j == 0 && tierPrices.Count == 1 && tierPrices[0].Quantity == 1) //no tier pricing
                    {
                        //do nothing
                    }
                    else if (j == 0 && tierPrices.Count > 0 && tierPrices[0].Quantity == 1) // first is quantity 1 so skip
                    {
                        jModifier = -1;
                        if (tierPrices.Count > 1)
                        {
                            bShow = false;
                        }
                    }
                    else
                    {
                        tierQuantity = System.Convert.ToInt32(tierPrices[j].Quantity);
                        tierSalePrice = System.Convert.ToDecimal(tierPrices[j].SalePrice);
                        tierQId = tierPrices[j].Id;
                    }
                    if (bShow)
                    {
                        sbPricing.Append(" 					                            <tr class=\"tier stripe\" id=\"tier_").Append(j + jModifier).Append("\"> ").Append(Environment.NewLine);
                        sbPricing.Append(" 						                            <td class=\"tierRemove\"> ").Append(Environment.NewLine);
                        if (!(Mode == ModeType.View))
                        {
                            sbPricing.Append(" 							                            <input type=\"checkbox\" title=\"").Append(m_WorkAreaBase.GetMessage("lbl remove tier")).Append("\" class=\"ektron_RemoveTier_Checkbox\" onclick=\"Ektron.Commerce.Pricing.Tier.toggleRemove();\"/> ").Append(Environment.NewLine);
                        }
                        sbPricing.Append(" 						                            </td> ").Append(Environment.NewLine);
                        sbPricing.Append(" 						                            <td class=\"tierQuantity\"> ").Append(Environment.NewLine);
                        if (!((Mode == ModeType.View) == true) && !IsFloated)
                        {
                            sbPricing.Append(" 							                            <input maxlength=\"9\" id=\"ektron_TierPricing_TierQuantity_").Append(currencyList[i].Id).Append("_").Append(j + jModifier).Append("\" name=\"ektron_TierPricing_TierQuantity_").Append(currencyList[i].Id).Append("_").Append(j + jModifier).Append("\" type=\"text\" ");
                            sbPricing.Append("value=\"" + tierQuantity + "\"");
                            sbPricing.Append("/> ").Append(Environment.NewLine);
                        }
                        else
                        {
                            sbPricing.Append(" 							                            <input maxlength=\"9\" id=\"ektron_TierPricing_TierQuantity_").Append(currencyList[i].Id).Append("_").Append(j + jModifier).Append("\" name=\"ektron_TierPricing_TierQuantity_").Append(currencyList[i].Id).Append("_").Append(j + jModifier).Append("\" type=\"text\" disabled=\"disabled\" ");
                            sbPricing.Append("value=\"" + tierQuantity + "\"");
                            sbPricing.Append("/> ").Append(Environment.NewLine);
                        }
                        sbPricing.Append(" 							                            <input id=\"hdn_ektron_TierPricing_TierId_").Append(currencyList[i].Id).Append("_").Append(j + jModifier).Append("\" name=\"hdn_ektron_TierPricing_TierId_").Append(currencyList[i].Id).Append("_").Append(j + jModifier).Append("\" type=\"hidden\" ");
                        sbPricing.Append("value=\"" + tierQId + "\"");
                        sbPricing.Append("/> ").Append(Environment.NewLine);
                        sbPricing.Append(" 						                            </td> ").Append(Environment.NewLine);
                        sbPricing.Append(" 						                            <td class=\"tierPrice\"> ").Append(Environment.NewLine);
                        sbPricing.Append(" 							                            <span class=\"currencySymbol noFloat\">").Append(currencyList[i].ISOCurrencySymbol).Append(currencyList[i].CurrencySymbol).Append("</span> ").Append(Environment.NewLine);
                        if (!((Mode == ModeType.View) == true) && !IsFloated)
                        {
                            sbPricing.Append(" 							                            <input maxlength=\"12\" id=\"ektron_TierPricing_TierPrice_").Append(currencyList[i].Id).Append("_").Append(j + jModifier).Append("\" name=\"ektron_TierPricing_TierPrice_").Append(currencyList[i].Id).Append("_").Append(j + jModifier).Append("\" class=\"noFloat\" type=\"text\" ");
                            sbPricing.Append("value=\"" + m_WorkAreaBase.FormatCurrency(tierSalePrice, "") + "\"");
                            sbPricing.Append("/> ").Append(Environment.NewLine);
                        }
                        else
                        {
                            sbPricing.Append(" 							                            <input maxlength=\"12\" id=\"ektron_TierPricing_TierPrice_").Append(currencyList[i].Id).Append("_").Append(j + jModifier).Append("\" name=\"ektron_TierPricing_TierPrice_").Append(currencyList[i].Id).Append("_").Append(j + jModifier).Append("\" class=\"noFloat\" type=\"text\" disabled=\"disabled\" ");
                            sbPricing.Append("value=\"" + m_WorkAreaBase.FormatCurrency(tierSalePrice, "") + "\"");
                            sbPricing.Append("/> ").Append(Environment.NewLine);
                        }
                        sbPricing.Append(" 						                            </td> ").Append(Environment.NewLine);
                        sbPricing.Append(" 					                            </tr> ").Append(Environment.NewLine);
                    }
                }
                sbPricing.Append(" 				                            </tbody> ").Append(Environment.NewLine);
                sbPricing.Append(" 			                            </table> ").Append(Environment.NewLine);
                sbPricing.Append(" 		                            </div> ").Append(Environment.NewLine);
                sbPricing.Append(" 	                            </div> ").Append(Environment.NewLine);
            }
            if (Mode != ModeType.View && showPricingTier == true)
            {
                sbPricing.Append(" 	                            <p class=\"ektron_TierPricing_Commands clearfix\"> ").Append(Environment.NewLine);
                sbPricing.Append(" 		                            <a href=\"#AddPricingTier\" class=\"button buttonRight greenHover marginLeft\" title=\"").Append(m_WorkAreaBase.GetMessage("lbl add pricing tier")).Append("\" onclick=\"Ektron.Commerce.Pricing.Tier.addTier(this);return false;\"> ").Append(Environment.NewLine);
                sbPricing.Append(" 			                            <img src=\"").Append(m_WorkAreaBase.AppImgPath).Append("commerce/coins_add.gif\" alt=\"").Append(m_WorkAreaBase.GetMessage("lbl add pricing tier")).Append("\" /> ").Append(Environment.NewLine);
                sbPricing.Append(" 			                            ").Append(m_WorkAreaBase.GetMessage("lbl add pricing tier")).Append(" ").Append(Environment.NewLine);
                sbPricing.Append(" 		                            </a> ").Append(Environment.NewLine);
                sbPricing.Append(" 		                            <a href=\"#RemovePricingTier\" class=\"button buttonRight ektron_RemovePricingTier_Button disabled\" title=\"").Append(m_WorkAreaBase.GetMessage("lbl remove pricing tier")).Append("\" onclick=\"Ektron.Commerce.Pricing.Tier.removeTier();return false;\" ").Append(showRemoveForDefault ? "style=\"display:block;\"" : "").Append("> ").Append(Environment.NewLine);
                sbPricing.Append(" 			                            <img src=\"").Append(m_WorkAreaBase.AppImgPath).Append("commerce/coins_delete.gif\" alt=\"").Append(m_WorkAreaBase.GetMessage("lbl remove pricing tier")).Append("\" /> ").Append(Environment.NewLine);
                sbPricing.Append(" 			                            ").Append(m_WorkAreaBase.GetMessage("lbl remove pricing tier")).Append(" ").Append(Environment.NewLine);
                sbPricing.Append(" 		                            </a> ").Append(Environment.NewLine);
                sbPricing.Append(" 	                            </p> ").Append(Environment.NewLine);
            }
            sbPricing.Append("                             </div> ").Append(Environment.NewLine);
            sbPricing.Append("                             <div id=\"ektron_Pricing_Modal\" class=\"ektronWindow\"> ").Append(Environment.NewLine);
            sbPricing.Append(" 	                            <h4 id=\"ektron_Pricing_Modal_Header\"> ").Append(Environment.NewLine);
            sbPricing.Append(" 		                            <img src=\"").Append(m_WorkAreaBase.AppImgPath).Append("commerce/closeButton.gif\" alt=\"").Append(m_WorkAreaBase.GetMessage("lbl cancel and close window")).Append("\" class=\"ektronModalClose\" />	 ").Append(Environment.NewLine);
            sbPricing.Append(" 	                            </h4> ").Append(Environment.NewLine);
            sbPricing.Append(" 	                            <div class=\"ektron_Pricing_Modal_InnerWrapper\"> ").Append(Environment.NewLine);
            sbPricing.Append(" 		                            <p>").Append(m_WorkAreaBase.GetMessage("js confirm remove selected pricing tiers")).Append("</p> ").Append(Environment.NewLine);
            sbPricing.Append(" 		                            <p class=\"buttons clearfix\"> ").Append(Environment.NewLine);
            sbPricing.Append(" 			                            <a href=\"#Ok\" class=\"button buttonRight greenHover marginLeft ektronModalClose\" title=\"").Append(m_WorkAreaBase.GetMessage("lbl ok")).Append("\" onclick=\"Ektron.Commerce.Pricing.Tier.removeTier();return false;\"> ").Append(Environment.NewLine);
            sbPricing.Append(" 				                            <img src=\"").Append(m_WorkAreaBase.AppImgPath).Append("commerce/accept.gif\" alt=\"").Append(m_WorkAreaBase.GetMessage("lbl ok")).Append("\" /> ").Append(Environment.NewLine);
            sbPricing.Append(" 				                            ").Append(m_WorkAreaBase.GetMessage("lbl ok")).Append(" ").Append(Environment.NewLine);
            sbPricing.Append(" 			                            </a> ").Append(Environment.NewLine);
            sbPricing.Append(" 			                            <a href=\"#Cancel\" class=\"button buttonRight redHover ektronModalClose\" title=\"").Append(m_WorkAreaBase.GetMessage("generic cancel")).Append("\" onclick=\"return false;\"> ").Append(Environment.NewLine);
            sbPricing.Append(" 				                            <img src=\"").Append(m_WorkAreaBase.AppImgPath).Append("commerce/cancel.gif\" alt=\"").Append(m_WorkAreaBase.GetMessage("generic cancel")).Append("\" /> ").Append(Environment.NewLine);
            sbPricing.Append(" 				                            ").Append(m_WorkAreaBase.GetMessage("generic cancel")).Append(" ").Append(Environment.NewLine);
            sbPricing.Append(" 			                            </a> ").Append(Environment.NewLine);
            sbPricing.Append(" 		                            </p> ").Append(Environment.NewLine);
            sbPricing.Append(" 	                            </div> ").Append(Environment.NewLine);
            sbPricing.Append("                             </div> ").Append(Environment.NewLine);
            sbPricing.Append("                         </div> ").Append(Environment.NewLine);
            sbPricing.Append("                          ").Append(Environment.NewLine);
            sbPricing.Append("                 </td> ").Append(Environment.NewLine);
            sbPricing.Append("             </tr> ").Append(Environment.NewLine);
            sbPricing.Append("             </table> ").Append(Environment.NewLine);

            if (entryType == Ektron.Cms.Common.EkEnumeration.CatalogEntryType.SubscriptionProduct)
            {

                Ektron.Cms.Common.RecurrenceType recurrenceType = Ektron.Cms.Common.RecurrenceType.MonthlyByDay;
                int recurrenceInterval = 1;

                if (pricing.IsRecurringPrice)
                {

                    recurrenceType = pricing.Recurrence.RecurrenceType;
                    recurrenceInterval = pricing.Recurrence.Intervals;

                }

                sbPricing.Append(" 		                            <input class=\"EktronRecurringPricingEditStatus\" type=\"hidden\" value=\"").Append(pricing.IsRecurringPrice ? "true" : "false").Append("\" />").Append(Environment.NewLine);
                sbPricing.Append(" 		                            <input class=\"EktronRecurringPricingMode\" type=\"hidden\" value=\"").Append(Mode.ToString()).Append("\" />").Append(Environment.NewLine);

                sbPricing.Append(" 		                            <table class=\"ektron_RecurringPricing_Table\" summary=\"").Append(m_WorkAreaBase.GetMessage("lbl recurring billing data")).Append("\"> ").Append(Environment.NewLine);
                sbPricing.Append(" 			                            <colgroup> ").Append(Environment.NewLine);
                sbPricing.Append(" 				                            <col class=\"narrowCol\"/> ").Append(Environment.NewLine);
                sbPricing.Append(" 				                            <col class=\"wideCol\" /> ").Append(Environment.NewLine);
                sbPricing.Append(" 			                            </colgroup> ").Append(Environment.NewLine);
                sbPricing.Append(" 			                            <thead> ").Append(Environment.NewLine);
                sbPricing.Append(" 				                            <tr> ").Append(Environment.NewLine);
                sbPricing.Append(" 					                            <th colspan=\"2\" class=\"alignLeft noBorderRight\"> ").Append(Environment.NewLine);
                sbPricing.Append(" 						                            ").Append(m_WorkAreaBase.GetMessage("lbl recurring billing")).Append(" ").Append(Environment.NewLine);
                sbPricing.Append(" 					                            </th> ").Append(Environment.NewLine);
                sbPricing.Append(" 				                            </tr> ").Append(Environment.NewLine);
                sbPricing.Append(" 			                            </thead> ").Append(Environment.NewLine);
                sbPricing.Append(" 			                            <tbody> ").Append(Environment.NewLine);

                ///''''''''''''''''''''''''''''''''''''''''
                //Row: Use Recurrent Billing
                sbPricing.Append(" 				                            <tr>").Append(Environment.NewLine);
                sbPricing.Append(" 					                            <th> ").Append(Environment.NewLine);
                sbPricing.Append(" 						                            <img src=\"").Append(m_WorkAreaBase.AppImgPath).Append("commerce/about.gif\" alt=\"").Append(m_WorkAreaBase.GetMessage("lbl use recurrent billing")).Append("\" title=\"").Append(m_WorkAreaBase.GetMessage("lbl use recurrent billing")).Append("\" class=\"moreInfo\" /> ").Append(Environment.NewLine);
                sbPricing.Append(" 						                            <label for=\"PricingTabRecurringBillingUseRecurrentBilling").Append("\">").Append(m_WorkAreaBase.GetMessage("lbl use recurrent billing")).Append(":</label> ").Append(Environment.NewLine);
                sbPricing.Append(" 					                            </th> ").Append(Environment.NewLine);
                sbPricing.Append(" 					                            <td> ").Append(Environment.NewLine);
                if (Mode == ModeType.View)
                {
                    sbPricing.Append(" 						                            <span id=\"PricingTabRecurringBillingUseRecurrentBilling\">").Append(Environment.NewLine);
                    sbPricing.Append(pricing.IsRecurringPrice ? "Yes" : "No");
                    sbPricing.Append("                                                  </span> ").Append(Environment.NewLine);
                }
                else
                {
                    sbPricing.Append(" 						                            <select class=\"recurringBilling\" onchange=\"Ektron.Commerce.Pricing.floatRecurring(this);\" name=\"PricingTabRecurringBillingUseRecurrentBilling\" id=\"PricingTabRecurringBillingUseRecurrentBilling\">").Append(Environment.NewLine);
                    sbPricing.Append(" 						                                <option value=\"true\"").Append(pricing.IsRecurringPrice ? "selected=\"selected\"" : "").Append(">Yes</option>").Append(Environment.NewLine);
                    sbPricing.Append(" 						                                <option value=\"false\"").Append(pricing.IsRecurringPrice ? "" : "selected=\"selected\"").Append(">No</option>").Append(Environment.NewLine);
                    sbPricing.Append("                                                  </span> ").Append(Environment.NewLine);
                }
                sbPricing.Append(" 					                            </td> ").Append(Environment.NewLine);
                sbPricing.Append(" 				                            </tr> ").Append(Environment.NewLine);

                ///''''''''''''''''''''''''''''''''''''''''
                //Row: Billing Cycle
                sbPricing.Append(" 				                            <tr class=\"billingCycle stripe\">").Append(Environment.NewLine);
                sbPricing.Append(" 					                            <th>").Append(Environment.NewLine);
                sbPricing.Append(" 						                            <img src=\"").Append(m_WorkAreaBase.AppImgPath).Append("commerce/about.gif\" alt=\"").Append(m_WorkAreaBase.GetMessage("lbl billing cycle")).Append("\" title=\"").Append(m_WorkAreaBase.GetMessage("lbl billing cycle desc")).Append("\" class=\"moreInfo\" /> ").Append(Environment.NewLine);
                sbPricing.Append(" 						                            <label for=\"PricingTabRecurringBillingBillingCycle").Append("\" class=\"billingCycle\">").Append(m_WorkAreaBase.GetMessage("lbl billing cycle")).Append(":</label> ").Append(Environment.NewLine);
                sbPricing.Append(" 					                            </th>").Append(Environment.NewLine);
                sbPricing.Append(" 					                            <td>").Append(Environment.NewLine);
                if (Mode == ModeType.View)
                {
                    sbPricing.Append(" 						                            <span id=\"PricingTabRecurringBillingBillingCycle\">").Append(Environment.NewLine);
                    sbPricing.Append(recurrenceType == Ektron.Cms.Common.RecurrenceType.MonthlyByDay ? "Monthly" : "");
                    sbPricing.Append(recurrenceType == Ektron.Cms.Common.RecurrenceType.Yearly ? "Yearly" : "");
                }
                else
                {
                    sbPricing.Append(" 						                            <select id=\"PricingTabRecurringBillingBillingCycle\" name=\"PricingTabRecurringBillingBillingCycle\" ").Append(this.GetEnabled(Mode, pricing)).Append(" /> ").Append(Environment.NewLine);
                    sbPricing.Append("                                                      <option value=\"month\"").Append(recurrenceType == Ektron.Cms.Common.RecurrenceType.MonthlyByDay ? " SELECTED " : "").Append(">Monthly</option>");
                    sbPricing.Append("                                                      <option value=\"year\"").Append(recurrenceType == Ektron.Cms.Common.RecurrenceType.Yearly ? " SELECTED " : "").Append(">Yearly</option>");
                    sbPricing.Append("                                                  </select>").Append(Environment.NewLine);
                }
                sbPricing.Append(" 					                            </td> ").Append(Environment.NewLine);
                sbPricing.Append(" 				                            </tr>").Append(Environment.NewLine);

                ///''''''''''''''''''''''''''''''''''''''''
                //Row: Interval
                sbPricing.Append(" 				                            <tr class=\"interval\">").Append(Environment.NewLine);
                sbPricing.Append(" 					                            <th>").Append(Environment.NewLine);
                sbPricing.Append(" 						                            <img src=\"").Append(m_WorkAreaBase.AppImgPath).Append("commerce/about.gif\" alt=\"").Append(m_WorkAreaBase.GetMessage("lbl billing intervals")).Append("\" title=\"").Append(m_WorkAreaBase.GetMessage("lbl billing intervals desc")).Append("\" class=\"moreInfo\" /> ").Append(Environment.NewLine);
                sbPricing.Append(" 						                            <label for=\"PricingTabRecurringBillingInterval").Append("\" class=\"StartDate\">").Append(m_WorkAreaBase.GetMessage("lbl billing intervals")).Append(":</label> ").Append(Environment.NewLine);
                sbPricing.Append(" 					                            </th>").Append(Environment.NewLine);
                sbPricing.Append(" 					                            <td>").Append(Environment.NewLine);
                sbPricing.Append(" 						                            <input maxlength=\"8\" type=\"text\" class=\"interval\" ").Append(this.GetEnabled(Mode, pricing)).Append(" name=\"PricingTabRecurringBillingInterval\" title=\"Select Interval\" id=\"PricingTabRecurringBillingInterval\" value=\"" + recurrenceInterval + "\" />").Append(Environment.NewLine);
                sbPricing.Append(" 					                                <span class=\"intervalRequired\">* must be numeric</span> ").Append(Environment.NewLine);
                sbPricing.Append(" 					                            </td> ").Append(Environment.NewLine);
                sbPricing.Append(" 				                            </tr> ").Append(Environment.NewLine);

                sbPricing.Append(" 			                            </tbody> ").Append(Environment.NewLine);
                sbPricing.Append(" 		                            </table> ").Append(Environment.NewLine);

                if (!(Mode == ModeType.View))
                {

                    sbPricing.Append("                                  <div class=\"finish\"> ").Append(Environment.NewLine);
                    sbPricing.Append(" 		                            <h3>").Append(m_WorkAreaBase.GetMessage("lbl important")).Append("</h3> ").Append(Environment.NewLine);
                    sbPricing.Append(" 		                            <div class=\"innerWrapper\"> ").Append(Environment.NewLine);
                    sbPricing.Append(" 		                            <p><span>").Append(m_WorkAreaBase.GetMessage("lbl recurring billing test")).Append("</span></p> ").Append(Environment.NewLine);
                    sbPricing.Append(" 		                            </div> ").Append(Environment.NewLine);
                    sbPricing.Append(" 		                            </div> ").Append(Environment.NewLine);

                }

            }

            return sbPricing.ToString();
        }
 private ModelInfo CreateNewModelInfo(Type type, ModeType appMode)
 {
     return CreateNewModelInfo(type, null, appMode);
 }
Beispiel #18
0
 private void BtnModeWIM_OnClick(object sender, RoutedEventArgs e)
 {
     CurrentMode = ModeType.Main;
 }
Beispiel #19
0
 private void BtnModeREG_OnClick(object sender, RoutedEventArgs e)
 {
     CurrentMode = ModeType.REG;
 }
Beispiel #20
0
 private void BtnModeAIO_OnClick(object sender, RoutedEventArgs e)
 {
     CurrentMode = ModeType.AIO;
 }
 public override void OnTriggerDown(Transform controller, int controllerIndex)
 {
     base.OnTriggerDown(controller, controllerIndex);
     mode = Mode.mode;
     HandleTriggerDown(controller, controllerIndex);
 }
Beispiel #22
0
 /// <summary>
 /// Checks if the specified phonetic shape matches this environment.
 /// </summary>
 /// <param name="leftNode">The left node.</param>
 /// <param name="rightNode">The right node.</param>
 /// <param name="mode">The mode.</param>
 /// <returns>
 ///     <c>true</c> if the specified left node is match; otherwise, <c>false</c>.
 /// </returns>
 public bool IsMatch(PhoneticShapeNode leftNode, PhoneticShapeNode rightNode, ModeType mode)
 {
     return(IsMatch(leftNode, rightNode, mode, new VariableValues()));
 }
Beispiel #23
0
        /// <summary>
        /// UI Selector of modes
        /// </summary>
        /// <param name="type"></param>
        protected void uiViewMode(ModeType type)
        {
            textEditor.config(logic.getCommonCfg(type));
            updateColors();
            tabPageCfgInterpreter.Enabled       = false;
            numericTimeLimit.Enabled            = false;
            tabPageCompilerCfg.Enabled          = false;
            textEditor.Enabled                  = true;
            checkBoxProcessHide.Enabled         = true;
            checkBoxOperationsAbort.Enabled     = false;
            checkBoxCommandsAbort.Enabled       = false;
            checkBoxSBEScriptSupport.Enabled    = true;
            updateTimeLimitField();
            updateCodeCompletionStatus();

            tabs(type);

            if(type == ModeType.Interpreter)
            {
                tabPageCommand.Text = "Command script for stream processor";
                tabPageCfgInterpreter.Enabled   = true;
                numericTimeLimit.Enabled        = true;
                return;
            }
            if(type == ModeType.File)
            {
                tabPageCommand.Text = "Files for execution (separated by enter key)";
                numericTimeLimit.Enabled = true;
                return;
            }
            if(type == ModeType.Script) {
                tabPageCommand.Text = "Script:";
                checkBoxSBEScriptSupport.Enabled = false;
                checkBoxSBEScriptSupport.Checked = true;
                checkBoxProcessHide.Enabled      = false;
                return;
            }
            if(type == ModeType.Targets) {
                tabPageCommand.Text = ".targets";
                if(textEditor.Text.Length < 1) {
                    textEditor.Text = Resource.StringDefaultValueForTargetsMode;
                }
                return;
            }
            if(type == ModeType.CSharp) {
                tabPageCommand.Text = "C# code";
                tabPageCompilerCfg.Enabled  = true;
                checkBoxProcessHide.Enabled = false;
                if(textEditor.Text.Length < 1) {
                    textEditor.Text = Resource.StringCSharpModeCodeByDefault;
                }
                return;
            }
            if(type == ModeType.Operation)
            {
                tabPageCommand.Text = "DTE execute (separated by enter key)";
                checkBoxOperationsAbort.Enabled = true;
                checkBoxProcessHide.Enabled     = false;
                return;
            }
            if(type == ModeType.EnvCommand)
            {
                checkBoxCommandsAbort.Enabled = true;
                checkBoxProcessHide.Enabled = false;
                return;
            }
        }
Beispiel #24
0
 /// <summary>
 /// Set the mode of the row to "Cancel", so it will generate cancel events
 /// </summary>
 public void SetCancel()
 {
     this.mode = ModeType.Cancel;
     this.AlterText("Cancel");
 }
        private ModelInfo GetModelInfoFromCache(Type type, ModeType appMode)
        {
            var store = ObjectBuilder.GetModelStore();

            return store.GetModel(type, appMode);
        }
Beispiel #26
0
 /// <summary>
 /// Sets the mode of the row to "Dismiss", so it will generate dismiss events
 /// </summary>
 public void SetDismiss()
 {
     this.mode = ModeType.Dismiss;
     this.AlterText("Dismiss");
 }
 /// <summary>
 /// Part of a SOAP model
 /// </summary>
 public Change(ModeType operation, string attrName, string attrValue)
     : base(attrName, attrValue)
 {
     Operation = operation;
 }
Beispiel #28
0
        /*public int Id { get; set; }
         * public int TripId { get; set; }
         * public int ModeId { get; set; }
         * public DateTime StartDate { get; set; }
         * public DateTime EndDate { get; set; }
         * public string FromName { get; set; }
         * public string FromStopCode { get; set; }
         * public int? FromProviderId { get; set; }
         * public string ToName { get; set; }
         * public string ToStopCode { get; set; }
         * public int? ToProviderId { get; set; }
         * public decimal Distance { get; set; }
         * public string RouteNumber { get; set; }
         *
         * public int Duration_sec()
         * {
         *      TimeSpan ts = EndDate - StartDate;
         *      int ts_min = (int)Math.Round (ts.TotalSeconds);
         *      return ts_min;
         * }
         *
         * public int Duration_min()
         * {
         *      TimeSpan ts = EndDate - StartDate;
         *      int ts_min = (int)Math.Round (ts.TotalMinutes);-
         *      return ts_min;
         * }*/
        private void UpdateView(Step step, View convertView, int position)
        {
            ImageView    ivIcon                      = convertView.FindViewById <ImageView> (Resource.Id.leg_list_item_iv_icon);
            TextView     tvStopName                  = convertView.FindViewById <TextView> (Resource.Id.leg_list_item_tv_stop_name);
            TextView     tvTime                      = convertView.FindViewById <TextView> (Resource.Id.leg_list_item_tv_time);
            TextView     tvDescription               = convertView.FindViewById <TextView> (Resource.Id.leg_list_item_tv_description);
            TextView     tvDetailsDepart_Time        = convertView.FindViewById <TextView> (Resource.Id.leg_list_item_tv_details_depart_time);
            TextView     tvDetailsDepart_Description = convertView.FindViewById <TextView> (Resource.Id.leg_list_item_tv_details_depart_description);
            TextView     tvDetailsArrive_Time        = convertView.FindViewById <TextView> (Resource.Id.leg_list_item_tv_details_arrive_time);
            TextView     tvDetailsArrive_Description = convertView.FindViewById <TextView> (Resource.Id.leg_list_item_tv_details_arrive_description);
            LinearLayout llDetails                   = convertView.FindViewById <LinearLayout> (Resource.Id.leg_list_item_details);

            if (selectedPosition == position)
            {
                llDetails.Visibility = ViewStates.Visible;
            }
            else
            {
                llDetails.Visibility = ViewStates.Gone;
            }

            string mode           = ModeType.IdToString(step.ModeId);
            string durationString = step.Duration_min().ToString() + " min";
            string stopName       = step.ToName;
            string toProvider     = "";
            int?   toProviderID   = step.ToProviderId;

            if (toProviderID != null)
            {
                toProvider = Providers.IdToString((int)toProviderID);
            }
            string agencyAndRoute  = toProvider + " " + step.RouteNumber;
            string boardingString  = "";
            string departString    = "";
            string startTimeString = "";
            string endTimeString   = "";
            int?   fromProviderID  = step.FromProviderId;
            string fromProvider    = "";

            if (fromProviderID != null)
            {
                fromProvider = Providers.IdToString((int)fromProviderID);
            }

            int modeImage;

            startTimeString = step.StartDate.ToLocalTime().ToString("t");
            endTimeString   = step.EndDate.ToLocalTime().ToString("t");
            if (mode.ToLower().Equals("walk"))
            {
                modeImage      = Resource.Drawable.walking_icon;
                agencyAndRoute = "Walk";
                boardingString = "Walk from " + step.FromName;
                departString   = "to " + step.ToName;
            }
            else if (mode.ToLower().Equals("rail"))
            {
                modeImage      = Resource.Drawable.rail_icon;
                boardingString = "Board " + fromProvider + " " + step.RouteNumber;
                departString   = "Depart at " + step.ToName;
            }
            else
            {
                modeImage      = Resource.Drawable.bus_icon;
                boardingString = "Board " + fromProvider + " " + step.RouteNumber;
                departString   = "Depart at " + step.ToName;
            }

            tvDetailsDepart_Description.Text = boardingString;
            tvDetailsDepart_Time.Text        = startTimeString;

            tvDetailsArrive_Description.Text = departString;
            tvDetailsArrive_Time.Text        = endTimeString;


            tvStopName.Text = stopName;
            ivIcon.SetImageResource(modeImage);
            tvTime.Text        = durationString;
            tvDescription.Text = agencyAndRoute;
        }
Beispiel #29
0
		bool ProcessIterative(PhoneticShape input, Direction dir, PhoneticPattern ptemp, ModeType mode)
		{
			bool reordered = false;
			PhoneticShapeNode node = input.GetFirst(dir);
			Match match;
			// iterate thru each match
			while (FindNextMatch(node, dir, ptemp, mode, out match))
			{
				// reorder the matching segments
				Reorder(dir, match);
				reordered = true;
				IList<PhoneticShapeNode> nodes = match.EntireMatch;
				node = nodes[nodes.Count - 1].GetNext(dir);
			}

			return reordered;
		}
Beispiel #30
0
 private void SaveScore(ModeType modeType)
 {
     ES3.Save <int>(SaveDataKeys.PreviousScore, CurrentScore.Value, SaveDataPaths.PuzzleDataPath);
 }
Beispiel #31
0
        public async Task <IEnumerable <Score> > GetScoresAsync(ModeType modeType)
        {
            var data = await _jSRuntime.InvokeAsync <string>("localStorage.getItem", Key(modeType)).ConfigureAwait(false);

            return(data == null ? new List <Score>() : JsonSerializer.Deserialize <IEnumerable <Score> >(data));
        }
Beispiel #32
0
 protected void Initialise(ModeType givenModeType)
 {
     m_mode = givenModeType;
     SetSize(10, 10);
 }
 public PwMatchCommand(ModeType mode)
 {
     Mode = mode;
     Options = new List<VoteOption>();
     DefenderFactions = new List<string>();
 }
Beispiel #34
0
        /// <summary>
        /// 创建项目
        /// </summary>
        /// <param name="_chooseFolderPath">用户选择的路径</param>
        /// <param name="_projectName">项目的名字</param>
        /// <param name="_modeType">项目的模式</param>
        /// <returns>是否创建成功?</returns>
        public bool CreateProject(string _chooseFolderPath, string _projectName, ModeType _modeType)
        {
            try
            {
                /* 判断文件夹是否存在 */
                DirectoryInfo _directoryInfo = new DirectoryInfo(_chooseFolderPath);//文件夹的信息
                if (_directoryInfo.Exists == false)
                {
                    return(false);
                }



                /* 去除ProjectName中的非法字符:
                 *  文件夹和文件的 名字中,不能包含:? * : " < > \ / |
                 *  并且,不能以空格开头*/
                string _projectFileName = StringTool.RemoveInvaildChat(_projectName);

                /* 如果项目名为空格,或者是去除了违规字符后为空 */
                if (_projectFileName == null || _projectFileName == "")
                {
                    //设置新的文件名字
                    _projectFileName = "New Bugs";
                }

                /*判断是否有相同的文件夹*/
                //判断是否有相同的文件夹(返回值是一个唯一的文件夹【xxxx/文件夹 (1)/】)
                string _onlyFolderPath = FolderTool.AvoidSameFolder(_chooseFolderPath + "/" + _projectFileName);
                //取到文件夹的名字(这个文件夹不会和任何文件夹重名)
                DirectoryInfo _onlyFolderInfo = new DirectoryInfo(_onlyFolderPath);
                _projectFileName = _onlyFolderInfo.Name;



                /* Project数据 */
                //创建ProjectData对象
                ProjectData _projectData = new ProjectData();
                _projectData.Id       = DateTimeTool.DateTimeToLong(DateTime.UtcNow, TimeFormatType.YearMonthDayHourMinuteSecondMillisecond);
                _projectData.Name     = _projectName;
                _projectData.FileName = _projectFileName;
                _projectData.ModeType = _modeType;

                //修改ProjectData属性
                ProjectData = _projectData;

                //工程文件夹的路径
                ProjectFolderPath = _chooseFolderPath + "\\" + _projectFileName;



                /* 创建文件和文件夹 */
                //创建:[项目文件夹]、[Bug文件夹]、[记录文件夹]、[图片文件夹]、[备份文件夹]
                CreateFolders();
                //创建:[项目文件]、[Bug文件]
                CreateFiles();



                /* 保存Project数据 */
                bool _isSave = SaveProject();
                if (_isSave == false)
                {
                    return(false);
                }


                /* 打开协同合作功能 */
                AppManager.Systems.CollaborationSystem.Handle(true);


                return(true);
            }
            catch (Exception e)
            {
                //输出错误
                AppManager.Uis.ErrorUi.UiControl.TipContent = e.ToString();
                AppManager.Uis.ErrorUi.OpenOrClose(true);
                return(false);
            }
        }
Beispiel #35
0
 /// <summary>
 /// 作者:Vincen
 /// 时间:2013.12.13
 /// 描述:生成缩略图
 /// </summary>
 /// <param name="imgPath">源图路径(物理路径)</param>
 /// <param name="savePath"></param>
 /// <param name="x">开始坐标(x轴)</param>
 /// <param name="y">开始坐标(y轴)</param>
 /// <param name="w">缩略图宽度</param>
 /// <param name="h">缩略图高度</param>
 /// <param name="mode">生成缩略图的方式</param>   
 public static void MakeThumbnail(string imgPath, string savePath, int x, int y, int w, int h, ModeType mode)
 {
     var img = Image.FromFile(imgPath);
     MakeThumbnail(img, savePath, x, y, w, h, mode);
 }
Beispiel #36
0
 public Topic(string topic, ModeType mode)
 {
     this.topic = topic;
     this.mode  = mode;
 }
Beispiel #37
0
 /// <summary>
 /// 作者:Vincen
 /// 时间:2013.12.13
 /// 描述:生成缩略图
 /// </summary>
 /// <param name="imgPath"></param>
 /// <param name="savePath"></param>
 /// <param name="w"></param>
 /// <param name="h"></param>
 /// <param name="mode"></param>
 /// <returns></returns>
 public static void MakeThumbnail(string imgPath, string savePath, int w, int h, ModeType mode)
 {
     MakeThumbnail(imgPath, savePath, 0, 0, w, h, mode);
 }
Beispiel #38
0
 public async Task <IEnumerable <Score> > GetScoresAsync(ModeType modeType)
 {
     return(await _localStorageService.GetScoresAsync(modeType));
 }
Beispiel #39
0
        protected void tabs(ModeType type)
        {
            hideTabPage(tabPageCommand, tabControlCfg);
            hideTabPage(tabPageEnvCmd, tabControlCfg);
            hideTabPage(tabPageOperations, tabControlCfg);

            switch(type) {
                case ModeType.EnvCommand: {
                    showTabPage(tabPageEnvCmd, 0, tabControlCfg);
                    return;
                }
                case ModeType.Operation: {
                    showTabPage(tabPageOperations, 0, tabControlCfg);
                    return;
                }
            }
            showTabPage(tabPageCommand, 0, tabControlCfg);
        }
Beispiel #40
0
        private void PopulateProperties()
        {
            base.RemovePropertyFromObjectDefinition("measures");

            _isCalculationGroup   = (_tomTable.CalculationGroup != null);
            _partitionsDefinition = "";
            _dataSourceName       = "";
            bool hasMQueryOrPolicyPartition = false;

            //Associate table with a DataSource if possible. It's not possible if calc table or if M expression refers to a shared expression, or multiple data sources
            foreach (Partition partition in _tomTable.Partitions)
            {
                _tableModeType = partition.Mode;
                if (partition.SourceType == PartitionSourceType.M)
                {
                    hasMQueryOrPolicyPartition = true;

                    //Check M dependency tree to see if all partitions refer only to a single DataSource
                    CalcDependencyCollection calcDependencies = _parentTabularModel.MDependencies.DependenciesReferenceFrom(CalcDependencyObjectType.Partition, _tomTable.Name, partition.Name);
                    if (calcDependencies.Count == 1 && calcDependencies[0].ReferencedObjectType == CalcDependencyObjectType.DataSource)
                    {
                        if (_dataSourceName == "")
                        {
                            _dataSourceName = calcDependencies[0].ReferencedObjectName;
                        }
                        else if (_dataSourceName != calcDependencies[0].ReferencedObjectName)
                        {
                            //Partition depends on a different DataSource to another partition in same table, so ensure no DataSource association for the table and stop iterating partitions.
                            _dataSourceName = "";
                            break;
                        }
                    }
                    else
                    {
                        //Partition has mutiple dependencies, or depends on an expression instead of DataSource, so ensure no DataSource association for the table and stop iterating partitions.
                        _dataSourceName = "";
                        break;
                    }
                }

                //If old partition, find the primary partition (first one) to determine DataSource. Technically it is possible for different partitions in the same table to point to different DataSources, but the Tabular Designer in VS doesn't support it. If set manually in .bim file, the UI still associates with the first partition (e.g. when processing table by itself, or deletinig the DataSource gives a warning message listing associated tables).
                if (partition.SourceType == PartitionSourceType.Query)
                {
                    hasMQueryOrPolicyPartition = true;
                    _dataSourceName            = ((QueryPartitionSource)partition.Source).DataSource.Name;
                    break;
                }

                //Might be a policy partition.
                if (partition.SourceType == PartitionSourceType.PolicyRange)
                {
                    hasMQueryOrPolicyPartition = true;
                    break;
                }
            }

            if (hasMQueryOrPolicyPartition || _isCalculationGroup)
            {
                _partitionsDefinition = base.RetrievePropertyFromObjectDefinition("partitions");

                //Option to hide partitions only applies to M, query and policy partitions (calculated tables hold dax defintitions in their partitions)
                if (!_parentTabularModel.ComparisonInfo.OptionsInfo.OptionPartitions)
                {
                    base.RemovePropertyFromObjectDefinition("partitions");
                }
            }

            //Find table relationships
            foreach (Tom.Relationship relationship in _tomTable.Model.Relationships)
            {
                if (relationship.FromTable.Name == _tomTable.Name && relationship.Type == RelationshipType.SingleColumn)  //currently only support single column
                {
                    _relationships.Add(new Relationship(this, (SingleColumnRelationship)relationship));
                }
            }

            //Find measures
            foreach (Tom.Measure measure in _tomTable.Measures)
            {
                _measures.Add(new Measure(this, measure, measure.KPI != null));
            }

            //Find calc items
            if (_isCalculationGroup)
            {
                foreach (Tom.CalculationItem calcItem in _tomTable.CalculationGroup.CalculationItems)
                {
                    _calculationItems.Add(new CalculationItem(this, calcItem));
                }
            }
        }
Beispiel #41
0
 /// <summary>
 /// Checks if the specified phonetic shape node matches this phonetic pattern node.
 /// </summary>
 /// <param name="node">The phonetic shape node.</param>
 /// <param name="dir">The direction.</param>
 /// <param name="mode">The mode.</param>
 /// <param name="isTarget">if <c>true</c> the phonetic pattern is a target.</param>
 /// <param name="instantiatedVars">The instantiated variables.</param>
 /// <returns>All matches.</returns>
 internal abstract IList <Match> Match(PhoneticShapeNode node, Direction dir, ModeType mode,
                                       VariableValues instantiatedVars);
 public CaseModel CreateCaseModel(string outCome, ModeType modeType, DateTime lastUpdated)
 {
     return(new CaseModel(_primaryKey.ToString(), outCome, modeType, lastUpdated));
 }
        private void SetModelInfoIntoCache(Type type, ModelInfo modelInfo, ModeType appMode)
        {
            var store = ObjectBuilder.GetModelStore();

            store.SetModel(type, modelInfo, appMode);
        }
Beispiel #44
0
        /// <summary>
        /// Converts the specified phonetic shape to a valid regular expression string. Regular expressions
        /// formatted for display purposes are NOT guaranteed to compile.
        /// </summary>
        /// <param name="shape">The phonetic shape.</param>
        /// <param name="mode">The mode.</param>
        /// <param name="displayFormat">if <c>true</c> the result will be formatted for display, otherwise
        /// it will be formatted for compilation.</param>
        /// <returns>The regular expression string.</returns>
        public string ToRegexString(PhoneticShape shape, ModeType mode, bool displayFormat)
        {
            StringBuilder sb = new StringBuilder();

            foreach (PhoneticShapeNode node in shape)
            {
                switch (node.Type)
                {
                case PhoneticShapeNode.NodeType.SEGMENT:
                    Segment seg = node as Segment;
                    IList <SegmentDefinition> segDefs = GetMatchingSegmentDefinitions(seg, mode);
                    if (segDefs.Count > 0)
                    {
                        if (segDefs.Count > 1)
                        {
                            sb.Append(displayFormat ? "[" : "(");
                        }
                        for (int i = 0; i < segDefs.Count; i++)
                        {
                            if (segDefs[i].StrRep.Length > 1)
                            {
                                sb.Append("(");
                            }

                            if (displayFormat)
                            {
                                sb.Append(segDefs[i].StrRep);
                            }
                            else
                            {
                                sb.Append(Regex.Escape(segDefs[i].StrRep));
                            }

                            if (segDefs[i].StrRep.Length > 1)
                            {
                                sb.Append(")");
                            }
                            if (i < segDefs.Count - 1 && !displayFormat)
                            {
                                sb.Append("|");
                            }
                        }
                        if (segDefs.Count > 1)
                        {
                            sb.Append(displayFormat ? "]" : ")");
                        }

                        if (seg.IsOptional)
                        {
                            sb.Append("?");
                        }
                    }
                    break;

                case PhoneticShapeNode.NodeType.BOUNDARY:
                    Boundary bdry = node as Boundary;
                    if (bdry.BoundaryDefinition.StrRep.Length > 1)
                    {
                        sb.Append("(");
                    }

                    if (displayFormat)
                    {
                        sb.Append(bdry.BoundaryDefinition.StrRep);
                    }
                    else
                    {
                        sb.Append(Regex.Escape(bdry.BoundaryDefinition.StrRep));
                    }

                    if (bdry.BoundaryDefinition.StrRep.Length > 1)
                    {
                        sb.Append(")");
                    }
                    sb.Append("?");
                    break;

                case PhoneticShapeNode.NodeType.MARGIN:
                    if (!displayFormat)
                    {
                        Margin margin = node as Margin;
                        sb.Append(margin.MarginType == Direction.LEFT ? "^" : "$");
                    }
                    break;
                }
            }
            return(sb.ToString());
        }
Beispiel #45
0
 public void SetModeType(ModeType givenMode)
 {
     currMode = givenMode;
 }
Beispiel #46
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BaseEnvelope"/> class.
 /// </summary>
 /// <param name="envelopeType">The envelope type.</param>
 /// <param name="attackTime">The envelope attack time (ms).</param>
 /// <param name="decayTime">The envelope decay time (ms).</param>
 /// <param name="sustainLevel">The envelope sustain level (0-1).</param>
 /// <param name="releaseTime">The envelope release time (ms).</param>
 /// <param name="mode">The envelope mode.</param>
 protected BaseEnvelope(EnvelopeType envelopeType = EnvelopeType.ADSR, double attackTime = 200, double decayTime = 50, float sustainLevel = .01f, double releaseTime = 400, ModeType mode = ModeType.ANALOG)
 {
     this.Type         = envelopeType;
     this.AttackTime   = attackTime;
     this.DecayTime    = decayTime;
     this.SustainLevel = sustainLevel;
     this.ReleaseTime  = releaseTime;
     this.Mode         = mode;
 }
	public void SetViewMode (ModeType value)
	{
		if (view_mode == value)
			return;

		view_mode = value;
		switch (view_mode) {
		case ModeType.IconView:
			if (view_notebook.CurrentPage != 0)
				view_notebook.CurrentPage = 0;

			display_timeline.Sensitive = true;
			display_filmstrip.Sensitive = false;
			group_selector.Visible = display_timeline.Active;

			if (photo_view.View.Loupe != null)
				loupe_menu_item.Active = false;
			JumpTo (photo_view.Item.Index);
			zoom_scale.Value = icon_view.Zoom;
			break;
		case ModeType.PhotoView:
			if (view_notebook.CurrentPage != 1)
				view_notebook.CurrentPage = 1;

			display_timeline.Sensitive = false;
			display_filmstrip.Sensitive = true;
			group_selector.Visible = false;
			
			JumpTo (icon_view.FocusCell);
			zoom_scale.Value = photo_view.NormalizedZoom;
			break;
		}
		Selection.MarkChanged ();
		UpdateToolbar ();
		if (ViewModeChanged != null) 
			ViewModeChanged (this, null);
	}
 private void btnHuy_Click(object sender, EventArgs e)
 {
     m_Mode = ModeType.Cancel;
     Close();
 }
Beispiel #49
0
        protected bool actionBy(ModeType type, ISolutionEvent evt)
        {
            if(evt.Process.Waiting) {
                return actions[type].process(evt);
            }

            string marker = null;
            //if(Thread.CurrentThread.Name == Events.LoggingEvent.IDENT_TH) {
            //    marker = Events.LoggingEvent.IDENT_TH;
            //}

            (new Task(() => {

                if(marker != null && Thread.CurrentThread.Name != marker) {
                    Thread.CurrentThread.Name = marker;
                }
                Log.Trace("Task for another thread is started for '{0}' /{1}", evt.Name, type);
                actions[type].process(evt);

            })).Start();

            return true;
        }
Beispiel #50
0
 public bool IsMatch(PhoneticShapeNode node, Direction dir, ModeType mode, out IList <Match> matches)
 {
     return(IsMatch(node, dir, mode, new VariableValues(), out matches));
 }
Beispiel #51
0
		bool FindNextMatch(PhoneticShapeNode node, Direction dir, PhoneticPattern ptemp, ModeType mode,
			out Match match)
		{
			for (; node != node.Owner.GetLast(dir); node = node.GetNext(dir))
			{
				if (mode == ModeType.ANALYSIS && node.Type == PhoneticShapeNode.NodeType.BOUNDARY)
					continue;

				IList<Match> matches;
				if (ptemp.IsMatch(node, dir, mode, out matches))
				{
					match = matches[0];
					return true;
				}
			}

			match = null;
			return false;
		}
Beispiel #52
0
 private static void Initialize()
 {
     mode = ModeType.Vertex;
 }
Beispiel #53
0
 private static string Key(ModeType modeType) => modeType == ModeType.Standard ? ScoresKey : $"{ScoresKey}|{modeType}";
 public PwMatchCommand(ModeType mode)
 {
     Mode             = mode;
     Options          = new List <VoteOption>();
     DefenderFactions = new List <string>();
 }
Beispiel #55
0
 private void modes_SelectedIndexChanged(object sender, EventArgs e)
 {
     mode = modes.SelectedIndex;
     if (mode == (int)ModeType.fireAll)
         Mode = ModeType.fireAll;
     else if (mode == (int)ModeType.fireFoes)
         Mode = ModeType.fireFoes;
     else
         Mode = ModeType.fireFriends;
 }
		/// <summary>
		/// Generates a string representation of the specified phonetic shape.
		/// </summary>
		/// <param name="shape">The phonetic shape.</param>
		/// <param name="mode">The mode.</param>
		/// <param name="includeBdry">if <c>true</c> boundary markers will be included in the
		/// string representation.</param>
		/// <returns>The string representation.</returns>
		public string ToString(PhoneticShape shape, ModeType mode, bool includeBdry)
		{
			StringBuilder sb = new StringBuilder();
			foreach (PhoneticShapeNode node in shape)
			{
				switch (node.Type)
				{
					case PhoneticShapeNode.NodeType.SEGMENT:
						Segment seg = node as Segment;
						IList<SegmentDefinition> segDefs = GetMatchingSegmentDefinitions(seg, mode);
						if (segDefs.Count > 0)
							sb.Append(segDefs[0].StrRep);
						break;

					case PhoneticShapeNode.NodeType.BOUNDARY:
						if (includeBdry)
						{
							Boundary bdry = node as Boundary;
							sb.Append(bdry.BoundaryDefinition.StrRep);
						}
						break;
				}
			}
			return sb.ToString();
		}
			public bool MatchEnvEmpty(PhoneticShapeNode node, Direction dir, ModeType mode,
				VariableValues instantiatedVars)
			{
				PhoneticShapeNode leftNode = null;
				PhoneticShapeNode rightNode = null;
				switch (dir)
				{
					case Direction.LEFT:
						rightNode = node;
						leftNode = node.GetNext(Direction.LEFT);
						break;

					case Direction.RIGHT:
						rightNode = node.GetNext(Direction.RIGHT);
						leftNode = node;
						break;
				}

				// in case this is an epenthesis rule, we want to ensure that the segment to the right
				// of where we're going to do the epenthesis is not a boundary marker, unless the
				// environment calls for one.
				if (mode == ModeType.SYNTHESIS && m_env.RightEnvironment != null && m_env.RightEnvironment.Count > 0)
				{
					if (rightNode.Type == PhoneticShapeNode.NodeType.BOUNDARY
							&& m_env.RightEnvironment.First.Type != PhoneticPatternNode.NodeType.BDRY_CTXT)
						return false;
				}

				// there is a small difference between legacy HC and HC.NET in matching environments when the
				// analysis target is empty and one of the environments is empty. In this case, legacy HC does
				// not try to skip the initial optional segments when matching the right environment. I think
				// this will cause HC.NET to overproduce a little more during analysis, which isn't that big of a
				// deal
				if (!m_env.IsMatch(leftNode, rightNode, mode, instantiatedVars))
					return false;

				// remove ambiguous variables
				instantiatedVars.RemoveAmbiguousVariables();

				return true;
			}
Beispiel #58
0
 public void SetModel(Type type, ModelInfo modelInfo, ModeType appMode)
 {
     InternalStorage.AddOrUpdate(GetKey(type, appMode), modelInfo, (type1, info) => info);
 }
Beispiel #59
0
        public static void SetMode(ModeType value)
        {
            ModeType oldMode = mode;

            mode = value;

            Mesh mesh = Meshes.GetSelectedMesh();

            if (!mesh)
            {
                return;
            }

            //Debug.Log("oldMode=" + oldMode + ",mode=" + mode);
            if (!Modes.noDelete.Contains(mode))
            {
                mesh.selection.ClearSelectedVertices();
                mesh.vertices.DeleteVertexInstances();
                mesh.triangles.DeleteTriangleInstances();
                mesh.alignmentTools.SetActiveCollidersOnAlignmentTools(false);
                mesh.SetRenderOptions(true, true, true);
                mesh.triangles.autoCreateTriangleObjects = false;
                mesh.triangles.SetTriangleInstancesSelectable(true);
            }

            if (mode != ModeType.SelectVerticesByTriangles)
            {
                mesh.vertices.SetVertexInstancesSelectable(true);
            }

            switch (mode)
            {
            case ModeType.AlignmentDelete:
                mesh.alignmentTools.SetActiveCollidersOnAlignmentTools(true);
                if (OnModeChanged != null)
                {
                    OnModeChanged();
                }
                return;

            case ModeType.Settings:
                mode = oldMode;
                if (OnModeChanged != null)
                {
                    OnModeChanged();
                }
                return;

            case ModeType.Tools:
                mode = oldMode;
                if (OnModeChanged != null)
                {
                    OnModeChanged();
                }
                return;

            case ModeType.Open:
                mode = oldMode;
                if (OnModeChanged != null)
                {
                    OnModeChanged();
                }
                return;

            case ModeType.SaveAs:
                //meshController.keyboardPanelController.ToggleVisible();

                mode = oldMode;
                if (OnModeChanged != null)
                {
                    OnModeChanged();
                }
                return;

            case ModeType.DeselectAll:
                mesh.selection.Clear();
                mesh.copy.Clear();
                mode = oldMode;
                if (OnModeChanged != null)
                {
                    OnModeChanged();
                }
                return;

            case ModeType.Vertex:
            case ModeType.Face:
            case ModeType.Delete:
                mesh.vertices.CreateVertexInstances();
                break;

            case ModeType.PrimitiveSphere:
            case ModeType.PrimitiveCircle:
            case ModeType.PrimitiveCylinder:
            case ModeType.PrimitivePlane:
            case ModeType.PrimitiveBox:
                mesh.vertices.CreateVertexInstances();
                mesh.triangles.autoCreateTriangleObjects = true;
                mesh.SetRenderOptions(false, false, false);
                mesh.triangles.SetTriangleInstancesSelectable(false);
                mesh.triangles.CreateTriangleInstances();
                break;

            case ModeType.SelectVertices:
                mesh.vertices.CreateVertexInstances(false);
                mesh.triangles.SetTriangleInstancesSelectable(false);
                mesh.triangles.CreateTriangleInstances();
                mesh.SetRenderOptions(false, false, false);
                break;

            case ModeType.SelectVerticesByTriangles:
                mesh.vertices.SetVertexInstancesSelectable(false);
                mesh.vertices.CreateVertexInstances(false);
                mesh.triangles.SetTriangleInstancesSelectable(true);
                mesh.triangles.CreateTriangleInstances();
                mesh.SetRenderOptions(false, false, false);
                break;

            case ModeType.BoxSelect:
                mesh.vertices.CreateVertexInstances(false);
                mesh.triangles.autoCreateTriangleObjects = true;
                mesh.triangles.SetTriangleInstancesSelectable(false);
                mesh.triangles.CreateTriangleInstances();
                mesh.SetRenderOptions(false, false, false);
                break;

            case ModeType.Normal:
            case ModeType.Fill:
            case ModeType.TriangleDelete:
            case ModeType.SelectTriangles:
            case ModeType.PickColor:
                mesh.SetRenderOptions(false, false, false);
                mesh.triangles.CreateTriangleInstances();
                break;
            }

            if (!Modes.noSelectionClear.Contains(mode))
            {
                mesh.selection.Clear();
                mesh.copy.Clear();
            }


            if (Modes.endingInTriangleSelection.Contains(oldMode) && !Modes.noTriangleSelectionClear.Contains(mode))
            {
                mesh.selection.Clear();
                mesh.copy.Clear();
            }

            if (Modes.endingInSelection.Contains(oldMode) && mode == ModeType.DeleteSelection)
            {
                mesh.selection.DeleteSelected();
                mesh.triangles.DeleteTriangleInstances(); // This shouldn't be necessary, but there is a bug somewhere
                mesh.triangles.SetTriangleInstancesSelectable(false);
                mesh.triangles.CreateTriangleInstances(); // ditto
                mesh.SetRenderOptions(false, false, false);
                mode = ModeType.SelectVertices;
            }

            if ((Modes.endingInSelection.Contains(oldMode) || Modes.endingInTriangleSelection.Contains(oldMode)) && mode == ModeType.FillSelection)
            {
                mesh.selection.FillSelected();
                mesh.SetRenderOptions(false, false, false);
                mode = (oldMode == ModeType.SelectTriangles) ? ModeType.SelectTriangles : ModeType.SelectVertices;
            }

            if (Modes.endingInSelection.Contains(oldMode) && mode == ModeType.Extrude)
            {
                mesh.extrusion.ExtrudeSelected(true);
                mesh.SetRenderOptions(false, false, false);
                mesh.triangles.SetTriangleInstancesSelectable(false);
                mode = ModeType.SelectVertices;
            }

            if (oldMode == ModeType.SelectVertices && mode == ModeType.MergeVertices)
            {
                mesh.vertices.MergeSelected();
                mesh.SetRenderOptions(false, false, false);
                mode = ModeType.SelectVertices;
            }

            if ((Modes.endingInSelection.Contains(oldMode) || Modes.endingInTriangleSelection.Contains(oldMode)) && mode == ModeType.SelectionFlipNormal)
            {
                mesh.triangles.FlipNormalsOfSelection();
                mesh.SetRenderOptions(false, false, false);
                mode = (oldMode == ModeType.SelectTriangles) ? ModeType.SelectTriangles : ModeType.SelectVertices;
            }

            if (Modes.endingInSelection.Contains(oldMode) && mode == ModeType.Copy)
            {
                mesh.copy.CopySelection();
                mesh.SetRenderOptions(false, false, false);
                mode = ModeType.SelectVertices;
            }

            if (Modes.endingInSelection.Contains(oldMode) && mode == ModeType.Paste)
            {
                mesh.selection.Clear();
                mesh.triangles.autoCreateTriangleObjects = true;
                mesh.copy.Paste();
                mesh.SetRenderOptions(false, false, false);
                mode = ModeType.SelectVertices;
            }

            if (oldMode != ModeType.Object && mode == ModeType.Object)
            {
                mesh.triangles.trianglesChanged = true;
                mesh.EnableBoxCollider();
            }

            if (oldMode == ModeType.Object && mode != ModeType.Object)
            {
                mesh.DisableBoxCollider();
            }
            if (OnModeChanged != null)
            {
                OnModeChanged();
            }
        }
Beispiel #60
0
 public bool IsMatch(PhoneticShapeNode node, Direction dir, ModeType mode)
 {
     return(IsMatch(node, dir, mode, new VariableValues()));
 }