Ejemplo n.º 1
0
 public void Add(I item)
 {
     throw new NotSupportedException(message: StringResource.Get(id: "CannotModifyCollection"));
 }
Ejemplo n.º 2
0
 I IList <I> .this[int index] {
     get { return(this[index : index]); }
     set { throw new NotSupportedException(message: StringResource.Get(id: "CannotModifyCollection")); }
 }
Ejemplo n.º 3
0
        internal static Provider Read(RegistryKey providersKey, string friendlyName)
        {
            var  registryKey = providersKey.OpenSubKey(name: friendlyName);
            var  description = registryKey.GetValue(name: "Description", defaultValue: string.Empty) as string;
            bool result;
            var  typeName = bool.TryParse(value: registryKey.GetValue(name: "OnByDefault", defaultValue: string.Empty) as string, result: out result) ? registryKey.GetValue(name: "RegistrarType", defaultValue: string.Empty) as string : throw new InvalidOperationException(message: StringResource.Get(id: "InvalidProviderEntry"));
            var  type     = !string.IsNullOrEmpty(value: typeName) ? Type.GetType(typeName: typeName, throwOnError: false) : throw new InvalidOperationException(message: StringResource.Get(id: "InvalidProviderEntry"));

            if ((object)type == null)
            {
                throw new InvalidOperationException(message: StringResource.Get(id: "InvalidProviderEntry"));
            }
            return(new Provider(type: type, friendlyName: friendlyName, onByDefault: result, description: description));
        }
Ejemplo n.º 4
0
 public void RemoveAt(int index)
 {
     throw new NotSupportedException(message: StringResource.Get(id: "CannotModifyCollection"));
 }
Ejemplo n.º 5
0
        static RIMNativeMethods.MOUSE_EVENT_FLAGS MouseButtonsToMouseInputs(
            PointerButtons physicalButton,
            bool isMouseFlagsDown)
        {
            var mouseEventFlags = RIMNativeMethods.MOUSE_EVENT_FLAGS.NONE;

            if (isMouseFlagsDown)
            {
                if ((physicalButton & PointerButtons.PhysicalLeft) != PointerButtons.None)
                {
                    mouseEventFlags |= RIMNativeMethods.MOUSE_EVENT_FLAGS.LEFTDOWN;
                }
                if ((physicalButton & PointerButtons.PhysicalRight) != PointerButtons.None)
                {
                    mouseEventFlags |= RIMNativeMethods.MOUSE_EVENT_FLAGS.RIGHTDOWN;
                }
                if ((physicalButton & PointerButtons.Middle) != PointerButtons.None)
                {
                    mouseEventFlags |= RIMNativeMethods.MOUSE_EVENT_FLAGS.MIDDLEDOWN;
                }
                if ((physicalButton & PointerButtons.XButton1) != PointerButtons.None || (physicalButton & PointerButtons.XButton2) != PointerButtons.None)
                {
                    mouseEventFlags |= RIMNativeMethods.MOUSE_EVENT_FLAGS.XDOWN;
                }
            }
            else
            {
                if ((physicalButton & PointerButtons.PhysicalLeft) != PointerButtons.None)
                {
                    mouseEventFlags |= RIMNativeMethods.MOUSE_EVENT_FLAGS.LEFTUP;
                }
                if ((physicalButton & PointerButtons.PhysicalRight) != PointerButtons.None)
                {
                    mouseEventFlags |= RIMNativeMethods.MOUSE_EVENT_FLAGS.RIGHTUP;
                }
                if ((physicalButton & PointerButtons.Middle) != PointerButtons.None)
                {
                    mouseEventFlags |= RIMNativeMethods.MOUSE_EVENT_FLAGS.MIDDLEUP;
                }
                if ((physicalButton & PointerButtons.XButton1) != PointerButtons.None || (physicalButton & PointerButtons.XButton2) != PointerButtons.None)
                {
                    mouseEventFlags |= RIMNativeMethods.MOUSE_EVENT_FLAGS.XUP;
                }
            }

            return(mouseEventFlags != RIMNativeMethods.MOUSE_EVENT_FLAGS.NONE ? mouseEventFlags : throw new ArgumentException(message: StringResource.Get(id: "InvalidMouseButtonEnum"), paramName: "mouseInputs"));
        }