コード例 #1
0
ファイル: DateClass.cs プロジェクト: weimingtom/KirikiriSharp
            /// <exception cref="TJSException"></exception>
            protected internal override int Process(Variant result, Variant[] param, Dispatch2
                                                    objthis)
            {
                DateNI _this = (DateNI)objthis.GetNativeInstance(DateClass.mClassID
                                                                 );

                // インスタンス所得
                if (_this == null)
                {
                    return(Error.E_NATIVECLASSCRASH);
                }
                _this.mDateTime = DateClass.ParseDateString(param[0].GetString());
                return(Error.S_OK);
            }
コード例 #2
0
ファイル: DateClass.cs プロジェクト: weimingtom/KirikiriSharp
            /// <exception cref="VariantException"></exception>
            protected internal override int Process(Variant result, Variant[] param, Dispatch2
                                                    objthis)
            {
                DateNI _this = (DateNI)objthis.GetNativeInstance(DateClass.mClassID
                                                                 );

                if (_this == null)
                {
                    return(Error.E_NATIVECLASSCRASH);
                }
                if (result != null)
                {
                    result.Set((int)_this.mDateTime.Get(Calendar.YEAR));
                }
                return(Error.S_OK);
            }
コード例 #3
0
ファイル: DateClass.cs プロジェクト: weimingtom/KirikiriSharp
            /// <exception cref="VariantException"></exception>
            protected internal override int Process(Variant result, Variant[] param, Dispatch2
                                                    objthis)
            {
                DateNI _this = (DateNI)objthis.GetNativeInstance(DateClass.mClassID
                                                                 );

                if (_this == null)
                {
                    return(Error.E_NATIVECLASSCRASH);
                }
                if (result != null)
                {
                    long num = _this.mDateTime.GetTimeInMillis();
                    result.Set(num);
                }
                return(Error.S_OK);
            }
コード例 #4
0
ファイル: DateClass.cs プロジェクト: weimingtom/KirikiriSharp
            /// <exception cref="VariantException"></exception>
            protected internal override int Process(Variant result, Variant[] param, Dispatch2
                                                    objthis)
            {
                DateNI _this = (DateNI)objthis.GetNativeInstance(DateClass.mClassID
                                                                 );

                if (_this == null)
                {
                    return(Error.E_NATIVECLASSCRASH);
                }
                if (param.Length < 1)
                {
                    return(Error.E_BADPARAMCOUNT);
                }
                _this.mDateTime.Set(Calendar.SECOND, param[0].AsInteger());
                return(Error.S_OK);
            }
コード例 #5
0
ファイル: DateClass.cs プロジェクト: weimingtom/KirikiriSharp
            /// <exception cref="VariantException"></exception>
            protected internal override int Process(Variant result, Variant[] param, Dispatch2
                                                    objthis)
            {
                DateNI _this = (DateNI)objthis.GetNativeInstance(DateClass.mClassID
                                                                 );

                if (_this == null)
                {
                    return(Error.E_NATIVECLASSCRASH);
                }
                if (param.Length < 1)
                {
                    return(Error.E_BADPARAMCOUNT);
                }
                double num = param[0].AsDouble();

                _this.mDateTime.SetTimeInMillis((long)num);
                return(Error.S_OK);
            }
コード例 #6
0
ファイル: DateClass.cs プロジェクト: weimingtom/KirikiriSharp
            /// <exception cref="VariantException"></exception>
            /// <exception cref="TJSException"></exception>
            protected internal override int Process(Variant result, Variant[] param, Dispatch2
                                                    objthis)
            {
                DateNI _this = (DateNI)objthis.GetNativeInstance(DateClass.mClassID
                                                                 );

                if (_this == null)
                {
                    return(Error.E_NATIVECLASSCRASH);
                }
                int hr = _this.Construct(param, objthis);

                if (hr < 0)
                {
                    return(hr);
                }
                if (param.Length == 0)
                {
                    _this.mDateTime = Calendar.GetInstance();
                }
                else
                {
                    if (param.Length >= 1)
                    {
                        if (param[0].IsString())
                        {
                            _this.mDateTime = DateClass.ParseDateString(param[0].GetString());
                        }
                        else
                        {
                            int y;
                            int mon = 0;
                            int day = 1;
                            int h   = 0;
                            int m   = 0;
                            int s   = 0;
                            y = param[0].AsInteger();
                            if (param.Length > 1 && param[1].IsVoid() != true)
                            {
                                mon = param[1].AsInteger();
                            }
                            if (param.Length > 2 && param[2].IsVoid() != true)
                            {
                                day = param[2].AsInteger();
                            }
                            if (param.Length > 3 && param[3].IsVoid() != true)
                            {
                                h = param[3].AsInteger();
                            }
                            if (param.Length > 4 && param[4].IsVoid() != true)
                            {
                                m = param[4].AsInteger();
                            }
                            if (param.Length > 5 && param[5].IsVoid() != true)
                            {
                                s = param[5].AsInteger();
                            }
                            Calendar cal = Calendar.GetInstance();
                            cal.Set(y, mon, day, h, m, s);
                            _this.mDateTime = cal;
                        }
                    }
                }
                return(Error.S_OK);
            }