コード例 #1
0
        // Defines a new lambda resource
        public CdkWorkshopStack(Construct parent, string id, IStackProps props = null) : base(parent, id, props)
        {
            var hello = new Function(this, "HelloHandler", new FunctionProps
            {
                Runtime = Runtime.NODEJS_10_X,
                Code    = Code.FromAsset("lambda"),
                Handler = "hello.handler"
            });

            var helloWithCounter = new HitCounter(this, "HelloHitCounter", new HitCounterProps
            {
                Downstream = hello
            });

            var gateway = new LambdaRestApi(this, "Endpoint", new LambdaRestApiProps
            {
                Handler = helloWithCounter.Handler
            });

            var tv = new TableViewer(this, "ViewerHitCount", new TableViewerProps
            {
                Title = "Hello Hits",
                Table = helloWithCounter.MyTable
            });

            this.HCViewerUrl = new CfnOutput(this, "TableViewerUrl", new CfnOutputProps
            {
                Value = gateway.Url
            });

            this.HCEndpoint = new CfnOutput(this, "GatewayUrl", new CfnOutputProps
            {
                Value = gateway.Url
            });
        }
コード例 #2
0
        public bool WatchTable(int userId, int tableId)
        {
            CancelWatchTable(userId, false);
            SetOutTable(userId);
            TableViewer newTableViewer = new TableViewer(userId, tableId);

            _context.TableViewers.Add(newTableViewer);
            return(_context.SaveChanges() > 0);
        }
コード例 #3
0
ファイル: ViewersTest.cs プロジェクト: zachwieja/RTVS
        public void TableViewerTest()
        {
            var e      = Substitute.For <IDataObjectEvaluator>();
            var viewer = new TableViewer(_aggregator, e);

            var eval = Substitute.For <IRValueInfo>();

            eval.Classes.Returns(new List <string>()
            {
                "foo"
            });

            viewer.CanView(null).Should().BeFalse();
            viewer.CanView(eval).Should().BeFalse();

            eval.Dim.Count.Returns(0);
            viewer.CanView(eval).Should().BeFalse();

            foreach (var c in new string[] { "matrix", "data.frame", "table", "array" })
            {
                eval.Classes.Returns(new List <string>()
                {
                    c
                });
                eval.Dim.Count.Returns(3);
                viewer.CanView(eval).Should().BeFalse();
                eval.Dim.Count.Returns(2);
                viewer.CanView(eval).Should().BeTrue();
                eval.Dim.Count.Returns(1);
                viewer.CanView(eval).Should().BeFalse();
                eval.Dim.Count.Returns(0);
                viewer.CanView(eval).Should().BeFalse();
            }

            eval.Dim.Returns((IReadOnlyList <int>)null);
            foreach (var c in new string[] { "a", "b" })
            {
                eval.Classes.Returns(new List <string>()
                {
                    c
                });
                viewer.CanView(eval).Should().BeFalse();
            }

            eval.Classes.Returns(new List <string>()
            {
                "foo", "bar"
            });
            viewer.CanView(eval).Should().BeFalse();
        }
コード例 #4
0
ファイル: Actions.cs プロジェクト: nqdior/Reseacher2017
        public void F01_Action(object sender, EventArgs e)
        {
            if (!_controller.sqlManager.isConnected)
            {
                MessageBox.Show($"{_controller.FormBar.SVCombo.Text}との接続が開かれていません。", "Reseacher");
                return;
            }

            if (tableViewer == null || tableViewer.IsDisposed)
            {
                tableViewer         = new TableViewer(_controller);
                tableViewer.Opacity = ((Form)_controller).Opacity;
                tableViewer.Show();
            }
            else
            {
                tableViewer.Activate();
            }
        }
コード例 #5
0
        private void menuDetails_Click(object sender, EventArgs e)
        {
            DataGridViewCell cell = dataGrid1.SelectedCells[0];

            if (cell.ColumnIndex != 0 && cell.Value != DBNull.Value)
            {
                DataRow row = ((DataRowView)cell.OwningRow.DataBoundItem).Row;
                MultipleSeriesDataTable tbl = row.Table as MultipleSeriesDataTable;
                DateTime t        = Convert.ToDateTime(row[0]);
                string   interval = tbl.TableName;
                HdbPoet.TimeSeriesDataSet.SeriesRow s = tbl.LookupSeries(cell.ColumnIndex);
                var info = Hdb.Instance.BaseInfo(t, s.hdb_site_datatype_id, interval);

                info = DataTableUtility.Transpose(info);
                TableViewer tv = new TableViewer(info);
                tv.Show();


                //msDataTable
                //row[cell.ColumnIndex] = DBNull.Value;
            }
        }
コード例 #6
0
        public CodeEditorPlugin(IHDEHost host, INode node, ISolution solution, ILogger logger)
        {
            FHDEHost   = host;
            FNode      = node;
            FSolution  = solution;
            FLogger    = logger;
            FErrorList = new ViewableCollection <object>();

            if (CompletionIcons.Images.Count == 0)
            {
                var resources = new ComponentResourceManager(typeof(CodeEditorPlugin));
                CompletionIcons.TransparentColor = System.Drawing.Color.Transparent;
                CompletionIcons.Images.Add((System.Drawing.Bitmap)resources.GetObject("Icons.16x16.Class"));
                CompletionIcons.Images.Add((System.Drawing.Bitmap)resources.GetObject("Icons.16x16.Method"));
                CompletionIcons.Images.Add((System.Drawing.Bitmap)resources.GetObject("Icons.16x16.Property"));
                CompletionIcons.Images.Add((System.Drawing.Bitmap)resources.GetObject("Icons.16x16.Field"));
                CompletionIcons.Images.Add((System.Drawing.Bitmap)resources.GetObject("Icons.16x16.Enum"));
                CompletionIcons.Images.Add((System.Drawing.Bitmap)resources.GetObject("Icons.16x16.NameSpace"));
                CompletionIcons.Images.Add((System.Drawing.Bitmap)resources.GetObject("Icons.16x16.Event"));

                var path     = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @"..\..\thirdparty"));
                var provider = new SD.FileSyntaxModeProvider(path);
                SD.HighlightingManager.Manager.AddSyntaxModeFileProvider(provider);
            }

            SuspendLayout();

            FCodeEditorForm                     = new Form();
            FCodeEditorForm.Location            = new Point(0, 0);
            FCodeEditorForm.TopLevel            = false;
            FCodeEditorForm.TopMost             = false;
            FCodeEditorForm.Dock                = DockStyle.Fill;
            FCodeEditorForm.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            FCodeEditorForm.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
            FCodeEditorForm.BackColor           = System.Drawing.Color.Silver;
            FCodeEditorForm.ClientSize          = new System.Drawing.Size(881, 476);
            FCodeEditorForm.ControlBox          = false;
            FCodeEditorForm.FormBorderStyle     = System.Windows.Forms.FormBorderStyle.None;
            FCodeEditorForm.MaximizeBox         = false;
            FCodeEditorForm.MinimizeBox         = false;
            FCodeEditorForm.ShowIcon            = false;
            FCodeEditorForm.ShowInTaskbar       = false;
            FCodeEditorForm.SizeGripStyle       = System.Windows.Forms.SizeGripStyle.Hide;
            FCodeEditorForm.TopMost             = true;
            FCodeEditorForm.Show();

            FEditor      = new CodeEditor(FCodeEditorForm, FLogger);
            FEditor.Dock = DockStyle.Fill;
            FCodeEditorForm.Controls.Add(FEditor);

            FErrorTableViewer              = new TableViewer();
            FErrorTableViewer.Dock         = DockStyle.Bottom;
            FErrorTableViewer.TabIndex     = 0;
            FErrorTableViewer.DoubleClick += FErrorTableViewerDoubleClick;
            FErrorTableViewer.AutoSize     = true;
            FErrorTableViewer.AutoSizeMode = AutoSizeMode.GrowAndShrink;
            FErrorTableViewer.MaximumSize  = new Size(0, 100);

            Controls.Add(FCodeEditorForm);
            Controls.Add(FErrorTableViewer);

            ResumeLayout(false);
            PerformLayout();

            var registry = new MappingRegistry();

            registry.RegisterDefaultMapping <IEnumerable <Column>, ErrorCollectionColumnProvider>();
            registry.RegisterMapping <CompilerError, IEnumerable <ICell>, ErrorCellProvider>();
            registry.RegisterMapping <RuntimeError, IEnumerable <ICell>, RuntimeErrorCellProvider>();

            FErrorTableViewer.Registry = registry;
            FErrorTableViewer.Input    = FErrorList;

            FEditor.LinkClicked += FEditor_LinkClicked;
        }
コード例 #7
0
        public static IDictionary <ToolbarActionNames, string> GetMoreActionsMenu(this View view, string guid, TableViewer tableViewer, UrlHelper UrlHelper)
        {
            IDictionary <ToolbarActionNames, string> actionsMenu = new Dictionary <ToolbarActionNames, string>();

            bool isViewDisabled      = view.IsDisabled(guid);
            bool hasHistoryAction    = view.SaveHistory && tableViewer.IsEditable(view);
            bool hasExportAction     = view.ExportToCsv && !isViewDisabled;
            bool isImportable        = view.ImportFromExcel && !Durados.Web.Mvc.UI.Helpers.SecurityHelper.IsDenied(view.DenyEditRoles, view.AllowEditRoles) && !Durados.Web.Mvc.UI.Helpers.SecurityHelper.IsDenied(view.DenyCreateRoles, view.AllowCreateRoles);
            bool hasImportAction     = isImportable && !isViewDisabled;
            bool hasPrintAction      = view.Print && !isViewDisabled;
            bool hasMessagesAction   = view.HasMessages();
            bool hasCopyConfigAction = view is Durados.Config.IConfigView && Durados.Web.Mvc.UI.Helpers.SecurityHelper.IsInRole("Developer") && view.Name == "View";
            bool hasDatabaseRoles    = view is Durados.Config.IConfigView && (Durados.Web.Mvc.UI.Helpers.SecurityHelper.IsInRole("Developer") || Durados.Web.Mvc.UI.Helpers.SecurityHelper.IsInRole("Admin")) && (view.Name == "Database" || view.Name == "View");
            bool hasDiagnoseAction   = view is Durados.Config.IConfigView && Durados.Web.Mvc.UI.Helpers.SecurityHelper.IsInRole("Developer") && (view.Name == "Database" || view.Name == "View");
            bool hasSyncAllAction    = view is Durados.Config.IConfigView && (Durados.Web.Mvc.UI.Helpers.SecurityHelper.IsInRole("Developer") || Durados.Web.Mvc.UI.Helpers.SecurityHelper.IsInRole("Admin")) && (view.Name == "View");

            if (hasHistoryAction)
            {
                string historyGuid = "History_" + ShortGuid.Next() + "_";
                string historyUrl  = UrlHelper.Action("HistoryFilter", "History", new { viewName = "durados_v_ChangeHistory" });
                string historyView = view.Name;
                string onclick     = "History('" + historyUrl + "', '" + guid + "', '" + historyGuid + "', '" + historyView + "');return false;";
                if (view.Base.Name != null)
                {
                    historyView = view.Base.Name;
                }

                AddClickMenuItem(view, actionsMenu, ToolbarActionNames.HISTORY, onclick);
            }

            if (hasExportAction)
            {
                string iconClass = "icon export";
                string href      = view.GetExportToCsvUrl() + "?guid=" + guid;
                AddHrefMenuItem(view, actionsMenu, ToolbarActionNames.EXPORT, href, iconClass);
            }

            if (hasImportAction)
            {
                string onclick = "Excel.Import('" + view.Name + "','" + guid + "');return false;";
                AddClickMenuItem(view, actionsMenu, ToolbarActionNames.IMPORT, onclick);
            }

            if (hasPrintAction)
            {
                string onclick = "Print('" + guid + "');return false;";
                AddClickMenuItem(view, actionsMenu, ToolbarActionNames.PRINT, onclick);
            }

            if (hasMessagesAction)
            {
                string onclick = "Messages.Show('" + view.Name + "','" + guid + "');return false;";
                AddClickMenuItem(view, actionsMenu, ToolbarActionNames.MESSAGE_BOARD, onclick);
            }

            if (hasCopyConfigAction)
            {
                string onclick = "showCopyDialog('" + guid + "', this); return false;";
                AddClickMenuItem(view, actionsMenu, ToolbarActionNames.COPY_CONFIG, onclick);

                onclick = "showCloneDialog('" + guid + "'); return false;";
                AddClickMenuItem(view, actionsMenu, ToolbarActionNames.CLONE_CONFIG, onclick);
            }

            if (hasDatabaseRoles)
            {
                string sendConfigUrl = UrlHelper.Action("SendConfig", "Admin");
                string onclick       = "sendConfig('" + sendConfigUrl + "');";
                AddClickMenuItem(view, actionsMenu, ToolbarActionNames.SEND_CONFIG, onclick);

                //BR: TODO
                //<a target="_blank" href="<%= downloadConfigUrl%>" title="<%= title%>">
                //<%=Map.Database.Localizer.Translate("Download")%></a>
                string href = UrlHelper.Action("DownloadConfig", "Admin");
                AddHrefMenuItem(view, actionsMenu, ToolbarActionNames.DOWNLOAD_CONFIG, href);

                onclick = "UploadConfig.Open('Database', '" + guid + "')";
                AddClickMenuItem(view, actionsMenu, ToolbarActionNames.UPLOAD_CONFIG, onclick);
            }
            if (hasDiagnoseAction)
            {
                string onclick = "Diagnostics.Diagnose('" + guid + "');";
                AddClickMenuItem(view, actionsMenu, ToolbarActionNames.DIAGNOSE, onclick);

                string dictionaryUrl = UrlHelper.Action("Index", "Block", new { parameters = "xxx" });
                onclick = "Dictionary('" + dictionaryUrl + "', '" + guid + "');";
                AddClickMenuItem(view, actionsMenu, ToolbarActionNames.DICTIONARY, onclick);
            }

            if (hasSyncAllAction)
            {
                string onclick = "syncAll()";
                AddClickMenuItem(view, actionsMenu, ToolbarActionNames.SYNC_ALL, onclick);
            }

            return(actionsMenu);
        }
コード例 #8
0
ファイル: DataTableTree.cs プロジェクト: zhoufengzd/DotNet
 public DataTableTree(IDataProvider <DataTable> tblProvider, IEnumerable <string> indexColumns, string leafColumn)
 {
     _tblViewer    = new TableViewer(tblProvider);
     _indexColumns = indexColumns;
     _leafColumn   = leafColumn;
 }
コード例 #9
0
 public TableWindow()
 {
     viewer = new TableViewer();
 }