public ResourceRequest Loader(string Path) { // Callback action System.Action <UnityEngine.Object, System.Action <UnityEngine.Object> > DoJob = (asset, callback) => { Object obj = null; this.Cache.TryGetValue(Path, out obj); if (obj == null) { this.Cache.Add(Path, obj); obj = Modeling.LoadPrefab(asset); } callback?.Invoke(obj); }; var AsysnJob = AsyncLoader.LoadAsyncObject <GameObject>(Path, DoJob, callback: beLoaded => { //var AI = (beLoaded as GameObject).GetComponent<ClassA>(); //Debug.LogError(AI.name); //Nothi } ); return(AsysnJob); }
public TableDefinition(Type modelType, string alias, TypeModeling builderModeling) { ModelType = modelType; Alias = alias; var tableName = modelType.Name; var schemaName = builderModeling.DefaultSchema ?? Modeling.DefaultSchema ?? null; // First global modeling if (Modeling.HasModel(modelType)) { _tableModel = Modeling.GetModel(modelType); tableName = _tableModel.TableName ?? tableName; schemaName = _tableModel.SchemaName ?? schemaName; } // By the end check builder modeling if (builderModeling.HasModel(modelType)) { _builderTableModel = builderModeling.GetModel(modelType); tableName = _builderTableModel.TableName ?? tableName; schemaName = _builderTableModel.SchemaName ?? schemaName; } TableName = tableName; SchemaName = schemaName; }
static void Main(string[] args) { IModeling modeling = new Modeling(); mainDevice = new Device(modeling); mainDevice.HandlingTime = 10; mainDevice.Queue = new Queue(modeling); mainDevice.OnStartHandling += mainDevice_OnStartHandling; modeling.Devices.Add(mainDevice); modeling.EndsAt = 100; modeling.OnCause += modeling_OnCause; modeling.Reset(); modeling.Schedule(new Event { Transaction = new Transaction { Status = SampleTransactionStatus.Arriving } }); modeling.Run(); Console.WriteLine("--------------------------------------------------------------"); Console.WriteLine("Время моделирования: {0}", modeling.EndsAt); Console.WriteLine("Обработано заявок: {0}", mainDevice.HandledTransactionsCount); Console.WriteLine("Поступило заявок: {0}", mainDevice.Queue.TotalAmount); Console.Read(); }
protected AudioClip Load(string fileName, string RootPath) { if (this._Audioes != null) { if (_Audioes.ContainsKey(fileName)) { var clip = _Audioes[fileName] ?? Modeling.LoadResource <AudioClip>(RootPath + fileName); #if UNITY_EDITOR //if (clip == null) // Debug.LogError("Mising audioclupo + " + fileName); #endif _Audioes.TryAdd(fileName, clip); return(clip); } else { var clip = Modeling.LoadResource <AudioClip>(RootPath + fileName); #if UNITY_EDITOR //if (clip == null) // Debug.LogError("Mising audioclupo + " + fileName); #endif _Audioes.TryAdd(fileName, clip); return(clip); } } #if UNITY_EDITOR //Debug.LogError("Mising audioclupo + " + fileName); #endif return(null); }
public void ApiTest() { Modeling.Name(); Modeling.Namespace(); Modeling.Element(); Modeling.Attribute(); Modeling.DeepEquals(); }
public static void LoadAsyncObject(string path, System.Action callback = null, string tag = "Default", Transform parent = null) { LoadModel.LoadAsyncObject <GameObject>(path, () => { Modeling.LoadPrefab(path, tag, parent); callback?.Invoke(); }); }
private static Report CreateReport(Modeling.Report repdef) { var report = new Report(); SetReportProperties(report, repdef); AddDataSources(report, repdef); AddBody(report, repdef); AddDataSets(report, repdef); return report; }
/// <summary> /// Creates and initializes the audiosource component with the appropriate values /// </summary> public virtual void Create() { _AudioSource = Modeling.LoadResource <AudioSource>(this.Path) as AudioSource; _AudioSource.clip = this.Clip; _AudioSource.loop = this.Loop; _AudioSource.mute = this.Mute; _AudioSource.volume = this.Volume; _AudioSource.priority = this.Priority; _AudioSource.pitch = this.Pitch; }
public void SelectWithDefaultSchema() { Modeling.ResetModeling(); Modeling.DefaultSchema = "DBO"; Configuration.SetDialect(new TestDialect()); var b = new SelectFrom <DeliveryNote>(); var gen = b.GetSqlText(); var spec = "SELECT * FROM [DBO].[DeliveryNote] AS [T0]"; Assert.Equal(spec, gen); }
internal static void SetModeling() { Modeling.ResetModeling(); Modeling.Model <Supplier>().SetSchema("WH").SetColumnName(s => s.CreatedBy, "CreatedBy_Id"); Modeling.Model <DeliveryNote>().SetSchema("WH"); Modeling.Model <DeliveryNoteDetail>().SetSchema("WH"); Modeling.Model <Product>().SetSchema("WH"); Modeling.Model <EquivalentProduct>().SetSchema("WH"); Modeling.Model <DeliveryNoteDetail>().SetColumnName(dnd => dnd.DeliveryNoteId, "DeliveryNote_Id"); Modeling.Model <User>() .SetSchema("LoB") .SetTable("SecurityProfile") .SetColumnName(u => u.CreatedBy, "CreatedBy_Id"); }
protected void Page_Load(object sender, EventArgs e) { String[] cases = (string[])Session["cases"]; if (cases == null) { Session["Error"] = "Use Case Statements are Mandatory"; Response.Redirect("default.aspx"); return; } else { Label1.Text = ""; Image1.ImageUrl = Modeling.createModel(cases); } }
private static void SetReportProperties(Report report, Modeling.Report report_model) { var repdef = report_model.PageLayout; report.Width = repdef.BodyWidth; report.PageWidth = repdef.PageWidth; report.PageHeight = repdef.PageHeight; report.LeftMargin = repdef.LeftMargin; report.RightMargin = repdef.RightMargin; report.TopMargin = repdef.TopMargin; report.BottomMargin = repdef.BottomMargin; var docprops = report_model.DocumentProperties; report.Language = docprops.Language; report.Author = docprops.Author; }
public void CanSetModelingByBuilder() { Modeling.ResetModeling(); Modeling.DefaultSchema = "KKK"; Modeling.Model <Supplier>().SetSchema("CUS").SetTable("CUSTOMER"); var b = new SelectBuilder(); b.Modeling.Model <Supplier>().SetSchema("dbo").SetTable("MyTable"); b.From <Supplier>(); var gen = b.GetSqlText(); var spec = "SELECT * FROM [dbo].[MyTable] AS [T0]"; Assert.Equal(spec, gen); }
private void ViewLoaded() { mInterface.SendMessageToOutput("---------------------------------------------------"); mInterface.SendMessageToOutput("Loading Discounting modules and R interface..."); mDiscount = new Modeling(); mInterface.SendMessageToOutput("Discounting modules loaded."); /* Prepares R DLLs for fitting */ REngine.SetEnvironmentVariables(); engine = REngine.GetInstance(); engine.Initialize(); mInterface.SendMessageToOutput("R interop modules loaded."); }
public void ReadWriteTest() { try { Modeling.Read(); Assert.Fail(); } catch (XmlException exception) { Trace.WriteLine(exception); } IEnumerable <XElement> items = Modeling.RssItems("https://weblogs.asp.net/dixin/rss"); Assert.IsTrue(items.Any()); Modeling.XNodeToString(); Modeling.Write(); }
private static void AddDataSets(Report report, Modeling.Report repdef) { var dataset = new XDataSet(); report.DataSets.Add(dataset); dataset.Name = repdef.DatasetName; dataset.CommandText = ""; dataset.DataSourceName = repdef.DatasetName; for (int colindex = 0; colindex < repdef.DataTable.Columns.Count; colindex++) { var dt_col = repdef.DataTable.Columns[colindex]; var field = new Field(); field.Name = dt_col.ColumnName; field.DataField = dt_col.ColumnName; dataset.Fields.Add(field); } }
public void CanDefineSeveralModelsAndColumns() { Modeling.ResetModeling(); Modeling.Model <Supplier>().SetSchema("CUS").SetTable("CUSTOMER"); Modeling.Model(typeof(Supplier)).SetColumnName("Name", "NOMBRE"); Modeling.Model <Supplier>().Ignore(c => c.PhoneNumber2); Modeling.Model <DeliveryNote>().SetSchema("WH"); Modeling.Model <DeliveryNote>().SetTable("INVOICE"); Assert.Equal("CUS", Modeling.Model <Supplier>().SchemaName); Assert.Equal("CUSTOMER", Modeling.Model <Supplier>().TableName); Assert.Equal("WH", Modeling.Model <DeliveryNote>().SchemaName); Assert.Equal("INVOICE", Modeling.Model <DeliveryNote>().TableName); Assert.Equal("NOMBRE", Modeling.Model <Supplier>().Column(c => c.Name).ColumnName); Assert.Equal("NOMBRE", Modeling.Model(typeof(Supplier)).Column("Name").ColumnName); Assert.Equal(true, Modeling.Model <Supplier>().Column(c => c.PhoneNumber2).Ignored); Assert.Equal(2, Modeling.Model <Supplier>().PropertyCount); Assert.Equal(2, Modeling.ModelListCount); }
private void openFileDialog_FileOk(object sender, CancelEventArgs e) { this.OutputWindow.Text = String.Empty; try { var fileName = openFileDialog.FileName.ToString(); var xml = XDocument.Load(fileName); var iterationProcess = XMLInputDataMapper.MapIterationProcess(xml); var areas = XMLInputDataMapper.MapAreas(xml, iterationProcess); this.Problem = new Problem(areas, iterationProcess); this.Problem = XMLInputDataMapper.MapOutputPoints(xml, this.Problem); this.modeling = new Modeling(this.Problem, shapePictureBox.Size); this.modeling.Draw(this.shapePictureBox.CreateGraphics()); this.OutputWindow.Text = "**************************************" + Environment.NewLine + "***Data correct***" + Environment.NewLine + "**************************************" + Environment.NewLine; } catch (Exception exception) { this.OutputWindow.Text = "Exception:" + Environment.NewLine + exception.Message + Environment.NewLine; } }
private static void AddBody(Report report, Modeling.Report repdef) { var coldefs = new List<Viziblr.Reporting.RDL2005.ColumnDef>(); coldefs.AddRange(repdef.ColumnDefinitions); while (coldefs.Count < repdef.DataTable.Columns.Count) { var coldef = new ColumnDef(); coldef.Width = repdef.DefaultColumnWidth; coldefs.Add(coldef); } var body = new Body(); SetBodyProperties(repdef, body); AddTitle(repdef, body); AddTableDataRegion(coldefs, repdef, body); report.Body = body; }
private static void AddTableGrouping(Modeling.Report repdef, Table table) { for (int grouping_col_index = 0; grouping_col_index < repdef.GroupOnColumns.Count; grouping_col_index++) { var grouping_col = repdef.GroupOnColumns[grouping_col_index]; var tablegroup = new TableGroup(); tablegroup.Name = string.Format("TABLE_GROUP_ON_COL_{0}_{1}", grouping_col, grouping_col_index); var col = repdef.DataTable.Columns[grouping_col]; tablegroup.GroupingExpressions.Add(Util.GetExprFieldValue(col.ColumnName)); table.TableGroups.Add(tablegroup); var tableheight = new TableRow(); tableheight.Height = repdef.DetailRowHeight; tablegroup.Header.TableRows.Add(tableheight); for (int colindex = 0; colindex < repdef.DataTable.Columns.Count; colindex++) { var tablecell = new TableCell(); tableheight.TableCells.Add(tablecell); var textbox = new TextBox(tablegroup.Name + "_" + colindex.ToString(), null); tablecell.ReportItems.Add(textbox); if (colindex == grouping_col_index) { textbox.Value = Util.GetExprFieldValue(col.ColumnName); } else { textbox.Value = ""; } textbox.Height = repdef.DetailRowHeight; } // TODO hide the column that was grouped! } }
public static void LoadAsyncObject(string path, Quaternion localRotation, string tag = GameTag.Player, Transform parent = null) { AsyncModeling.AsyncLoader.LoadAsyncObject <GameObject>(path, () => Modeling.LoadPrefab(path, tag, parent)); }
public T Load <T>(string Path, bool IsIMMEDIATE = false) where T : UnityEngine.Object { if (this.Cache == null) { this.Cache = new Dictionary <string, Object>(); } Object Obj = null; // Cái TryGetValue sẽ tự Add Key luôn. if (this.Cache.TryGetValue(Path, out Obj)) { if (Obj == null) { Debug.LogError("34567i9o0"); // Nếu chưa Loadxong mà Return ngay lúc dó thì sao ? /* return Async.asset as GameObject; */ if (IsIMMEDIATE == false) { ResourceRequest Async = Loader(Path); Async.completed += async => { this.Cache[Path] = Async.asset; // Chổ này cái Obj bị hủy thì có tính là Null không ta ? // À. Nó tính là Null nè; if (Obj != null) { Obj = Async.asset; } }; return(Async.asset as T); } // Vậy nếu cần ngay thì sao ?!. // Chuyển sang Load ngay lập tức và Return luôn else { Obj = Modeling.LoadResource <T>(Path); this.Cache.Add(Path, Obj); return(Obj as T); } } } else { // Debug.LogError("34567i9o0"); // Nếu chưa Loadxong mà Return ngay lúc dó thì sao ? /* return Async.asset as GameObject; */ if (IsIMMEDIATE == false) { ResourceRequest Async = Loader(Path); Async.completed += async => { this.Cache[Path] = Async.asset; // Chổ này cái Obj bị hủy thì có tính là Null không ta ? // À. Nó tính là Null nè; if (Obj != null) { Obj = Async.asset; } }; return(Async.asset as T); } // Vậy nếu cần ngay thì sao ?!. // Chuyển sang Load ngay lập tức và Return luôn else { Obj = Modeling.LoadResource <T>(Path); this.Cache.Add(Path, Obj); return(Obj as T); } } return(Obj as T); }
private static void AddDataSources(Report report, Modeling.Report repdef) { var datasource0 = new DataSource(); datasource0.DatasetName = repdef.DatasetName; report.DataSources.Add(datasource0); }
private static void AddTitle(Modeling.Report repdef, Body body) { var tbtitle = new TextBox("REPORT_TITLE", repdef.ReportTitle); tbtitle.CanGrow = true; tbtitle.Height = repdef.TitleHeight; tbtitle.Style.FontFamily = repdef.DefaultFontFamily; tbtitle.Style.FontSize = repdef.DefautlReportTitleFontSize; body.ReportItems.Add(tbtitle); }
public static void LoadAsyncObject(string path, Quaternion localRotation, string tag = "Player", Transform parent = null) { LoadModel.LoadAsyncObject <GameObject>(path, () => Modeling.LoadPrefab(path, tag, parent)); }
private static void AddTableDataRegion(List<ColumnDef> coldefs, Modeling.Report repdef, Body body) { var table = new Table(); table.Name = "REPORT_DATAREGION"; table.Top = repdef.DataRegionTop; table.DatasetName = repdef.DatasetName; AddTableHeader(repdef, table, coldefs); AddTableDetailCells(coldefs, repdef, table); AddTableDataColumns(coldefs, repdef, table); AddTableGrouping(repdef, table); body.ReportItems.Add(table); }
private static void SetBodyProperties(Modeling.Report repdef, Body body) { body.Height = repdef.PageLayout.BodyHeight; body.ColumnSpacing = repdef.BodyColumnSpacing; }
public void CreateAndSerializeTest() { Modeling.CreateAndSerializeWithDom(); Modeling.CreateAndSerializeWithLinq(); Modeling.Construction(); }
private static void AddTableHeader(Modeling.Report repdef, Table table, IList<ColumnDef> coldefs) { var tablerow = new TableRow(); for (int colindex = 0; colindex < repdef.DataTable.Columns.Count; colindex++) { var coldef = coldefs[colindex]; var dt_col = repdef.DataTable.Columns[colindex]; var tablecell = new TableCell(); var celltb = new TextBox("HEADER_COL_" + colindex.ToString() + "_TEXTBOX", dt_col.Caption); celltb.CanGrow = true; celltb.Height = repdef.HeaderHeight; celltb.Width = coldef.Width; celltb.Style.FontFamily = repdef.DefaultFontFamily; celltb.Style.FontSize = repdef.DefaultHeaderRowFontSize; celltb.Style.FontWeight = repdef.DefaultHeaderRowFontWeight; tablecell.ReportItems.Add(celltb); tablerow.TableCells.Add(tablecell); } tablerow.Height = repdef.HeaderHeight; table.Header.TableRows.Add(tablerow); }
public static GameObject LoadObject <T>(string path, Quaternion localRotation, string tag = "Default", Transform parent = null) where T : UnityEngine.Component { return(Modeling.LoadObject <T>(path, Vector3.one, localRotation, Vector3.zero, parent, tag)); }
public bool saveNewFrontDemands(Modeling.FrontOffice.Order[] newFrontOrders) { foreach(Modeling.FrontOffice.Order order in newFrontOrders) { int urg=0; if (order.isExpress==true) urg=1; /* CDemand demand = new CDemand(order.OrderID, this.modelTime, urg, new Dictionary<int, int> { { 1, order.ProductCount[0] }, { 2, order.ProductCount[1] }, { 3, order.ProductCount[2] } }); */ //---> ProductCluster productCluster = new ProductCluster(); for (int iProductNumber = 1; iProductNumber <= Params.PRODUCTS_NUMBER; iProductNumber++) { productCluster.AddProduct(iProductNumber, order.ProductCount[iProductNumber - 1 ]); } Demand demand = new Demand(order.OrderID, this.modelTime, urg, productCluster); //<--- demand.ShouldBeDoneDate = order.doneDate; bool addResult = this.storage.AddAcceptedDemand(demand); if (addResult==false) return false; } return true; }
public void StreamingTest() { Modeling.StreamingElementWithChildElements(); Modeling.StreamingElementWithChildElementModification(); }
private static void AddTableDataColumns(List<ColumnDef> coldefs, Modeling.Report repdef, Table table) { for (int colindex = 0; colindex < repdef.DataTable.Columns.Count; colindex++) { var dt_col = repdef.DataTable.Columns[colindex]; var coldef = coldefs[colindex]; var tablecol = new TableColumn(); tablecol.Width = coldef.Width; table.TableColumns.Add(tablecol); } }
public void CreateAndSerializeTest() { Modeling.CreateAndSerialize(); Modeling.Construction(); }
public static System.Xml.Linq.XDocument ShowReport(ReportViewer reportviewer, Modeling.Report report_model, ViewingOptions viewingoptions, System.Action<Viziblr.Reporting.RDL2005.Report> mod_report) { var report = CreateReport(report_model); if (mod_report != null) { mod_report(report); } var new_dom = report.ReportToXMLDOM(); if (viewingoptions.SaveRDLFile) { string temp_rdl = viewingoptions.OutputRDLFilename; new_dom.Save(temp_rdl); } reportviewer.LocalReport.DataSources.Clear(); var rep_ds = new Microsoft.Reporting.WinForms.ReportDataSource(report_model.DatasetName, report_model.DataTable); reportviewer.LocalReport.DataSources.Add(rep_ds); reportviewer.ProcessingMode = ProcessingMode.Local; var mem_stream = SaveXMLToMemoryStream(new_dom); //reportviewer.LocalReport.ReportPath = temp_rdl; reportviewer.LocalReport.LoadReportDefinition(mem_stream); reportviewer.RefreshReport(); return new_dom; }
public static GameObject LoadObject <T>(string path, Vector3 localScale, Quaternion localRotation, Vector3 localPosition, Transform parent, string tag) where T : UnityEngine.Component { return(Modeling.LoadObject <T>(path, localScale, localRotation, localPosition, parent, tag)); }
public void StreamingTest() { Modeling.StreamingElement(); }
public bool saveChangedFrontDemands(Modeling.FrontOffice.Order[] changedFrontOrders) { foreach (Modeling.FrontOffice.Order order in changedFrontOrders) { int urg = 0; if (order.isExpress == true) urg = 1; ProductCluster productCluster = new ProductCluster(); for (int iProductNumber = 1; iProductNumber <= Params.PRODUCTS_NUMBER; iProductNumber++) { productCluster.AddProduct(iProductNumber, order.ProductCount[iProductNumber - 1]); } Demand demand = new Demand(order.OrderID, new DateTime(), urg, productCluster); demand.ShouldBeDoneDate = order.doneDate; bool changeResult = this.storage.ModifyDemand(demand); if (changeResult == false) return false; } return true; }
protected virtual AudioClip LoadSfx(string path, string fileExt) { return(Modeling.LoadResource <AudioClip>(path)); }
public static GameObject LoadObject <T>(string path, string tag = "Player", Transform parent = null) where T : UnityEngine.Component { return(Modeling.LoadObject <T>(path, Vector3.one, Quaternion.Euler(0, 0, 0), Vector3.zero, parent, tag)); }
private static void AddTableDetailCells(List<ColumnDef> coldefs, Modeling.Report repdef, Table table) { var tablerow = new TableRow(); for (int colindex = 0; colindex < repdef.DataTable.Columns.Count; colindex++) { var coldef = coldefs[colindex]; var datatable_col = repdef.DataTable.Columns[colindex]; var tablecell = new TableCell(); tablerow.TableCells.Add(tablecell); var tbval = Util.GetExprFieldValue(datatable_col.ColumnName); var tbname = "DETAIL_COL_" + colindex.ToString() + "_TEXTBOX"; var textbox = new TextBox(tbname, tbval); tablecell.ReportItems.Add(textbox); textbox.CanGrow = true; textbox.Height = repdef.HeaderHeight; textbox.Width = coldef.Width; textbox.Style.FontFamily = repdef.DefaultFontFamily; textbox.Style.FontSize = repdef.DefaultDetailRowFontSize; textbox.Style.BorderStyle.Default = repdef.TableCellBorderStyle; textbox.Style.BorderColor.Default.ColorName = repdef.TableCellBorderColor; textbox.Style.BorderWidth.Default = repdef.TableCellBorderWidth; if (repdef.DefaultDetailRowBackgroundColor != null) { if (repdef.DefaultDetailRowBackgroundColorAlternate == null) { textbox.Style.BackgroundColor.ColorName = repdef.DefaultDetailRowBackgroundColor; } else { textbox.Style.BackgroundColor.Expression = string.Format("=IIF(RowNumber(Nothing) Mod 2 = 0,\"{0}\",\"{1}\")", repdef.DefaultDetailRowBackgroundColor, repdef.DefaultDetailRowBackgroundColorAlternate); } } } tablerow.Height = repdef.DetailRowHeight; table.Details.TableRows.Add(tablerow); }