Esempio n. 1
0
        /// <summary>
        /// This method returns the Windows.UI control instance. It must be separate as in
        /// some cases we need to append to an existing XAML Islands instance rather than creating
        /// a new XAML host.
        /// </summary>
        /// <param name="controlType"></param>
        /// <returns></returns>
        internal WUX.Controls.Control GetWUXControl(ControlEnum controlType)
        {
            var xamlControls = new ControlHelperXamlIslandControls();

            switch (controlType)
            {
            case ControlEnum.UWPTextbox:
                return(xamlControls.GetTextBox());

            case ControlEnum.UWPCheckbox:
                return(xamlControls.GetCheckbox());

            case ControlEnum.UWPRadioGroup:
                return(xamlControls.GetRadio());

            case ControlEnum.UWPCombobox:
                return(xamlControls.GetCombobox());

            case ControlEnum.UWPButton:
                return(xamlControls.GetButton());

            case ControlEnum.UWPSlider:
                return(xamlControls.GetSlider());

            case ControlEnum.UWPNotes:
                return(xamlControls.GetNotes());

            case ControlEnum.UWPCalendar:
                return(xamlControls.GetCalendar());

            default:
                return(null);
            }//switch
        }
Esempio n. 2
0
        Control GetControl(ControlEnum cEnum, params object[] sourceObjects)
        {
            switch (cEnum)
            {
            case ControlEnum.TextBox:
                return(new TextBox());

            case ControlEnum.Combobox:
                var tempC = new ComboBox();

                if (sourceObjects != null && sourceObjects.Length > 0)
                {
                    tempC.Items.AddRange(sourceObjects);
                    tempC.SelectedIndex = 0;
                }
                return(tempC);

            case ControlEnum.NumericUpDown:
                return(new NumericUpDown());

            case ControlEnum.DateTime:
                break;

            default:
                break;
            }
            return(null);
        }
Esempio n. 3
0
        /// <summary>
        /// The control instance factory returning a .NET Framework control instance.
        /// </summary>
        /// <param name="controlType">The type of control to return.</param>
        /// <returns>Instance of the control</returns>
        internal override Control GetControl(ControlEnum controlType)
        {
            var netControls = new ControlHelperStandardNetControls();

            switch (controlType)
            {
            case ControlEnum.Textbox:
                return(netControls.GetTextbox());

            case ControlEnum.Checkbox:
                return(netControls.GetCheckbox());

            case ControlEnum.RadioGroup:
                return(netControls.GetRadio());

            case ControlEnum.Combobox:
                return(netControls.GetCombobox());

            case ControlEnum.Button:
                return(netControls.GetButton());

            case ControlEnum.Notes:
                return(netControls.GetNotes());

            case ControlEnum.Calendar:
                return(netControls.GetCalendar());

            case ControlEnum.Browser:
                return(netControls.GetBrowser());

            default:
                return(null);
            }
        }
Esempio n. 4
0
        private void Comandos(object sender, KeyPressEventArgs key)
        {
            try
            {
                Digite.ForeColor = Color.Black;
                if (control != ControlEnum.HIBERNAR)
                {
                    if (p != null)
                    {
                        if (key.KeyChar == 13)
                        {
                            string Mensagem = Digite.Text;
                            if (Mensagem.Length > 0)
                            {
                                if (Mensagem.ToLower().Equals("/bytes"))
                                {
                                    control = ControlEnum.HIBERNAR;
                                    for (int i = 0; i < 100; i++)
                                    {
                                        byte[] data = new byte[new Random().Next(0, 10000)];
                                        p.ClientGame.SendPacket(data);
                                        Logger.Send("Enviando Bytes " + data.Length);
                                        Thread.Sleep(3000);
                                    }
                                }
                                else
                                {
                                    ReadPacket.flods = false;
                                    switch (control)
                                    {
                                    case ControlEnum.LOBBY_CHAT:
                                    {
                                        p.ClientGame.SendPacket(new LOBBY_CHATTING_ACK(Mensagem, Chat_Type.LOBBY_CHAT_LOBBY).Write());
                                        break;
                                    }

                                    case ControlEnum.RoomChat:
                                    {
                                        p.ClientGame.SendPacket(new LOBBY_CHATTING_ACK(Mensagem, Chat_Type.LOBBY_CHAT_LOBBY).Write());
                                        break;
                                    }
                                    }
                                }
                                Digite.Text = string.Empty;
                            }
                        }
                    }
                    else
                    {
                        Logger.Error("Player is NULL!");
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.Error("Cu do coy" + ex.ToString());
            }
        }
Esempio n. 5
0
        public void Shell_WriteLocationSettings(ControlEnum control, int x, int y)
        {
            XElement ele  = _shellConfigs.Root.Element(_controlNameDictionary[control]);
            XElement eleX = ele.Element("LastLocationX");

            eleX.Value = x.ToString();
            XElement eleY = ele.Element("LastLocationY");

            eleY.Value = y.ToString();
        }
Esempio n. 6
0
 public override System.Collections.Generic.Queue <Moonfish.Tags.BlamPointer> ReadFields(System.IO.BinaryReader binaryReader)
 {
     System.Collections.Generic.Queue <Moonfish.Tags.BlamPointer> pointerQueue = new System.Collections.Generic.Queue <Moonfish.Tags.BlamPointer>(base.ReadFields(binaryReader));
     this.VehicleVehicleFlags = ((VehicleFlags)(binaryReader.ReadInt32()));
     this.Type                           = ((TypeEnum)(binaryReader.ReadInt16()));
     this.Control                        = ((ControlEnum)(binaryReader.ReadInt16()));
     this.MaximumForwardSpeed            = binaryReader.ReadSingle();
     this.MaximumReverseSpeed            = binaryReader.ReadSingle();
     this.SpeedAcceleration              = binaryReader.ReadSingle();
     this.SpeedDeceleration              = binaryReader.ReadSingle();
     this.MaximumLeftTurn                = binaryReader.ReadSingle();
     this.MaximumRightTurn               = binaryReader.ReadSingle();
     this.WheelCircumference             = binaryReader.ReadSingle();
     this.TurnRate                       = binaryReader.ReadSingle();
     this.BlurSpeed                      = binaryReader.ReadSingle();
     this.SpecificType                   = ((SpecificTypeEnum)(binaryReader.ReadInt16()));
     this.PlayerTrainingVehicleType      = ((PlayerTrainingVehicleTypeEnum)(binaryReader.ReadInt16()));
     this.FlipMessage                    = binaryReader.ReadStringID();
     this.TurnScale                      = binaryReader.ReadSingle();
     this.SpeedTurnPenaltyPower          = binaryReader.ReadSingle();
     this.SpeedTurnPenalty               = binaryReader.ReadSingle();
     this.MaximumLeftSlide               = binaryReader.ReadSingle();
     this.MaximumRightSlide              = binaryReader.ReadSingle();
     this.SlideAcceleration              = binaryReader.ReadSingle();
     this.SlideDeceleration              = binaryReader.ReadSingle();
     this.MinimumFlippingAngularVelocity = binaryReader.ReadSingle();
     this.MaximumFlippingAngularVelocity = binaryReader.ReadSingle();
     this.VehicleSize                    = ((VehicleSizeEnum)(binaryReader.ReadInt16()));
     this.fieldpad4                      = binaryReader.ReadBytes(2);
     this.FixedGunYaw                    = binaryReader.ReadSingle();
     this.FixedGunPitch                  = binaryReader.ReadSingle();
     this.OverdampenCuspAngle            = binaryReader.ReadSingle();
     this.OverdampenExponent             = binaryReader.ReadSingle();
     this.CrouchTransitionTime           = binaryReader.ReadSingle();
     this.fieldpad5                      = binaryReader.ReadBytes(4);
     this.EngineMoment                   = binaryReader.ReadSingle();
     this.EngineMaxAngularVelocity       = binaryReader.ReadSingle();
     pointerQueue.Enqueue(binaryReader.ReadBlamPointer(68));
     this.FlyingTorqueScale = binaryReader.ReadSingle();
     this.SeatEnteranceAccelerationScale = binaryReader.ReadSingle();
     this.SeatExitAccelersationScale     = binaryReader.ReadSingle();
     this.AirFrictionDeceleration        = binaryReader.ReadSingle();
     this.ThrustScale     = binaryReader.ReadSingle();
     this.SuspensionSound = binaryReader.ReadTagReference();
     this.CrashSound      = binaryReader.ReadTagReference();
     this.UNUSED          = binaryReader.ReadTagReference();
     this.SpecialEffect   = binaryReader.ReadTagReference();
     this.UnusedEffect    = binaryReader.ReadTagReference();
     pointerQueue         = new System.Collections.Generic.Queue <Moonfish.Tags.BlamPointer>(pointerQueue.Concat(this.HavokVehiclePhysics.ReadFields(binaryReader)));
     return(pointerQueue);
 }
Esempio n. 7
0
        /// <summary>
        /// The XAML Islands methods to return a type of control.
        /// </summary>
        /// <param name="controlType"></param>
        /// <returns>The type of control to return.</returns>
        internal override Control GetControl(ControlEnum controlType)
        {
            var xamlControls    = new ControlHelperXamlIslandControls();
            var windowsXamlHost = new Microsoft.Toolkit.Forms.UI.XamlHost.WindowsXamlHost();

            switch (controlType)
            {
            case ControlEnum.UWPTextbox:
                return(xamlControls.WrapInXamlHost(windowsXamlHost, xamlControls.GetTextBox()));

            case ControlEnum.UWPCheckbox:
                return(xamlControls.WrapInXamlHost(windowsXamlHost, xamlControls.GetCheckbox()));

            case ControlEnum.UWPRadioGroup:
                return(xamlControls.WrapInXamlHost(windowsXamlHost, xamlControls.GetRadio()));

            case ControlEnum.UWPCombobox:
                return(xamlControls.WrapInXamlHost(windowsXamlHost, xamlControls.GetCombobox()));

            case ControlEnum.UWPButton:
                return(xamlControls.WrapInXamlHost(windowsXamlHost, xamlControls.GetButton()));

            case ControlEnum.UWPSlider:
                return(xamlControls.WrapInXamlHost(windowsXamlHost, xamlControls.GetSlider()));

            case ControlEnum.UWPNotes:
                return(xamlControls.WrapInXamlHost(windowsXamlHost, xamlControls.GetNotes()));

            case ControlEnum.UWPCalendar:
                return(xamlControls.WrapInXamlHost(windowsXamlHost, xamlControls.GetCalendar()));

            case ControlEnum.UWPInk:
                return(xamlControls.GetInk());

            case ControlEnum.UWPMap:
                return(xamlControls.GetMap());

            case ControlEnum.UWPWebView:
                return(xamlControls.GetWebView());

            case ControlEnum.UWPMediaPlayer:
                return(xamlControls.GetMedia());

            default:
                return(null);
            }
        }
Esempio n. 8
0
        /// <summary>
        /// Determines if the control is of a Windows UI (WUX) type or not.
        /// </summary>
        /// <param name="controlType"></param>
        /// <returns>bool</returns>
        internal bool IsWuxControl(ControlEnum controlType)
        {
            switch (controlType)
            {
            case ControlEnum.UWPTextbox:
                return(true);

            case ControlEnum.UWPCheckbox:
                return(true);

            case ControlEnum.UWPRadioGroup:
                return(true);

            case ControlEnum.UWPCombobox:
                return(true);

            case ControlEnum.UWPButton:
                return(true);

            case ControlEnum.UWPSlider:
                return(true);

            case ControlEnum.UWPNotes:
                return(true);

            case ControlEnum.UWPCalendar:
                return(true);

            case ControlEnum.UWPInk:
                return(false);

            case ControlEnum.UWPMap:
                return(false);

            case ControlEnum.UWPWebView:
                return(false);

            default:
                return(false);
            }
        }
Esempio n. 9
0
    /// <summary>
    /// 开始控制
    /// </summary>
    /// <param name="controlEnum"></param>
    public T StartControl <T>(ControlEnum controlEnum) where T : BaseControl
    {
        Dictionary <ControlEnum, BaseControl> dicControl = manager.dicControl;
        BaseControl baseControl = null;

        foreach (var itemDic in dicControl)
        {
            if (itemDic.Key == controlEnum)
            {
                baseControl = itemDic.Value;
            }
            else
            {
                itemDic.Value.EndControl();
            }
        }
        if (baseControl == null)
        {
            baseControl = manager.GetControl <T>(controlEnum);
        }
        baseControl.StartControl();
        return(baseControl as T);
    }
Esempio n. 10
0
 /// <summary>
 /// Enum türünde veriler girmek için
 /// </summary>
 /// <param name="displayName"></param>
 /// <param name="desiredControl"></param>
 /// <param name="sourceType"></param>
 public PropertyMVC(string displayName, ControlEnum desiredControl, Type sourceType)
 {
     DesiredControl = desiredControl;
     Source         = Enum.GetNames(sourceType);
     DisplayName    = displayName;
 }
Esempio n. 11
0
 public PropertyMVC(string displayName, ControlEnum desiredControl, params object[] source)
 {
     DesiredControl = desiredControl;
     Source         = source;
     DisplayName    = displayName;
 }
Esempio n. 12
0
 public PropertyMVC(string displayName, ControlEnum desiredControl)
 {
     DesiredControl = desiredControl;
     DisplayName    = displayName;
 }
Esempio n. 13
0
 public PropertyMVC(ControlEnum desiredControl, Type sourceType)
 {
     DesiredControl = desiredControl;
     Source         = Enum.GetNames(sourceType);
 }
Esempio n. 14
0
 public PropertyMVC(ControlEnum desiredControl, params object[] source)
 {
     DesiredControl = desiredControl;
     Source         = source;
 }
Esempio n. 15
0
 public PropertyMVC(ControlEnum desiredControl)
 {
     DesiredControl = desiredControl;
 }
Esempio n. 16
0
 internal abstract Control GetControl(ControlEnum controlType);
Esempio n. 17
0
        private void UIEnableControl(ControlEnum control)
        {
            switch (control)
            {
            case ControlEnum.Compress:
                groupBox_FileFormat.IsEnabled         = true;
                groupBox_FileFormat.Opacity           = 1;
                groupBox_CompressionProfile.IsEnabled = true;
                groupBox_CompressionProfile.Opacity   = 1;
                groupBox_Progression.IsEnabled        = true;
                groupBox_Progression.Opacity          = 1;
                groupBox_CodeblockSize.IsEnabled      = true;
                groupBox_CodeblockSize.Opacity        = 1;
                groupBox_ResolutionNum.IsEnabled      = true;
                groupBox_ResolutionNum.Opacity        = 1;
                groupBox_CompressionValue.IsEnabled   = true;
                groupBox_CompressionValue.Opacity     = 1;
                ShowRawPicture_Button.IsEnabled       = true;
                Compress_Button.IsEnabled             = true;

                ShowCompress_Button.IsEnabled = false;
                groupBox_Decompression_RGBProfile.IsEnabled = false;
                groupBox_Decompression_RGBProfile.Opacity   = 0.2;
                groupBox_ResolutionNum_Decode.IsEnabled     = false;
                groupBox_ResolutionNum_Decode.Opacity       = 0.2;
                Decompress_Button.IsEnabled     = false;
                ShowDecompress_Button.IsEnabled = false;
                break;

            case ControlEnum.Decompress:
                groupBox_FileFormat.IsEnabled         = false;
                groupBox_FileFormat.Opacity           = 0.2;
                groupBox_CompressionProfile.IsEnabled = false;
                groupBox_CompressionProfile.Opacity   = 0.2;
                groupBox_Progression.IsEnabled        = false;
                groupBox_Progression.Opacity          = 0.2;
                groupBox_CodeblockSize.IsEnabled      = false;
                groupBox_CodeblockSize.Opacity        = 0.2;
                groupBox_ResolutionNum.IsEnabled      = false;
                groupBox_ResolutionNum.Opacity        = 0.2;
                groupBox_CompressionValue.IsEnabled   = false;
                groupBox_CompressionValue.Opacity     = 0.2;
                ShowRawPicture_Button.IsEnabled       = true;
                Compress_Button.IsEnabled             = false;

                ShowCompress_Button.IsEnabled = false;
                groupBox_Decompression_RGBProfile.IsEnabled = true;
                groupBox_Decompression_RGBProfile.Opacity   = 1;
                groupBox_ResolutionNum_Decode.IsEnabled     = true;
                groupBox_ResolutionNum_Decode.Opacity       = 1;
                Decompress_Button.IsEnabled     = true;
                ShowDecompress_Button.IsEnabled = false;
                break;

            case ControlEnum.Start:
                groupBox_FileFormat.IsEnabled         = false;
                groupBox_FileFormat.Opacity           = 0.2;
                groupBox_CompressionProfile.IsEnabled = false;
                groupBox_CompressionProfile.Opacity   = 0.2;
                groupBox_Progression.IsEnabled        = false;
                groupBox_Progression.Opacity          = 0.2;
                groupBox_CodeblockSize.IsEnabled      = false;
                groupBox_CodeblockSize.Opacity        = 0.2;
                groupBox_ResolutionNum.IsEnabled      = false;
                groupBox_ResolutionNum.Opacity        = 0.2;
                groupBox_CompressionValue.IsEnabled   = false;
                groupBox_CompressionValue.Opacity     = 0.2;
                ShowRawPicture_Button.IsEnabled       = false;
                Compress_Button.IsEnabled             = false;

                ShowCompress_Button.IsEnabled = false;
                groupBox_Decompression_RGBProfile.IsEnabled = false;
                groupBox_Decompression_RGBProfile.Opacity   = 0.2;
                groupBox_ResolutionNum_Decode.IsEnabled     = false;
                groupBox_ResolutionNum_Decode.Opacity       = 0.2;
                Decompress_Button.IsEnabled     = false;
                ShowDecompress_Button.IsEnabled = false;
                break;
            }
        }
Esempio n. 18
0
 public void Fechada_da_room()
 {
     control = ControlEnum.RoomChat;
     Program.LobbyChatting();
 }