public void AwakeFromNib() { // set appearance of view TextFieldTitle.TextColor = NSColor.WhiteColor; TextFieldTitle.Font = FontManager.FontLarge; ViewTable.RowHeight = 60.0f; ViewTable.BackgroundColor = NSColor.ClearColor; NSTableColumn textColumn = ViewTable.TableColumns[1].CastAs <NSTableColumn>(); NSTextFieldCell textCell = textColumn.DataCell.CastAs <NSTextFieldCell>(); textCell.TextColor = NSColor.WhiteColor; textCell.Font = FontManager.FontSemiLarge; // setup model eventing iBookmarkManager.EventBookmarkAdded += ModelChanged; iBookmarkManager.EventBookmarkRemoved += ModelChanged; iBookmarkManager.EventBookmarksChanged += ModelChanged; ModelChanged(this, EventArgs.Empty); // setup drag/drop ViewTable.DataSource = this; ViewTable.SetDraggingSourceOperationMaskForLocal(NSDragOperation.NSDragOperationMove | NSDragOperation.NSDragOperationDelete, true); NSArray dragTypes = NSArray.ArrayWithObject(PasteboardViewDragDataBookmarks.PboardType); ViewTable.RegisterForDraggedTypes(dragTypes); // setup delegate - if this is done in IB, the methods can be called // before awakeFromNib which causes complications ViewTable.Delegate = this; ViewTable.DeselectAll(this); }
void FillViewCombo(bool bFillCombo) { if (bFillCombo) { comboBoxPageSetupViews.Items.Clear(); using (ViewTable pViewTable = (ViewTable)m_plotStg.Database.ViewTableId.GetObject(OpenMode.ForRead)) { foreach (ObjectId objView in pViewTable) { using (ViewTableRecord pView = (ViewTableRecord)objView.GetObject(OpenMode.ForRead)) { if (pView.IsPaperspaceView != isModelSpacePageSetup()) { comboBoxPageSetupViews.Items.Add(pView.Name); } } } } } comboBoxPageSetupViews.Enabled = (comboBoxPageSetupViews.Items.Count > 0); if (comboBoxPageSetupViews.Items.Count > 0) { comboBoxPageSetupViews.SelectedItem = m_plotStg.PlotViewName; } }
public static IEnumerable <ViewTableRecord> GetViewTableRecords(this ViewTable symbolTbl, OpenMode mode = OpenMode.ForRead, SymbolTableRecordFilter filter = SymbolTableRecordFilter.None) { return (symbolTbl.GetSymbolTableRecords <ViewTableRecord>(symbolTbl.Database.TransactionManager.TopTransaction, mode, filter, false)); }
public void AwakeFromNib() { // set appearance of view TextFieldTitle.TextColor = NSColor.WhiteColor; TextFieldTitle.Font = FontManager.FontLarge; ViewTable.RowHeight = 60.0f; ViewTable.BackgroundColor = NSColor.ClearColor; ButtonRefresh.Image = Properties.Resources.IconRefreshButton; ButtonRefresh.Frame = new NSRect(ButtonRefresh.Frame.origin.x, ButtonRefresh.Frame.origin.y, 21, 21); ButtonRefresh.ActionEvent += RefreshClick; Hourglass.Show(false); Hourglass.Frame = new NSRect(ButtonRefresh.Frame.origin.x - 4, ButtonRefresh.Frame.origin.y - 4, 30, 30); // setup model eventing iModel.EventChanged += ModelChanged; ModelChanged(this, EventArgs.Empty); if (SelectedIndex != -1) { ViewTable.ScrollRowToVisible(SelectedIndex); } // setup delegate - if this is done in IB, the methods can be called // before awakeFromNib which causes complications ViewTable.Delegate = this; }
// GET: Pcenter public ActionResult Index() { List <User> lu = db.User.Where(a => a.UserID == id).ToList(); List <Log> lg = db.Log.Where(a => a.UserID == id).ToList(); List <Like> lk = db.Like.Where(a => a.UserID == id).ToList(); List <Follow> lf = db.Follow.Where(a => a.UserID == id).ToList(); List <Forward> lw = db.Forward.Where(a => a.UserID == id).ToList(); List <Command> lc = db.Command.Where(a => a.UserID == id).ToList(); var ViewTable = new ViewTable() { Userss = lu, Logss = lg, Likess = lk, Followss = lf, Forwardss = lw, Commandss = lc }; //SqlParameter[] paras = new SqlParameter[] { //new SqlParameter("@UserID",id), //}; //var gz =db.Database.SqlQuery<string>("select count(*) from Follow where UserID="+id); string sql = string.Format("select count(*) from Follow where UserID ={0}", id); int result = (int)db.Database.ExecuteSqlCommand(sql); int gz = db.Follow.Where(a => a.UserID == id).Count(); int fs = db.Follow.Where(a => a.FollowUID == id).Count(); int wb = db.Log.Where(a => a.UserID == id).Count(); ViewBag.GZ = gz; ViewBag.FS = fs; ViewBag.WB = wb; return(View(ViewTable)); }
private void EditTable_Click(object sender, RoutedEventArgs e) { ViewTable nextPage = new ViewTable(); NavigationService navService = NavigationService.GetNavigationService(this); navService.Navigate(nextPage); }
// Get the table we've built up. public DataTable CloseAndGetTable() { DataTable result = _table; _table = null; // mark as closed, prevents future rows. return(result); }
/// <summary> /// Initializes data objects based on the configuration database tables. /// </summary> public void Init() { RightMatrix.Init(this); Enums.Init(this); SortedViews.AddRange(ViewTable.Enumerate()); SortedViews.Sort(new ViewComparer()); }
public void can_add_column() { string columnName = "string column"; IViewTable viewTable = new ViewTable(10); viewTable.AddStringColumn(columnName, "default"); Assert.AreEqual(1, viewTable.ColumnCount); Assert.AreEqual(10, viewTable.RowCount); Assert.AreEqual("default", viewTable.GetValueString(0, columnName)); viewTable.UpdateString(0, columnName, "new string value"); Assert.AreEqual("new string value", viewTable.GetValueString(0, columnName)); }
//变更 public IActionResult change(string id) { List <salary_standardModel1> list = issb.Select().Where(e => e.standard_id == id).ToList(); List <salary_standard_detailsModel> list2 = issdb.Select().Where(e => e.standard_id == id).ToList(); ViewTable vt = new ViewTable() { salary_standardModel = list, salary_standard_detailsModel = list2 }; ViewBag.b = HttpContext.Session.GetString("Uname"); return(View(vt)); }
bool viewsExists() { using (ViewTable pViewTable = (ViewTable)m_plotStg.Database.ViewTableId.GetObject(OpenMode.ForRead)) { foreach (ObjectId objView in pViewTable) { using (ViewTableRecord pView = (ViewTableRecord)objView.GetObject(OpenMode.ForRead)) { if (pView.IsPaperspaceView != isModelSpacePageSetup()) { return(true); } } } } return(false); }
public void testViewScale() { Database db = HostApplicationServices.WorkingDatabase; Editor ed = Application.DocumentManager.MdiActiveDocument.Editor; using (Transaction trans = db.TransactionManager.StartTransaction()) { ViewTable vt = (ViewTable)trans.GetObject(db.ViewTableId, OpenMode.ForWrite); ViewTableRecord curVtr = ed.GetCurrentView(); Point2d cen = curVtr.CenterPoint; double width = curVtr.Width; double height = curVtr.Height; ViewTableRecord newVtr = curVtr; newVtr.Name = "newView"; newVtr.Width = width / 2; newVtr.Height = height / 2; ed.SetCurrentView(newVtr); trans.Commit(); } }
//复核修改 public async Task <IActionResult> Update(salary_standardModel1 ssm) { string[] sdt_id = HttpContext.Request.Form["sdt_id"]; string[] item_name = HttpContext.Request.Form["item_name"]; string[] salary = HttpContext.Request.Form["salary"]; string ssid = HttpContext.Request.Form["ssid"]; ssm.ssd_id = int.Parse(ssid); int result = await issb.Update(ssm); if (result > 0) { for (int i = 0; i < sdt_id.Length; i++) { salary_standard_detailsModel ssdm = new salary_standard_detailsModel() { standard_id = ssm.standard_id, standard_name = ssm.standard_name, sdt_id = int.Parse(sdt_id[i]), item_name = item_name[i], salary = double.Parse(salary[i]) }; await issdb.Update(ssdm); } return(RedirectToAction("check_success")); } else { List <salary_standardModel1> list = issb.Select().Where(e => e.standard_id == ssm.standard_id).ToList(); List <salary_standard_detailsModel> list2 = issdb.Select().Where(e => e.standard_id == ssm.standard_id).ToList(); ViewTable vt = new ViewTable() { salary_standardModel = list, salary_standard_detailsModel = list2 }; return(View(vt)); } }
public static IEnumerable <ViewTableRecord> GetViewTableRecords(this ViewTable symbolTbl, Transaction trx, OpenMode mode = OpenMode.ForRead, SymbolTableRecordFilter filter = SymbolTableRecordFilter.None) { return(symbolTbl.GetSymbolTableRecords <ViewTableRecord>(trx, mode, filter, false)); }
/// <summary> /// This is the method that actually does the work. /// </summary> /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param> protected override void SolveInstance(IGH_DataAccess DA) { string view_name = ""; DA.GetData <string>(0, ref view_name); string server_msg = ""; DA.GetData <string>(1, ref server_msg); string post = "{\"id\": \"" + screenshot_id + "\"}"; //if (!active) if (Equals(server_msg, "100")) { string url = "http://127.0.0.1:5000/api/v1.0/ss-register-id"; Tuple <bool, string> result = Helpers.PostToServer(url, post); string message = result.Item2; if (!result.Item1) { Helpers.Print(DA, "Error:" + message); throw new Exception(message); } else { var serializer = new JavaScriptSerializer(); var json = serializer.Deserialize <ScreenshotMSG>(message); Helpers.Print(DA, json.status); addFileWatcher(DA, json.path); } } if (active) { RhinoView view = Rhino.RhinoDoc.ActiveDoc.Views.ActiveView; if (view_name == "") { Helpers.Print(DA, "Using active viewport " + view.MainViewport.Name); } else { ViewTable view_table = Rhino.RhinoDoc.ActiveDoc.Views; RhinoView[] views = view_table.GetViewList(true, false); bool exists = false; for (int i = 0; i < views.Length; i++) { view = views[i]; string vp_name = view.MainViewport.Name; if (string.Equals(vp_name, view_name)) { Helpers.Print(DA, "Viewport " + view_name + " found"); exists = true; break; } } if (exists) { } else { Helpers.Print(DA, "New viewport " + view_name + " created"); Rectangle rec = new Rectangle(0, 0, 800, 600); RhinoView new_view = view_table.Add(view_name, Rhino.Display.DefinedViewportProjection.Perspective, rec, true); new_view.MainViewport.WorldAxesVisible = false; new_view.MainViewport.ConstructionGridVisible = false; new_view.MainViewport.ConstructionAxesVisible = false; new_view.MainViewport.DisplayMode = DisplayModeDescription.FindByName("shaded"); view = new_view; } Bitmap bitmap = view.CaptureToBitmap(false, false, false); string url = "http://127.0.0.1:5000/api/v1.0/ss-get-path"; Tuple <bool, string> result = Helpers.PostToServer(url, post); string message = result.Item2; if (!result.Item1) { Helpers.Print(DA, "Error:" + message); throw new Exception(message); } else { var serializer = new JavaScriptSerializer(); var json = serializer.Deserialize <ScreenshotMSG>(message); if (string.Equals(json.status, "success")) { string[] components = { json.path, "png" }; string path = string.Join(".", components); Helpers.Print(DA, "Screenshot captured to: " + path); bitmap.Save(path); } else { Helpers.Print(DA, json.status); } } Helpers.PingServer("http://127.0.0.1:5000/api/v1.0/ss-done"); } //else //{ // Helpers.Print(DA, screenshot_id + " active."); //} active = false; } }
// Get the table we've built up. public DataTable CloseAndGetTable() { DataTable result = _table; _table = null; // mark as closed, prevents future rows. return result; }
public TableWriter(DataTable source) { _table = new ViewTable(); _table._ColumnNames = source.ColumnNames.ToArray(); // copy in case source is mutable }
public ViewExpression(ViewTable viewTable, VirtualPath root) { _viewTable = viewTable; _root = root; }