示例#1
0
        protected override void CustomSort(int ColumnIndex)
        {
            if (OldColumnIndex != ColumnIndex)
            {
                SortDirection = SortDirection.Asc;
            }
            if (SortDirection == SortDirection.Desc)
            {
                SortDirection = SortDirection.Asc;
            }
            else
            {
                SortDirection = SortDirection.Desc;
            }

            var resultList = new List <Directive>();
            var list       = radGridView1.Rows.Select(i => i).ToList();

            list.Sort(new DirectiveGridViewDataRowInfoComparer(ColumnIndex, Convert.ToInt32(SortDirection)));

            foreach (var item in list)
            {
                resultList.Add(item.Tag as Directive);
            }

            SetItemsArray(resultList.ToArray());
            OldColumnIndex = ColumnIndex;
        }
示例#2
0
        protected override void CustomSort(int ColumnIndex)
        {
            if (OldColumnIndex != ColumnIndex)
            {
                SortDirection = SortDirection.Asc;
            }
            if (SortDirection == SortDirection.Desc)
            {
                SortDirection = SortDirection.Asc;
            }
            else
            {
                SortDirection = SortDirection.Desc;
            }

            OldColumnIndex = ColumnIndex;
            var resultList = new List <NextPerformance>();
            var list       = radGridView1.Rows.Select(i => i).ToList();

            list.Sort(new GridViewDataRowInfoComparer(ColumnIndex, Convert.ToInt32(SortDirection)));

            resultList.AddRange(list.Select(i => i.Tag as NextPerformance));

            SetItemsArray(resultList.ToArray());
        }
示例#3
0
        /// <summary>
        /// Initilze Rendering
        /// </summary>
        /// <param name="rendering">Rendering to Initialze
        /// </param>
        public void Initialize(Rendering rendering)
        {
            if (string.IsNullOrEmpty(rendering.DataSource))
            {
                return;
            }

            var datasource = Context.Database.GetItem(rendering.DataSource);

            BackgroundImageUrl = datasource.ImageUrl(FieldConstants.Banner.BackgroundImage.ToString());

            TitleColor    = datasource[FieldConstants.Banner.TitleColor];
            SubTitleColor = datasource[FieldConstants.Banner.SubtitleColor];
            LinkColor     = datasource[FieldConstants.Banner.LinkColor];
            var y = double.Parse(datasource[FieldConstants.Banner.LogoTop]);

            LogoTop = Convert.ToInt32(30 * y);
            var x = double.Parse(datasource[FieldConstants.Banner.LogoLeft]);

            LogoLeft = Convert.ToInt32(8 * x);
            var bannerHeightValue = datasource[FieldConstants.Banner.BannerHeight];

            if (bannerHeightValue == null)
            {
                return;
            }

            var z = double.Parse(bannerHeightValue);

            BannerHeight = Convert.ToInt32(z * 100);
        }
示例#4
0
        /// <summary>
        /// Creates the arm.
        /// </summary>
        /// <returns>The arm.</returns>
        /// <param name="side">Side.</param>
        public static IList <IJoint> CreateArm(Side side)
        {
            int handY           = -50;
            int wristX          = 50;
            int wristY          = 0;
            int elbowX          = 75;
            int elbowY          = 218;
            int shoulderX       = 160;
            var handOrientation = new Vector4(0, 0, 0, 0);

            var arm = new List <IJoint>();

            var shoulder = new OrientedJoint();
            var elbow    = new OrientedJoint();
            var wrist    = new OrientedJoint();
            var hand     = new HandJoint();

            if (side == Side.LEFT)
            {
                shoulder.JointType = JointType.SHOULDER_LEFT;
                elbow.JointType    = JointType.ELBOW_LEFT;
                wrist.JointType    = JointType.WRIST_LEFT;
                hand.JointType     = JointType.HAND_LEFT;
            }
            else
            {
                shoulder.JointType = JointType.SHOULDER_RIGHT;
                elbow.JointType    = JointType.ELBOW_RIGHT;
                wrist.JointType    = JointType.WRIST_RIGHT;
                hand.JointType     = JointType.HAND_RIGHT;
            }

            int s = Convert.ToInt32(side);

            // shoulders relative to neck
            shoulder.Point = new Vector3(s * shoulderX, 400, 0);
            shoulder.Valid = true;
            arm.Add(shoulder);

            // elbows relative to shoulders
            elbow.Point = new Vector3(s * (elbowX + shoulderX), elbowY, 0);
            elbow.Valid = true;
            arm.Add(elbow);

            wrist.Point = new Vector3(s * (wristX + shoulderX), wristY, 0);
            wrist.Valid = true;
            arm.Add(wrist);

            hand.Orientation = handOrientation * -s;
            hand.Point       = new Vector3(s * (wristX + shoulderX), handY, 0);
            hand.Valid       = true;
            arm.Add(hand);

            return(arm);
        }
        private void LoadVariables()
        {
            limit = Convert.ToInt32(GetConfig("Limit Settings", "Max Cupboard by player", "1"));

            if (!ConfigChanged)
            {
                return;
            }
            SaveConfig();
            ConfigChanged = false;
        }
示例#6
0
        /// <summary>
        /// Creates the leg.
        /// </summary>
        /// <returns>The leg.</returns>
        /// <param name="side">Side.</param>
        public static IList <IJoint> CreateLeg(Side side)
        {
            int footLength = 255;
            int ankleY     = -830;
            int kneeY      = -427;
            int hipX       = 50;
            int hipY       = -100;

            var leg = new List <IJoint>();

            var footOrientation = new Vector4(0, 0, 0, 0);

            var foot  = new OrientedJoint();
            var ankle = new OrientedJoint();
            var knee  = new OrientedJoint();
            var hip   = new OrientedJoint();

            if (side == Side.LEFT)
            {
                foot.JointType  = JointType.FOOT_LEFT;
                ankle.JointType = JointType.ANKLE_LEFT;
                knee.JointType  = JointType.KNEE_LEFT;
                hip.JointType   = JointType.HIP_LEFT;
            }
            else
            {
                foot.JointType  = JointType.FOOT_RIGHT;
                ankle.JointType = JointType.ANKLE_RIGHT;
                knee.JointType  = JointType.KNEE_RIGHT;
                hip.JointType   = JointType.HIP_RIGHT;
            }

            int s = Convert.ToInt32(side);

            hip.Point = new Vector3(s * hipX, hipY, 0);
            hip.Valid = true;
            leg.Add(hip);

            knee.Point = new Vector3(s * hipX, kneeY, 0);
            knee.Valid = true;
            leg.Add(knee);

            ankle.Point = new Vector3(s * hipX, ankleY, 0);
            ankle.Valid = true;
            leg.Add(ankle);

            foot.Orientation = footOrientation;
            foot.Point       = new Vector3(s * hipX, ankleY, -footLength);
            foot.Valid       = true;

            return(leg);
        }
示例#7
0
        void SerializeString(string aString, StringBuilder builder)
        {
            builder.Append("\"");

            char[] charArray = aString.ToCharArray();
            for (int i = 0; i < charArray.Length; i++)
            {
                char c = charArray[i];
                if (c == '"')
                {
                    builder.Append("\\\"");
                }
                else if (c == '\\')
                {
                    builder.Append("\\\\");
                }
                else if (c == '\b')
                {
                    builder.Append("\\b");
                }
                else if (c == '\f')
                {
                    builder.Append("\\f");
                }
                else if (c == '\n')
                {
                    builder.Append("\\n");
                }
                else if (c == '\r')
                {
                    builder.Append("\\r");
                }
                else if (c == '\t')
                {
                    builder.Append("\\t");
                }
                else
                {
                    int codepoint = Convert.ToInt32(c);
                    if ((codepoint >= 32) && (codepoint <= 126))
                    {
                        builder.Append(c);
                    }
                    else
                    {
                        builder.Append("\\u" + Convert.ToString(codepoint, 16).PadLeft(4, '0'));
                    }
                }
            }

            builder.Append("\"");
        }
示例#8
0
        public void ConvertXmlToJson()
        {
            var manufacturers = _xmlConverter.GetXml()
                                .Element("Manufacturers")
                                ?.Elements("Manufacturer")
                                .Select(m => new Manufacturer
            {
                City = m.Attribute("City")?.Value,
                Name = m.Attribute("Name")?.Value,
                Year = Convert.ToInt32(m.Attribute("Year")?.Value)
            });

            new CustomJsonConverter(manufacturers).ConvertToJson();
        }
示例#9
0
        public ActionResult Column()
        {
            var renderingParameters = RenderingContext.Current.Rendering.Parameters;
            var colNumberString     = renderingParameters["Col Number"];
            var size  = renderingParameters["size"];
            var model = new ColumnModel
            {
                ColumnNumber = Convert.ToInt32(colNumberString),
                Size         = size
            };


            return(View("~/Views/DynamicComponents/Layout/Column.cshtml", model));
        }
        public ActionResult Rendering()
        {
            var cart        = GetCart();
            var basketModel = new BasketRenderingViewModel();

            var currency = new Currency()
            {
                ISOCode = cart.CurrencyCode
            };

            foreach (var cartLine in cart.Lines)
            {
                var orderLineViewModel = new BasketRenderingViewModel.OrderlineViewModel();

                orderLineViewModel.Quantity    = (int)cartLine.Quantity;
                orderLineViewModel.ProductName = cartLine.Product.ProductName;
                orderLineViewModel.Sku         = cartLine.Product.ProductId;
                if (cartLine.GetPropertyValue("VariantSku") != null)
                {
                    orderLineViewModel.VariantSku = cartLine.GetPropertyValue("VariantSku").ToString();
                }
                orderLineViewModel.Total    = new Money(cartLine.Total.Amount, currency.ISOCode).ToString();
                orderLineViewModel.Discount = new Money(cartLine.Adjustments.Sum(x => x.Amount), currency.ISOCode).Value;
                if (cartLine.Total.TaxTotal != null)
                {
                    orderLineViewModel.Tax = new Money(cartLine.Total.TaxTotal.Amount, currency.ISOCode).ToString();
                }
                orderLineViewModel.Price      = new Money(cartLine.Product.Price.Amount, currency.ISOCode).ToString();
                orderLineViewModel.ProductUrl = _urlService.GetUrl(_catalogContext.CurrentCatalog,
                                                                   _catalogLibrary.GetProduct(cartLine.Product.ProductId));
                orderLineViewModel.PriceWithDiscount = new Money((cartLine.Product.Price.Amount - cartLine.Adjustments.Sum(x => x.Amount)), currency.ISOCode).ToString();
                orderLineViewModel.OrderLineId       = Convert.ToInt32(cartLine.ExternalCartLineId);

                basketModel.OrderLines.Add(orderLineViewModel);
            }

            basketModel.OrderTotal    = new Money(cart.Total.Amount, currency.ISOCode).ToString();
            basketModel.DiscountTotal = new Money(cart.Adjustments.Sum(x => x.Amount), currency.ISOCode).ToString();
            if (cart.Total.TaxTotal != null)
            {
                basketModel.TaxTotal = new Money(cart.Total.TaxTotal.Amount, currency.ISOCode).ToString();
            }
            basketModel.SubTotal = new Money((cart.Total.Amount - cart.Total.TaxTotal.Amount), currency.ISOCode).ToString();

            return(View(basketModel));
        }
示例#11
0
        private void LoadVariables()
        {
            /*Prefix = Convert.ToString(GetConfig("Chat Settings", "Prefix", "[My CH47] "));                       // CHAT PLUGIN PREFIX
             * PrefixColor = Convert.ToString(GetConfig("Chat Settings", "PrefixColor", "#149800"));                // CHAT PLUGIN PREFIX COLOR
             * ChatColor = Convert.ToString(GetConfig("Chat Settings", "ChatColor", "#bbffb1"));                    // CHAT MESSAGE COLOR
             * SteamIDIcon = Convert.ToUInt64(GetConfig("Chat Settings", "SteamIDIcon", "76561198332562475"));*/
            sound         = Convert.ToBoolean(GetConfig("Sound Settings", "play soundfx", "false"));
            bannerdisplay = Convert.ToBoolean(GetConfig("Banner Settings", "display banner", "false"));
            HUDfontsize   = Convert.ToInt32(GetConfig("HUD Settings", "font size", "10"));
            HUDcolor      = Convert.ToString(GetConfig("HUD Settings", "color on 3 firsts numbers - opacity on last number", "0.5 0.5 0.5 0.30"));
            bannercolor   = Convert.ToString(GetConfig("Banner Settings", "color on 3 firsts numbers - opacity on last number", "0.5 0.5 0.5 0.30"));

            if (!ConfigChanged)
            {
                return;
            }
            SaveConfig();
            ConfigChanged = false;
        }
        protected override void OnGUIValue()
        {
            char _value    = (char)CachedValue;
            var  str       = EditorGUILayout.TextField(_value.ToString(), GUILayout.ExpandWidth(true));
            var  intValue  = Convert.ToInt32(_value);
            var  intValue2 = EditorGUILayout.IntField(intValue, GUILayout.ExpandWidth(true));

            if (intValue2 != intValue)
            {
                SetValue((char)intValue2);
            }
            else if (str.Length > 0)
            {
                char val = str[0];
                if (val != _value)
                {
                    SetValue(val);
                }
            }
        }
        private void LoadVariables()
        {
            /*Prefix = Convert.ToString(GetConfig("Chat Settings", "Prefix", "[NightPVP] "));                       // CHAT PLUGIN PREFIX
             * PrefixColor = Convert.ToString(GetConfig("Chat Settings", "PrefixColor", "#bf0000"));                // CHAT PLUGIN PREFIX COLOR
             * ChatColor = Convert.ToString(GetConfig("Chat Settings", "ChatColor", "#dd8e8e"));                    // CHAT MESSAGE COLOR
             * SteamIDIcon = Convert.ToUInt64(GetConfig("Chat Settings", "SteamIDIcon", "76561198079320022")); */// SteamID FOR PLUGIN ICON - STEAM PROFILE CREATED FOR THIS PLUGIN / NONE YET /
            pvpcolor        = Convert.ToString(GetConfig("HUD COLOR", "for PVP", "0.6 0.2 0.2"));
            pvecolor        = Convert.ToString(GetConfig("HUD COLOR", "for PVE", "0.5 1.0 0.0"));
            pvpcoloropacity = Convert.ToString(GetConfig("HUD OPACITY", "for PVP", "0.5"));
            pvecoloropacity = Convert.ToString(GetConfig("HUD OPACITY", "for PVE", "0.4"));
            textsize        = Convert.ToInt32(GetConfig("HUD TEXT", "size", "12"));
            pvptextcolor    = Convert.ToString(GetConfig("HUD TEXT", "color for PVP", "1.0 1.0 1.0"));
            pvetextcolor    = Convert.ToString(GetConfig("HUD TEXT", "color for PVE", "1.0 1.0 1.0"));
            HUDleft         = Convert.ToDouble(GetConfig("HUD POSITION", "left", "0.65"));
            HUDbottom       = Convert.ToDouble(GetConfig("HUD COLOR", "bottom", "0.04"));

            if (!ConfigChanged)
            {
                return;
            }
            SaveConfig();
            ConfigChanged = false;
        }
示例#14
0
 private void Button_Click_1(object sender, RoutedEventArgs e)
 {
     TestClient.StartRecieveThread(Convert.ToInt32(portRecieve.Text));
     _readyTowork = true;
 }