本文整理匯總了C#中System.Factory.Get方法的典型用法代碼示例。如果您正苦於以下問題:C# Factory.Get方法的具體用法?C# Factory.Get怎麽用?C# Factory.Get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Factory
的用法示例。
在下文中一共展示了Factory.Get方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: MainPresenter
public MainPresenter (Factory factory)
{
_mainViewModel = factory.Get<MainViewModel> ();
Localaizer= factory.Get<LocalizeService> ();
Localaizer.LoadLocalization ("en");
MainPage = new NavigationPage (new LoginPresenter (factory, Localaizer));
}
示例2: VTSListPresenter
public VTSListPresenter (Factory factory, ILocalizeService localaize)
{
_vtsListViewModel = factory.Get<VTSViewModel> ();
_vtsListViewModel.Server = ConfigurationManager.SERVER;
Label header = new Label {
Text = localaize.Data.vacations,// "Vacations",
Font = Font.SystemFontOfSize (30),
TextColor = Color.FromHex ("#000"),
HorizontalOptions = LayoutOptions.Center
};
_listView = new ListView {
ItemsSource = null,
ItemTemplate = new DataTemplate (typeof(VTSListViewTemplate))
};
this.Padding = new Thickness (10, Device.OnPlatform (20, 0, 0), 10, 5);
this.Content = new StackLayout {
BackgroundColor = Color.FromHex ("#FFF"),
Children = {
header,
_listView
}
};
changeListView();
}
示例3: LoginPresenter
public LoginPresenter(Factory factory, ILocalizeService localaize)
{
_localize = localaize;
_factory = factory;
_loginViewModel = factory.Get<LoginViewModel> ();
_image = new Image
{
Source = "logo.png"
};
_userName = new Entry
{
Placeholder = _localize.Data.username
};
_password = new Entry
{
IsPassword = true,
Placeholder = _localize.Data.password
};
_loginButton = new Button
{
Text = _localize.Data.login
};
_error = new Label
{
//Text = _loginViewModel.errorMessage,//_localize.Data.loginError,
//TextColor = Color.Red,//FromHex ("#FA8072"),
XAlign = TextAlignment.Center,
IsVisible = false
};
_loginButton.Clicked += onLoginButtonClicked;
Content = new StackLayout
{
VerticalOptions = LayoutOptions.Center,
Padding = 50,
Children ={
_image,
_userName,
_password,
_loginButton,
_error
}
};
}
示例4: simulate
public void simulate()
{
if (lagstring == "None") { }
if (lagstring == "Small (50-150ms)") { lowerlag = 50; upperlag = 150; }
if (lagstring == "Med (125-225ms)") { lowerlag = 125; upperlag = 225; }
logging = true;
var jobtext = "";
var statweighttext = "";
var fightlengthtext = "";
//bucket clear
bucketlist.Clear();
this.Dispatcher.Invoke((Action)(() => {
jobtext = job.Text;
statweighttext = statweights.Text;
fightlengthtext = fightLengthInput.Text;
}));
stopwatch.Start();
Factory fact = new Factory();
Report r = new Report();
var playerjob = fact.Get(jobtext);
var p = playerjob;
Trace.Assert(playerjob.name != null, "No job selected. ERROR 1"); //assert failure of factory set.
p = playerjob;
string swselected = Convert.ToString(statweighttext);
p.statforweights = swselected;
// TODO: steps and delta...
int step = 5;
int delta = 50;
int newdelta = delta;
// TODO: add negative and positive delta selection. Currently we're doing positive only.
StatWeight swenum = StatWeight.None;
if (swselected == "None") { swenum = StatWeight.None; newdelta = 0; } else { newdelta *= 2; }
if (swselected == "Weapon Damage") { swenum = StatWeight.WeaponDamage; }
if (swselected == "Magic Damage") { swenum = StatWeight.MagicDamage; }
if (swselected == "Dexterity") { swenum = StatWeight.Dexterity; }
if (swselected == "Strength") { swenum = StatWeight.Strength; }
if (swselected == "Mind") { swenum = StatWeight.Mind; }
if (swselected == "Piety") { swenum = StatWeight.Piety; }
if (swselected == "Intelligence") { swenum = StatWeight.Intelligence; }
if (swselected == "Accuracy") { swenum = StatWeight.Accuracy; }
if (swselected == "Crit") { swenum = StatWeight.Crit; }
if (swselected == "Determination") { swenum = StatWeight.Determination; }
if (swselected == "Skill Speed") { swenum = StatWeight.SkillSpeed; }
if (swselected == "Spell Speed") { swenum = StatWeight.SpellSpeed; }
//subtract an extra step because one gets added initially.
//buckets for dpstimeline
for (int x = 0; x < 50; x++) {
bucketlist.Add(0);
}
List<double> DPSarray = new List<double>();
List<double> WeightArray = new List<double>();
List<double> WeightDiff = new List<double>();
for (int y = 0; y <= newdelta; y += step) {
//progress bar incrementing here.. for stat weights
if (swselected != "None") {
this.Dispatcher.Invoke((Action)(() => {
progressBar.Value = (int)((100) - ((newdelta) - (y)));
}));
}
//start iterations (needs threading!!!)
for (int x = 1; x <= iterations; ++x) {
int ticknumber = 0;
iterationum = x;
servertick = randtick.Next(1, 4);
//alt progress bar for iterations only
if (swselected == "None") {
this.Dispatcher.Invoke((Action)(() => {
this.progressBar.Value = (int)(((double)x / (double)iterations) * 100);
}));
}
p.getStats(this);
switch (swenum) {
case StatWeight.WeaponDamage:
p.WEP = p.WEP - (delta - y);
break;
case StatWeight.MagicDamage:
p.MDMG = p.MDMG - (delta - y);
break;
case StatWeight.Dexterity:
p.DEX = p.DEX - (delta - y);
break;
case StatWeight.Strength:
p.STR = p.STR - (delta - y);
break;
case StatWeight.Intelligence:
p.INT = p.INT - (delta - y);
break;
case StatWeight.Mind:
p.MND = p.MND - (delta - y);
//.........這裏部分代碼省略.........