public IActionResult Advertiserment() { var C = CategoryRepository.Categories(); ModelView m = new ModelView() { Categories = C }; return(View(m)); }
public IActionResult Privacy() { var C = CategoryRepository.Categories(); ModelView m = new ModelView() { Categories = C }; return(View(m)); }
public ActionResult Edit([Bind(Include = "ID,MakeID,Name,Abrv,inStock")] ModelView modelView) { if (ModelState.IsValid) { vehicleService.EditVehicleModel(modelView); return(RedirectToAction("Index")); } ViewBag.MakeID = new SelectList(vehicleService.GetAllVehicleMakes(), "ID", "Name", modelView.MakeID); return(View(modelView)); }
static void Main(string[] args) { //Some pure fabrication! ModelView mod = new ModelView(); // Model view creates the model that creates the DB manager that connects to the db that exists Console.WriteLine("Starting backend"); Console.ReadKey(); //Console.ReadLine; //TODO the various Views? }
public IActionResult Danhsachtheloai() { IEnumerable <Category> C = CategoryRepository.Categories(); ModelView modelView = new ModelView() { Categories = C }; return(View(modelView)); }
public MainWindow() { InitializeComponent(); MyModel = new ModelView(); // Here's where I'm setting the object to look at. MyLabel.DataContext = MyModel; // Now I don't need to access the textbox directly. MyModel.MyLabel = "Hello World"; }
internal AppItemContext(AppItem Container, ModelView.ModelViewAppItem ModelViewAppItem, ModelSecurity.ModelSecObject ModelSecObject, Context Context) { _container = Container; _modelViewAppItem = ModelViewAppItem; _modelSecObject = ModelSecObject; _context = Context; }
public IActionResult Index() { Division myDivision = new Division(); ModelView newModelView = new ModelView { divisionList = db.Divisions.ToList(), divisionModel = myDivision }; return(View(newModelView)); }
public static void Main() { string path = Application.StartupPath; string[] tutorialFiles = Directory.GetFiles(path, "*.cs"); TutorialsView tview = new TutorialsView(); tview.TutorialFiles = tutorialFiles; Application.EnableVisualStyles(); ModelView.RunInForm(tview, "Infer.NET tutorials viewer", false); }
private void button1_Click(object sender, EventArgs e) { ISldWorks sldWorks = Utility.ConnectToSolidWorks(); ModelDoc2 modelDoc = (ModelDoc2)sldWorks.ActiveDoc; ModelView modelView = (ModelView)modelDoc.ActiveView; // modelDoc.ViewZoomtofit2(); modelView.Scale2 = double.Parse(txtSC.Text); modelDoc.GraphicsRedraw2(); }
public void UpdateRailpos(int id, Point3D[] Points) { RemoveRailPoints(((LinesVisual3D)Models["AllRailInfos"][id])); if (Points.Length < 2) { return; } AddRailpoints((LinesVisual3D)Models["AllRailInfos"][id], Points, 5); Positions["AllRailInfos"][id] = Points[0].ToVector3D(); ModelView.UpdateLayout(); }
public static void UIUpdateEnable(this ModelDoc2 swModel, bool IsEnable) { swModel.FeatureManager.EnableFeatureTree = IsEnable; swModel.FeatureManager.EnableFeatureTreeWindow = IsEnable; ModelView modelView = (ModelView)swModel.ActiveView; if (modelView != null) { modelView.EnableGraphicsUpdate = IsEnable; } }
private void button3_Click(object sender, EventArgs e) { ISldWorks sldWorks = Utility.ConnectToSolidWorks(); ModelDoc2 modelDoc = (ModelDoc2)sldWorks.ActiveDoc; ModelView modelView = (ModelView)modelDoc.ActiveView; sldWorks.FrameState = 1; modelDoc.ViewZoomtofit2(); modelView.Scale2 = 0.5; }
internal void GenerateExample(string path, ModelView modelView) { STPModelData md = new STPModelData(false, modelView); md.NextObjectRecord = 50; IfcBuilding building = new IfcBuilding(md, "IfcBuilding") { GlobalId = "39t4Pu3nTC4ekXYRIHJB9W" }; building.ContainsElements[0].GlobalId = "3Sa3dTJGn0H8TQIGiuGQd5"; building.Comments.Add("defines the default building (as required as the minimum spatial element) "); md.NextObjectRecord = 100; IfcProject project = new IfcProject(building, "IfcProject", GGYM.Units.Length.mm) { GlobalId = "0$WU4A9R19$vKWO$AdOnKA" }; project.IsDecomposedBy[0].GlobalId = "091a6ewbvCMQ2Vyiqspa7a"; project.RepresentationContexts[0].Comments.Add("general entities required for all IFC data sets, defining the context for the exchange"); md.NextObjectRecord = 200; GenerateData(md, building); string filePath = Path.Combine(path, this.GetType().Name + ".ifc"); if (File.Exists(filePath)) { string[] newLines = md.ToString().Split(new char[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries); List <string> existingLines = new List <string>(File.ReadAllLines(filePath)); existingLines.RemoveAll(x => string.IsNullOrEmpty(x)); if (newLines.Length == existingLines.Count) { bool identical = true; for (int icounter = 0; icounter < newLines.Length; icounter++) { string s1 = newLines[icounter], s2 = existingLines[icounter]; if (s1.StartsWith("/* time_stamp */ ") && s2.StartsWith("/* time_stamp */ ")) { continue; } if (string.Compare(s1, s2, true) != 0) { identical = false; break; } } if (identical) { return; } } } md.WriteFile(filePath); }
/// <summary> /// Applies the Modelview-, projection- and normal matrix to the shaders if the "Parameters" are an implementation of "IMVPNParameters". /// </summary> /// <param name="gl">The GL.</param> /// <param name="modelview">The modelview class that contains the matrix.</param> /// <param name="projection">The projection class that contains the matrix.</param> /// <param name="normal">The normal class that contains the matrix.</param> /// <param name="throwException">Property that sets whether it should throw an exception or just return when this shaderprogram doesn't implement the required interface.</param> public void ApplyMVPNMatrices(OpenGL gl, ModelView modelview, Projection projection, Normal normal, bool throwException = true) { // Test if the parameters implementing the required interface. if (!TypeTest(throwException, typeof(IMVPNParameters))) { return; } var prms = Parameters as IMVPNParameters; prms.ApplyMVPNParameters(gl, this, projection, modelview, normal); }
public IActionResult Index(int?id) { var modelView = new ModelView { UserProfile = id != null ? _databaseService.GetUserProfileById(id.Value) : _databaseService.GetCurrentUserProfileWithFullInfo(User), CurrentUserProfile = _databaseService.GetCurrentUserProfile(User) }; return(View(modelView)); }
/// <summary> /// Loads the tables from the database /// </summary> /// <param name="databaseModel">the DatabaseModel object to exeute the query against</param> /// <returns>returns a List<TableModel> (Columns not loaded)</returns> public List <TableModel> GetTables(Dispatcher dispatcher) { List <TableModel> result = new List <TableModel>(); DataAccess dataAccess = null; dispatcher.Invoke(() => { RECONNECT: dataAccess = new DataAccess(Connections.Instance.DatabaseModel); if (!dataAccess.TestConnection()) { if (ModelView.ShowDialog("Connection Failure", Connections.Instance.DatabaseModel).IsFalse()) { throw new Exception("Connection failure. User opt out."); } goto RECONNECT; } }); XDocument tablesXml = dataAccess.ExecuteQuery(SQLQueries.DatabaseQueries.DatabaseTablesQuery(Connections.Instance.DatabaseModel.DatabaseName)); List <dynamic> clusterList = dataAccess.ExecuteQueryDynamic(SQLQueries.DatabaseQueries.DatabasePrimaryClusterName()); foreach (XElement rowItem in tablesXml.Root.Elements()) { string tableName = rowItem.Element("TABLE_NAME").Value; string tableSchema = rowItem.Element("TABLE_SCHEMA").Value; EventParser.ParseMessage(this, dispatcher, "Reading", tableName); if (tableName == "sysdiagrams") { continue; } dynamic selectedCluster = clusterList.FirstOrDefault(d => ((IDictionary <string, object>)d).Values.ToArray()[1].ToString() == tableName); TableModel model = new TableModel { TableName = tableName, SchemaName = tableSchema }; model.PrimaryKeyClusterConstraintName = selectedCluster != null ? ((IDictionary <string, object>)clusterList[0]).Values.FirstOrDefault().ToString() : tableName; result.Add(model); } return(result); }
public IActionResult Edit(int id) { var C = CategoryRepository.Categories(); var c = CategoryRepository.findByID(id); var modelView = new ModelView() { Categories = C, getCategory = c }; return(View(modelView)); }
public IActionResult Index() { IEnumerable <Product> Products = ProductRepository.Products(); IEnumerable <Category> Categories = CategoryRepository.Categories(); ModelView modelView = new ModelView() { Products = Products, Categories = Categories }; return(View(modelView)); }
IEnumerator LoadObject(string path, string viewer) { AssetBundleCreateRequest bundle = AssetBundle.LoadFromFileAsync(path); yield return(bundle); AssetBundle myLoadedAssetBundle = bundle.assetBundle; if (myLoadedAssetBundle == null) { Debug.Log("Failed to load AssetBundle!"); yield break; } var names = myLoadedAssetBundle.GetAllAssetNames(); // AssetBundleRequest request = myLoadedAssetBundle.LoadAsset(); //yield return request; AssetBundleRequest objreq = myLoadedAssetBundle.LoadAssetAsync(names[0]); yield return(objreq); //obj.transform.position = new Vector3(0.08f, -2.345f, 297.54f); // obj.transform.Rotate(350.41f, 400f, 20f); // obj.transform.localScale = new Vector3(1.0518f, 0.998f, 1.1793f); if (viewer.Equals("model")) { LoadedModel = Instantiate((GameObject)objreq.asset, Model.transform); LoadedModel.transform.parent = Model.transform; LoadingPanal.SetActive(false); ProjectsPanal.SetActive(false); ModelPanel.SetActive(true); ModelView.SetActive(true); } else { if (PlaceOnPlane.AssatObj != null) { PlaceOnPlane.AssatObj = null; } PlaceOnPlane.AssatObj = (GameObject)objreq.asset; Projects[projectIndex].LoadedObj = (GameObject)objreq.asset; Projects[projectIndex].isloaded = true; LoadingPanal.SetActive(false); // ARCanvas.SetActive(true); ArSession.SetActive(true); ArModePanel.SetActive(true); ProjectsPanal.SetActive(false); ArExitpanel.SetActive(true); } myLoadedAssetBundle.Unload(false); }
public bool DetachModelViewEventHandler(ModelView mView) { DocView dView; if (openModelViews.Contains(mView)) { dView = (DocView)openModelViews[mView]; openModelViews.Remove(mView); mView = null; dView = null; } return true; }
public IActionResult Index(ModelView movie) { ModelView modelview = new ModelView(); modelview.MovieViewList = SearchByID(movie.MovieID); modelview.MovieID = movie.MovieID; if (modelview.MovieViewList.Count != 0) { return(PartialView("_MovieListPartial", modelview.MovieViewList)); } return(Json("Not Found")); }
/// <summary> /// we cannot use this code inside of DisconnectModelViews because we use modelView to iterate through the hastable /// </summary> /// <param name="modelView">represents the model view for a solidworks document</param> /// <returns></returns> public bool DetachModelViewEventHandler(ModelView modelView) { ModelViewHelper modelViewHelper; if (openModelViews.Contains(modelView)) { modelViewHelper = (ModelViewHelper)openModelViews[modelView]; openModelViews.Remove(modelView); modelView = null; modelViewHelper = null; } return true; }
public virtual void Show() { AppTools.InvokeOnMainThread(() => { if (!ModelView.IsNull()) { new CrossViewInjector(this); } Frame = AppTools.TopViewController.View.Frame; AppTools.TopViewController.View.AddSubview(this); }); }
public void ModelViewConstructorWith3Urls() { tlog.Debug(tag, $"ModelViewConstructorWith3Urls START"); var testingTarget = new ModelView(objUrl, mtlUrl, imageUrl); Assert.IsNotNull(testingTarget, "Can't create success object ModelView"); Assert.IsInstanceOf <ModelView>(testingTarget, "Should be an instance of ModelView type."); testingTarget.Dispose(); tlog.Debug(tag, $"ModelViewConstructorWith3Urls END (OK)"); }
public async Task <ActionResult> UpdateInfo() { var user = await GetCurrentUserAsync(); var C = _CategoryRepository.Categories(); ModelView m = new ModelView() { Categories = C }; //get thông tin return(View(m)); }
public ActionResult Create_Qualifi(ModelView model) { if (ModelState.IsValid) { EmployeeQualification data = new EmployeeQualification(); db.EmployeeQualifications.Add(data); TempData["message"] = "Insert success"; db.SaveChanges(); return(RedirectToAction("Edit", "Employee")); } return(View()); }
private void createPart() { swDoc = null; int longstatus = 0; swDoc = ((ModelDoc2)(sldApp.NewDocument("C:\\ProgramData\\SOLIDWORKS\\SOLIDWORKS 2016\\templates\\Part.prtdot", 0, 0, 0))); sldApp.ActivateDoc2("Part2", false, ref longstatus); swDoc = ((ModelDoc2)(sldApp.ActiveDoc)); ModelView myModeview = null; myModeview = ((ModelView)(swDoc.ActiveView)); myModeview.FrameState = ((int)(swWindowState_e.swWindowMaximized)); }
public IActionResult Create(int id = 0) { var s = SupplierRepository.Suppliers(); var c = CategoryRepository.Categories(); var mv = new ModelView() { Suppliers = s, Categories = c }; return(View(mv)); }
public bool DetachModelViewEventHandler(ModelView mView) { DocView dView; if (openModelViews.Contains(mView)) { dView = (DocView)openModelViews[mView]; openModelViews.Remove(mView); mView = null; dView = null; } return(true); }
/// <summary> /// Lay ra danh sach hoc sinh /// </summary> /// <returns></returns> public async Task <ActionResult> ListAll(ModelView <Student, string> model) { long totalRecord; model.PageInfo.PageSize = 2; model.Items = await UnitOfWork.StudentRepo.FindAsync(out totalRecord, null, null, model.PageInfo.CurrentPage, model.PageInfo.PageSize); model.PageInfo.TotalRecord = (int)totalRecord; model.PageInfo.Url = Url.Action("Index", "Home"); return(View(model)); }
/// <summary> /// Prints the ModelView /// /// </summary> /// <param name="modelView"></param> /// <returns></returns> public TreeViewItem PrintModelView(ModelView modelView) { TreeViewItem treeViewItem = new TreeViewItem(); treeViewItem.Header = "ModelView - " + modelView.name; if (modelView.uuid != "") { treeViewItem.Items.Add("UUID: " + modelView.uuid); } if (modelView.version != "") { treeViewItem.Items.Add("Version: " + modelView.version); } if (modelView.applicableSchema != "") { treeViewItem.Items.Add("applicableSchema: " + modelView.applicableSchema); } Dictionary <string, ConceptRoot> allConceptRoots = modelView.GetAllConceptRoots(); if (allConceptRoots.Count > 0) { TreeViewItem mvdRootTreeViewItem = new TreeViewItem(); mvdRootTreeViewItem.Header = "ConceptRoots"; foreach (var conceptRoot in allConceptRoots) { TreeViewItem conceptRootItem = new TreeViewItem(); conceptRootItem = PrintConceptRoot(conceptRoot.Value); mvdRootTreeViewItem.Items.Add(conceptRootItem); } treeViewItem.Items.Add(mvdRootTreeViewItem); } Dictionary <string, ExchangeRequirement> allExchangeRequirements = modelView.GetAllExchangeRequirements(); if (allExchangeRequirements.Count > 0) { TreeViewItem mvdExchangeTreeViewItem = new TreeViewItem(); mvdExchangeTreeViewItem.Header = "ExchangeRequirements"; foreach (var exchangeRequirement in allExchangeRequirements) { TreeViewItem exchangeRequirementItem = new TreeViewItem(); exchangeRequirementItem = PrintExchangeRequirement(exchangeRequirement.Value); mvdExchangeTreeViewItem.Items.Add(exchangeRequirementItem); } treeViewItem.Items.Add(mvdExchangeTreeViewItem); } return(treeViewItem); }
internal AppContext(IEnumerable<DataAvail.XtraObjectProperties.XtraObjectProperties> XtraObjectsProperties, ModelView.ModelViewApp ModelViewApp, ModelSecurity.ModelSecApp ModelSecApp) { _xtraObjectsProperties = XtraObjectsProperties; _modelViewApp = ModelViewApp; IEnumerable<ModelView.ModelViewAppItem> mvItems = ModelViewApp != null ? ModelViewApp.AppItems.Items : new ModelView.ModelViewAppItem[] { }; _secObjs = ModelSecApp != null ? ModelSecApp.Objects : new ModelSecurity.ModelSecObject[] { }; foreach(DataAvail.XtraObjectProperties.XtraObjectProperties xop in XtraObjectsProperties) { AddAppItem(xop.ObjectName, mvItems.FirstOrDefault(p => p.Name == xop.ObjectName), null); } }
internal void GenerateExample(string path,ModelView modelView) { STPModelData md = new STPModelData(false,modelView); md.NextObjectRecord = 50; IfcBuilding building = new IfcBuilding(md, "IfcBuilding") { GlobalId = "39t4Pu3nTC4ekXYRIHJB9W"}; building.ContainsElements[0].GlobalId = "3Sa3dTJGn0H8TQIGiuGQd5"; building.Comments.Add("defines the default building (as required as the minimum spatial element) "); md.NextObjectRecord = 100; IfcProject project = new IfcProject(building, "IfcProject", GGYM.Units.Length.mm) { GlobalId = "0$WU4A9R19$vKWO$AdOnKA"}; project.IsDecomposedBy[0].GlobalId = "091a6ewbvCMQ2Vyiqspa7a"; project.RepresentationContexts[0].Comments.Add("general entities required for all IFC data sets, defining the context for the exchange"); md.NextObjectRecord = 200; GenerateData(md,building); string filePath = Path.Combine(path,this.GetType().Name + ".ifc"); if (File.Exists(filePath)) { string[] newLines = md.ToString().Split(new char[] { '\r' , '\n' },StringSplitOptions.RemoveEmptyEntries); List<string> existingLines = new List<string>( File.ReadAllLines(filePath)); existingLines.RemoveAll(x => string.IsNullOrEmpty(x)); if (newLines.Length == existingLines.Count) { bool identical = true; for (int icounter = 0; icounter < newLines.Length; icounter++) { string s1 = newLines[icounter], s2 = existingLines[icounter]; if (s1.StartsWith("/* time_stamp */ ") && s2.StartsWith("/* time_stamp */ ")) continue; if (string.Compare(s1, s2, true) != 0) { identical = false; break; } } if (identical) return; } } md.WriteFile(filePath); }
public DocView(SwAddin addin, IModelView mv, DocumentEventHandler doc) { userAddin = addin; mView = (ModelView)mv; iSwApp = (ISldWorks)userAddin.SwApp; parent = doc; }
public bool IsMenuItemVisible(ModelView.ModelViewMenuItem ModelViewMenuItem) { return ModelViewMenuItem.AppItem == null || GetAppItemContext(ModelViewMenuItem.AppItem.Name, new DefaultContext()).IsCanView; }
private void AddAppItem(string Name, ModelView.ModelViewAppItem ModelViewAppItem, AppItemContext ParentAppItemContext) { AppItem appItem = GetAppItem(Name); AppItemContext itemContext = appItem.AddAppItemContext(ModelViewAppItem, ParentAppItemContext); }
public bool DetachModelViewEventHandler(ModelView mView) { if (OpenModelViews.Contains(mView)) { OpenModelViews.Remove(mView); } return true; }
public DocView(IModelView mv, DocumentEventHandler doc) { _mView = (ModelView)mv; _parent = doc; }
private OpenGlRenderer(ModelView mv) { if (mv == null) throw new ArgumentNullException(nameof(mv)); _GlDoubleBuffer = new GLDoubleBuffer(mv); _Scheduler = DispatcherScheduler.Current; _MView = mv; DoSetup(); _Disposable = _MView.BufferSwapNotifyObservable().Subscribe(args => { var time = DateTime.Now; var layers = _GlDoubleBuffer.Front.GroupBy(o => o.Value.Item1) .OrderBy(o => o.Key) .Select(o => new {Index = o.Key, Renderables = o.Select(q => q.Value.Item2).ToList()}) .ToList(); foreach (var layer in layers) { // Clear the depth buffer after each subsequent layer. This // will ensure that they are drawn on top of each other. if(layer.Index!=0) GL.Clear(ClearBufferMask.DepthBufferBit); foreach (var r in layer.Renderables) r.Render(time); } }); }
public AppItemContext AddAppItemContext(ModelView.ModelViewAppItem ModelViewAppItem, Context Context) { return this.AppItemContexts.Add(ModelViewAppItem, Context); }
public AppItemContext AddAppItemContext(ModelView.ModelViewAppItem ModelViewAppItem, AppItemContext ParentAppItemContext) { return this.AppItemContexts.Add(ModelViewAppItem, ParentAppItemContext == null ? (Context)new DefaultContext() : (Context)new ChildContext(ParentAppItemContext)); }
public static void Read(string path, ModelView.SoundModelView modelView) { if (!File.Exists(path)) return; File.SetAttributes(path, FileAttributes.Normal); try { Stream stream = new FileStream(path, FileMode.Open, FileAccess.Read); Mp3Stream mp3 = new Mp3Stream(stream); if (!mp3.HasTags) { stream.Close(); ComputeFromFileName(path, modelView.Sound); return; } var tags = mp3.GetAllTags(); foreach (var tag in tags) if (tag != null) { modelView.Sound.artist = tag.Artists.Value; modelView.Sound.title = tag.Title.Value; modelView.Photo = GetPicture(tag); //int.TryParse(tag.BeatsPerMinute.Value, out modelView.duration); break; } stream.Close(); }//try catch (Exception) { ComputeFromFileName(path, modelView.Sound); } }
public DatabaseIfc(bool generate, ModelView view) : this(generate, view == ModelView.Ifc2x3Coordination ? Schema.IFC2x3 : Schema.IFC4A1,view) { }
private DatabaseIfc(bool generate,Schema schema, ModelView view) { mSchema = schema; mModelView = view; #if(RHINO) mModelSIScale = 1 / GGYM.Units.mLengthConversion[(int) GGYM.GGYMRhino.GGRhino.ActiveUnits()]; Tolerance = Rhino.RhinoDoc.ActiveDoc.ModelAbsoluteTolerance; #endif if (mSchema == Schema.IFC2x3 || mSchema == Schema.IFC4) { OwnerHistory(IfcChangeActionEnum.ADDED); } mGeomRepContxt = new IfcGeometricRepresentationContext(this, 3, Tolerance) { ContextType = "Model" }; mGeoRepSubContxtAxis = new IfcGeometricRepresentationSubContext(mGeomRepContxt, 0, IfcGeometricProjectionEnum.MODEL_VIEW) { ContextIdentifier = "Axis" }; mGeoRepSubContxtBody = new IfcGeometricRepresentationSubContext(mGeomRepContxt, 0, IfcGeometricProjectionEnum.MODEL_VIEW) { ContextIdentifier = "Body" }; if (generate) initData(); }
public MouseEventHandler(SwAddin addin, IModelView mv, DocumentEventHandler doc) { userAddin = addin; mView = (ModelView)mv; mMouse = mView.GetMouse(); iSwApp = (ISldWorks)userAddin.SwApp; parent = doc; }
public DatabaseIfc(ModelView view) : this(true, view) { }