示例#1
0
        public string ToJSON()
        {
            var sb = new StringBuilder("{");

            sb.Append("\"titles\":");
            if (TitleRow != null)
            {
                sb.Append(TitleRow.ToJson());
            }
            else
            {
                sb.Append(GetDefaultTitleRow().ToJson());
            }
            sb.Append(",");
            if (Rows != null && Rows.Length > 0)
            {
                sb.Append("\"rows\":");
                sb.Append(GetJSONData());
            }
            else
            {
                sb.Append("\"rows\":[]");
            }

            sb.Append("}"); //end of complete object

            return(sb.ToString());
        }
示例#2
0
        public static RowX CreateFrom(TitleRow titleRow)
        {
            if (titleRow == null)
            {
                throw new ArgumentNullException(nameof(titleRow));
            }

            CellX cellX = CellX.CreateFrom(titleRow.TitleCell);

            cellX.HorizontalMerge = int.MaxValue;

            RowX rowX = new()
            {
                Border = titleRow.ParentDataGrid?.Border.IsVisible == true
                    ? DataGridBorderX.CreateFrom(titleRow.ParentDataGrid.Border)
                    : null,
                Cells = new List <CellX>
                {
                    cellX
                }
            };

            rowX.CalculateLayout();

            return(rowX);
        }
        public Notepad_MainPage()
        {
            InitializeComponent();
            currentFile        = null;
            textChanged        = false;
            prepared           = false;
            previousLVItem     = null;
            numToLoad          = ITEMS_IN_FULL_SCREEN;
            searchIndex        = 0;
            snapped            = false;
            isSharing          = true;
            readyForDisplay    = false;
            displayAddToMRU    = false;
            displayRefreshData = false;
            displayFile        = null;

            recentFilesTimer          = new DispatcherTimer();
            recentFilesTimer.Interval = TimeSpan.FromMilliseconds(UPDATE_TIMER);
            recentFilesTimer.Tick    += timer_Tick;

            displayTimer          = new DispatcherTimer();
            displayTimer.Interval = TimeSpan.FromMilliseconds(UPDATE_TIMER);
            displayTimer.Tick    += displayTimer_Tick;

            //Don't start the timer, it will be called from the navigation function when not sharing
            //recentFilesTimer.Start();

            //InitializePrinting();

            //Layout
            //Window.Current.SizeChanged += Current_SizeChanged;
            this.SizeChanged += Current_SizeChangedUAP;

            //Suspend
            Utilities.App.Current.Suspending += new SuspendingEventHandler(App_Suspending);

            //set up a timer to save periodically
            saveTimer          = new DispatcherTimer();
            saveTimer.Interval = TimeSpan.FromMinutes(5);
            saveTimer.Tick    += saveTimer_Tick;
            saveTimer.Start();

            updateTimer          = new DispatcherTimer();
            updateTimer.Interval = TimeSpan.FromMilliseconds(UPDATE_TIMER);
            updateTimer.Tick    += t_Tick;

            //Initialize TitleRow
            App.ScheduleOnNextRender(delegate
            {
                List <Breadcrumb> breadcrumbs = new List <Breadcrumb>();
                breadcrumbs.Add(new Breadcrumb(App.Apps.MainPage));
                breadcrumbs.Add(new Breadcrumb(App.Apps.Notepad, true));
                TitleRow.SetupBreadcrumbs(breadcrumbs);
                this.recentSpacer.Height = this.contentLine.Height;
            });

            //TBD:SettingsPane.GetForCurrentView().CommandsRequested += Settings_CommandsRequested;
        }
示例#4
0
        public string GetJSONTitles()
        {
            if (TitleRow == null)
            {
                throw new NullReferenceException("Titles row not defined.");
            }

            return(TitleRow.ToJson());
        }
示例#5
0
        public ActionResult ListTitles()
        {
            string          path      = Server.MapPath("~/App_Data/dashboard.json");
            List <TitleRow> titleRows = _bll_TitleRow.GetTitleRows(path);
            TitleRow        titleRow  = titleRows.ToList().Where(x => x.Name == "Continue Watching").FirstOrDefault();
            List <Title>    titles    = titleRow.Titles.ToList();

            ViewData.TemplateInfo.HtmlFieldPrefix = $"Title";
            return(PartialView("EditorTemplates/ListTitles", titles));
        }
示例#6
0
 public string ToXElementTitles()
 {
     if (TitleRow != null)
     {
         return(TitleRow.ToXElementString());
     }
     else
     {
         return(GetDefaultTitleRow().ToXElementString());
     }
 }
示例#7
0
        public PCal_MainPage()
        {
            this.InitializeComponent();

            App.ScheduleOnNextRender(delegate
            {
                List <Breadcrumb> breadcrumbs = new List <Breadcrumb>();
                breadcrumbs.Add(new Breadcrumb(App.Apps.MainPage));
                breadcrumbs.Add(new Breadcrumb(App.Apps.PCalendar, true));
                TitleRow.SetupBreadcrumbs(breadcrumbs);
            });
        }
示例#8
0
        protected override void OnAppearing()
        {
            base.OnAppearing();

            displayInformationGrid.Opacity = 0;
            displayInfoGridTwo.Opacity     = 0;
            ImageRow.Opacity       = 0;
            TitleRow.Opacity       = 0;
            AddButtonRow.Opacity   = 0;
            CloseButtonRow.Opacity = 0;

            displayInformationGrid.FadeTo(1, 2500, Easing.SinOut);
            displayInfoGridTwo.FadeTo(1, 2500, Easing.SinInOut);
            ImageRow.FadeTo(1, 2800, Easing.SinOut);
            TitleRow.FadeTo(1, 3000, Easing.SinOut);
            AddButtonRow.FadeTo(1, 3200, Easing.SinOut);
            CloseButtonRow.FadeTo(1, 3400, Easing.SinOut);
        }
示例#9
0
        private void MainPage_ViewStateChanged()
        {
            TitleRow.ChangeViewState();
            if (App.isSnapped())
            {
                SnappedViewPane.Visibility   = Windows.UI.Xaml.Visibility.Visible;
                SnappedViewPaneHeight.Height = new GridLength(1, GridUnitType.Star);
                CalendarFlipHeight.Height    = new GridLength(250, GridUnitType.Pixel);
                CalendarFlip.Margin          = new Thickness(10);

                for (int i = 0; i < _allMonths.Count; i++)
                {
                    _allMonths[i].SnapView();
                }
            }

            else if (App.isPortrait())
            {
                SnappedViewPane.Visibility   = Windows.UI.Xaml.Visibility.Visible;
                SnappedViewPaneHeight.Height = new GridLength(1, GridUnitType.Star);
                CalendarFlipHeight.Height    = new GridLength(1, GridUnitType.Star);
                CalendarFlip.Margin          = new Thickness(0);

                for (int i = 0; i < _allMonths.Count; i++)
                {
                    _allMonths[i].NormalView();
                }
            }

            else if (App.isLandscape())
            {
                SnappedViewPane.Visibility   = Windows.UI.Xaml.Visibility.Collapsed;
                SnappedViewPaneHeight.Height = new GridLength(1, GridUnitType.Auto);
                CalendarFlipHeight.Height    = new GridLength(1, GridUnitType.Star);
                CalendarFlip.Margin          = new Thickness(0);

                for (int i = 0; i < _allMonths.Count; i++)
                {
                    _allMonths[i].NormalView();
                }
            }
        }
示例#10
0
        public void FormatSheet()
        {
            if (IsReadOnly)
            {
                return;
            }

            Worksheet.xFormatTitleRow();

            // If there are no columns set then this DataSheet hasn't been formatted yet so:
            if (Columns.Count == 0)
            {
                TitleRow.ConfigureDataSheet(this);
            }

            foreach (ExcelColumn column in Columns.Values)
            {
                column.Format();
            }
        }
示例#11
0
 public CredentialRow AddCredentialRow(TitleRow parentTitleRowByFK_Title_Credential, string Kind, string Body) {
     CredentialRow rowCredentialRow = ((CredentialRow)(this.NewRow()));
     object[] columnValuesArray = new object[] {
             null,
             null,
             Kind,
             Body};
     if ((parentTitleRowByFK_Title_Credential != null)) {
         columnValuesArray[1] = parentTitleRowByFK_Title_Credential[0];
     }
     rowCredentialRow.ItemArray = columnValuesArray;
     this.Rows.Add(rowCredentialRow);
     return rowCredentialRow;
 }
 public TitleRowChangeEvent(TitleRow row, System.Data.DataRowAction action) {
     this.eventRow = row;
     this.eventAction = action;
 }
示例#13
0
 public void AddColumnTypes(string columnTypes)
 {
     TitleRow.AddColumnTypes(columnTypes);
 }
示例#14
0
 public SubscriberRow AddSubscriberRow(TitleRow parentTitleRowByFK_Title_Subscriber, string AuthenticationKey, string AuthScheme, System.DateTime LockoutUntil) {
     SubscriberRow rowSubscriberRow = ((SubscriberRow)(this.NewRow()));
     object[] columnValuesArray = new object[] {
             null,
             null,
             AuthenticationKey,
             AuthScheme,
             LockoutUntil};
     if ((parentTitleRowByFK_Title_Subscriber != null)) {
         columnValuesArray[1] = parentTitleRowByFK_Title_Subscriber[0];
     }
     rowSubscriberRow.ItemArray = columnValuesArray;
     this.Rows.Add(rowSubscriberRow);
     return rowSubscriberRow;
 }
示例#15
0
 public void Render(ITablePrinter tablePrinter)
 {
     TitleRow?.Render(tablePrinter, Size);
 }
示例#16
0
        public TitleRowX(TitleRow titleRow)
        {
            TitleRow = titleRow;

            Size = titleRow?.CalculatePreferedSize() ?? Size.Empty;
        }
示例#17
0
 public TitleRowChangeEvent(TitleRow row, global::System.Data.DataRowAction action)
 {
     this.eventRow    = row;
     this.eventAction = action;
 }
 public void RemoveTitleRow(TitleRow row) {
     this.Rows.Remove(row);
 }
 public void AddTitleRow(TitleRow row) {
     this.Rows.Add(row);
 }