コード例 #1
0
        public static void InitializeSpreadsheet(this SpreadsheetControl spreadsheetControl)
        {
            SpreadsheetUtils.InitializeWorkbook(spreadsheetControl.Document);
            spreadsheetControl.Options.Behavior.FunctionNameCulture = FunctionNameCulture.English;

            spreadsheetControl.DocumentLoaded += (s, e) =>
                                                 SpreadsheetUtils.InitializeWorkbook(((SpreadsheetControl)s).Document);

            spreadsheetControl.EmptyDocumentCreated += (s, e) =>
                                                       SpreadsheetUtils.InitializeWorkbook(((SpreadsheetControl)s).Document);

            spreadsheetControl.CellBeginEdit    += SpreadRichTextEditForm.SpreadsheetControl_CellBeginEdit;
            spreadsheetControl.PopupMenuShowing += SpreadRichTextEditForm.SpreadsheetControl_PopupMenuShowing;

            spreadsheetControl.KeyDown += SpreadsheetControl_KeyDown;

            spreadsheetControl.BeforeDragRange += SpreadsheetControl_BeforeDragRange;
            spreadsheetControl.DragOver        += SpreadsheetControl_DragOver;
            spreadsheetControl.DragDrop        += SpreadsheetControl_DragDrop;

            var oldMouseHandler = (IMouseHandlerService)spreadsheetControl.GetService(typeof(IMouseHandlerService));

            if (oldMouseHandler != null)
            {
                spreadsheetControl.RemoveService(typeof(IMouseHandlerService));
            }
            var newMouseHandler = new SCMouseHandlerService(spreadsheetControl, oldMouseHandler);

            spreadsheetControl.AddService(typeof(IMouseHandlerService), newMouseHandler);
        }
コード例 #2
0
        private void Spreadsheet_DocumentLoaded(object sender, EventArgs e)
        {
            SpreadsheetUtils.InitializeWorkbook(Spreadsheet.Document);

            Spreadsheet.Modified = false;

            var fluent = mvvmContext.OfType <SpreadsheetDocumentViewModel>();

            fluent.ViewModel.FileName = Spreadsheet.Document.Options.Save.CurrentFileName;
            fluent.ViewModel.Modified = false;
        }
コード例 #3
0
 public void LoadFromStream(Stream stream)
 {
     Spreadsheet.LoadDocument(stream);
     SpreadsheetUtils.InitializeWorkbook(Spreadsheet.Document);
 }