상속: FarsiLibrary.Win.BaseClasses.BaseDateControl
예제 #1
0
 public MonthViewCultureTest()
 {
     FALocalizeManager.Instance.CustomCulture = null;
     mockMonthView = new FAMonthView(false);
     farsiCulture = new CultureInfo("fa-IR");
     arabicCulture = new CultureInfo("ar-SA");
     spanishCulture = new CultureInfo("es-ES");
 }
예제 #2
0
        public void Should_Return_Saturday_As_First_Day_Of_Week()
        {
            using (new CultureSwitchContext(new CultureInfo("fa-ir")))
            {
                var mv = new FAMonthView();
                var firstDayOfWeek = mv.GetAbbrDayName(DayOfWeek.Saturday);

                Assert.AreEqual("ش", firstDayOfWeek);
            }
        }
예제 #3
0
        public void Should_Return_Wednesday_As_Fourth_Of_March_2009()
        {
            using(new CultureSwitchContext(CultureInfo.InvariantCulture))
            {
                var mv = new FAMonthView();
                mv.SelectedDateTime = new DateTime(2009, 3, 4);

                var dayOfWeek = mv.GetAbbrDayName(mv.SelectedDateTime.Value.DayOfWeek);

                Assert.AreEqual("Wed", dayOfWeek);
            }
        }
 /// <summary>
 /// Creates a new instance of FAMonthViewContainer which hosts a <see cref="FAMonthView"/> control in popup mode.
 /// </summary>
 /// <param name="ownerControl"></param>
 public FAMonthViewContainer(Control ownerControl)
 {
     hook = new FAHookPopup(this);
     mv = new FAMonthView(true);
     mv.Dock = DockStyle.Fill;
     Size = new Size(mv.Size.Width - 2, mv.Size.Height - 2);
     Controls.Add(mv);
     mv.IsPopupMode = true;
     serviceObject = popupServiceControl;
     base.RealBounds = new Rectangle(mv.Bounds.X, mv.Bounds.Y, mv.Bounds.Width, mv.Bounds.Height);
     Parent = owner;
     FormBorderStyle = FormBorderStyle.FixedToolWindow;
     ControlBox = false;
     owner = ownerControl;
     SetStyle(ControlStyles.Opaque, true);
     base.ShadowSize = 3;
     base.RightToLeft = ownerControl.RightToLeft;
 }
예제 #5
0
        public FormMain()
        {
            DataLayer.BeginTransaction();
            InitializeComponent();

            Methods.SetWindowsIcon(this);
            SetIcons();
            CheckSessionAccessList();

            this.Closed += new EventHandler(FormMain_Closed);

            DataLayer.Attach(Session.CurrentUser);
            Session.Context = DataLayer.GetContext();

            // this code will force calenders to be in persian mode--------------------
            FAMonthView fam = new FAMonthView();
            fam.DefaultCalendar = fam.PersianCalendar;
            fam.DefaultCulture = fam.PersianCulture;
            //-------------------------------------------------------------------------

            //radScheduler1.ActiveViewChanging += new EventHandler<SchedulerViewChangingEventArgs>(radScheduler1_ActiveViewChanging);

            this.radScheduler1.AppointmentEditDialogShowing += (a, b) =>
            {
                FormEditAppoinment frm = new FormEditAppoinment();
                frm.VisitContextSaved += new EventHandler(FormMain_VisitDialogContextSaved);
                b.AppointmentEditDialog = frm;
            };

            CultureInfo ci = new CultureInfo("en-US");
            ci.DateTimeFormat.FirstDayOfWeek = DayOfWeek.Saturday;
            ci.DateTimeFormat.DayNames = new string[7] { "یکشنبه", "دوشنبه", "سه شنبه", "چهارشنبه", "پنجشنبه", "جمعه", "شنبه" };
            radScheduler1.Culture = ci;

            RefreshScheduler();

            SetMenuShortcut();
        }
예제 #6
0
        protected virtual void CreateMonthView()
        {
            monthView = new FAMonthView(false)
            {
                Visible = false,
                Name = "MonthView"
            };

            monthView.SelectedDateTimeChanged += (sender, e) => SelectedDateTime = monthView.SelectedDateTime;
            monthView.ViewDateTimeChanged += (sender, e) => ViewDateTime = monthView.ViewDateTime;
            monthView.ButtonClicked += (sender, e) =>
            {
                if (e.Rect.Action == FocusedPart.MonthDay && e.Rect.IsFocused)
                {
                    ShowDayView();
                }
            };

            Controls.Add(monthView);
        }
예제 #7
0
        /// <summary>
        /// Create the actual control, note this is static so it can be called from the
        /// constructor.
        /// 
        /// </summary>
        /// <returns></returns>
        private static Control CreateControlInstance()
        {
            FAMonthView mv = new FAMonthView(false);

            if (FAThemeManager.UseThemes)
            {
                mv.Theme = ThemeTypes.Office2003;
            }
            else
            {
                mv.Theme = ThemeTypes.Office2000;
            }

            return mv;
        }