Ejemplo n.º 1
0
        /// <summary>
        ///     Executes the request and returns a response, authenticating if needed
        /// </summary>
        /// <param name="request">Request to be executed</param>
        /// <returns>RestResponse</returns>
        public virtual IRestResponse Execute(IRestRequest request)
        {
            var method = Enum2.GetName(typeof(Method), request.Method);

            switch (request.Method)
            {
            case Method.COPY:
                return(Execute(request, method, DoExecuteAsPost));

            case Method.POST:
                return(Execute(request, method, DoExecuteAsPost));

            case Method.PUT:
                return(Execute(request, method, DoExecuteAsPost));

            case Method.PATCH:
                return(Execute(request, method, DoExecuteAsPost));

            case Method.MERGE:
                return(Execute(request, method, DoExecuteAsPost));

            default:
                return(Execute(request, method, DoExecuteAsGet));
            }
            ;
        }
Ejemplo n.º 2
0
        public SettingsPageViewModel()
        {
            IconKey = nameof(SettingsPageViewModel);

            SelectLanguage = R.Languages.FirstOrDefault(x => x.Key == UISettings.Language.Value);
            this.WhenValueChanged(x => x.SelectLanguage, false)
            .Subscribe(x => UISettings.Language.Value = x.Key);

            UpdateChannels = Enum2.GetAll <UpdateChannelType>();

            if (IApplication.IsDesktopPlatform)
            {
                SelectFont = R.Fonts.FirstOrDefault(x => x.Value == UISettings.FontName.Value);
                this.WhenValueChanged(x => x.SelectFont, false)
                .Subscribe(x => UISettings.FontName.Value = x.Value);

                SelectImage_Click = ReactiveCommand.CreateFromTask(async() =>
                {
                    FilePickerFileType fileTypes = new ValueTuple <string, string[]>[] {
                        ("Image Files", new[] {
                            FileEx.BMP,
                            FileEx.JPG,
                            FileEx.JPEG,
                            FileEx.PNG,
                            FileEx.GIF,
                            FileEx.WEBP,
                        }),
                        //("All Files", new[] { "*", }),
                    };
                    await PickAsync(SetBackgroundImagePath, fileTypes);
                });

                ResetImage_Click = ReactiveCommand.Create(() => SetBackgroundImagePath(null));
            }
        }
Ejemplo n.º 3
0
        public void EnumHasFlag()
        {
            Assert.IsTrue(Enum2.HasFlag(
                              AttributeTargets.All,
                              AttributeTargets.All));
            Assert.IsTrue(Enum2.HasFlag(
                              AttributeTargets.All,
                              AttributeTargets.Assembly));
            Assert.IsTrue(Enum2.HasFlag(
                              AttributeTargets.All,
                              AttributeTargets.Constructor));
            Assert.IsTrue(Enum2.HasFlag(
                              AttributeTargets.Assembly | AttributeTargets.Module,
                              AttributeTargets.Assembly));
            Assert.IsTrue(Enum2.HasFlag(
                              AttributeTargets.Assembly | AttributeTargets.Module,
                              AttributeTargets.Module));
            Assert.IsFalse(Enum2.HasFlag(
                               AttributeTargets.Assembly,
                               AttributeTargets.Module));
            Assert.IsFalse(Enum2.HasFlag(
                               AttributeTargets.Assembly | AttributeTargets.Module,
                               AttributeTargets.Class));

            Assert.IsFalse(Enum2.HasFlag(
                               MemberTypes.Method,
                               MemberTypes.All));
            Assert.IsTrue(Enum2.HasFlag(
                              MemberTypes.All,
                              MemberTypes.Method));
        }
Ejemplo n.º 4
0
 public void outParameters(out bool aBool, out byte aByte,
                           out short aShort, out ushort aUShort,
                           out int aInt, out uint aUInt,
                           out long aLong, out ulong aULong,
                           out float aFloat, out double aDouble,
                           out char aChar, out string aString,
                           out Type aType, out uno.Any aAny,
                           out Enum2 aEnum, out Struct1 aStruct,
                           out object aXInterface,
                           out unoidl.com.sun.star.lang.XComponent aXComponent,
                           out bool[] seqBool)
 {
     aBool       = m_Bool;
     aByte       = m_Byte;
     aShort      = m_Short;
     aUShort     = m_UShort;
     aInt        = m_Int;
     aUInt       = m_UInt;
     aLong       = m_Long;
     aULong      = m_ULong;
     aFloat      = m_Float;
     aDouble     = m_Double;
     aChar       = m_Char;
     aString     = m_String;
     aType       = m_Type;
     aAny        = m_Any;
     aEnum       = m_Enum2;
     aStruct     = m_Struct1;
     aXInterface = m_XInterface;
     aXComponent = m_XComponent;
     seqBool     = m_seqBool;
 }
Ejemplo n.º 5
0
 public void inParameters(bool aBool, byte aByte,
                          short aShort, ushort aUShort,
                          int aInt, uint aUInt,
                          long aLong, ulong aULong,
                          float aFloat, double aDouble,
                          char aChar, string aString,
                          Type aType, uno.Any aAny,
                          Enum2 aEnum, Struct1 aStruct,
                          object aXInterface,
                          unoidl.com.sun.star.lang.XComponent aXComponent,
                          bool[] seqBool)
 {
     m_Bool       = aBool;
     m_Byte       = aByte;
     m_Short      = aShort;
     m_UShort     = aUShort;
     m_Int        = aInt;
     m_UInt       = aUInt;
     m_Long       = aLong;
     m_ULong      = aULong;
     m_Float      = aFloat;
     m_Double     = aDouble;
     m_Char       = aChar;
     m_String     = aString;
     m_Type       = aType;
     m_Any        = aAny;
     m_Enum2      = aEnum;
     m_Struct1    = aStruct;
     m_XInterface = aXInterface;
     m_XComponent = aXComponent;
     m_seqBool    = seqBool;
 }
Ejemplo n.º 6
0
        /// <summary>
        /// 初始化右上角 Toolbar Menu
        /// </summary>
        /// <typeparam name="TEnum">视图模型中定义的Menu枚举类型</typeparam>
        /// <param name="viewModel">当前视图模型</param>
        /// <param name="except">可选排除枚举项</param>
        /// <returns></returns>
        public static IReadOnlyDictionary <TEnum, ToolbarItem> InitToolbarItems <TEnum, TViewModel>(
            this TViewModel viewModel,
            IEnumerable <TEnum>?except = null)
            where TEnum : struct, Enum
            where TViewModel : ViewModelBase, IActionItem <TEnum>
        {
            var query = Enum2.GetAll <TEnum>().AsEnumerable();

            if (except.Any_Nullable())
            {
                query = query.Except(except);
            }
            var command = ReactiveCommand.Create <TEnum>(viewModel.MenuItemClick);
            var dict    = query.ToDictionary(x => x, x =>
            {
                var item = new ToolbarItem
                {
                    IconImageSource  = viewModel.GetIcon(x),
                    Command          = command,
                    CommandParameter = x,
                    Order            = viewModel.IsPrimary(x) ? ToolbarItemOrder.Primary : ToolbarItemOrder.Secondary,
                };

                return(item);
            });

            R.Subscribe(() =>
            {
                foreach (var item in dict)
                {
                    item.Value.Text = viewModel.ToString2(item.Key);
                }
            }).AddTo(viewModel);
            return(dict);
        }
Ejemplo n.º 7
0
        public void Enum_GetName_MultipleMatches()
        {
            // In the case of multiple matches, GetName returns one of them (which one is an implementation detail.)
            string s = Enum2.GetName(typeof(SimpleEnum), 3);

            Assert.IsTrue(s == "Green" || s == "Green_a" || s == "Green_b", "got '{0}'", s);
        }
Ejemplo n.º 8
0
        public void Test1()
        {
            Map.Extensions = TypeExtension.GetExtensions("Mapping.xml");

            Enum1 e1 = (Enum1)Map.ValueToEnum("3", typeof(Enum1));

            Assert.AreEqual(Enum1.Value2, e1);

            Enum2 e2 = (Enum2)Map.ValueToEnum("3", typeof(Enum2));

            Assert.AreEqual(Enum2.Value2, e2);

            Enum3 e3 = (Enum3)Map.ValueToEnum("4", typeof(Enum3));

            Assert.AreEqual(Enum3.Value2, e3);

            Enum4 e4 = (Enum4)Map.ValueToEnum("4", typeof(Enum4));

            Assert.AreEqual(Enum4.Value2, e4);

            Dest o = (Dest)Map.ObjectToObject(new Source(), typeof(Dest));

            Assert.AreEqual(Enum1.Value2, o.Field1);
            Assert.AreEqual(Enum1.Value1, o.Field2);
            Assert.AreEqual(Enum2.Value1, o.Field3);
        }
Ejemplo n.º 9
0
        private static void Format(Type enumType, object value, string format, string expected)
        {
            // Format string is case insensitive
            var result = Enum2.Format(enumType, value, format.ToUpperInvariant());

            result = Enum2.Format(enumType, value, format.ToLowerInvariant());
        }
        /// <summary>
        ///     Executes the request and callback asynchronously, authenticating if needed
        /// </summary>
        /// <param name="request">Request to be executed</param>
        /// <param name="callback">Callback function to be executed upon completion providing access to the async handle.</param>
        /// <param name="httpMethod">HTTP call method (GET, PUT, etc)</param>
        public virtual RestRequestAsyncHandle ExecuteAsync(
            IRestRequest request,
            Action <IRestResponse, RestRequestAsyncHandle> callback, Method httpMethod
            )
        {
            var method = Enum2.GetName(typeof(Method), httpMethod);

            switch (httpMethod)
            {
            case Method.COPY:
                return(ExecuteAsync(request, callback, method, DoAsPostAsync));

            case Method.MERGE:
                return(ExecuteAsync(request, callback, method, DoAsPostAsync));

            case Method.PATCH:
                return(ExecuteAsync(request, callback, method, DoAsPostAsync));

            case Method.POST:
                return(ExecuteAsync(request, callback, method, DoAsPostAsync));

            case Method.PUT:
                return(ExecuteAsync(request, callback, method, DoAsPostAsync));

            default:
                return(ExecuteAsync(request, callback, method, DoAsGetAsync));
            }
        }
Ejemplo n.º 11
0
    private static bool smethod_2(int int_1, string string_0, out string string_1)
    {
        bool flag;

        string_1 = "";
        IntPtr zero = IntPtr.Zero;

        try
        {
            string  s       = "20110401";
            Enum2   sUCCESS = Enum2.SUCCESS;
            Struct1 struct2 = new Struct1();
            sUCCESS = (Enum2)SDog.LIV_get_software_info(ref struct2);
            sUCCESS = (Enum2)SDog.LIV_open(0, int_1, ref zero);
            if (sUCCESS != Enum2.SUCCESS)
            {
                throw new Exception("打开加密狗失败! " + sUCCESS.ToString());
            }
            Struct0 struct3 = new Struct0();
            sUCCESS = (Enum2)SDog.LIV_get_hardware_info(zero, ref struct3);
            if (sUCCESS != Enum2.SUCCESS)
            {
                throw new Exception("获取加密狗信息失败! " + sUCCESS.ToString());
            }
            if (SDog.LIV_passwd(zero, 1, Encoding.UTF8.GetBytes(s)) != 0)
            {
                throw new Exception("加密狗信息无法验证! ");
            }
            byte[] buffer = new byte[0x200];
            if (SDog.LIV_read(zero, 0, buffer) != 0)
            {
                throw new Exception("从加密狗读取数据失败! ");
            }
            string str2  = Encoding.UTF8.GetString(buffer);
            int    index = str2.IndexOf('\0');
            str2 = str2.Substring(0, index);
            if (string_0 != str2.Trim())
            {
                throw new Exception("加密狗授权验证失败! ");
            }
            flag = true;
        }
        catch (Exception exception)
        {
            string_1 = exception.Message;
            flag     = false;
        }
        finally
        {
            try
            {
                SDog.LIV_close(zero);
            }
            catch
            {
            }
        }
        return(flag);
    }
Ejemplo n.º 12
0
 // Token: 0x060011BB RID: 4539 RVA: 0x00003AD4 File Offset: 0x00001CD4
 public void DeviceSyncStateChange(GInterface2 pDevice, Enum2 NewState)
 {
     if (this.delegate48_0 != null)
     {
         this.delegate48_0(pDevice, NewState);
         return;
     }
 }
Ejemplo n.º 13
0
 // Token: 0x0600065D RID: 1629 RVA: 0x00005A77 File Offset: 0x00003C77
 private static CipherMode smethod_1(Enum2 enum2_1)
 {
     if (enum2_1 == (Enum2)1)
     {
         return(CipherMode.CBC);
     }
     throw new InvalidOperationException("Cipher mode is not supported");
 }
Ejemplo n.º 14
0
 // Token: 0x06000655 RID: 1621 RVA: 0x00005A0B File Offset: 0x00003C0B
 public void method_1(Enum2 enum2_1)
 {
     if (this.enum2_0 == enum2_1)
     {
         return;
     }
     this.enum2_0 = enum2_1;
     this.bool_1  = true;
 }
Ejemplo n.º 15
0
        public void Enums()
        {
            var appUpdateFailCodes = Enum2.GetAll <ApplicationUpdateFailCode>();

            foreach (var item in appUpdateFailCodes)
            {
                _ = item.ToString2();
            }
        }
Ejemplo n.º 16
0
        public void GetUnderlyingValue()
        {
            Enum1 enum1 = Enum1.B;

            enum1.GetUnderlyingValue <int>().ShouldBe(2);
            Enum2 enum2 = Enum2.C;

            enum2.GetUnderlyingValue <byte>().ShouldBe((byte)3);
        }
Ejemplo n.º 17
0
        public void TestEnumLong()
        {
            Enum a = Enum.A;

            Assert.True(a == 0L);

            Enum2 b = Enum2.A;

            Assert.True(b == 0L);
        }
Ejemplo n.º 18
0
        private static int smethod_0(Enum2 enum2_1)
        {
            int num = 0;

            for (int num2 = (int)enum2_1; num2 != 0; num2 &= num2 - 1)
            {
                num++;
            }
            return(num);
        }
        /// <summary>
        /// MemberData to be passed to tests that take an IEnumerable{T}. This method returns every permutation of
        /// EnumerableType to test on (e.g. HashSet, Queue), and size of set to test with (e.g. 0, 1, etc.).
        /// </summary>
        public static IEnumerable <object[]> EnumerableTestData()
        {
            foreach (object[] collectionSizeArray in ValidCollectionSizes())
            {
                foreach (EnumerableType enumerableType in Enum2.GetValues(typeof(EnumerableType)))
                {
                    int count = (int)collectionSizeArray[0];
                    yield return(new object[] { enumerableType, count, 0, 0, 0 });                       // Empty Enumerable

                    yield return(new object[] { enumerableType, count, count + 1, 0, 0 });               // Enumerable that is 1 larger

                    if (count >= 1)
                    {
                        yield return(new object[] { enumerableType, count, count, 0, 0 });               // Enumerable of the same size

                        yield return(new object[] { enumerableType, count, count - 1, 0, 0 });           // Enumerable that is 1 smaller

                        yield return(new object[] { enumerableType, count, count, 1, 0 });               // Enumerable of the same size with 1 matching element

                        yield return(new object[] { enumerableType, count, count + 1, 1, 0 });           // Enumerable that is 1 longer with 1 matching element

                        yield return(new object[] { enumerableType, count, count, count, 0 });           // Enumerable with all elements matching

                        yield return(new object[] { enumerableType, count, count + 1, count, 0 });       // Enumerable with all elements matching plus one extra
                    }

                    if (count >= 2)
                    {
                        yield return(new object[] { enumerableType, count, count - 1, 1, 0 });           // Enumerable that is 1 smaller with 1 matching element

                        yield return(new object[] { enumerableType, count, count + 2, 2, 0 });           // Enumerable that is 2 longer with 2 matching element

                        yield return(new object[] { enumerableType, count, count - 1, count - 1, 0 });   // Enumerable with all elements matching minus one

                        yield return(new object[] { enumerableType, count, count, 2, 0 });               // Enumerable of the same size with 2 matching element

                        if ((enumerableType == EnumerableType.List || enumerableType == EnumerableType.Queue))
                        {
                            yield return new object[] { enumerableType, count, count, 0, 1 }
                        }
                        ;                                                                               // Enumerable with 1 element duplicated
                    }

                    if (count >= 3)
                    {
                        if ((enumerableType == EnumerableType.List || enumerableType == EnumerableType.Queue))
                        {
                            yield return new object[] { enumerableType, count, count, 0, 1 }
                        }
                        ;                                                                               // Enumerable with all elements duplicated
                        yield return(new object[] { enumerableType, count, count - 1, 2, 0 });          // Enumerable that is 1 smaller with 2 matching elements
                    }
                }
            }
        }
Ejemplo n.º 20
0
        public void MultipleWorkItemsMultiplePriorities()
        {
            // Get all the available priorities
            WorkItemPriority[] priorities = Enum2.GetValues(typeof(WorkItemPriority)).Cast <WorkItemPriority> ().ToArray();

            // Create an array of priority items
            PriorityItem[] priorityItems = new PriorityItem[priorities.Length];

            // Create a priority item for each priority
            int i = priorities.Length;

            foreach (WorkItemPriority workItemPriority in priorities)
            {
                --i;
                priorityItems[i] = new PriorityItem(workItemPriority);
            }

            // Create a PermutationGenerator for the priority items
            PermutationGenerator permutations = new PermutationGenerator(priorityItems);

            int count = 0;

            // Iterate over the permutations
            foreach (object[] permutation in permutations)
            {
                ++count;
                //Console.Write ("Permutation #" + count + " : ");
                for (int j = 0; j < permutation.Length; ++j)
                {
                    PriorityItem pi = permutation[j] as PriorityItem;
                    //Console.Write (pi.WorkItemPriority + ", ");
                }
                //Console.WriteLine ();
                // Create a priority queue
                PriorityQueue pq = new PriorityQueue();

                // Enqueue each priority item according to the permutation
                for (i = 0; i < permutation.Length; ++i)
                {
                    PriorityItem priorityItem = permutation[i] as PriorityItem;
                    pq.Enqueue(priorityItem);
                }

                // Make sure all the priority items are in the queue
                Assert.AreEqual(priorityItems.Length, pq.Count);

                // Compare the order of the priority items
                for (i = 0; i < priorityItems.Length; ++i)
                {
                    PriorityItem priorityItem = pq.Dequeue() as PriorityItem;
                    Assert.AreSame(priorityItems[i], priorityItem);
                }
            }
        }
Ejemplo n.º 21
0
        private void EnumGetNames(Type enumType, string[] expected)
        {
            string[] result = Enum2.GetNames(enumType);

            Assert.IsNotNull(result);
            Assert.AreEqual(expected.Length, result.Length);

            for (int i = 0; i < result.Length; i++)
            {
                Assert.AreEqual(expected[i], result[i]);
            }
        }
Ejemplo n.º 22
0
        private void EnumGetValues(Type enumType, ulong[] expected)
        {
            Array result = Enum2.GetValues(enumType);

            Assert.IsNotNull(result);
            Assert.AreEqual(expected.Length, result.Length);

            for (int i = 0; i < result.Length; i++)
            {
                Assert.AreEqual(expected[i], Convert.ToUInt64(result.GetValue(i)));
            }
        }
Ejemplo n.º 23
0
        public void Enum_GetName_Invalid()
        {
            Type t = typeof(SimpleEnum);

            AssertExtensions.Throws <ArgumentNullException>("enumType", () => Enum2.GetName(null, 1)); // Enum type is null
            AssertExtensions.Throws <ArgumentNullException>("value", () => Enum2.GetName(t, null));    // Value is null

            //AssertExtensions.Throws<ArgumentException>(null, () => Enum2.GetName(typeof(object), 1)); // Enum type is not an enum
            AssertExtensions.Throws <ArgumentException>("enumType", () => Enum2.GetName(typeof(object), 1)); // Enum type is not an enum
            AssertExtensions.Throws <ArgumentException>("value", () => Enum2.GetName(t, "Red"));             // Value is not the type of the enum's raw data
            AssertExtensions.Throws <ArgumentException>("value", () => Enum2.GetName(t, (IntPtr)0));         // Value is out of range
        }
Ejemplo n.º 24
0
        private static void Enum_GetName(Type enumType, object value, string expected)
        {
            Assert.AreEqual(expected, Enum2.GetName(enumType, value),
                            "Invalid name for {0} of type {1}", value, enumType.Name);

            // The format "G" should return the name of the enum case
            if (value.GetType() == enumType)
            {
                ToString_Format((Enum)value, "G", expected);
            }
            else
            {
                Format(enumType, value, "G", expected ?? value.ToString());
            }
        }
Ejemplo n.º 25
0
 public Stream2(Enum2 enum2_1, ushort ushort_0, GenericAudioStream stream1_0, Interface5[] interface5_0) : base()
 {
     this.list_0    = new List <GenericAudioStream>();
     this.class12_0 = new Class12(new Interface5[0]);
     //base..ctor();
     this.enum2_0      = enum2_1;
     this.bool_1       = false;
     this.waveFormat_0 = new WaveFormat(stream1_0.vmethod_0().int_0, (ushort_0 != 0) ? ((int)ushort_0) : Math.Min((int)stream1_0.vmethod_0().short_0, Stream2.smethod_0(this.enum2_0)));
     this.list_0.Add(stream1_0);
     this.long_1        = 0L;
     stream1_0.Position = 0L;
     this.long_0        = Convert.ToInt64((double)(this.waveFormat_0.int_0 * (int)this.waveFormat_0.short_1) * stream1_0.vmethod_1().timeSpan_0.TotalSeconds);
     this.method_0(interface5_0);
     this.bool_0 = (stream1_0.vmethod_0().short_0 == 1 && ushort_0 < 2);
     this.int_2  = (int)this.waveFormat_0.short_0 << 2;
 }
Ejemplo n.º 26
0
        public void Enum_Format_Invalid()
        {
            AssertExtensions.Throws <ArgumentNullException>("enumType", () => Enum2.Format(null, (Int32Enum)1, "F"));                // Enum type is null
            AssertExtensions.Throws <ArgumentNullException>("value", () => Enum2.Format(typeof(SimpleEnum), null, "F"));             // Value is null
            AssertExtensions.Throws <ArgumentNullException>("format", () => Enum2.Format(typeof(SimpleEnum), SimpleEnum.Red, null)); // Format is null

            AssertExtensions.Throws <ArgumentException>("enumType", () => Enum2.Format(typeof(object), 1, "F"));                     // Enum type is not an enum type

            AssertExtensions.Throws <ArgumentException>(null, () => Enum2.Format(typeof(SimpleEnum), (Int32Enum)1, "F"));            // Value is of the wrong enum type

            AssertExtensions.Throws <ArgumentException>(null, () => Enum2.Format(typeof(SimpleEnum), (short)1, "F"));                // Value is of the wrong integral
            AssertExtensions.Throws <ArgumentException>(null, () => Enum2.Format(typeof(SimpleEnum), "Red", "F"));                   // Value is of the wrong integral

            AssertExtensions.Throws <FormatException>(() => Enum2.Format(typeof(SimpleEnum), SimpleEnum.Red, ""));                   // Format is empty
            AssertExtensions.Throws <FormatException>(() => Enum2.Format(typeof(SimpleEnum), SimpleEnum.Red, "   \t"));              // Format is whitespace
            AssertExtensions.Throws <FormatException>(() => Enum2.Format(typeof(SimpleEnum), SimpleEnum.Red, "t"));                  // No such format
        }
Ejemplo n.º 27
0
        public void SpecifiedOptionalArgumentTest()
        {
            const Enum2 expectedValue = Enum2.Value5;

            this.cakeArgs.Setup(
                m => m.HasArgument(optionalArgName)
                ).Returns(true);

            this.cakeArgs.SetupGetArgumentSingle(
                optionalArgName,
                expectedValue.ToString()
                );

            OptionalArgument2 uut = ArgumentBinderAliases.CreateFromArguments <OptionalArgument2>(this.cakeContext.Object);

            Assert.AreEqual(expectedValue, uut.Enum2Property);
        }
Ejemplo n.º 28
0
 public Stream2(Enum2 enum2_1, ushort ushort_0, GenericAudioStream stream1_0, Interface5[] interface5_0)
     : base()
 {
     this.list_0 = new List<GenericAudioStream>();
     this.class12_0 = new Class12(new Interface5[0]);
     //base..ctor();
     this.enum2_0 = enum2_1;
     this.bool_1 = false;
     this.waveFormat_0 = new WaveFormat(stream1_0.vmethod_0().int_0, (ushort_0 != 0) ? ((int)ushort_0) : Math.Min((int)stream1_0.vmethod_0().short_0, Stream2.smethod_0(this.enum2_0)));
     this.list_0.Add(stream1_0);
     this.long_1 = 0L;
     stream1_0.Position = 0L;
     this.long_0 = Convert.ToInt64((double)(this.waveFormat_0.int_0 * (int)this.waveFormat_0.short_1) * stream1_0.vmethod_1().timeSpan_0.TotalSeconds);
     this.method_0(interface5_0);
     this.bool_0 = (stream1_0.vmethod_0().short_0 == 1 && ushort_0 < 2);
     this.int_2 = (int)this.waveFormat_0.short_0 << 2;
 }
Ejemplo n.º 29
0
        private void EnumGetName(Type enumType, object[] values, string[] names)
        {
            Assert.IsNotNull(values);
            Assert.IsNotNull(names);
            Assert.AreEqual(values.Length, names.Length);

            if (values.Length < 1)
            {
                Assert.Fail("Values cannot be empty");
            }

            for (int i = 0; i < values.Length; i++)
            {
                string name = Enum2.GetName(enumType, values[i]);
                Assert.AreEqual(names[i], name);
            }
        }
Ejemplo n.º 30
0
        private static void GetNames_GetValues(Type enumType, string[] expectedNames, object[] expectedValues)
        {
            //Assert.AreEqual(expectedNames, Enum.GetNames(enumType));
            //Assert.AreEqual(expectedValues, Enum.GetValues(enumType).Cast<object>().ToArray());
            string[] names = Enum2.GetNames(enumType);
            Assert.IsNotNull(names, enumType.ToString());
            Assert.AreEqual(expectedNames.Length, names.Length, enumType.ToString());
            for (int i = 0; i < names.Length; i++)
            {
                Assert.AreEqual(expectedNames[i], names[i], enumType.ToString());
            }

            object[] values = Enum2.GetValues(enumType).Cast <object>().ToArray();
            Assert.IsNotNull(values);
            Assert.AreEqual(expectedValues.Length, values.Length);
            for (int i = 0; i < values.Length; i++)
            {
                Assert.AreEqual(expectedValues[i], values[i], enumType.ToString());
            }
        }
        public AboutPageViewModel()
        {
            preferenceButtons = new(Enum2.GetAll <PreferenceButton>().Select(x => PreferenceButtonViewModel.Create(x, this)));

            UserService.Current.WhenAnyValue(x => x.User).Subscribe(value =>
            {
                if (value == null)
                {
                    PreferenceButtonViewModel.RemoveAuthorized(preferenceButtons, this);
                }
                else
                {
                    var delAccount = preferenceButtons.FirstOrDefault(x => x.Id == PreferenceButton.账号注销);
                    if (delAccount == null)
                    {
                        delAccount = PreferenceButtonViewModel.Create(PreferenceButton.账号注销, this);
                        preferenceButtons.Add(delAccount);
                    }
                }
            }).AddTo(this);
        }
Ejemplo n.º 32
0
 // Token: 0x06000E46 RID: 3654
 // RVA: 0x0004E3A4 File Offset: 0x0004C5A4
 public int method_1(Enum2 enum2_0, Class31 class31_0)
 {
     if (this.bool_0)
     {
         byte[] array = this.byte_0[(int)enum2_0];
         if (array != null)
         {
             if (array.Length > 0)
             {
                 class31_0.Seek(0, SeekOrigin.Begin);
                 class31_0.BaseStream.Write(array, 0, array.Length);
             }
             return array.Length;
         }
     }
     int num;
     switch (enum2_0)
     {
     case Enum2.const_0:
         IL_47:
         num = this.method_2(class31_0);
         goto IL_59;
     case Enum2.const_1:
         num = this.method_3(class31_0);
         goto IL_59;
     }
     goto IL_47;
     IL_59:
     if (this.bool_0)
     {
         byte[] array2 = new byte[num];
         if (num > 0)
         {
             class31_0.Seek(0, SeekOrigin.Begin);
             class31_0.BaseStream.Read(array2, 0, num);
         }
         this.byte_0[(int)enum2_0] = array2;
     }
     return num;
 }
Ejemplo n.º 33
0
 public Stream2(Enum2 enum2_1, ushort ushort_0, bool bool_2, GenericAudioStream[] stream1_0)
     : base()
 {
     this.list_0 = new List<GenericAudioStream>();
     this.class12_0 = new Class12(new Interface5[0]);
     //base..ctor();
     this.enum2_0 = enum2_1;
     this.bool_1 = bool_2;
     this.list_0.AddRange(stream1_0);
     this.bool_0 = (stream1_0.Length == 1 && stream1_0[0].vmethod_0().short_0 == 1 && ushort_0 < 2);
     this.long_1 = 0L;
     this.long_0 = stream1_0[0].Length;
     int val = 0;
     int num = 0;
     for (int i = 0; i < stream1_0.Length; i++)
     {
         GenericAudioStream stream = stream1_0[i];
         val = Math.Max(val, stream.vmethod_0().int_0);
         if (this.bool_1)
         {
             num += (int)stream.vmethod_0().short_0;
         }
         else
         {
             num = Math.Max(num, (int)stream.vmethod_0().short_0);
         }
         stream.Position = this.long_1;
     }
     this.waveFormat_0 = new WaveFormat(val, (ushort_0 != 0) ? ((int)ushort_0) : Math.Min(num, Stream2.smethod_0(this.enum2_0) * (this.bool_1 ? stream1_0.Length : 1)));
     for (int j = 0; j < stream1_0.Length; j++)
     {
         GenericAudioStream stream2 = stream1_0[j];
         this.long_0 = Math.Max(this.long_0, Convert.ToInt64((double)(this.waveFormat_0.int_0 * (int)this.waveFormat_0.short_1) * stream2.vmethod_1().timeSpan_0.TotalSeconds));
     }
     this.int_2 = (int)this.waveFormat_0.short_0 << 2;
 }
Ejemplo n.º 34
0
 public void outParameters(out bool aBool, out byte aByte,
                   out short aShort, out ushort aUShort,
                   out int aInt, out uint aUInt,
                   out long aLong, out ulong aULong,
                   out float aFloat, out double aDouble,
                   out char aChar, out string aString,
                   out Type aType, out uno.Any aAny,
                   out Enum2 aEnum, out Struct1 aStruct,
                   out object aXInterface,
                   out unoidl.com.sun.star.lang.XComponent aXComponent,
                   out bool[] seqBool)
 {
     aBool = m_Bool;
     aByte = m_Byte;
     aShort = m_Short;
     aUShort = m_UShort;
     aInt = m_Int;
     aUInt = m_UInt;
     aLong = m_Long;
     aULong = m_ULong;
     aFloat = m_Float;
     aDouble = m_Double;
     aChar = m_Char;
     aString = m_String;
     aType = m_Type;
     aAny = m_Any;
     aEnum = m_Enum2;
     aStruct = m_Struct1;
     aXInterface = m_XInterface;
     aXComponent = m_XComponent;
     seqBool = m_seqBool;
         
 }
Ejemplo n.º 35
0
 public Stream2(Enum2 enum2_1, GenericAudioStream stream1_0, Interface5[] interface5_0)
     : this(enum2_1, 0, stream1_0, interface5_0)
 {
 }
Ejemplo n.º 36
0
    public void testS1(Logger l) {
        l.Function = "testS1";
        object obj = new Object();
        ucss.uno.RuntimeException excRuntime =
            new ucss.uno.RuntimeException("RuntimeException", obj);
        ucss.uno.Exception excException =
            new ucss.uno.Exception("Exception", obj);
        ucss.lang.IllegalAccessException excIllegalAccess =
            new ucss.lang.IllegalAccessException("IllegalAccessException", obj);
        ucss.uno.DeploymentException excDeployment =
            new ucss.uno.DeploymentException("DeploymentException", obj);
        ucss.lang.InvalidListenerException excInvalidListener =
            new ucss.lang.InvalidListenerException("ListenerException", obj);
        
        /* create1 does not specify exceptions. Therefore RuntimeExceptions
           fly through and other exceptions cause a DeploymentException.
        */            
        try {
            S1.create1(new Context(Context.test_kind.TEST_EXCEPTION, excRuntime));
        } catch (ucss.uno.RuntimeException e) {
            l.assure(e.Message == excRuntime.Message
                     && e.Context == obj);
        } catch (System.Exception) {
            l.assure(false);
        }

        Context c = new Context(Context.test_kind.TEST_EXCEPTION, excException); 
        try {
            S1.create1(c);
        } catch (ucss.uno.DeploymentException e) {
            //The message of the original exception should be contained
            // in the Deploymentexception
            l.assure(e.Message.IndexOf(excException.Message) != -1 && e.Context == c);
        } catch (System.Exception) {
            l.assure(false);
        }

        /* create2 specifies many exceptions, including RuntimeException and Exception.
           Because Exception is specified all exceptions are allowed, hence all thrown
           exceptions fly through.
         */
        try {
            S1.create2(new Context(Context.test_kind.TEST_EXCEPTION, excRuntime));
        } catch (ucss.uno.RuntimeException e) {
            l.assure(e.Message == excRuntime.Message
                     && e.Context == obj);
        } catch (System.Exception) {
            l.assure(false);
        }

        try {
            S1.create2(new Context(Context.test_kind.TEST_EXCEPTION, excIllegalAccess));
        } catch (ucss.lang.IllegalAccessException e) {
            l.assure(e.Message == excIllegalAccess.Message
                     && e.Context == obj);
        } catch (System.Exception) {
            l.assure(false);
        }

        try {
            S1.create2(new Context(Context.test_kind.TEST_EXCEPTION, excException));
        } catch (ucss.uno.Exception e) {
            l.assure(e.Message == excException.Message
                     && e.Context == obj);
        } catch (System.Exception) {
            l.assure(false);
        }

        /* create3 specifies exceptions but no com.sun.star.uno.Exception. RuntimeException
           and derived fly through. Other specified exceptions are rethrown and all other
           exceptions cause a DeploymentException.
        */
        try {
            S1.create3(new Context(Context.test_kind.TEST_EXCEPTION, excDeployment),
                       new Any[]{});
        } catch (ucss.uno.DeploymentException e) {
            l.assure(e.Message == excDeployment.Message
                     && e.Context == obj);
        } catch (System.Exception) {
            l.assure(false);
        }

        try {
            S1.create3(new Context(Context.test_kind.TEST_EXCEPTION, excIllegalAccess),
                       new Any[0]);
        } catch (ucss.lang.IllegalAccessException e) {
            l.assure(e.Message == excIllegalAccess.Message
                     && e.Context == obj);
        } catch (System.Exception) {
            l.assure(false);
        }

        c = new Context(Context.test_kind.TEST_EXCEPTION, excInvalidListener);
        try {
            S1.create3(c, new Any[0]);
        } catch (ucss.uno.DeploymentException e) {
            l.assure(e.Message.IndexOf(excInvalidListener.Message) != -1
                     && e.Context == c);
        } catch (System.Exception) {
            l.assure(false);
        }

        /* test the case when the context cannot provide a service manager.
         */
        try {
            S1.create2(new Context(Context.test_kind.NO_FACTORY));
        } catch (ucss.uno.DeploymentException e) {
            l.assure(e.Message.Length > 0);
        } catch (System.Exception) {
            l.assure(false);
        }

        /* When the service manager returns a null pointer then a DeploymentException
         * is to be thrown.
         */
        try {
            S1.create2(new Context(Context.test_kind.CREATION_FAILED));
        } catch (ucss.uno.DeploymentException e) {
            l.assure(e.Message.Length > 0);
        } catch (System.Exception) {
            l.assure(false);
        }


        /** Test creation of components and if the passing of parameters works.
         */
        c = new Context(Context.test_kind.NORMAL);
        try {
            XTest xTest = S1.create1(c);
            Component cobj = (Component) xTest;
            l.assure(cobj.Args[0].Value == c);

            Any a1 = new Any("bla");
            Any a2 = new Any(3.14f);
            Any a3 = new Any(3.145d);
            xTest = S1.create2(c, a1, a2, a3);
            cobj = (Component) xTest;
            l.assure(cobj.Args[0].Value == c
                     && a1.Equals(cobj.Args[1])
                     && a2.Equals(cobj.Args[2])
                     && a3.Equals(cobj.Args[3]));

            bool b1 = true;
            byte b2 = 1;
            short b3 = 2;
            ushort b4 = 3;
            int b5 = 4;
            uint b6 = 5;
            long b7 = 6;
            ulong b8 = 7;
            float b9 = 0.8f;
            double b10 = 0.9;
            char b11 = 'A';
            string b12 = "BCD";
            Type b13 = typeof(ulong);
            Any b14 = new Any(22);
            Enum2 b15 = Enum2.VALUE4;
            Struct1 b16 = new Struct1(1);
            PolyStruct b17 = new PolyStruct('A', 1);
            PolyStruct b18 = new PolyStruct(new Any(true), 1);
            object b19 = new uno.util.WeakComponentBase();
            ucss.lang.XComponent b20 = (ucss.lang.XComponent) b19;
            bool b21 = b1;
            byte b22 = b2;
            short b23 = b3;
            ushort b24 = b4;
            int b25 = b5;
            uint b26 = b6;
            long b27 = b7;
            ulong b28 = b8;
            float b29 = b9;
            double b30 = b10;
            char b31 = b11;
            string b32 = b12;
            Type b33 = b13;
            Any b34 = b14;
            Enum2 b35 = b15;
            Struct1 b36 = b16;
            object b37 = b19;
            ucss.lang.XComponent b38 = b20;
            bool[] b39 = new bool[] { false, true };
            byte[] b40 = new byte[] { (byte) 1, (byte) 2 };
            short[] b41 = new short[] { (short) 123, (short) 456};
            ushort[] b42 = new ushort[] { (ushort) 789, (ushort) 101};
            int[] b43 = new int[] {1, 2, 3};
            uint[] b44 = new uint[] {4, 5, 6};
            long[] b45 = new long[] {7,8,9};
            ulong[] b46 = new ulong[] {123, 4356};
            float[] b47 = new float[] {2435f,87f};
            double[] b48 = new double[] {234d,45.2134d};
            char[] b49 = new char[] {'\u1234', 'A'};
            string[] b50 = new string[] {"a","bc"};
            Type[] b51 = new Type[] {typeof(int), typeof(long)};
            Any[] b52 = new Any[] {new Any(1), new Any("adf")};
            Enum2[] b53 = new Enum2[] {Enum2.VALUE2};
            Struct1[] b54 = new Struct1[] {new Struct1(11), new Struct1(22)};
            object[] b55 = new object[0];
            ucss.lang.XComponent[] b56 = new ucss.lang.XComponent[]{
                new uno.util.WeakComponentBase(), new uno.util.WeakComponentBase()};
            bool[][] b57 = new bool[][] {new bool[]{true,false}, new  bool[] {true}};
            byte[][] b58 = new byte[][]{new byte[] {(byte) 1}, new byte[]{(byte) 2}};
            short[][] b59 = new short[][] {new short[]{(short)6, (short)7}, new short[] {(short)9}};
            ushort[][] b60 = new ushort[][] { new ushort[]{(ushort) 11}};
            int[][] b61 = new int[][] {new int[]{1}, new int[]{2,3}, new int[]{4,5,6}};
            uint[][] b62 = new uint[][] {new uint[]{10U}, new uint[]{20U,30U}, new uint[]{40U,50U,60}};
            long[][] b63 = new long[][] {new long[]{10L}, new long[]{20L,30}, new long[]{40,50,60}};
            ulong[][] b64 = new ulong[][] { new ulong[]{10L}, new ulong[]{20L, 30L}, new ulong[]{40,50,60}};
            float[][] b65 = new float[][] {new float[]{10f}, new float[]{20f,30f}, new float[]{40f,50f,60f}};
            double[][] b66 = new double[][]{new double[]{10d}, new double[]{20d,30d}};
            char[][] b67 = new char[][] {new char[]{'a'}, new char[]{'b', 'c'}};
            string[][] b68 = new String[][] {new string[]{"a"}, new string[]{"ad", "lkj"}};
            Type[][] b69 = new Type[][] {new Type[]{typeof(byte), typeof(long)}, new Type[]{typeof(Any)}};
            Any[][] b70 = new Any[][] {new Any[]{new Any(1f), new Any(2d)}, new Any[]{new Any(34U)}};
            Enum2[][] b71 = new Enum2[][] {new Enum2[]{Enum2.VALUE2}};
            Struct1[][] b72 = new Struct1[][] {new Struct1[]{new Struct1(2), new Struct1(3)}};
            object[][] b73 =  new Object[0][];
            ucss.lang.XComponent[][] b74 = new uno.util.WeakComponentBase[0][];
            bool[][] b75 = b57;
            byte[][] b76 = b58;
            short[][] b77 = b59;
            ushort[][] b78 = b60;
            int[][] b79 = b61;
            uint[][] b80 = b62;
            long[][] b81 = b63;
            ulong[][] b82 = b64;
            float[][] b83 = b65;
            double[][] b84 = b66;
            char[][] b85 = b67;
            String[][] b86 = b68;
            Type[][] b87 =b69;
            Any[][] b88 = b70;
            Enum2[][] b89 = b71;
            Struct1[][] b90 = b72;
            Object[][] b91 = b73;
            ucss.lang.XComponent[][] b92 = b74;

            xTest = S1.create5(
                c,
                b1, b2, b3, b4, b5, b6, b7 ,b8, b9, b10,
                b11, b12, b13,
                b14,
                b15, b16, b17, b18, b19, b20,
                b21, b22, b23, b24, b25, b26, b27, b28, b29, b30,
                b31, b32, b33,
                b34,
                b35, b36, b37, b38, b39, b40,
                b41, b42, b43, b44, b45, b46, b47, b48, b49, b50,
                b51, b52, b53, b54, b55, b56, b57, b58, b59, b60,
                b61, b62, b63, b64, b65, b66, b67, b68, b69, b70,
                b71, b72, b73, b74, b75, b76, b77, b78, b79, b80,
                b81, b82, b83, b84, b85, b86, b87, b88, b89, b90,
                b91, b92
                 );

            cobj = (Component) xTest;
            l.assure(cobj.Args[0].Value == c);
            l.assure(b1.Equals(cobj.Args[1].Value));
            l.assure(b2.Equals(cobj.Args[2].Value));
            l.assure(b3.Equals(cobj.Args[3].Value));
            l.assure(b4.Equals(cobj.Args[4].Value));
            l.assure(b5.Equals(cobj.Args[5].Value));
            l.assure(b6.Equals(cobj.Args[6].Value));
            l.assure(b7.Equals(cobj.Args[7].Value));
            l.assure(b8.Equals(cobj.Args[8].Value));
            l.assure(b9.Equals(cobj.Args[9].Value));
            l.assure(b10.Equals(cobj.Args[10].Value));
            l.assure(b11.Equals(cobj.Args[11].Value));
            l.assure(b12.Equals(cobj.Args[12].Value));
            l.assure(b13.Equals(cobj.Args[13].Value));
			//Anys are not wrapped by the generated code
            l.assure(b14.Equals(cobj.Args[14]));
            l.assure(b15.Equals(cobj.Args[15].Value));
            l.assure(b16.Equals(cobj.Args[16].Value));
            l.assure(b17.Equals(cobj.Args[17].Value));
            l.assure(b18.Equals(cobj.Args[18].Value));
            l.assure(b19.Equals(cobj.Args[19].Value));
            l.assure(b20.Equals(cobj.Args[20].Value));
            l.assure(b21.Equals(cobj.Args[21].Value));
            l.assure(b22.Equals(cobj.Args[22].Value));
            l.assure(b23.Equals(cobj.Args[23].Value));
            l.assure(b24.Equals(cobj.Args[24].Value));
            l.assure(b25.Equals(cobj.Args[25].Value));
            l.assure(b26.Equals(cobj.Args[26].Value));
            l.assure(b27.Equals(cobj.Args[27].Value));
            l.assure(b28.Equals(cobj.Args[28].Value));
            l.assure(b29.Equals(cobj.Args[29].Value));
            l.assure(b30.Equals(cobj.Args[30].Value));
            l.assure(b31.Equals(cobj.Args[31].Value));
            l.assure(b32.Equals(cobj.Args[32].Value));
            l.assure(b33.Equals(cobj.Args[33].Value));
			//Anys are not wrapped by the generated code
            l.assure(b34.Equals(cobj.Args[34]));
            l.assure(b35.Equals(cobj.Args[35].Value));
            l.assure(b36.Equals(cobj.Args[36].Value));
            l.assure(b37.Equals(cobj.Args[37].Value));
            l.assure(b38.Equals(cobj.Args[38].Value));
            l.assure(b39.Equals(cobj.Args[39].Value));
            l.assure(b40.Equals(cobj.Args[40].Value));
            l.assure(b41.Equals(cobj.Args[41].Value));
            l.assure(b42.Equals(cobj.Args[42].Value));
            l.assure(b43.Equals(cobj.Args[43].Value));
            l.assure(b44.Equals(cobj.Args[44].Value));
            l.assure(b45.Equals(cobj.Args[45].Value));
            l.assure(b46.Equals(cobj.Args[46].Value));
            l.assure(b47.Equals(cobj.Args[47].Value));
            l.assure(b48.Equals(cobj.Args[48].Value));
            l.assure(b49.Equals(cobj.Args[49].Value));
            l.assure(b50.Equals(cobj.Args[50].Value));
            l.assure(b51.Equals(cobj.Args[51].Value));
            l.assure(b52.Equals(cobj.Args[52].Value));
            l.assure(b53.Equals(cobj.Args[53].Value));
            l.assure(b54.Equals(cobj.Args[54].Value));
            l.assure(b55.Equals(cobj.Args[55].Value));
            l.assure(b56.Equals(cobj.Args[56].Value));
            l.assure(b57.Equals(cobj.Args[57].Value));
            l.assure(b58.Equals(cobj.Args[58].Value));
            l.assure(b59.Equals(cobj.Args[59].Value));
            l.assure(b60.Equals(cobj.Args[60].Value));
            l.assure(b61.Equals(cobj.Args[61].Value));
            l.assure(b62.Equals(cobj.Args[62].Value));
            l.assure(b63.Equals(cobj.Args[63].Value));
            l.assure(b64.Equals(cobj.Args[64].Value));
            l.assure(b65.Equals(cobj.Args[65].Value));
            l.assure(b66.Equals(cobj.Args[66].Value));
            l.assure(b67.Equals(cobj.Args[67].Value));
            l.assure(b68.Equals(cobj.Args[68].Value));
            l.assure(b69.Equals(cobj.Args[69].Value));
            l.assure(b70.Equals(cobj.Args[70].Value));
            l.assure(b71.Equals(cobj.Args[71].Value));
            l.assure(b72.Equals(cobj.Args[72].Value));
            l.assure(b73.Equals(cobj.Args[73].Value));
            l.assure(b74.Equals(cobj.Args[74].Value));
            l.assure(b75.Equals(cobj.Args[75].Value));
            l.assure(b76.Equals(cobj.Args[76].Value));
            l.assure(b77.Equals(cobj.Args[77].Value));
            l.assure(b78.Equals(cobj.Args[78].Value));
            l.assure(b79.Equals(cobj.Args[79].Value));
            l.assure(b80.Equals(cobj.Args[80].Value));
            l.assure(b81.Equals(cobj.Args[81].Value));
            l.assure(b82.Equals(cobj.Args[82].Value));
            l.assure(b83.Equals(cobj.Args[83].Value));
            l.assure(b84.Equals(cobj.Args[84].Value));
            l.assure(b85.Equals(cobj.Args[85].Value));
            l.assure(b86.Equals(cobj.Args[86].Value));
            l.assure(b87.Equals(cobj.Args[87].Value));
            l.assure(b88.Equals(cobj.Args[88].Value));
            l.assure(b89.Equals(cobj.Args[89].Value));
            l.assure(b90.Equals(cobj.Args[90].Value));
            l.assure(b91.Equals(cobj.Args[91].Value));
            l.assure(b92.Equals(cobj.Args[92].Value));

        } catch (Exception) {
            l.assure(false);
        }

        //test
        c = new Context(Context.test_kind.NORMAL);
        try {
            
            PolyStruct2 arg1 = new PolyStruct2(typeof(PolyStruct2), 1);
            PolyStruct2 arg2 = new PolyStruct2(new Any(true), 1);
            PolyStruct2 arg3 = new PolyStruct2(true, 1);
            PolyStruct2 arg4 = new PolyStruct2((Byte)8, 1);
            PolyStruct2 arg5 = new PolyStruct2('c', 1);
            PolyStruct2 arg6 = new PolyStruct2((Int16)10, 1);
            PolyStruct2 arg7 = new PolyStruct2(11, 1);
            PolyStruct2 arg8 = new PolyStruct2(12L, 1);
            PolyStruct2 arg9 = new PolyStruct2("Hello", 1);
            PolyStruct2 arg10 = new PolyStruct2(1.3, 1);
            PolyStruct2 arg11 = new PolyStruct2(1.3d, 1);
            PolyStruct2 arg12 = new PolyStruct2(new Object(), 1);
            PolyStruct2 arg13 = new PolyStruct2(new uno.util.WeakComponentBase(), 1);
            PolyStruct2 arg14 = new PolyStruct2(
                new PolyStruct('A', 1), 1);
            PolyStruct2 arg15 = new PolyStruct2(
                new PolyStruct(new PolyStruct('A',1),1),1);
            PolyStruct arg16 = new PolyStruct("Hallo", 1);
            PolyStruct arg17 = new PolyStruct(
                new PolyStruct('A',1),1);

            Type[] arType = {typeof(PolyStruct), typeof(PolyStruct2)};
            PolyStruct2 arg101 = new PolyStruct2(arType,1);
            PolyStruct2 arg102 = new PolyStruct2(
                new Any[] {new Any(true)},1);
            PolyStruct2 arg103 = new PolyStruct2(new bool[]{true}, 1);
            PolyStruct2 arg104 = new PolyStruct2(new byte[] { (byte) 1}, 1);
            PolyStruct2 arg105 = new PolyStruct2(new char[] {'\u1234', 'A'}, 1);
            PolyStruct2 arg106 = new PolyStruct2(new short[] {(short)1}, 1);
            PolyStruct2 arg107 = new PolyStruct2(new int[] {1}, 1);
            PolyStruct2 arg108 = new PolyStruct2(new long[] {1}, 1);
            PolyStruct2 arg109 = new PolyStruct2(new string[]{"Hallo"}, 1);
            PolyStruct2 arg110 = new PolyStruct2(new float[]{1.3f}, 1);
            PolyStruct2 arg111 = new PolyStruct2(new double[] {1.3d}, 1);
            PolyStruct2 arg112 = new PolyStruct2(
                new Object[] { new Object()}, 1);
            PolyStruct2 arg113 = new PolyStruct2(
                new uno.util.WeakComponentBase[] {
                    new uno.util.WeakComponentBase()}, 1);
            PolyStruct2 arg114 = new PolyStruct2(
                new PolyStruct[]{
                new PolyStruct('A',1)} ,1);
            PolyStruct2 arg115 = new PolyStruct2(
                new PolyStruct[] {
                new PolyStruct( new PolyStruct2('A',1),1)}
                ,1);
            PolyStruct2 arg201 = new PolyStruct2(new char[][] { new char[]{'A'},
                                                            new char[]{'B'}}, 1);

			PolyStruct2[] arg301 = new PolyStruct2[] {new PolyStruct2('A', 1)};
			PolyStruct2[] arg302 = new PolyStruct2[] {new PolyStruct2(
				new PolyStruct('A', 1), 1)};
			PolyStruct2[] arg303 = new PolyStruct2[] {new PolyStruct2(
				new PolyStruct(new PolyStruct('A',1),1),1)};
			PolyStruct[] arg304 = new PolyStruct[] {new PolyStruct("Hallo", 1)};
			PolyStruct[] arg305 = new PolyStruct[] {new PolyStruct(
				new PolyStruct('A',1),1)};

			PolyStruct2[][] arg401 = new PolyStruct2[][] {new PolyStruct2[] {new PolyStruct2('A', 1)}};
			PolyStruct2[][] arg402 = new PolyStruct2[][] {new PolyStruct2[] {new PolyStruct2(
				new PolyStruct('A', 1), 1)}};
			PolyStruct2[][] arg403 = new PolyStruct2[][] {new PolyStruct2[] {new PolyStruct2(
				new PolyStruct(new PolyStruct('A',1),1),1)}};
			PolyStruct[][] arg404 = new PolyStruct[][] {new PolyStruct[] {new PolyStruct("Hallo", 1)}};
			PolyStruct[][] arg405 = new PolyStruct[][] {new PolyStruct[] {new PolyStruct(
				new PolyStruct('A',1),1)}};


            XTest xTest = S1.create6(c,
                 arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,
                 arg11,arg12,arg13,arg14,arg15,arg16,arg17,
                 arg101,arg102,arg103,arg104,arg105,arg106,arg107,arg108,arg109,arg110,
                 arg111,arg112,arg113,arg114,arg115,
                 arg201,
				arg301, arg302, arg303, arg304, arg305,
				arg401, arg402, arg403, arg404, arg405);
            Component cobj = (Component) xTest;
            l.assure(cobj.Args[0].Value == c);
			//arg1 - arg17
            string sType = ((PolymorphicType) cobj.Args[1].Type).PolymorphicName;
            l.assure( sType == "unoidl.test.cliure.climaker.PolyStruct2<System.Type>");
            sType = ((PolymorphicType) cobj.Args[2].Type).PolymorphicName;
            l.assure( sType == "unoidl.test.cliure.climaker.PolyStruct2<uno.Any>");
            sType = ((PolymorphicType) cobj.Args[3].Type).PolymorphicName;
            l.assure( sType == "unoidl.test.cliure.climaker.PolyStruct2<System.Boolean>");
            sType = ((PolymorphicType) cobj.Args[4].Type).PolymorphicName;
            l.assure( sType == "unoidl.test.cliure.climaker.PolyStruct2<System.Byte>");
            sType = ((PolymorphicType) cobj.Args[5].Type).PolymorphicName;
            l.assure( sType == "unoidl.test.cliure.climaker.PolyStruct2<System.Char>");
            sType = ((PolymorphicType) cobj.Args[6].Type).PolymorphicName;
            l.assure( sType == "unoidl.test.cliure.climaker.PolyStruct2<System.Int16>");
            sType = ((PolymorphicType) cobj.Args[7].Type).PolymorphicName;
            l.assure( sType == "unoidl.test.cliure.climaker.PolyStruct2<System.Int32>");
            sType = ((PolymorphicType) cobj.Args[8].Type).PolymorphicName;
            l.assure( sType == "unoidl.test.cliure.climaker.PolyStruct2<System.Int64>");
            sType = ((PolymorphicType) cobj.Args[9].Type).PolymorphicName;
            l.assure( sType == "unoidl.test.cliure.climaker.PolyStruct2<System.String>");
            sType = ((PolymorphicType) cobj.Args[10].Type).PolymorphicName;
            l.assure( sType == "unoidl.test.cliure.climaker.PolyStruct2<System.Single>");
            sType = ((PolymorphicType) cobj.Args[11].Type).PolymorphicName;
            l.assure( sType == "unoidl.test.cliure.climaker.PolyStruct2<System.Double>");
            sType = ((PolymorphicType) cobj.Args[12].Type).PolymorphicName;
            l.assure( sType == "unoidl.test.cliure.climaker.PolyStruct2<System.Object>");
            sType = ((PolymorphicType) cobj.Args[13].Type).PolymorphicName;
            l.assure( sType == "unoidl.test.cliure.climaker.PolyStruct2<unoidl.com.sun.star.lang.XComponent>");
            sType = ((PolymorphicType) cobj.Args[14].Type).PolymorphicName;
            l.assure( sType == "unoidl.test.cliure.climaker.PolyStruct2<unoidl.test.cliure.climaker.PolyStruct<System.Char,uno.Any>>");
            sType = ((PolymorphicType) cobj.Args[15].Type).PolymorphicName;
            l.assure( sType == "unoidl.test.cliure.climaker.PolyStruct2<" +
                      "unoidl.test.cliure.climaker.PolyStruct<" +
                      "unoidl.test.cliure.climaker.PolyStruct<" +
                      "System.Char,uno.Any>,System.String>>");
            sType = ((PolymorphicType) cobj.Args[16].Type).PolymorphicName;
            l.assure( sType == "unoidl.test.cliure.climaker.PolyStruct<" +
                      "System.String,unoidl.test.cliure.climaker.PolyStruct<" +
                      "System.Char,unoidl.test.cliure.climaker.PolyStruct2<" +
                      "uno.Any>>>");
            sType = ((PolymorphicType) cobj.Args[17].Type).PolymorphicName;
            l.assure( sType == "unoidl.test.cliure.climaker.PolyStruct<" +
                      "unoidl.test.cliure.climaker.PolyStruct<System.Char,uno.Any>," +
                      "unoidl.test.cliure.climaker.PolyStruct2<System.Char>>");
			//arg101 - arg115
            sType = ((PolymorphicType) cobj.Args[18].Type).PolymorphicName;
            l.assure( sType == "unoidl.test.cliure.climaker.PolyStruct2<System.Type[]>");
            sType = ((PolymorphicType) cobj.Args[19].Type).PolymorphicName;
            l.assure( sType == "unoidl.test.cliure.climaker.PolyStruct2<uno.Any[]>");
            sType = ((PolymorphicType) cobj.Args[20].Type).PolymorphicName;
            l.assure( sType == "unoidl.test.cliure.climaker.PolyStruct2<System.Boolean[]>");
            sType = ((PolymorphicType) cobj.Args[21].Type).PolymorphicName;
            l.assure( sType == "unoidl.test.cliure.climaker.PolyStruct2<System.Byte[]>");
            sType = ((PolymorphicType) cobj.Args[22].Type).PolymorphicName;
            l.assure( sType == "unoidl.test.cliure.climaker.PolyStruct2<System.Char[]>");
            sType = ((PolymorphicType) cobj.Args[23].Type).PolymorphicName;
            l.assure( sType == "unoidl.test.cliure.climaker.PolyStruct2<System.Int16[]>");
            sType = ((PolymorphicType) cobj.Args[24].Type).PolymorphicName;
            l.assure( sType == "unoidl.test.cliure.climaker.PolyStruct2<System.Int32[]>");
            sType = ((PolymorphicType) cobj.Args[25].Type).PolymorphicName;
            l.assure( sType == "unoidl.test.cliure.climaker.PolyStruct2<System.Int64[]>");
            sType = ((PolymorphicType) cobj.Args[26].Type).PolymorphicName;
            l.assure( sType == "unoidl.test.cliure.climaker.PolyStruct2<System.String[]>");
            sType = ((PolymorphicType) cobj.Args[27].Type).PolymorphicName;
            l.assure( sType == "unoidl.test.cliure.climaker.PolyStruct2<System.Single[]>");
            sType = ((PolymorphicType) cobj.Args[28].Type).PolymorphicName;
            l.assure( sType == "unoidl.test.cliure.climaker.PolyStruct2<System.Double[]>");
            sType = ((PolymorphicType) cobj.Args[29].Type).PolymorphicName;
            l.assure( sType == "unoidl.test.cliure.climaker.PolyStruct2<System.Object[]>");
            sType = ((PolymorphicType) cobj.Args[30].Type).PolymorphicName;
            l.assure( sType == "unoidl.test.cliure.climaker.PolyStruct2<unoidl.com.sun.star.lang.XComponent[]>");
            sType = ((PolymorphicType) cobj.Args[31].Type).PolymorphicName;
            l.assure( sType == "unoidl.test.cliure.climaker.PolyStruct2<" +
                      "unoidl.test.cliure.climaker.PolyStruct<System.Char,uno.Any[]>[]>");
            sType = ((PolymorphicType) cobj.Args[32].Type).PolymorphicName;
            l.assure( sType == "unoidl.test.cliure.climaker.PolyStruct2<" +
                                "unoidl.test.cliure.climaker.PolyStruct<" +
                                "unoidl.test.cliure.climaker.PolyStruct2<" +
                                "System.Char>,uno.Any[]>[]>");
			//arg 201
            sType = ((PolymorphicType) cobj.Args[33].Type).PolymorphicName;
            l.assure( sType == "unoidl.test.cliure.climaker.PolyStruct2<" +
                                "System.Char[][]>");
			//arg 301 - arg305
			sType = ((PolymorphicType) cobj.Args[34].Type).PolymorphicName;
			l.assure (sType == "unoidl.test.cliure.climaker.PolyStruct2<System.Char>[]");
			sType = ((PolymorphicType) cobj.Args[35].Type).PolymorphicName;
			l.assure( sType == "unoidl.test.cliure.climaker.PolyStruct2<unoidl.test.cliure.climaker.PolyStruct<System.Char,uno.Any>>[]");
			sType = ((PolymorphicType) cobj.Args[36].Type).PolymorphicName;
			l.assure( sType == "unoidl.test.cliure.climaker.PolyStruct2<" +
				"unoidl.test.cliure.climaker.PolyStruct<" +
				"unoidl.test.cliure.climaker.PolyStruct<" +
				"System.Char,uno.Any>,System.String>>[]");
			sType = ((PolymorphicType) cobj.Args[37].Type).PolymorphicName;
			l.assure( sType == "unoidl.test.cliure.climaker.PolyStruct<" +
				"System.String,unoidl.test.cliure.climaker.PolyStruct<" +
				"System.Char,unoidl.test.cliure.climaker.PolyStruct2<" +
				"uno.Any>>>[]");
			sType = ((PolymorphicType) cobj.Args[38].Type).PolymorphicName;
			l.assure( sType == "unoidl.test.cliure.climaker.PolyStruct<" +
				"unoidl.test.cliure.climaker.PolyStruct<System.Char,uno.Any>," +
				"unoidl.test.cliure.climaker.PolyStruct2<System.Char>>[]");
			//arg 401 - arg405
			sType = ((PolymorphicType) cobj.Args[39].Type).PolymorphicName;
			l.assure( sType == "unoidl.test.cliure.climaker.PolyStruct2<System.Char>[][]");
			sType = ((PolymorphicType) cobj.Args[40].Type).PolymorphicName;
			l.assure( sType == "unoidl.test.cliure.climaker.PolyStruct2<" +
				"unoidl.test.cliure.climaker.PolyStruct<System.Char,uno.Any>>[][]");
			sType = ((PolymorphicType) cobj.Args[41].Type).PolymorphicName;
			l.assure( sType == "unoidl.test.cliure.climaker.PolyStruct2<" +
				"unoidl.test.cliure.climaker.PolyStruct<" +
				"unoidl.test.cliure.climaker.PolyStruct<" +
				"System.Char,uno.Any>,System.String>>[][]");
			sType = ((PolymorphicType) cobj.Args[42].Type).PolymorphicName;
			l.assure( sType == "unoidl.test.cliure.climaker.PolyStruct<" +
				"System.String,unoidl.test.cliure.climaker.PolyStruct<" +
				"System.Char,unoidl.test.cliure.climaker.PolyStruct2<" +
				"uno.Any>>>[][]");
			sType = ((PolymorphicType) cobj.Args[43].Type).PolymorphicName;
			l.assure( sType == "unoidl.test.cliure.climaker.PolyStruct<" +
				"unoidl.test.cliure.climaker.PolyStruct<System.Char,uno.Any>," +
				"unoidl.test.cliure.climaker.PolyStruct2<System.Char>>[][]");
			
			
			
 
        } 
		catch (Exception) 
		{
            l.assure(false);
        }
    }
Ejemplo n.º 37
0
 public Stream2(Enum2 enum2_1, GenericAudioStream[] stream1_0)
     : this(enum2_1, 0, false, stream1_0)
 {
 }
Ejemplo n.º 38
0
 private static int smethod_0(Enum2 enum2_1)
 {
     int num = 0;
     for (int num2 = (int)enum2_1; num2 != 0; num2 &= num2 - 1)
     {
         num++;
     }
     return num;
 }
Ejemplo n.º 39
0
    //returns the values which have been set in a previous call
    //to this function or inParameters.
    public void inoutParameters(ref bool aBool, ref byte aByte,
                      ref short aShort, ref ushort aUShort,
                      ref int aInt, ref uint aUInt,
                      ref long aLong, ref ulong aULong,
                      ref float aFloat, ref double aDouble,
                      ref char aChar,  ref string aString,
                      ref Type aType, ref uno.Any aAny,
                      ref Enum2 aEnum, ref Struct1 aStruct,
                      ref object aXInterface,
                      ref unoidl.com.sun.star.lang.XComponent aXComponent,
                      ref bool[] seqBool)
    {
        bool _bool = aBool;
        aBool = m_Bool;
        m_Bool = _bool;

        byte _byte = aByte;
        aByte = m_Byte;
        m_Byte = _byte;
        
        short _short = aShort;
        aShort = m_Short;
        m_Short = _short;

        ushort _ushort = aUShort;
        aUShort = m_UShort;
        m_UShort = _ushort;

        int _int = aInt;
        aInt = m_Int;
        m_Int = _int;

        uint _uint = aUInt;
        aUInt = m_UInt;
        m_UInt = _uint;
        
        long _long = aLong;
        aLong = m_Long;
        m_Long = _long;

        ulong _ulong = aULong;
        aULong = m_ULong;
        m_ULong = _ulong;
        
        float _f = aFloat;
        aFloat = m_Float;
        m_Float = _f;

        double _d = aDouble;
        aDouble = m_Double;
        m_Double = _d;
        
        char _char = aChar;
        aChar = m_Char;
        m_Char = _char;

        string _string = aString;
        aString = m_String;
        m_String = _string;

        Type _type = aType;
        aType = m_Type;
        m_Type = _type;

        Any _any = aAny;
        aAny = m_Any;
        m_Any = _any;

        Enum2 _enum2 = aEnum;
        aEnum = m_Enum2;
        m_Enum2 = _enum2;

        Struct1 _struct1 = aStruct;
        aStruct = m_Struct1;
        m_Struct1 = _struct1;
        
        object _obj = aXInterface;
        aXInterface = m_XInterface;
        m_XInterface = _obj;

        ucss.lang.XComponent _xcomp = aXComponent;
        aXComponent = m_XComponent;
        m_XComponent = _xcomp;

        bool[] _seq = seqBool;
        seqBool = m_seqBool;
        m_seqBool = _seq;
    }
Ejemplo n.º 40
0
    public void inParameters(bool aBool, byte aByte,
                      short aShort, ushort aUShort,
                      int aInt, uint aUInt,
                      long aLong, ulong aULong,
                      float aFloat, double aDouble,
                      char aChar, string aString,
                      Type aType, uno.Any aAny,
                      Enum2 aEnum, Struct1 aStruct,
                      object aXInterface,
                      unoidl.com.sun.star.lang.XComponent aXComponent,
                      bool[] seqBool)
    {
        m_Bool = aBool;
        m_Byte = aByte;
        m_Short = aShort;
        m_UShort = aUShort;
        m_Int = aInt;
        m_UInt = aUInt;
        m_Long = aLong;
        m_ULong = aULong;
        m_Float = aFloat;
        m_Double = aDouble;
        m_Char = aChar;
        m_String = aString;
        m_Type = aType;
        m_Any = aAny;
        m_Enum2 = aEnum;
        m_Struct1 = aStruct;
        m_XInterface = aXInterface;
        m_XComponent = aXComponent;
        m_seqBool = seqBool;

    }