Esempio n. 1
0
        /// <summary>
        /// Show Bulma Message
        /// </summary>
        /// <param name="jsRuntume"></param>
        /// <param name="target">selector where show the message</param>
        /// <param name="title">title for the message</param>
        /// <param name="message">message to show</param>
        /// <param name="timeout">timeout to out hide. 0 never hide</param>
        /// <returns></returns>
        public static async void BulmaMessageAsync(this IJSRuntime jsRuntume, BoxType type,
                                                   string target, string title, string message, int timeout)
        {
            switch (type)
            {
            case BoxType.Success:
                await jsRuntume.InvokeVoidAsync("$p.MsgSuccess", target, title, message, timeout, true);

                break;

            case BoxType.Warning:
                await jsRuntume.InvokeVoidAsync("$p.MsgWarning", target, title, message, timeout, true);

                break;

            case BoxType.Danger:
            case BoxType.Error:
                await jsRuntume.InvokeVoidAsync("$p.MsgError", target, title, message, timeout, true);

                break;

            case BoxType.Waiting:
                await jsRuntume.InvokeVoidAsync("$p.MsgWaiting", target, message, timeout);

                break;

            case BoxType.Info:
            default:
                await jsRuntume.InvokeVoidAsync("$p.MsgInfo", target, title, message, timeout, true);

                break;
            }
        }
Esempio n. 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Box"/> class.
 /// </summary>
 /// <param name="offset">The offset in the stream where this box begins.</param>
 /// <param name="size">The size of this box.</param>
 /// <param name="boxType">Type of the box.</param>
 public Box(long offset, long size, BoxType boxType)
     : this()
 {
     this.Offset = offset;
     this.Size = size;
     this.Type = boxType;
 }
 public GridBox(int iX, int iY,BoxType iType)
 {
     this.x = iX;
     this.y = iY;
     this.boxType = iType;
     switch (iType)
     {
         case BoxType.Normal:
             brush = new SolidBrush(Color.WhiteSmoke);
             break;
         case BoxType.End:
             brush = new SolidBrush(Color.Red);
             break;
         case BoxType.Start:
             brush = new SolidBrush(Color.Green);
             break;
         case BoxType.Wall:
             brush = new SolidBrush(Color.Gray);
             break;
     
     }
     width = 18;
     height = 18;
     boxRec = new Rectangle(x, y, width, height);
 }
            public static Codec forType(BoxType type)
            {
                CodecType ac;

                switch (type)
                {
                case BoxType.MP4A_SAMPLE_ENTRY: ac = CodecType.AAC; break;

                case BoxType.AC3_SAMPLE_ENTRY: ac = CodecType.AC3; break;

                case BoxType.AMR_SAMPLE_ENTRY: ac = CodecType.AMR; break;

                case BoxType.AMR_WB_SAMPLE_ENTRY: ac = CodecType.AMR_WIDE_BAND; break;

                case BoxType.EVRC_SAMPLE_ENTRY: ac = CodecType.EVRC; break;

                case BoxType.EAC3_SAMPLE_ENTRY: ac = CodecType.EXTENDED_AC3; break;

                case BoxType.QCELP_SAMPLE_ENTRY: ac = CodecType.QCELP; break;

                case BoxType.SMV_SAMPLE_ENTRY: ac = CodecType.SMV; break;

                default: ac = CodecType.UNKNOWN_AUDIO_CODEC; break;
                }

                return(new AudioCodec(ac));
            }
Esempio n. 5
0
            private Box(Box parent, ulong start)
            {
                m_reader = parent.m_reader;
                Parent   = parent;
                Start    = start;
                m_reader.BaseStream.Position = (long)start;
                var size = m_reader.ReadUInt32BE();

                BoxType = Encoding.ASCII.GetString(m_reader.ReadBytes(4));
                Body    = Start + 8;
                if (size == 0)
                {
                    Size = (ulong)m_reader.BaseStream.Length - Start;
                }
                else if (size == 1)
                {
                    Size  = m_reader.ReadUInt64BE();
                    Body += 8;
                }
                else
                {
                    Size = size;
                }
                if (BoxType.Equals("uuid", StringComparison.Ordinal))
                {
                    BoxType = Encoding.ASCII.GetString(m_reader.ReadBytes(16));
                    Body   += 16;
                }
            }
Esempio n. 6
0
        internal static void CreateBoxType(BoxType boxType)
        {
            string connectionString = GlobalConfig.DbConn;
            string commandText      = @"INSERT INTO BoxType 
                                                ( 
                                                CreateTime, 
                                                HoldNum,
                                                Lowest,
                                                SellerId, 
                                                Title
                                                )
                                                VALUES
                                                ( 
                                                ?CreateTime, 
                                                ?HoldNum,
                                                ?Lowest,
                                                ?SellerId, 
                                                ?Title
                                                )";

            List <MySqlParameter> parameters = new List <MySqlParameter>();

            parameters.Add(new MySqlParameter("?CreateTime", boxType.CreateTime));
            parameters.Add(new MySqlParameter("?HoldNum", boxType.HoldNum));
            parameters.Add(new MySqlParameter("?Lowest", boxType.Lowest));
            parameters.Add(new MySqlParameter("?SellerId", boxType.SellerId));
            parameters.Add(new MySqlParameter("?Title", boxType.Title));



            MySqlHelper.ExecuteNonQuery(connectionString, CommandType.Text, commandText, parameters.ToArray());
        }
Esempio n. 7
0
        public BoxEntity(BoxType type, Vector3 origin, Vector3 angle, int range)
        {
            Type  = type;
            Range = range;

            Entity = MapEdit.SpawnCrate(origin, angle);
        }
Esempio n. 8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Box"/> class.
 /// </summary>
 /// <param name="offset">The offset in the stream where this box begins.</param>
 /// <param name="size">The size of this box.</param>
 /// <param name="boxType">Type of the box.</param>
 public Box(long offset, long size, BoxType boxType)
     : this()
 {
     this.Offset = offset;
     this.Size   = size;
     this.Type   = boxType;
 }
Esempio n. 9
0
        public GridBox(int iX, int iY, BoxType iType)
        {
            this.x       = iX;
            this.y       = iY;
            this.boxType = iType;
            switch (iType)
            {
            case BoxType.Normal:
                brush = new SolidBrush(Color.WhiteSmoke);
                break;

            case BoxType.End:
                brush = new SolidBrush(Color.Red);
                break;

            case BoxType.Start:
                brush = new SolidBrush(Color.Green);
                break;

            case BoxType.Wall:
                brush = new SolidBrush(Color.Gray);
                break;
            }
            width  = 18;
            height = 18;
            boxRec = new Rectangle(x, y, width, height);
        }
Esempio n. 10
0
 public void setParams(IBox parent, long size, BoxType type, long offset)
 {
     this.size   = size;
     this.type   = type;
     this.parent = parent;
     this.offset = offset;
 }
Esempio n. 11
0
 public void SetUp(SpawnPoint _goal,BoxType _type)
 {
     m_Goal=_goal;
     m_Type=_type;
     transform.position=_goal.transform.position;
     //TODO: update sprite
 }
Esempio n. 12
0
    void OnClicktopBtn(ButtonScript obj, object args, int param1, int param2)
    {
        if (GamePlayer.Instance.EmployeeList.Count + 1 > 100)
        {
            PopText.Instance.Show(LanguageManager.instance.GetValue("EN_EmployeeIsFull"));
            return;
        }
        showBuyBtn(false);
        if (BoxSystem.Instance.GreenCDTime > 0)
        {
            if (GamePlayer.Instance.GetIprop(PropertyType.PT_Money) < _BoxGreenSpend)
            {
                MessageBoxUI.ShowMe(LanguageManager.instance.GetValue("nomoney"), () => { showBuyBtn(true); });
                showBuyBtn(true);
                return;
            }

            MessageBoxUI.ShowMe(LanguageManager.instance.GetValue("chouxiaohanjq").Replace("{n}", _BoxGreenSpend.ToString()), () => {
                //NetConnection.Instance.drawLotteryBox(btpye,false);
                NetConnection.Instance.drawLotteryBox(BoxType.BX_Normal, false);
                btpye = BoxType.BX_Normal;
                GuideManager.Instance.ClearMask();
            }, false, () => { showBuyBtn(true); });
        }
        else
        {
            NetConnection.Instance.drawLotteryBox(BoxType.BX_Normal, false);
            btpye = BoxType.BX_Normal;
            GuideManager.Instance.ClearMask();
        }
        EmployessSystem.instance._BuyEmployeeTable_ = btpye;
    }
        /// <summary>
        ///     Extended MetroMessageBox.
        /// </summary>
        /// <param name="this"></param>
        /// <param name="message"></param>
        /// <param name="title"></param>
        /// <param name="buttons"></param>
        /// <param name="messageBoxType"></param>
        /// <returns></returns>
        public static MessageBoxResult ShowMetroMessageBox(this IWindowManager @this, string message, string title,
                                                           MessageBoxButton buttons, BoxType messageBoxType = BoxType.Default)
        {
            MessageBoxResult retval;
            var shellViewModel = IoC.Get <MainViewModel>();

            try
            {
                if (shellViewModel != null)
                {
                    shellViewModel.ShowOverlay();
                }
                var model = new MetroMessageBoxViewModel(message, title, buttons, messageBoxType);
                Execute.OnUIThread(() => @this.ShowDialog(model));
                retval = model.Result;
            }
            finally
            {
                if (shellViewModel != null)
                {
                    shellViewModel.HideOverlay();
                }
            }

            return(retval);
        }
Esempio n. 14
0
        public async Task <Box> CreateBoxAsync(string boxID, BoxType type)
        {
            // TODO:is it right here where validation is that check existing box ???

            var box = await db.Boxes.FindAsync(boxID);

            if (box != null)
            {
                return(null);
            }
            box = new Box()
            {
                BoxID   = boxID,
                RackID  = null,
                IsOut   = true,
                BoxType = type,
                Slot    = null
            };
            db.Boxes.Add(box);

            var affected = await db.SaveChangesAsync();

            if (affected != 0)
            {
                return(box);
            }
            return(null);
        }
Esempio n. 15
0
        protected async Task ProcessSharedLinksFromFile(string id, string path, BoxType t, bool json = false)
        {
            var boxClient = base.ConfigureBoxClient(oneCallAsUserId: this._asUser.Value(), oneCallWithToken: base._oneUseToken.Value());

            if (!string.IsNullOrEmpty(path))
            {
                path = GeneralUtilities.TranslatePath(path);
            }
            try
            {
                var sharedLinkRequests = base.ReadFile <BoxSharedLinkRequest, BoxSharedLinkRequestMap>(path);
                foreach (var sharedLinkRequest in sharedLinkRequests)
                {
                    if (t == BoxType.file)
                    {
                        var createdSharedLink = await boxClient.FilesManager.CreateSharedLinkAsync(id, sharedLinkRequest);

                        this.PrintSharedLink(createdSharedLink.SharedLink, json);
                    }
                    else if (t == BoxType.folder)
                    {
                        var createdSharedLink = await boxClient.FoldersManager.CreateSharedLinkAsync(id, sharedLinkRequest);

                        this.PrintSharedLink(createdSharedLink.SharedLink, json);
                    }
                }
            }
            catch (Exception e)
            {
                Reporter.WriteError(e.Message);
            }
        }
 private void AddStockAndMovement(CreateBoxVM entity, BoxType boxtype, int totalProductItems)
 {
     try
     {
         var stock = _unitOfWork.Repository <Stock>().Find(x => x.ProductID == entity.ProductID && x.ClientID == entity.ClientID);
         if (stock == null)
         {
             stock = Stock.FactoryCreate(entity.ClientID, entity.ProductID);
             stock.AddMovementInput(totalProductItems);
             _unitOfWork.Repository <Stock>().Add(stock);
         }
         else
         {
             stock.AddMovementInput(totalProductItems);
             _unitOfWork.Repository <Stock>().Update(stock);
         }
     }
     catch (CustomException exc)
     {
         throw exc;
     }
     catch (Exception ex)
     {
         throw CustomException.Create <BoxApplicationService>("Unexpected error fetching add boxes", nameof(this.Add), ex);
     }
 }
Esempio n. 17
0
 public Item(Texture2D itemImage, String name, BoxType boxType)
 {
     this.image      = itemImage;
     this.name       = name;
     this.collidable = false;
     this.boxType    = boxType;
 }
Esempio n. 18
0
        public GridBox(int iX, int iY, BoxType iType)
        {
            x       = iX;
            y       = iY;
            boxType = iType;
            switch (iType)
            {
            case BoxType.Normal:
                brush = Globals._SemiTransparency ? new SolidBrush(Globals.boxDefaultColor) : new SolidBrush(Color.WhiteSmoke);
                break;

            case BoxType.End:
                brush = new SolidBrush(Color.Red);
                break;

            case BoxType.Start:
                brush = new SolidBrush(Color.Green);
                break;

            case BoxType.Wall:
                brush = new SolidBrush(Color.Gray);
                break;

            case BoxType.Load:
                brush = new SolidBrush(myBrown);
                break;
            }
            width = height = Globals._BlockSide - 1;

            boxRec = new Rectangle(x, y, width, height);
        }
Esempio n. 19
0
        private void Form1_MouseDown(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                for (int widthTrav = 0; widthTrav < width; widthTrav++)
                {
                    for (int heightTrav = 0; heightTrav < height; heightTrav++)
                    {
                        if (m_rectangles[widthTrav][heightTrav].boxRec.IntersectsWith(new Rectangle(e.Location, new Size(1, 1))))
                        {
                            m_lastBoxType   = m_rectangles[widthTrav][heightTrav].boxType;
                            m_lastBoxSelect = m_rectangles[widthTrav][heightTrav];
                            switch (m_lastBoxType)
                            {
                            case BoxType.Normal:
                            case BoxType.Wall:
                                m_rectangles[widthTrav][heightTrav].SwitchBox();
                                this.Invalidate();
                                break;

                            case BoxType.Start:
                            case BoxType.End:

                                break;
                            }
                        }
                    }
                }
            }
        }
Esempio n. 20
0
            private Box(Box parent, ulong start)
            {
                m_stream          = parent.m_stream;
                Parent            = parent;
                Start             = start;
                m_stream.Position = (long)start;
                var size = ReadUInt32BE(m_stream);

                BoxType = ReadASCII(m_stream, 4);
                Body    = Start + 8;
                if (size == 0)
                {
                    Size = (ulong)m_stream.Length - Start;
                }
                else if (size == 1)
                {
                    Size  = ReadUInt64BE(m_stream);
                    Body += 8;
                }
                else
                {
                    Size = size;
                }
                if (BoxType.Equals("uuid", StringComparison.Ordinal))
                {
                    var uuid = new Guid(ReadBytes(m_stream, 16));
                    BoxType = uuid.ToString();
                    Body   += 16;
                }
            }
Esempio n. 21
0
 public Box(EquationContainer parent, BoxType boxType)
     : base(parent)
 {
     this.boxType = boxType;
     ActiveChild = insideEq = new RowContainer(this);
     childEquations.Add(insideEq);
 }
 public override Ferda.Modules.BoxType[] getAcceptedBoxTypes(Ice.Current __current)
 {
     BoxType a = new BoxType();
     a.neededSockets = new NeededSocket[0];
     a.functionIceId = "::Ferda::Modules::Boxes::LISpMinerTasks::AbstractLMTask::AbstractLMTaskFunctions";
     return new BoxType[] { a };
 }
Esempio n. 23
0
        internal static BoxType GetBoxType(int id)
        {
            var    p           = new BoxType();
            string commandText = @"select * from boxType where id = ?id";
            List <MySqlParameter> parameters = new List <MySqlParameter>();

            parameters.Add(new MySqlParameter("?id", id));
            try
            {
                using (var conn = Utility.ObtainConn(Utility._gameDbConn))
                {
                    //MySqlDataReader reader = MySqlHelper.ExecuteReader(GlobalConfig.DbConn, CommandType.Text, commandText, parameters.ToArray());
                    MySqlDataReader reader = MySqlHelper.ExecuteReader(conn, CommandType.Text, commandText, parameters.ToArray());
                    while (reader.Read())
                    {
                        p.Id         = reader.GetInt32(0);
                        p.CreateTime = (DateTime)reader["CreateTime"];
                        p.HoldNum    = (int)reader["HoldNum"];
                        p.Lowest     = (int)reader["Lowest"];
                        p.SellerId   = (int)reader["SellerId"];
                        p.Title      = reader["Title"].ToString();
                    }
                }
            }
            catch (System.Exception ex)
            {
                throw;
            }
            return(p);
        }
Esempio n. 24
0
        protected async Task ProcessCollaborationsFromFile(string id, string path, BoxType t, bool json = false)
        {
            var boxClient = base.ConfigureBoxClient(oneCallAsUserId: this._asUser.Value(), oneCallWithToken: base._oneUseToken.Value());

            if (!string.IsNullOrEmpty(path))
            {
                path = GeneralUtilities.TranslatePath(path);
            }
            try
            {
                var collaborationRequests = base.ReadFile <BoxCollaborationRequest, BoxCollaborationRequestMap>(path);
                foreach (var collaborationRequest in collaborationRequests)
                {
                    if (collaborationRequest.Item.Type != BoxType.file || collaborationRequest.Item.Type != BoxType.folder)
                    {
                        collaborationRequest.Item.Type = this._t;
                    }
                    var createdCollaboration = await boxClient.CollaborationsManager.AddCollaborationAsync(collaborationRequest);

                    this.PrintCollaboration(createdCollaboration, json);
                }
            }
            catch (Exception e)
            {
                Reporter.WriteError(e.Message);
            }
        }
        /// <summary>
        ///     Extended MetroMessageBox.
        /// </summary>
        /// <param name="this"></param>
        /// <param name="message"></param>
        /// <param name="title"></param>
        /// <param name="buttons"></param>
        /// <param name="messageBoxType"></param>
        /// <returns></returns>
        public static MessageBoxResult ShowMetroMessageBox(this IWindowManager @this, string message, string title,
            MessageBoxButton buttons, BoxType messageBoxType = BoxType.Default)
        {
            MessageBoxResult retval;
            var shellViewModel = IoC.Get<MainViewModel>();

            try
            {
                if (shellViewModel != null)
                {
                    shellViewModel.ShowOverlay();
                }
                var model = new MetroMessageBoxViewModel(message, title, buttons, messageBoxType);
                Execute.OnUIThread(() => @this.ShowDialog(model));
                retval = model.Result;
            }
            finally
            {
                if (shellViewModel != null)
                {
                    shellViewModel.HideOverlay();
                }
            }

            return retval;
        }
Esempio n. 26
0
        /*
         * protected char GetBorderChar(Int2 pos, char[] boxes)
         * {
         *  int id = 0;
         *  if (pos.x > 0 && borderMap[pos.x - 1, pos.y])
         *      id += 1;
         *  if (pos.y < Size.y - 1 && borderMap[pos.x, pos.y + 1])
         *      id += 2;
         *  if (pos.x < Size.x - 1 && borderMap[pos.x + 1, pos.y])
         *      id += 4;
         *  if (pos.y > 0 && borderMap[pos.x, pos.y - 1])
         *      id += 8;
         *  id -= 3;
         *  return boxes[id];
         * }
         */

        public static Char[] GetBoxArray(BoxType boxType)
        {
            Char[] bs;
            switch (boxType)
            {
            case BoxType.dashed:
                bs = dashedBoxChars;
                break;

            case BoxType.dashedLight:
                bs = dashedLightBoxChars;
                break;

            case BoxType.doubled:
                bs = doubleBoxChars;
                break;

            case BoxType.light:
                bs = lightBoxChars;
                break;

            case BoxType.round:
                bs = roundBoxChars;
                break;

            case BoxType.normal:
                bs = boxChars;
                break;

            default:
                bs = null;
                break;
            }
            return(bs);
        }
Esempio n. 27
0
 public void AddModule(BoxType type, int index)
 {
     if (state.HasBox(type))
     {
         StartCoroutine(Show("Module" + (index + 1).ToString("0")));
     }
 }
Esempio n. 28
0
    public ConversationItem Add(string who, string what, BoxType boxType)
    {
        var result = new ConversationItem(who, what, boxType);

        Items.Add(result);
        return(result);
    }
Esempio n. 29
0
 public Box(EquationContainer parent, BoxType boxType)
     : base(parent)
 {
     this.boxType = boxType;
     ActiveChild  = insideEq = new RowContainer(this);
     childEquations.Add(insideEq);
 }
Esempio n. 30
0
 public void SetUp(SpawnPoint _goal, BoxType _type)
 {
     m_Goal             = _goal;
     m_Type             = _type;
     transform.position = _goal.transform.position;
     //TODO: update sprite
 }
Esempio n. 31
0
 public void UpdateType(BoxType newType)
 {
     animator.SetTrigger(triggers[newType]);
     transform.GetChild((int)type).gameObject.SetActive(false);
     transform.GetChild((int)newType).gameObject.SetActive(true);
     type = newType;
 }
Esempio n. 32
0
 public static void List(string question, Dictionary <object, string> options, Action okay, bool allowEscape = false, bool doNotPush = false, string title = "", string icon = "")
 {
     fromWalkaround = NoxicoGame.Subscreen == null || Subscreens.PreviousScreen.Count == 0;
     if (!doNotPush)
     {
         Subscreens.PreviousScreen.Push(NoxicoGame.Subscreen);
     }
     NoxicoGame.Subscreen = MessageBox.Handler;
     type             = BoxType.List;
     MessageBox.title = title;
     width            = 46;
     foreach (var o in options.Values)
     {
         if (o.Length() + 2 > width)
         {
             width = o.Length() + 2;
         }
     }
     text                   = Toolkit.Wordwrap(question.Trim(), width); //.Split('\n');
     option                 = 0;
     onYes                  = okay;
     MessageBox.options     = options;
     MessageBox.allowEscape = allowEscape;
     MessageBox.icon        = icon.IsBlank() ? null : new UIPNG(Mix.GetBitmap(icon));
     NoxicoGame.Mode        = UserMode.Subscreen;
     Subscreens.FirstDraw   = true;
 }
Esempio n. 33
0
            private void SetSpriteColor(BoxType type)
            {
                this.type = type;

                switch (this.type)
                {
                    case BoxType.BODY_BOX:
                        color = Color.Blue;
                        break;
                    case BoxType.HIT_BOX:
                        color = Color.Red;
                        break;
                    case BoxType.BOUNDS_BOX:
                        color = Color.Yellow;
                        break;
                    default:
                        color = Color.ForestGreen;
                        break;
                }

                sprite = new Texture2D(Setup.graphicsDevice, 1, 1);
                Color[] colorData = new Color[1];
                colorData[0] = color;
                sprite.SetData<Color>(colorData);
            }
Esempio n. 34
0
        private void SpawnBox(BoxType type, params Parameter[] args)
        {
            BoxEntity ent;

            switch (type)
            {
            case BoxType.Teleporter:
                ent = new Teleporter(args[0].As <Vector3>(), args[2].As <Vector3>(), args[1].As <Vector3>());
                break;

            case BoxType.Trampline:
                ent = new Trampoline(args[0].As <Vector3>(), args[1].As <Vector3>(), args[2].As <int>());
                break;

            case BoxType.Gambler:
                ent = new Gambler(args[0].As <Vector3>(), args[1].As <Vector3>());
                break;

            case BoxType.PerkColaMachine:
                ent = new PerkColaMachine(args[0].As <Vector3>(), args[1].As <Vector3>(), (PerkColaType)args[2].As <int>());
                break;

            default:
                throw new Exception("Unknown BoxEntity");
            }

            boxents.Add(ent);
        }
Esempio n. 35
0
        public override void Update()
        {
            if (spark != null)
            {
                spark.Update();
                if (spark.dead)
                {
                    spark = null;
                }
            }

            if (box == ContentChest.Instance.smallBox)
            {
                boxType = BoxType.BIG;
            }
            else if (box == ContentChest.Instance.bigBox)
            {
                boxType = BoxType.SMALL;
            }
            else if (box == ContentChest.Instance.fragileBox)
            {
                boxType = BoxType.FRAGILE;
            }

            if (GameConstants.BoxConveyerRunning)
            {
                position.X -= .5f;
                bounds.X    = (int)position.X;
                drawRect.X  = (int)position.X;
            }
        }
Esempio n. 36
0
 public Box(BoxType type, double heigth, double width, double z, double weight)
 {
     Type   = type;
     Size   = new CartesianSize(width, heigth);
     _z     = z;
     Weight = weight;
 }
Esempio n. 37
0
 public void SetType(BoxType type)
 {
     _boxType        = type;
     CharacterCasing = type != BoxType.All
                         ? CharacterCasing.Upper
                         : CharacterCasing.Normal;
 }
 /// <summary>
 ///     MetroMessageBoxViewModel constructor.
 /// </summary>
 /// <param name="message">The message to show.</param>
 /// <param name="title">The title of the box.</param>
 /// <param name="buttons">Buttons to show up.</param>
 /// <param name="messageBoxType">The type of the box.</param>
 public MetroMessageBoxViewModel(string message, string title, MessageBoxButton buttons,
     BoxType messageBoxType)
 {
     if (title != null) Title = title;
     if (message != null) Message = message;
     MessageBoxType = messageBoxType;
     Buttons = buttons;
 }
Esempio n. 39
0
 public void DrawBox(Graphics iPaper,BoxType iType)
 {
     if (iType == boxType)
     {
         boxRec.X = x;
         boxRec.Y = y;
         iPaper.FillRectangle(brush, boxRec);
     }
 }
Esempio n. 40
0
		public void SetType(BoxType type)
		{
			_boxType = type;
			if (type != BoxType.All)
			{
				CharacterCasing = CharacterCasing.Upper;
			}
			else
			{
				CharacterCasing = CharacterCasing.Normal;
			}
		}
 public GridBox(int iX, int iY,BoxType iType)
 {
     this.x = iX;
     this.y = iY;
     this.boxType = iType;
     switch (iType)
     {
         case BoxType.Normal:
             brush = new SolidBrush(Color.Black);
             break;
         case BoxType.Pinned:
             brush = new SolidBrush(Color.Red);
             break;
     
     }
     width = 18;
     height = 18;
     boxRec = new Rectangle(x, y, width, height);
 }
Esempio n. 42
0
        private void getGoodie(BoxType type)
        {
            Mushroom m;
            switch (type)
            {
                case BoxType.GoodMushroom:
                    m = new Mushroom(MushroomType.Good, GameDirection.Right, Top, Left);
                    m.Init(World, AiEventHandler);
                    World.MovingElements.Add(m);
                    break;

                case BoxType.PoisonMushroom:
                    m = new Mushroom(MushroomType.Poison, GameDirection.Right, Top, Left);
                    m.Init(World, AiEventHandler);
                    World.MovingElements.Add(m);
                    break;

                case BoxType.LiveMushroom:
                    m = new Mushroom(MushroomType.Live, GameDirection.Right, Top, Left);
                    m.Init(World, AiEventHandler);
                    World.MovingElements.Add(m);
                    break;

                case BoxType.FireFlower:
                    FireFlower f = new FireFlower(Top, Left);
                    f.Init(World, AiEventHandler);
                    World.StickyElements.Add(f);
                    break;

                case BoxType.Star:
                    JumpingStar js = new JumpingStar(Top, Left);
                    js.Init(World, AiEventHandler);
                    World.MovingElements.Add(js);
                    break;

                case BoxType.ImmortializeStar:
                    ImmortializeStar iStar = new ImmortializeStar(GameDirection.Right, Top, Left);
                    iStar.Init(World, AiEventHandler);
                    World.MovingElements.Add(iStar);
                    break;
            }
        }
Esempio n. 43
0
 public InvalidBoxException(BoxType type, long position, string message)
     : base(message)
 {
     this.BoxType = type;
     this.Position = position;
 }
Esempio n. 44
0
        public static bool TryParse(string boxTypeCode, out BoxType boxType)
        {
#if true // not supported in PCL
            try
            {
                boxType = (BoxType)Enum.Parse(typeof(BoxType), boxTypeCode.Replace('-', '_'), true);
                return true;
            }
            catch (ArgumentException)
            {
                boxType = default(BoxType);
                return false;
            }
#else
            return Enum.TryParse<BoxType>(boxTypeCode.Replace('-', '_'), true, out boxType);
#endif
        }
 public UnexpectedBoxSizeException(BoxType type, ulong expectedSize, uint readSize)
 {
     this.BoxType = type;
     this.ExpectedSize = expectedSize;
     this.ReadSize = readSize;
 }
Esempio n. 46
0
        private void Form1_MouseDown(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                for (int widthTrav = 0; widthTrav < width; widthTrav++)
                {
                    for (int heightTrav = 0; heightTrav < height; heightTrav++)
                    {
                        if (m_rectangles[widthTrav][heightTrav].boxRec.IntersectsWith(new Rectangle(e.Location, new Size(1, 1))))
                        {
                            m_lastBoxType=m_rectangles[widthTrav][heightTrav].boxType;
                            m_lastBoxSelect = m_rectangles[widthTrav][heightTrav];
                            switch(m_lastBoxType)
                            {
                                case BoxType.Normal:
                                case BoxType.Wall:
                                m_rectangles[widthTrav][heightTrav].SwitchBox();
                                this.Invalidate();
                                break;
                                case BoxType.Start:
                                case BoxType.End:
                                   
                                break;
                            }
                        }


                    }
                }
                
            }
        }
 /// <summary>
 /// Determines whether specified functions object (<c>functionsPrx</c>)
 /// is satisfy specified box type (<c>boxType</c>) i.e. whether
 /// functions object implements required functions and its box module
 /// has required sockets.
 /// </summary>
 /// <param name="boxType">Required type of the box.</param>
 /// <param name="functionsPrx">The functions object`s proxy.</param>
 /// <param name="sockets">The sockets of box module to which the functions object belongs to.</param>
 /// <returns>
 /// <c>true</c> if the specified functions object 
 /// <see cref="M:Ice.ObjectPrx.ice_isA(System.String)">
 /// implements required functions</see> and and its box module 
 /// <see cref="M:Ferda.Modules.BoxModuleI.hasSockets(Ferda.Modules.NeededSocket[],Ferda.Modules.SocketInfo[])">
 /// has required sockets</see>.
 /// </returns>
 private static bool hasBoxType(BoxType boxType, Ice.ObjectPrx functionsPrx, SocketInfo[] sockets)
 {
     return functionsPrx.ice_isA(boxType.functionIceId) &&
         hasSockets(boxType.neededSockets, sockets);
 }
Esempio n. 48
0
        public void SwitchBox()
        {
            switch (this.boxType)
            {
                case BoxType.Normal:
                    if (this.brush != null)
                        this.brush.Dispose();
                    this.brush = new SolidBrush(Color.Gray);
                    this.boxType = BoxType.Wall;
                    break;
                case BoxType.Wall:
                    if (this.brush != null)
                        this.brush.Dispose();
                    this.brush = new SolidBrush(Color.WhiteSmoke);
                    this.boxType = BoxType.Normal;
                    break;

            }
        }
 /// <summary>
 /// Method HasBoxType
 /// </summary>
 /// <returns>A bool</returns>
 /// <param name="boxType">A  BoxType</param>
 public bool HasBoxType(BoxType boxType)
 {
     return true;
 }
 /// <summary>
 /// Method getSockets
 /// </summary>
 /// <returns>A Ferda.Modules.SocketInfo[]</returns>
 /// <param name="__current">An Ice.Current</param>
 public override SocketInfo[] getSockets(Current __current)
 {
     SocketInfo result = new SocketInfo();
     result.hint = "";
     result.label = "value";
     result.moreThanOne = false;
     result.name = "value";
     result.settingProperties = null;
     BoxType boxType = new BoxType();
     boxType.functionIceId = this.propertyFunctionsIceIds[0];
     boxType.neededSockets = null;
     result.socketType = new BoxType[] { boxType };
     return new SocketInfo[] { result };
 }
Esempio n. 51
0
		public override DoOrUndo DoubleClickAction(Util.WinForms.HitTestResult htr)
		{
			return @do => {
				var t = BoxType;
				if (@do) {
					BoxType = (t == BoxType.Rect ? BoxType.Ellipse : t == BoxType.Ellipse ? BoxType.Borderless : BoxType.Rect);
				} else {
					BoxType = (t == BoxType.Rect ? BoxType.Borderless : t == BoxType.Borderless ? BoxType.Ellipse : BoxType.Rect);
				}
			};
		}
Esempio n. 52
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FullBox"/> class.
 /// </summary>
 /// <param name="offset">The offset in the stream where this box begins.</param>
 /// <param name="size">The size of this box.</param>
 /// <param name="boxType">Type of the box.</param>
 public FullBox(long offset, long size, BoxType boxType)
     : base(offset, size, boxType)
 {
 }
 /// <summary>
 /// Method HasBoxType
 /// </summary>
 /// <returns>A bool</returns>
 /// <param name="boxType">A  Ferda.Modules.BoxType</param>
 public override bool HasBoxType(BoxType boxType)
 {
     return this.IsWithIceId(boxType.functionIceId) &&
         this.hasSockets(boxType.neededSockets);
 }
 public abstract bool HasBoxType(BoxType boxType);
Esempio n. 55
0
 public override void Deserialize(Dictionary<string, object> ser)
 {
     base.Deserialize(ser);
     btype = (BoxType)ser["BoxType"];
     Style = (BoxStyle)ser["BoxStyle"];
     Content = (int)ser["Content"];
 }
Esempio n. 56
0
 public void SetEndBox()
 {
     if (this.brush != null)
         this.brush.Dispose();
     this.brush = new SolidBrush(Color.Red);
     this.boxType = BoxType.End;
 }
Esempio n. 57
0
 public void SetNormalBox()
 {
     if (this.brush != null)
         this.brush.Dispose();
    this.brush = new SolidBrush(Color.WhiteSmoke);
    this.boxType = BoxType.Normal;
 }
Esempio n. 58
0
 public BoundingBox(BoxType type, int w, int h, int x, int y, int frame = -1)
 {
     SetSpriteColor(type);
     rect = new Rectangle(0, 0, w, h);
     offset = new Vector2(x, y);
 }
Esempio n. 59
0
        public List<MessageBox> GetBox(int userId, BoxType typeofBox)
        {
            var messages = repositoryMessage.GetBox(userId, typeofBox);

            return messages.ToList<MessageBox>();
        }
Esempio n. 60
0
 public void SetStartBox()
 {
     if (this.brush != null)
         this.brush.Dispose();
     this.brush = new SolidBrush(Color.Green);
     this.boxType = BoxType.Start;
 }