public ClasesRpt GetDetailReport(ClaseExtraList list) { if (list == null) { return(null); } System.ComponentModel.BindingList <Clase> lista = ListaClases.GetList(null, null, list); ClasesRpt doc = new ClasesRpt(); //Si no existen conceptos, no tiene sentido un informe detallado. Además, falla en Crystal Reports if (lista.Count <= 0) { return(null); } doc.SetDataSource(lista); doc.SetParameterValue("Empresa", Schema.Name); if (Schema.Oid == 2) { ((CrystalDecisions.CrystalReports.Engine.TextObject)(doc.Section5.ReportObjects["Text1"])).Color = System.Drawing.Color.FromArgb(13, 176, 46); } return(doc); }
public FilterGroup(string name) : base(name) { itemsCore = new System.ComponentModel.BindingList <FilterTreeNode>(); itemsCore.Add(new FilterItem("Item0")); itemsCore.Add(new FilterItem("Item1")); }
public static void UpdateSplineSpawnObjectsList(List <RSDKv5.SceneObject> sceneObjects) { Instance.Dispatcher.BeginInvoke(new Action(() => { Methods.Solution.SolutionState.Main.AllowSplineOptionsUpdate = false; sceneObjects.Sort((x, y) => x.Name.ToString().CompareTo(y.Name.ToString())); var bindingSceneObjectsList = new System.ComponentModel.BindingList <RSDKv5.SceneObject>(sceneObjects); Instance.SplineSelectedObjectSpawnList.Clear(); foreach (var _object in bindingSceneObjectsList) { TextBlock item = new TextBlock() { Tag = _object, Text = _object.Name.Name }; Instance.SplineSelectedObjectSpawnList.Add(item); } if (Instance.SplineSelectedObjectSpawnList != null && Instance.SplineSelectedObjectSpawnList.Count > 1) { Instance.EditorToolbar.SelectedSplineRender.ItemsSource = Instance.SplineSelectedObjectSpawnList; Instance.EditorToolbar.SelectedSplineRender.SelectedItem = Instance.EditorToolbar.SelectedSplineRender.Items[0]; var SelectedItem = Instance.EditorToolbar.SelectedSplineRender.SelectedItem as TextBlock; if (SelectedItem == null) { return; } SelectedItem.Foreground = (System.Windows.Media.SolidColorBrush)Instance.FindResource("NormalText"); Methods.Solution.SolutionState.Main.AllowSplineOptionsUpdate = true; } })); }
/// <summary> /// This writes changed data without rewriting the entire file /// </summary> public unsafe void QuickWrite() { VoidPtr origAddr = _rootNode.WorkingUncompressed.Address; SakuraiArchiveHeader *hdr = (SakuraiArchiveHeader *)origAddr; VoidPtr origBase = hdr->BaseAddress; System.ComponentModel.BindingList <SakuraiEntryNode> changed = _rootNode.RebuildEntries; if (changed.Count != 0) { foreach (SakuraiEntryNode entry in changed) { int eOffset = entry._offset; bint *lookup = hdr->LookupEntries; int currentOffset = *(bint *)(origBase + *lookup++); for (int i = 0; i < hdr->_lookupEntryCount - 1; i++, lookup++) { int nextOffset = *(bint *)(origBase + *lookup); if (eOffset >= currentOffset && eOffset < nextOffset) { int newSize = entry._calcSize; int oldSize = entry._initSize; int diff = newSize - oldSize; for (int x = i; x < hdr->_lookupEntryCount; x++) { lookup[x] += diff; } } currentOffset = nextOffset; } } } }
public ProfileManager() { Serializer = new XmlSerializer(typeof(User)); CurrentUsers = new List <User>(); CurrentPath = Directory.GetCurrentDirectory(); TargetPath = Path.Combine(CurrentPath, "Profiles"); try { ProfileFolder = Directory.CreateDirectory(TargetPath); } catch { throw; } UserNames = new System.ComponentModel.BindingList <string>(); foreach (FileInfo folder in ProfileFolder.EnumerateFiles("*.xml")) { try { ReadUserFromFile(folder.FullName); } catch { throw; } } foreach (User usr in CurrentUsers) { UserNames.Add(usr.Name); } }
internal IEnumOfXElement(System.ComponentModel.BindingList <object> refList, XName name) { this.ReferenceList = refList; this.Name = name; this.UpdateRefList(); this.ReferenceList.ListChanged += this.ReferenceList_Changed; }
public TasksPage() { foreach (Model.Task task in DatabaseConnector.DatabaseConnector.Tasks) { Tasks.Add(new Views.TasksView(task)); } foreach (Model.Task task in DatabaseConnector.DatabaseConnector.Tasks) { if ( (task.AcceptanceProperty == Model.Task.eAcceptanceProperty.Accepted_with_conditions || task.AcceptanceProperty == Model.Task.eAcceptanceProperty.Denied ) && task.From.Username == Logic.PermissionHandling.LoginHandler.LoggedInUserName ) { WFAtasks.Add(new Views.TasksView(task)); } } bindingList_Tasks = new System.ComponentModel.BindingList <Views.TasksView>(Tasks); bindingList_WFAtasks = new System.ComponentModel.BindingList <Views.TasksView>(WFAtasks); InitializeComponent(); this.TasksDataGrid.ItemsSource = bindingList_Tasks; this.WaitingForAcceptance.ItemsSource = bindingList_WFAtasks; }
private void RunEditor_FormClosed(object sender, FormClosedEventArgs e) { editorDialog.FormClosed -= RunEditor_FormClosed; editorDialog = null; segmentList.ListChanged -= SegmentList_ListChanged; segmentList = null; }
private object[] OnEndGetLogIDArchives(System.IAsyncResult result) { System.ComponentModel.BindingList <System.Guid> retVal = this.EndGetLogIDArchives(result); return(new object[] { retVal }); }
public override Control Reconcile(IEnumerable<PricingItem> mlpSource_, IEnumerable<PricingItem> dsSource_) { var allCodes = mlpSource_.Union(dsSource_).Select(x => x.SymmetryCode).Distinct(); var lines = new System.ComponentModel.BindingList<CloseItem>(); foreach (var symcode in allCodes) { var line = new CloseItem(); line.SymmetryCode = symcode; { var mlpitem = mlpSource_.Where(x => x.SymmetryCode.Equals(symcode)).FirstOrDefault(); if (mlpitem != null) line.MLPPrice = mlpitem.Value; } { var dsItem = dsSource_.Where(x => x.SymmetryCode.Equals(symcode)).FirstOrDefault(); if (dsItem != null) line.DSPrice = dsItem.Value; } lines.Add(line); } var grid = lines.DisplayInGrid(m_name,displayInShowForm_:false); grid.SetHeaderClickSort(); return grid; }
private static void ExtractSynonym( System.ComponentModel.BindingList <DataModel.MetadataItem> list, ActiveQueryBuilder.Core.MetadataItem mi, int parentID ) { if (mi == null) { return; } var o = ExtractItem(list, mi, parentID); { ActiveQueryBuilder.Core.MetadataObject m = mi as ActiveQueryBuilder.Core.MetadataObject; o.ReferencedObject = m.ReferencedObject?.NameFull; // for (int i = 0; i < m.ReferencedObjectName.Count; i++) { ActiveQueryBuilder.Core.MetadataQualifiedNamePart x = m.ReferencedObjectName[i]; o.ReferencedObjectName += "[" + System.Enum.GetName(typeof(ActiveQueryBuilder.Core.MetadataType), x.Type) + ":" + x.Name + "]" ; } } }
/// <summary> /// Adds the elements of the specified collection to the end of the <see cref="System.ComponentModel.BindingList{T}"/>, /// while only firing the <see cref="System.ComponentModel.BindingList{T}.ListChanged"/>-event once. /// </summary> /// <typeparam name="T"> /// The type T of the values of the <see cref="System.ComponentModel.BindingList{T}"/>. /// </typeparam> /// <param name="bindingList"> /// The <see cref="System.ComponentModel.BindingList{T}"/> to which the values shall be added. /// </param> /// <param name="collection"> /// The collection whose elements should be added to the end of the <see cref="System.ComponentModel.BindingList{T}"/>. /// The collection itself cannot be null, but it can contain elements that are null, /// if type T is a reference type. /// </param> /// <exception cref="ArgumentNullException">values is null.</exception> public static void AddRange <T>(this System.ComponentModel.BindingList <T> bindingList, IEnumerable <T> collection) { // The given collection may not be null. if (collection == null) { throw new ArgumentNullException(nameof(collection)); } // Remember the current setting for RaiseListChangedEvents // (if it was already deactivated, we shouldn't activate it after adding!). var oldRaiseEventsValue = bindingList.RaiseListChangedEvents; // Try adding all of the elements to the binding list. try { bindingList.RaiseListChangedEvents = false; foreach (var value in collection) { bindingList.Add(value); } } // Restore the old setting for RaiseListChangedEvents (even if there was an exception), // and fire the ListChanged-event once (if RaiseListChangedEvents is activated). finally { bindingList.RaiseListChangedEvents = oldRaiseEventsValue; if (bindingList.RaiseListChangedEvents) { bindingList.ResetBindings(); } } }
public TimeSeriesGroup() { this.items = new System.ComponentModel.BindingList <BaseTimeSeries>(); current = 0; this.items.ListChanged += new System.ComponentModel.ListChangedEventHandler(timeSeriesList_ListChanged); name = "no name define"; }
public void CreateVectorLayer() { var vl = new VectorLayerDefinitionType() { #if LDF_240 Watermarks = new System.ComponentModel.BindingList <OSGeo.MapGuide.ObjectModels.WatermarkDefinition.v2_4_0.WatermarkType>() #elif LDF_230 Watermarks = new System.ComponentModel.BindingList <OSGeo.MapGuide.ObjectModels.WatermarkDefinition.v2_3_0.WatermarkType>() #endif }; //TODO: Create composite type style if 1.2 or 1.3 schema vl.VectorScaleRange = new System.ComponentModel.BindingList <VectorScaleRangeType>(); var defaultRange = new VectorScaleRangeType() { Items = new System.ComponentModel.BindingList <object>(), AreaStyle = CreateDefaultAreaStyle(), LineStyle = CreateDefaultLineStyle(), PointStyle = CreateDefaultPointStyle(), #if LDF_100 || LDF_110 #else CompositeStyle = new ICompositeTypeStyle[] { CreateDefaultCompositeStyle() } #endif }; vl.VectorScaleRange.Add(defaultRange); this.Item = vl; }
public QuickSort(System.ComponentModel.BindingList <T> values) { input = new T[values.Count]; for (int i = 0; i < values.Count; i++) { input[i] = values[i]; } }
System.ComponentModel.BindingList <double> _sizeRows, _sizeCols; //多边形的边点 public ROIPolygon() { this._numHandles = 0; //未定,几何中心+根据用户确定的边点数 this._activeHandleIdx = 0; //活动操作柄在中点,以便于移动位置 this.ModeType = ROIType.ROI_TYPE_POLYGON; _sizeRows = new System.ComponentModel.BindingList <double>(); _sizeCols = new System.ComponentModel.BindingList <double>(); }
public void setData(System.ComponentModel.BindingList <Item.data> bl) { _bl.Clear(); foreach (var it in bl) { _bl.Add(it); } _bs.CurrencyManager.Refresh(); }
protected override void OnInitializeInRuntime() { base.OnInitializeInRuntime(); Filters = new System.ComponentModel.BindingList <FilterGroup> { new FilterGroup("Favorites"), new FilterGroup("Custom Filters"), new FilterGroup("Groups") }; }
public MainPresenter(IMainView view) { SyncContext = SynchronizationContext.Current; View = view; _clients = new List<Client>(); _bindingSourceClients = new BindingSource(); _bindingSourceClients.DataSource = null; _bindingSourceClients.DataSource = _clients; _logs = new List<Log>(); _bindingSourceLogs = new BindingSource(); _bindingSourceLogs.DataSource = null; _bindingSourceLogs.DataSource = _logs; _gkLifecycles = new System.ComponentModel.BindingList<GKLifecycle>(); _bindingSourceLifecycle = new BindingSource(); _bindingSourceLifecycle.DataSource = null; _bindingSourceLifecycle.DataSource = _gkLifecycles; GKLifecycleManager.GKLifecycleChangedEvent += On_GKLifecycleChangedEvent; ClientPolls = new List<ClientPolling>(); _bindingSourceClientPolls = new BindingSource(); _bindingSourceClientPolls.DataSource = null; _bindingSourceClientPolls.DataSource = ClientPolls; ServerTasks = new List<ServerTaskModel>(); _bindingSourceOperations = new BindingSource(); _bindingSourceOperations.DataSource = null; _bindingSourceOperations.DataSource = ServerTasks; License = new License(); License.LicenseChanged += EventHandler_License_LicenseChanged; View.Title = "Сервер приложений Глобал"; View.CommandDisconnectActivated += EventHandler_View_CommandDisconnectActivated; View.ClientsContext = _bindingSourceClients; View.EnableMenuDisconnect = false; View.LogsContext = _bindingSourceLogs; View.GkLifecyclesContext = _bindingSourceLifecycle; View.ClientPollsContext = _bindingSourceClientPolls; View.OperationsContext = _bindingSourceOperations; View.LicenseMode = License.LicenseInfo.LicenseMode; View.RemoteClientsCount = License.LicenseInfo.RemoteClientsCount; View.HasFirefighting = License.LicenseInfo.HasFirefighting; View.HasGuard = License.LicenseInfo.HasGuard; View.HasSKD = License.LicenseInfo.HasSKD; View.HasVideo = License.LicenseInfo.HasVideo; View.HasOpcServer = License.LicenseInfo.HasOpcServer; View.InitialKey = License.InitialKey; View.ClickLoadLicense += EventHandler_View_ClickLoadLicense; LastLog = String.Empty; Current = this; }
private void FillFromDropDown() { System.ComponentModel.BindingList<Repository> repos = Repositories.RemoteRepositoryHistory.Repositories; if (_NO_TRANSLATE_From.Items.Count != repos.Count) { _NO_TRANSLATE_To.Items.Clear(); foreach (Repository repo in repos) _NO_TRANSLATE_From.Items.Add(repo.Path); } }
private void ToDropDown(object sender, EventArgs e) { System.ComponentModel.BindingList<Repository> repos = Repositories.RepositoryHistory.Repositories; if (_NO_TRANSLATE_To.Items.Count != repos.Count) { _NO_TRANSLATE_To.Items.Clear(); foreach (Repository repo in repos) _NO_TRANSLATE_To.Items.Add(repo.Path); } }
public ExpensesPage() { foreach (Model.Expense expense in DatabaseConnector.DatabaseConnector.Expenses) { Expenses.Add(new Views.ExpensesView(expense)); } bindingList = new System.ComponentModel.BindingList <Views.ExpensesView>(Expenses); InitializeComponent(); this.ExpensesDataGrid.ItemsSource = bindingList; }
public static void ReadRemoteLog(string remoteIP) { _remoteIP = remoteIP; LastStreamOffset = 0; Lines = new System.ComponentModel.BindingList <LoggingInfo>(); _tmrReadLogging = new Timer(); _tmrReadLogging.Interval = 100; _tmrReadLogging.Tick += new EventHandler(_tmrReadLogging_Tick); _tmrReadLogging.Start(); }
public FeesPage() { foreach (Model.MonthlyFees fee in DatabaseConnector.DatabaseConnector.MonthlyFees) { MonthlyFees.Add(new Views.MonthlyFeesView(fee)); } bindingList = new System.ComponentModel.BindingList <Views.MonthlyFeesView>(MonthlyFees); InitializeComponent(); this.FeesDataGrid.ItemsSource = bindingList; }
/// <summary> /// 根据泛型IList 返回数据绑定的集合类。 /// </summary> /// <typeparam name="T"></typeparam> /// <param name="dataArray"></param> /// <returns></returns> public System.ComponentModel.BindingList <T> CreateBindingList <T>(IList dataArray) { System.ComponentModel.BindingList <T> dataList = new System.ComponentModel.BindingList <T>(); if (dataArray != null && dataArray.Count > 0) { foreach (T info in dataArray) { dataList.Add(info); } } return(dataList); }
public UsersPage() { foreach (Model.User user in DatabaseConnector.DatabaseConnector.Users) { Users.Add(new Views.UsersView(user)); } bindingList = new System.ComponentModel.BindingList <Views.UsersView>(Users); InitializeComponent(); this.UsersDataGrid.ItemsSource = bindingList; }
private void destinationComboBox_DropDown(object sender, EventArgs e) { System.ComponentModel.BindingList <Repository> repos = Repositories.RepositoryHistory.Repositories; if (this._NO_TRANSLATE_destinationComboBox.Items.Count != repos.Count) { this._NO_TRANSLATE_destinationComboBox.Items.Clear(); foreach (Repository repo in repos) { this._NO_TRANSLATE_destinationComboBox.Items.Add(repo.Path); } } }
public void Update(IInvalidator invalidator, LiveSplitState lvstate, float width, float height, LayoutMode mode) { if (editorDialog == null && Form.ActiveForm is RunEditorDialog runEditor) { PropertyInfo info = typeof(RunEditorDialog).GetProperty("SegmentList", BindingFlags.Instance | BindingFlags.NonPublic); segmentList = info.GetValue(runEditor) as System.ComponentModel.BindingList <ISegment>; if (segmentList != null) { editorDialog = runEditor; segmentList.ListChanged += SegmentList_ListChanged; runEditor.FormClosed += RunEditor_FormClosed; } } }
public PanelData(UCDNV863 Root) { root = Root; tmr.Tick += new EventHandler(tmr_Tick); loadrates = new System.ComponentModel.BindingList <MyClassLibrary.DevShare.VListItem>(); volts = new System.ComponentModel.BindingList <MyClassLibrary.DevShare.VListItem>(); realLoads = new System.ComponentModel.BindingList <MyClassLibrary.DevShare.ChartDataPoint>(); planLoads = new System.ComponentModel.BindingList <MyClassLibrary.DevShare.ChartDataPoint>(); greenpowers = new System.ComponentModel.BindingList <MyClassLibrary.DevShare.VListItem>(); greenscales = new System.ComponentModel.BindingList <MyClassLibrary.DevShare.ChartDataPoint>(); cars = new System.ComponentModel.BindingList <MyClassLibrary.DevShare.VListItem>(); customs = new System.ComponentModel.BindingList <MyClassLibrary.DevShare.VListItem>(); cuts = new System.ComponentModel.BindingList <MyClassLibrary.DevShare.VListItem>(); }
private static System.ComponentModel.BindingList <DataModel.MetadataItem> BuildBindingList( ActiveQueryBuilder.Core.SQLContext sc ) { System.ComponentModel.BindingList <DataModel.MetadataItem> list = new System.ComponentModel.BindingList <DataModel.MetadataItem>( ); using (var sqlContext = new ActiveQueryBuilder.Core.SQLContext( )) { sqlContext.Assign(sc); //sqlContext.MetadataContainer.LoadingOptions.LoadDefaultDatabaseOnly = false; //sqlContext.MetadataContainer.LoadingOptions.LoadSystemObjects = false; using (ActiveQueryBuilder.Core.MetadataList miList = new ActiveQueryBuilder.Core.MetadataList(sqlContext.MetadataContainer)) { miList.Load(ActiveQueryBuilder.Core.MetadataType.All, true); System.Collections.Generic.Stack <StackItem> stack = new System.Collections.Generic.Stack <StackItem>( ); stack.Push(new StackItem { list = miList, index = 0, parentID = -1, grandParentID = -1 }); do { StackItem si = stack.Pop( ); ActiveQueryBuilder.Core.MetadataList actualMIList = si.list; int actualIndex = si.index; int actualParentID = si.grandParentID; // IMPORTANT!!! { for ( ; actualIndex < actualMIList.Count; actualIndex++) { ExtractMetadataItem(list, actualMIList[actualIndex], actualParentID); if (actualMIList[actualIndex].Items.Count > 0) // branch... { // Push the "next" Item... stack.Push(new StackItem { list = actualMIList, index = actualIndex + 1, parentID = list[list.Count - 1].ID, grandParentID = actualParentID }); // Reset the loop to process the "actual" Item... actualParentID = list[list.Count - 1].ID; actualMIList = actualMIList[actualIndex].Items; actualIndex = -1; } } // for(;;)... } } while(stack.Count > 0); } // using()... } // using()... return(list); } // buildBindingList(...)
private static void ExtractNamespace( System.ComponentModel.BindingList <AQBTest.MetadataItemFQN> list, ActiveQueryBuilder.Core.MetadataItem mi, int parentID ) { if (mi == null) { return; } var o = ExtractItem(list, mi, parentID); { ActiveQueryBuilder.Core.MetadataNamespace m = mi as ActiveQueryBuilder.Core.MetadataNamespace; } }
private static void ExtractTable( System.ComponentModel.BindingList <DataModel.MetadataItem> list, ActiveQueryBuilder.Core.MetadataItem mi, int parentID ) { if (mi == null) { return; } var o = ExtractItem(list, mi, parentID); { ActiveQueryBuilder.Core.MetadataObject m = mi as ActiveQueryBuilder.Core.MetadataObject; } }
public override Control Reconcile(IEnumerable<PricingItem> mlpSource_, IEnumerable<PricingItem> dsSource_) { var allCodes = mlpSource_.Union(dsSource_).Select(x => x.SymmetryCode).Distinct(); var lines = new System.ComponentModel.BindingList<CompareItem>(); foreach(var symCode in allCodes) { var mlpItem = mlpSource_.Where(x => x.SymmetryCode.Equals(symCode)).FirstOrDefault(); var dsItem = dsSource_.Where(x => x.SymmetryCode.Equals(symCode)) // want to see the underlying price source (will be tweb most of the time, else reuters) .Where(x => x.QuoteSourceCode.Equals("SYM")).FirstOrDefault(); var line = new CompareItem(); if(mlpItem!=null) { line.SetCommon(mlpItem); line.MLPPrice = mlpItem.Value; } if(dsItem!=null) { line.SetCommon(dsItem); line.DSSnapCode = dsItem.SnapCode; line.DSPrice = dsItem.Value; //line.DSSources = string.Join(",", dsSource_.Where(x => x.SymmetryCode.Equals(symCode) && !x.QuoteSourceCode.Equals("SYM")).Select(x => x.QuoteSourceCode).OrderBy(x=>x).ToArray()); line.DSSources = string.Join(", ", dsSource_.Where(x => x.SymmetryCode.Equals(symCode) && !x.QuoteSourceCode.Equals("SYM")).OrderBy(x=>x.QuoteSourceCode).Select(x => string.Format("{0}:{1}", x.QuoteSourceCode, x.Value)).ToArray()); } lines.Add(line); } var control = new CurveCompareControl(); control.Create(lines); //control.DisplayInShowForm(string.Format("{0} curve", m_codeBase)); return control; }
public override Control Reconcile(IEnumerable<PricingItem> mlpSource_, IEnumerable<PricingItem> dsSource_) { var allCodes = mlpSource_.Union(dsSource_).Select(x => x.SymmetryCode).Distinct(); var lines = new System.ComponentModel.BindingList<BondReconcileLine>(); foreach(var symCode in allCodes) { var mlpItem = mlpSource_.Where(x => x.SymmetryCode.Equals(symCode)).FirstOrDefault(); var dsItem = dsSource_.Where(x => x.SymmetryCode.Equals(symCode)).FirstOrDefault(); var line = new BondReconcileLine(); if(mlpItem!=null) { line.SetCommon(mlpItem); line.MLPPrice = mlpItem.Value; } if(dsItem!=null) { line.SetCommon(dsItem); line.DSPrice = dsItem.Value; line.DS_Source = dsItem.QuoteSourceCode; } lines.Add(line); } var control = new BondCompareControl(); control.Create(lines); return control; //var grid = lines.DisplayInGrid(string.Format("{0} . Bond CleanPrice Reconciliation",m_name),displayInShowForm_:false); //grid.SetHeaderClickSort(); //return grid; }
public TimeSeriesGroup() { this.items = new System.ComponentModel.BindingList<BaseTimeSeries>(); current = 0; this.items.ListChanged += new System.ComponentModel.ListChangedEventHandler(timeSeriesList_ListChanged); name = "no name define"; }
public void CreateVectorLayer() { var vl = new VectorLayerDefinitionType() { #if LDF_240 Watermarks = new System.ComponentModel.BindingList<OSGeo.MapGuide.ObjectModels.WatermarkDefinition_2_4_0.WatermarkType>() #elif LDF_230 Watermarks = new System.ComponentModel.BindingList<OSGeo.MapGuide.ObjectModels.WatermarkDefinition_2_3_0.WatermarkType>() #endif }; //TODO: Create composite type style if 1.2 or 1.3 schema vl.VectorScaleRange = new System.ComponentModel.BindingList<VectorScaleRangeType>(); var defaultRange = new VectorScaleRangeType() { Items = new System.ComponentModel.BindingList<object>(), AreaStyle = CreateDefaultAreaStyle(), LineStyle = CreateDefaultLineStyle(), PointStyle = CreateDefaultPointStyle(), #if LDF_100 || LDF_110 #else CompositeStyle = new ICompositeTypeStyle[] { CreateDefaultCompositeStyle() } #endif }; vl.VectorScaleRange.Add(defaultRange); this.Item = vl; }
private void ReconnectEvents(StreamingContext context) { Items = new System.ComponentModel.BindingList<TimespanValue>(items); Items.ListChanged += new System.ComponentModel.ListChangedEventHandler(items_ListChanged); ExtrapolationMethod = ExtrapolationMethods.Linear; }
public TimespanSeries() { items = new List<TimespanValue>(); Items = new System.ComponentModel.BindingList<TimespanValue>(items); Items.ListChanged += new System.ComponentModel.ListChangedEventHandler(items_ListChanged); }
private void ReconnectEvents(StreamingContext context) { Items = new System.ComponentModel.BindingList<TimestampValue>(items); Items.ListChanged += new System.ComponentModel.ListChangedEventHandler(items_ListChanged); }
/// <summary> /// Constructor. Assigning default values for the timeseries properties. /// </summary> public TimestampSeries2() { Items = new System.ComponentModel.BindingList<TimestampValue>(items); Items.ListChanged += new System.ComponentModel.ListChangedEventHandler(items_ListChanged); ExtrapolationMethod = ExtrapolationMethods.Linear; }
public static void Test() { var model = new RvolSolveModel( targetVol_: 0.0121519, cov_: Singleton<SI.Data.CovarianceSource>.Instance.GetCovariance(DateTime.Today.AddDays(-1d)), ccys_: Singleton<SI.Data.FXIDs>.Instance.Select(x => new CurrencyLine( ccy_: x, expectedReturn_: 0.1, minWt_: x.IsGroup(Data.FXGroup.G10) ? -0.31 : -0.1215914, maxWeight_: x.IsGroup(Data.FXGroup.G10) ? 0.31 : 0.1215914)).ToArray() ) { SumOfWeightsMin = 0d, SumOfWeightsMax = 1d, }; new RvolSolver().SolveQuadratic(model); Console.WriteLine("ben"); return; var result = Singleton<ExcelOptimizer>.Instance.DoIt( model.CurrencyLines.Length, model.TargetVol, model.Covar.Data, model.CurrencyLines.Select(x => x.ExpectedReturn).ToArray(), ExtensionMethods.CreateArrayRep<double>(0d, model.CurrencyLines.Length), ExtensionMethods.CreateArrayRep<double>(0d, model.CurrencyLines.Length), model.CurrencyLines.Select(x => x.MinWeight).ToArray(), model.CurrencyLines.Select(x => x.MaxWeight).ToArray(), 1d, 1d, "2W", DateTime.Today); Singleton<ExcelOptimizer>.Instance.Dispose(); var list = new System.ComponentModel.BindingList<CompareResult>(); for (int i = 0; i < model.CurrencyLines.Length; ++i) { list.Add( new CompareResult() { Currency = model.CurrencyLines[i].Ccy.Code, SolverFoundation = model.CurrencyLines[i].Weight, XLL = result.Wts[i] }); } list.DisplayInGrid("result comparison"); }
public static IList<SwapsSummaryRow> GetListAsSummaryRows(bool forceGetStats_=false) { var list = new System.ComponentModel.BindingList<SwapsSummaryRow>(); foreach (var inst in GetList()) { if (forceGetStats_) inst.Stats.ToString(); list.Add(new SwapsSummaryRow(inst,null)); } return list; }
private void loadSitesToolStripMenuItem_Click(object sender, EventArgs e) { // set the startup directory to the default MediaPortal data directory string commonAppData = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + @"\Team MediaPortal\MediaPortal\"; if (Directory.Exists(commonAppData)) { openFileDialog1.InitialDirectory = commonAppData; } if (openFileDialog1.ShowDialog() == DialogResult.OK) { using (FileStream fs = new FileStream(openFileDialog1.FileName, FileMode.Open, FileAccess.Read)) { XmlSerializer ser = new XmlSerializer(typeof(SerializableSettings)); SerializableSettings s = (SerializableSettings)ser.Deserialize(fs); fs.Close(); SiteSettingsList = s.Sites; int i = 0; while (i < SiteSettingsList.Count) { if (SiteSettingsList[i].UtilName != "GenericSite" || SiteSettingsList[i].Configuration == null) SiteSettingsList.RemoveAt(i); else i++; } comboBoxSites.ComboBox.DisplayMember = "Name"; comboBoxSites.ComboBox.DataSource = SiteSettingsList; } } }