Ejemplo n.º 1
0
 public OYSTimeSpan(IYear Y, IMonth M, IWeek W, IDay D, IHour h, IMinute m, ISecond s)
 {
     this.Years   = Y;
     this.Months  = M;
     this.Days    = D;
     this.Hours   = h;
     this.Minutes = m;
     this.Seconds = s;
 }
Ejemplo n.º 2
0
 public OYSDateTime(IYear YYYY, IMonth MM, IDay DD, IHour hh, IMinute mm, ISecond ss)
 {
     this.Year   = YYYY;
     this.Month  = MM;
     this.Day    = DD;
     this.Hour   = hh;
     this.Minute = mm;
     this.Second = ss;
 }
Ejemplo n.º 3
0
 public OYSDateTime(DateTime datetime)
 {
     Year   = new Year(datetime.Year);
     Month  = new Month(datetime.Month);
     Day    = new Day(datetime.Day);
     Hour   = new Hour(datetime.Hour);
     Minute = new Minute(datetime.Minute);
     Second = new Second(datetime.Second);
 }
Ejemplo n.º 4
0
            public OYSTime(string date)
            {
                OYSTime conversion;

                TryParse(date, out conversion);
                this.Hour   = conversion.Hour;
                this.Minute = conversion.Minute;
                this.Second = conversion.Second;
            }
Ejemplo n.º 5
0
 public OYSTimeSpan(TimeSpan timespan)
 {
     Years   = new Year((new DateTime(2018, 01, 01, 0, 0, 0) + timespan).Year - (new DateTime(2018, 01, 01, 0, 0, 0).Year));
     Months  = new Month((new DateTime(2018, 01, 01, 0, 0, 0) + timespan).Month - (new DateTime(2018, 01, 01, 0, 0, 0).Month));
     Weeks   = 0.Weeks();
     Days    = new Day((new DateTime(2018, 01, 01, 0, 0, 0) + timespan).Day - (new DateTime(2018, 01, 01, 0, 0, 0).Day));
     Hours   = new Hour((new DateTime(2018, 01, 01, 0, 0, 0) + timespan).Hour - (new DateTime(2018, 01, 01, 0, 0, 0).Hour));
     Minutes = new Minute((new DateTime(2018, 01, 01, 0, 0, 0) + timespan).Minute - (new DateTime(2018, 01, 01, 0, 0, 0).Minute));
     Seconds = new Second((new DateTime(2018, 01, 01, 0, 0, 0) + timespan).Second - (new DateTime(2018, 01, 01, 0, 0, 0).Second));
 }
Ejemplo n.º 6
0
 public string GetTime(int iType)
 {
     if (iType == 1)
     {
         return(IHour.ToString() + ":" + IMinute.ToString() + ":" + ISecond.ToString());
     }
     else
     {
         return(IHour.ToString() + ":" + IMinute.ToString());
     }
 }
Ejemplo n.º 7
0
            public OYSTimeSpan(string date)
            {
                OYSTimeSpan conversion;

                TryParse(date, out conversion);
                this.Years   = conversion.Years;
                this.Months  = conversion.Months;
                this.Days    = conversion.Days;
                this.Hours   = conversion.Hours;
                this.Minutes = conversion.Minutes;
                this.Seconds = conversion.Seconds;
            }
Ejemplo n.º 8
0
            public OYSDateTime(string date)
            {
                OYSDateTime conversion;

                TryParse(date, out conversion);
                this.Year   = conversion.Year;
                this.Month  = conversion.Month;
                this.Day    = conversion.Day;
                this.Hour   = conversion.Hour;
                this.Minute = conversion.Minute;
                this.Second = conversion.Second;
            }
Ejemplo n.º 9
0
        public void MixinImplementingMoreThanOneInterface()
        {
            ProxyGenerationOptions proxyGenerationOptions = new ProxyGenerationOptions();

            ComplexMixin mixin_instance = new ComplexMixin();

            proxyGenerationOptions.AddMixinInstance(mixin_instance);

            AssertInvocationInterceptor interceptor = new AssertInvocationInterceptor();

            object proxy = generator.CreateClassProxy(
                typeof(SimpleClass),
                proxyGenerationOptions,
                interceptor
                );

            Assert.IsNotNull(proxy);
            Assert.IsTrue(typeof(SimpleClass).IsAssignableFrom(proxy.GetType()));

            Assert.IsFalse(interceptor.Invoked);

            IThird inter3 = proxy as IThird;

            Assert.IsNotNull(inter3);
            inter3.DoThird();

            Assert.IsTrue(interceptor.Invoked);
            Assert.AreSame(proxy, interceptor.proxy);
            Assert.AreSame(mixin_instance, interceptor.mixin);

            ISecond inter2 = proxy as ISecond;

            Assert.IsNotNull(inter2);
            inter2.DoSecond();

            Assert.IsTrue(interceptor.Invoked);
            Assert.AreSame(proxy, interceptor.proxy);
            Assert.AreSame(mixin_instance, interceptor.mixin);

            IFirst inter1 = proxy as IFirst;

            Assert.IsNotNull(inter1);
            inter1.DoFirst();

            Assert.IsTrue(interceptor.Invoked);
            Assert.AreSame(proxy, interceptor.proxy);
            Assert.AreSame(mixin_instance, interceptor.mixin);
        }
Ejemplo n.º 10
0
 public OverloadedTestClass(IFirst first, ISecond second, IThird third)
 {
     _first  = first;
     _second = second;
     _third  = third;
 }
Ejemplo n.º 11
0
 public static ITimeSpan ToTimeSpan(this ISecond input) => ObjectFactory.CreateTimeSpan(new System.TimeSpan(0, 0, 0, (int)input.RawValue));
Ejemplo n.º 12
0
 public TestClassWithPropertiesAndConstructor(ISecond second)
 {
     Second = second;
 }
Ejemplo n.º 13
0
 public C(ISecond someProperty) : base(someProperty)
 {
     //Works now
 }
Ejemplo n.º 14
0
 public static IDateTime ToDateTime(this ISecond input) => ObjectFactory.CreateDateTime(new System.DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 0, 0, (int)input.RawValue));
Ejemplo n.º 15
0
 public TestClassWithPropertiesAndConstructor(ISecond second)
 {
     Second = second;
 }
Ejemplo n.º 16
0
 public ObjectA(ISecond child)
 {
     this.Child = child;
 }
Ejemplo n.º 17
0
 public OverloadedTestClass(IFirst first, ISecond second)
     : this(first, second, null)
 {
 }
Ejemplo n.º 18
0
 public OverloadedTestClass(IFirst first, ISecond second, IThird third)
 {
     _first = first;
     _second = second;
     _third = third;
 }
Ejemplo n.º 19
0
 private App(IFirst first, ISecond second)
 {
     this.first  = first;
     this.second = second;
 }
Ejemplo n.º 20
0
 public OverloadedTestClass(IFirst first, ISecond second)
     : this(first, second, null)
 {
 }
Ejemplo n.º 21
0
 public OYSTime(DateTime datetime)
 {
     Hour   = new Hour(datetime.Hour);
     Minute = new Minute(datetime.Minute);
     Second = new Second(datetime.Second);
 }
Ejemplo n.º 22
0
 public OYSTime(IHour hh, IMinute mm, ISecond ss)
 {
     this.Hour   = hh;
     this.Minute = mm;
     this.Second = ss;
 }
Ejemplo n.º 23
0
 public RequiresSecondInConstructor(ISecond second)
 {
     Second = second;
 }