Posts

Showing posts from April 13, 2019

C#: determine if a class has already been initialized

Image
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box; 2 0 I have many classes in an assembly that I can't or don't want to modify. At some point of runtime, I want to know which of them have already been "initialized": static initializer (= static constructor) has run. Is there a way to do it with reflection or something else? For information, not every class in an assembly is initialized when the assembly is loaded. This can be easily observed with this piece of code: public static class Foo static Foo() MainClass.Value = "Something"; public static void DoSomething() Thread.Sleep(100); public static class MainClass public static string Value = "Nothing"; public static void Main() Console.WriteLine(Value); Foo.DoSomething(); Console.WriteLine(Value); Displays: Nothing Something c# reflection share | improve

Losfertigung

Image
Typischer Kostenverlauf bei Losfertigung Bei der Losfertigung durchläuft ein Produktionsauftrag (Los) als (geschlossener) Posten die Fertigungsstufen, wobei bei Auflegen eines einzelnen Loses jeweils einmalige Rüstkosten entstehen. Charakteristisch für die Losfertigung sind die Losauflagekosten, die zu Beginn und am Ende des Fertigungsprozesses unabhängig von der Reihenfolge der Sorten und Größe des Loses anfallen und damit fix sind. Dazu zählen Umrüstkosten für Einrichtung des Arbeitsplatzes, Einspannen der Werkzeuge, Bereitstellen der gemäß Stückliste und Fertigungslos definierten Produktionsfaktor-Teile, Abrüsten und Reinigen. Die Stückkosten enthalten anteilige Losauflagekosten und hängen damit von der Losgröße ab: Stu¨ckkosten=LosauflagekostenLosgröße+Materialstu¨ckkosten+Fertigungsstu¨ckkostendisplaystyle mathrm Stddot uckkosten =frac mathrm Losauflagekosten textLosgröße;+;mathrm Materialstddot uckkosten ;+;mathrm Fertigungsstddot uckkosten Die Fertigungsstückkosten entsprechen

Specify design time binding context in a GridTemplateColumn

Image
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box; 1 I'm working on a Xamarin.Forms project. In my xaml page, order to avoid "Cannot resolve property 'xxx'" warning, I've set a design-time data context. In this page I have a SfDataGrid object. In the following code snippet, the text property of the custom entry is binding to the Quantity field of a Part item. The Parts object is an ObservableCollection<Part> . <xForms:SfDataGrid ItemsSource="Binding Parts" AutoGenerateColumns="false" Margin="0" ScrollingMode="PixelLine" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" > <xForms:SfDataGrid.Columns> <xForms:GridTextColumn MappingName="ProductName" HeaderText="Product" HeaderTextAlignment="Start" ColumnSiz