Exemplo n.º 1
0
        /// <summary>
        /// 키 이벤트 명세를 생성합니다.
        /// </summary>
        /// <param name="key">이벤트를 발생시킬 System.Windows.Input.Key 입니다.</param>
        /// <param name="state">키를 누르는 이벤트인지, 떼는 이벤트인지 결정합니다.</param>
        public Input(Key key, InputState state)
        {
            type = InputType.Keyboard;
            u    = new InputUnion();

            switch (key)
            {
            case Key.LeftShift:
            case Key.RightShift:
                u.ki.wVk = VK_SHIFT;
                break;

            case Key.LeftCtrl:
            case Key.RightCtrl:
                u.ki.wVk = VK_CONTROL;
                break;

            case Key.LeftAlt:
            case Key.RightAlt:
                u.ki.wVk = VK_MENU;
                break;

            default:
                u.ki.wVk = (short)KeyInterop.VirtualKeyFromKey(key);
                break;
            }

            u.ki.wScan = (short)NativeMethods.MapVirtualKey(u.ki.wVk, MAPVK_VK_TO_VSC);
            if (InputState.Up == state)
            {
                u.ki.dwFlags = KeyEventFlag.KeyUp;
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// The Azure Active Directory identity type of the server.
 /// Set this to 'SystemAssigned' in order to automatically create and assign an Azure Active Directory principal for the resource.
 /// </summary>
 /// <param name="builder"></param>
 /// <param name="identityType"></param>
 /// <returns></returns>
 public static SqlServerBuilder IdentityType(this SqlServerBuilder builder, InputUnion <string, IdentityType> identityType)
 {
     builder.Arguments.Identity = new Pulumi.AzureNative.Sql.Inputs.ResourceIdentityArgs {
         Type = identityType
     };
     return(builder);
 }
Exemplo n.º 3
0
 public void SendMouseWheel(int deltaY)
 {
     TryOnInputDesktop(() =>
     {
         if (deltaY < 0)
         {
             deltaY = -120;
         }
         else if (deltaY > 0)
         {
             deltaY = 120;
         }
         var union = new InputUnion()
         {
             mi = new MOUSEINPUT()
             {
                 dwFlags = MOUSEEVENTF.WHEEL, dx = 0, dy = 0, time = 0, mouseData = deltaY, dwExtraInfo = GetMessageExtraInfo()
             }
         };
         var input = new INPUT()
         {
             type = InputType.MOUSE, U = union
         };
         SendInput(1, new INPUT[] { input }, INPUT.Size);
     });
 }
Exemplo n.º 4
0
			public InputStruct(MouseEvent mouseEvent) {
				this.Type=0; // INPUT_MOUSE
				this.Union=new InputUnion();
				this.Union.Mouse.Flags=mouseEvent;
				//this.Union.mi.dx un dy neietekmē nospiešanas pozīciju, tāpēc netiek aizpildīti.
				this.Union.Mouse.Time=0;
				this.Union.Mouse.ExtraInfo=IntPtr.Zero;
			}
Exemplo n.º 5
0
 public DomainSecuritySettingsArgs()
 {
     NtlmV1 = "Enabled";
     SyncKerberosPasswords = "Enabled";
     SyncNtlmPasswords     = "Enabled";
     SyncOnPremPasswords   = "Enabled";
     TlsV1 = "Enabled";
 }
Exemplo n.º 6
0
 public InputStruct(MouseEvent mouseEvent)
 {
     this.Type              = 0;  // INPUT_MOUSE
     this.Union             = new InputUnion();
     this.Union.Mouse.Flags = mouseEvent;
     //this.Union.mi.dx un dy neietekmē nospiešanas pozīciju, tāpēc netiek aizpildīti.
     this.Union.Mouse.Time      = 0;
     this.Union.Mouse.ExtraInfo = IntPtr.Zero;
 }
Exemplo n.º 7
0
 public INPUT(uint type, ScanCodeShort scan, KEYEVENTF flags)
 {
     this.type = type;
     this.U    = new InputUnion {
         ki = new KEYBDINPUT {
             wScan = scan, dwFlags = flags
         }
     };
 }
        /// <summary>
        /// Sets the SKU for this Storage Account
        /// </summary>
        /// <param name="builder">Storage Account Builder</param>
        /// <param name="sku">SKU</param>
        /// <returns></returns>
        public static StorageAccountBuilder Sku(this StorageAccountBuilder builder, InputUnion <string, SkuName> sku)
        {
            builder.Arguments.Sku = new SkuArgs
            {
                Name = sku,
            };

            return(builder);
        }
Exemplo n.º 9
0
            public INPUT(Keys wVk)
            {
                this.type = 1;
                KEYBDINPUT keybdInput = new PInvoke.KEYBDINPUT(wVk);

                this.U = new PInvoke.InputUnion
                {
                    ki = keybdInput
                };
            }
Exemplo n.º 10
0
        public static Output <CacheFromUnwrap?> Unwrap(this InputUnion <bool, CacheFrom>?build)
        {
            return(build.ToOutputNullable().ApplyNullable(v =>
            {
                if (v.IsT0)
                {
                    return Output.Create(new CacheFromUnwrap {
                        Stages = new ImmutableArray <string>()
                    });
                }

                return v.AsT1.Stages.ToOutput().Apply(b => new CacheFromUnwrap {
                    Stages = b
                });
            }));
        }
Exemplo n.º 11
0
        /// <summary>
        /// Sends a key down signal to the OS.
        /// </summary>
        /// <param name="virtualKey">The virtual key.</param>
        public void SendKeyDown(ushort virtualKey)
        {
            var scan          = (ushort)MapVirtualKey(virtualKey, 0);
            var keyboardFlags = KEYEVENTF.SCANCODE;
            var keyboardInput = new KEYBDINPUT()
            {
                virtualKey = 0, scanCode = scan, dwFlags = keyboardFlags, time = 0, dwExtraInfo = IntPtr.Zero
            };
            var wrapper = new InputUnion()
            {
                ki = keyboardInput
            };
            var down = new INPUT()
            {
                type = InputType.KEYBOARD, U = wrapper
            };

            SendInput(1, new INPUT[] { down }, INPUT.Size);
        }
Exemplo n.º 12
0
        public uint SendMouseMove(double percentX, double percentY, Viewer viewer)
        {
            // Coordinates must be normalized.  The bottom-right coordinate is mapped to 65535.
            var normalizedX = percentX * 65535D;
            var normalizedY = percentY * 65535D;
            var union       = new InputUnion()
            {
                mi = new MOUSEINPUT()
                {
                    dwFlags = MOUSEEVENTF.ABSOLUTE | MOUSEEVENTF.MOVE | MOUSEEVENTF.VIRTUALDESK, dx = (int)normalizedX, dy = (int)normalizedY, time = 0, mouseData = 0, dwExtraInfo = GetMessageExtraInfo()
                }
            };
            var input = new INPUT()
            {
                type = InputType.MOUSE, U = union
            };

            return(SendInput(1, new INPUT[] { input }, INPUT.Size));
        }
Exemplo n.º 13
0
        public static void SendKeyDown(VirtualKeyShort key)
        {
            var union = new InputUnion()
            {
                ki = new KEYBDINPUT()
                {
                    wVk         = key,
                    wScan       = 0,
                    time        = 0,
                    dwExtraInfo = GetMessageExtraInfo()
                }
            };
            var input = new INPUT()
            {
                type = InputType.KEYBOARD, U = union
            };

            SendInput(1, new INPUT[] { input }, INPUT.Size);
        }
Exemplo n.º 14
0
 public static Output <Union <string, DockerBuildUnwrap> > Unwrap(this InputUnion <string, DockerBuild> build)
 {
     return(build
            .ToOutput()
            .ApplyT1(v =>
                     Output.Tuple(v.Args.ToOutput(), v.CacheFrom.Unwrap(), v.Context.ToOutput(),
                                  v.Dockerfile.ToOutput(), v.Env.ToOutput(),
                                  v.ExtraOptions.ToOutput(), v.Target.ToOutput())
                     .Apply(vs => new DockerBuildUnwrap
     {
         Args = vs.Item1,
         CacheFrom = vs.Item2,
         Context = vs.Item3,
         Dockerfile = vs.Item4,
         Env = vs.Item5,
         ExtraOptions = vs.Item6,
         Target = vs.Item7,
     })));
 }
Exemplo n.º 15
0
        public void SendKeyDown(string key, Viewer viewer)
        {
            var keyCode = ConvertJavaScriptKeyToVirtualKey(key);
            var union   = new InputUnion()
            {
                ki = new KEYBDINPUT()
                {
                    wVk         = keyCode,
                    wScan       = 0,
                    time        = 0,
                    dwExtraInfo = GetMessageExtraInfo()
                }
            };
            var input = new INPUT()
            {
                type = InputType.KEYBOARD, U = union
            };

            SendInput(1, new INPUT[] { input }, INPUT.Size);
        }
Exemplo n.º 16
0
        public uint SendRightMouseUp(double percentX, double percentY, Viewer viewer)
        {
            var xyPercent = GetAbsolutePercentFromRelativePercent(percentX, percentY, viewer.Capturer);
            // Coordinates must be normalized.  The bottom-right coordinate is mapped to 65535.
            var normalizedX = xyPercent.Item1 * 65535D;
            var normalizedY = xyPercent.Item2 * 65535D;
            var union       = new InputUnion()
            {
                mi = new MOUSEINPUT()
                {
                    dwFlags = MOUSEEVENTF.ABSOLUTE | MOUSEEVENTF.RIGHTUP | MOUSEEVENTF.VIRTUALDESK, dx = (int)normalizedX, dy = (int)normalizedY, time = 0, mouseData = 0, dwExtraInfo = GetMessageExtraInfo()
                }
            };
            var input = new INPUT()
            {
                type = InputType.MOUSE, U = union
            };

            return(SendInput(1, new INPUT[] { input }, INPUT.Size));
        }
Exemplo n.º 17
0
 public void SendKeyDown(string key)
 {
     TryOnInputDesktop(() =>
     {
         var keyCode = ConvertJavaScriptKeyToVirtualKey(key);
         var union   = new InputUnion()
         {
             ki = new KEYBDINPUT()
             {
                 wVk         = keyCode,
                 wScan       = (ScanCodeShort)MapVirtualKeyEx((uint)keyCode, VkMapType.MAPVK_VK_TO_VSC, GetKeyboardLayout()),
                 time        = 0,
                 dwExtraInfo = GetMessageExtraInfo()
             }
         };
         var input = new INPUT()
         {
             type = InputType.KEYBOARD, U = union
         };
         SendInput(1, new INPUT[] { input }, INPUT.Size);
     });
 }
Exemplo n.º 18
0
        public void SendKeyUp(string key, Viewer viewer)
        {
            Win32Interop.SwitchToInputDesktop();
            var keyCode = ConvertJavaScriptKeyToVirtualKey(key);
            var union   = new InputUnion()
            {
                ki = new KEYBDINPUT()
                {
                    wVk         = keyCode,
                    wScan       = 0,
                    time        = 0,
                    dwFlags     = KEYEVENTF.KEYUP,
                    dwExtraInfo = GetMessageExtraInfo()
                }
            };
            var input = new INPUT()
            {
                type = InputType.KEYBOARD, U = union
            };

            SendInput(1, new INPUT[] { input }, INPUT.Size);
        }
Exemplo n.º 19
0
 public void SetKeyStatesUp()
 {
     TryOnInputDesktop(() =>
     {
         var thread = new Thread(() =>
         {
             foreach (VirtualKey key in Enum.GetValues(typeof(VirtualKey)))
             {
                 try
                 {
                     var state = GetKeyState(key);
                     if (state == -127)
                     {
                         var union = new InputUnion()
                         {
                             ki = new KEYBDINPUT()
                             {
                                 wVk         = key,
                                 wScan       = 0,
                                 time        = 0,
                                 dwFlags     = KEYEVENTF.KEYUP,
                                 dwExtraInfo = GetMessageExtraInfo()
                             }
                         };
                         var input = new INPUT()
                         {
                             type = InputType.KEYBOARD, U = union
                         };
                         SendInput(1, new INPUT[] { input }, INPUT.Size);
                     }
                 }
                 catch { }
             }
         });
         thread.SetApartmentState(ApartmentState.STA);
         thread.Start();
     });
 }
Exemplo n.º 20
0
        /// <summary>
        /// Sends a key up signal to the OS.
        /// </summary>
        /// <param name="virtualKey">The virtual key.</param>
        public void SendKeyUp(ushort virtualLKey, ushort modifierKey)
        {
            // Send modifier key
            var scan2          = (ushort)MapVirtualKey(modifierKey, 0);
            var keyboardFlags2 = KEYEVENTF.KEYUP | KEYEVENTF.SCANCODE;
            var keyboardInput2 = new KEYBDINPUT()
            {
                virtualKey = 0, scanCode = scan2, dwFlags = keyboardFlags2, time = 0, dwExtraInfo = IntPtr.Zero
            };
            var wrapper2 = new InputUnion()
            {
                ki = keyboardInput2
            };
            var up2 = new INPUT()
            {
                type = InputType.KEYBOARD, U = wrapper2
            };

            SendInput(1, new INPUT[] { up2 }, INPUT.Size);

            // Send actual key
            var scan          = (ushort)MapVirtualKey(virtualLKey, 0);
            var keyboardFlags = KEYEVENTF.KEYUP | KEYEVENTF.SCANCODE;
            var keyboardInput = new KEYBDINPUT()
            {
                virtualKey = 0, scanCode = scan, dwFlags = keyboardFlags, time = 0, dwExtraInfo = IntPtr.Zero
            };
            var wrapper = new InputUnion()
            {
                ki = keyboardInput
            };
            var up = new INPUT()
            {
                type = InputType.KEYBOARD, U = wrapper
            };

            SendInput(1, new INPUT[] { up }, INPUT.Size);
        }
Exemplo n.º 21
0
        /// <summary>
        /// Build and push the Dockerfile and context from a path into the requested docker
        /// repo.  It returns the unique target image name for the image in the docker
        /// repository. During preview this will build the image, and return the target image
        /// name, without pushing.During a normal update, it will do the same, as well as tag
        /// and push the image.
        /// </summary>
        /// <param name="imageName">Docker image name.</param>
        /// <param name="pathOrBuild">Image build parameters.</param>
        /// <param name="repositoryUrl">Target repository URL.</param>
        /// <param name="logResource">Associated Pulumi resource.</param>
        /// <param name="skipPush">Skip pushing the image.</param>
        /// <param name="registry">Optional image registry properties.</param>
        /// <returns></returns>
        public static Output <string> BuildAndPushImageAsync(string imageName, InputUnion <string, DockerBuild> pathOrBuild,
                                                             Input <string> repositoryUrl, Resource logResource, bool skipPush, Input <ImageRegistry>?registry)
        {
            return(Output.Tuple(pathOrBuild.Unwrap(), repositoryUrl.ToOutput(), registry.Unwrap()).Apply(async v =>
            {
                var buildVal = v.Item1;
                var repositoryUrlVal = v.Item2;
                var registryVal = v.Item3;

                // Give an initial message indicating what we're about to do.  That way, if anything
                // takes a while, the user has an idea about what's going on.
                Log.Info("Starting docker build and push...", logResource, ephemeral: true);

                var result = await BuildAndPushImageWorkerAsync(
                    imageName, buildVal, repositoryUrlVal, logResource, skipPush, registryVal).ConfigureAwait(false);

                // If we got here, then building/pushing didn't throw any errors.  update the status bar
                // indicating that things worked properly.  that way, the info bar isn't stuck showing the very
                // last thing printed by some subcommand we launched.
                Log.Info("successfully pushed to docker", logResource, ephemeral: true);

                return result;
            }));
        }
Exemplo n.º 22
0
        /// <summary>
        /// 마우스 이벤트 명세를 생성합니다.
        /// </summary>
        /// <param name="button">이벤트를 발생시킬 System.Windows.Input.MouseButton 입니다.</param>
        /// <param name="state">버튼을 누르는 이벤트인지, 떼는 이벤트인지 결정합니다.</param>
        public Input(MouseButton button, InputState state)
        {
            type = InputType.Mouse;
            u    = new InputUnion();
            switch (button)
            {
            case MouseButton.Left:
                u.mi.dwFlags   = MouseEventFlag.LeftDown;
                u.mi.mouseData = MouseData.None;
                break;

            case MouseButton.Middle:
                u.mi.dwFlags   = MouseEventFlag.MiddleDown;
                u.mi.mouseData = MouseData.None;
                break;

            case MouseButton.Right:
                u.mi.dwFlags   = MouseEventFlag.RightDown;
                u.mi.mouseData = MouseData.None;
                break;

            case MouseButton.XButton1:
                u.mi.dwFlags   = MouseEventFlag.XDown;
                u.mi.mouseData = MouseData.XButton1;
                break;

            case MouseButton.XButton2:
                u.mi.dwFlags   = MouseEventFlag.XDown;
                u.mi.mouseData = MouseData.XButton2;
                break;
            }
            if (InputState.Up == state)
            {
                u.mi.dwFlags = (MouseEventFlag)(((int)u.mi.dwFlags) << 1);
            }
        }
Exemplo n.º 23
0
 public RubberTreeState()
 {
     Farm = "(unknown)";
 }
Exemplo n.º 24
0
 public BaseImageTriggerArgs()
 {
     Status = "Enabled";
 }
Exemplo n.º 25
0
 public JobStepOutputArgs()
 {
     SchemaName = "dbo";
     Type       = "SqlDatabase";
 }
Exemplo n.º 26
0
 public ProviderArgs()
 {
     FavoriteColor = Utilities.GetEnv("FAVE_COLOR");
 }
Exemplo n.º 27
0
 public ConflictResolutionPolicyArgs()
 {
     Mode = "LastWriterWins";
 }
Exemplo n.º 28
0
 /// <summary>
 /// Sends a key up signal to the OS.
 /// </summary>
 /// <param name="virtualKey">The virtual key.</param>
 public void SendKeyUp(ushort virtualLKey)
 {
     var scan = (ushort)MapVirtualKey(virtualLKey, 0);
     var keyboardFlags = KEYEVENTF.KEYUP | KEYEVENTF.SCANCODE;
     var keyboardInput = new KEYBDINPUT() { virtualKey = 0, scanCode = scan, dwFlags = keyboardFlags, time = 0, dwExtraInfo = IntPtr.Zero };
     var wrapper = new InputUnion() { ki = keyboardInput };
     var up = new INPUT() { type = InputType.KEYBOARD, U = wrapper };
     SendInput(1, new INPUT[] { up }, INPUT.Size);
 }
Exemplo n.º 29
0
 public TrustPolicyArgs()
 {
     Status = "disabled";
     Type   = "Notary";
 }
Exemplo n.º 30
0
 public LoggingPropertiesArgs()
 {
     AuditLogStatus = "Disabled";
     LogLevel       = "Information";
 }
Exemplo n.º 31
0
 public SslConfigurationArgs()
 {
     Status = "Enabled";
 }
Exemplo n.º 32
0
        public void SendMouseButtonAction(int button, ButtonAction buttonAction, double percentX, double percentY, Viewer viewer)
        {
            TryOnInputDesktop(() =>
            {
                MOUSEEVENTF mouseEvent;
                switch (button)
                {
                case 0:
                    switch (buttonAction)
                    {
                    case ButtonAction.Down:
                        mouseEvent = MOUSEEVENTF.LEFTDOWN;
                        break;

                    case ButtonAction.Up:
                        mouseEvent = MOUSEEVENTF.LEFTUP;
                        break;

                    default:
                        return;
                    }
                    break;

                case 1:
                    switch (buttonAction)
                    {
                    case ButtonAction.Down:
                        mouseEvent = MOUSEEVENTF.MIDDLEDOWN;
                        break;

                    case ButtonAction.Up:
                        mouseEvent = MOUSEEVENTF.MIDDLEUP;
                        break;

                    default:
                        return;
                    }
                    break;

                case 2:
                    switch (buttonAction)
                    {
                    case ButtonAction.Down:
                        mouseEvent = MOUSEEVENTF.RIGHTDOWN;
                        break;

                    case ButtonAction.Up:
                        mouseEvent = MOUSEEVENTF.RIGHTUP;
                        break;

                    default:
                        return;
                    }
                    break;

                default:
                    return;
                }
                var xyPercent = GetAbsolutePercentFromRelativePercent(percentX, percentY, viewer.Capturer);
                // Coordinates must be normalized.  The bottom-right coordinate is mapped to 65535.
                var normalizedX = xyPercent.Item1 * 65535D;
                var normalizedY = xyPercent.Item2 * 65535D;
                var union       = new InputUnion()
                {
                    mi = new MOUSEINPUT()
                    {
                        dwFlags = MOUSEEVENTF.ABSOLUTE | mouseEvent | MOUSEEVENTF.VIRTUALDESK, dx = (int)normalizedX, dy = (int)normalizedY, time = 0, mouseData = 0, dwExtraInfo = GetMessageExtraInfo()
                    }
                };
                var input = new INPUT()
                {
                    type = InputType.MOUSE, U = union
                };
                SendInput(1, new INPUT[] { input }, INPUT.Size);
            });
        }