public DiagnosisDrugsViewModel(int id, Core.Services.IDiagnosisProvider provider) { this.Id = id; this.provider = provider; LoadDagnosisData(); }
public MenuItemControl(Core.MenuItem menuData) { InitializeComponent(); ID = menuData.ID; Info = menuData.Info; Header = menuData.Header; }
public static void OpenProfileFolder(Core.MCProfile profile) { System.Diagnostics.Process process = new System.Diagnostics.Process(); System.Diagnostics.ProcessStartInfo explorer = new System.Diagnostics.ProcessStartInfo("explorer.exe"); explorer.Arguments = profile.Path + "\\.minecraft"; process.StartInfo = explorer; process.Start(); }
public FEditMenuElem(Core.MenuItem _menuItem) { InitializeComponent(); menuItem = _menuItem; Header.Text = menuItem.Header; filePath.Text = menuItem.VideoPath; Info.Text = menuItem.Info; }
public MenuItemControl(Core.MenuItem _menuItem) { InitializeComponent(); this.menuItem = _menuItem; this.Header.Text = menuItem.Header; this.Info.Text = menuItem.Info; this.FilePath.Text = menuItem.VideoPath; this.ID = menuItem.ID; }
public static void LaunchGame(Core.MCProfile profile, string curDirectory) { string[] arg = new string[4]; arg[0] = AddQuotes(profile.Path); arg[1] = AddQuotes(FileMan.GetJavaInstallationPath() + "\\bin\\javaw.exe"); arg[2] = AddQuotes("-jar"); arg[3] = AddQuotes(curDirectory + "\\minecraft.exe"); string batString = AddQuotes(curDirectory + "\\mineBat.bat"); string arguments = arg[0] + " " + arg[1] + " " + arg[2] + " " + arg[3]; LaunchProcess(arguments, "\\minecraft.exe", curDirectory); }
public static void LaunchCartograph(Core.MCProfile profile, string curDirectory) { string saveString = profile.Path + "\\.minecraft\\saves"; string[] saves = Directory.GetDirectories(saveString); string[] arg = new string[3]; arg[0] = AddQuotes(profile.Path); arg[1] = AddQuotes(profile.Path + "\\.minecraft" + "\\Cartograph_G_Renderer.exe"); string batString = AddQuotes(curDirectory + "\\mineBat.bat"); string arguments = arg[0] + " " + arg[1]; LaunchProcess(arguments, "\\Cartograph_G.exe", curDirectory); }
public override void SetConnection(Core.Remote.PRoConClient prcClient) { base.SetConnection(prcClient); if (this.Client != null) { if (this.Client.Game != null) { this.Client_GameTypeDiscovered(prcClient); } else { this.Client.GameTypeDiscovered += new PRoConClient.EmptyParamterHandler(Client_GameTypeDiscovered); } } }
public Package CreatePackage(Application application, Core.Package source) { IEnumerable<Package> existingPackages = this.GetPackages(application); PackageContent packageContentInfo; try { packageContentInfo = this.ExtractPackageInfo(source); } catch (AppServerException ex) { Logger.Warn(this, ex, "Unable to extract package info"); throw new InvalidOperationException(ex.Message); } Package package = new Package { Version = Version.Parse(packageContentInfo.Bootstrapper.Assembly.Version) }; Logger.Info(this, "Detected package version = " + package.Version); if (existingPackages.Any(p => p.Version == package.Version)) throw new InvalidOperationException("Application " + application.Name + " already has a package with version " + package.Version.ToString(4)); package.Application = application; package.File = Path.Combine(this.RootFolder, application.Name, package.Version.ToString(4), source.Source); package.Directory = Path.GetDirectoryName(package.File); source.SaveAs(package.File); return (package); }
void multiBackgroundWorker1_DoWork(object sender, Core.MultiDoWorkEventArgs e) { //e.ta string taskId = e.TaskID.ToString(); e.Result = Compute(taskId, (MultiBackgroundWorker)sender, e); }
/// <summary> /// Execute startup tasks /// </summary> /// <param name="sender">object sending the event</param> /// <param name="e">event arguments</param> private void WindowLoaded(object sender, RoutedEventArgs e) { // Create the drawing group we'll use for drawing this.drawingGroup = new DrawingGroup(); // Create an image source that we can use in our image control this.imageSource = new DrawingImage(this.drawingGroup); // Display the drawing using our image control Image.Source = this.imageSource; // Look through all sensors and start the first connected one. // This requires that a Kinect is connected at the time of app startup. // To make your app robust against plug/unplug, // it is recommended to use KinectSensorChooser provided in Microsoft.Kinect.Toolkit foreach (var potentialSensor in KinectSensor.KinectSensors) { if (potentialSensor.Status == KinectStatus.Connected) { this.sensor = potentialSensor; break; } } if (null != this.sensor) { // Turn on the skeleton stream to receive skeleton frames this.sensor.SkeletonStream.Enable(); // Add an event handler to be called whenever there is new color frame data this.sensor.SkeletonFrameReady += this.SensorSkeletonFrameReady; // Start the sensor! try { this.sensor.Start(); recognitionCore = new Core(sensor); recognitionCore.ActivityRecognizingStarted += new ActivityRecognizingEventHandler(recognitionCore_ActivityRecognizingStarted); recognitionCore.ActivityRecognizingEnded += new ActivityRecognizingEventHandler(recognitionCore_ActivityRecognizingEnded); } catch (IOException) { this.sensor = null; } } if (null == this.sensor) { this.statusBarText.Text = KinectHumanActionRecognition.Properties.Resources.NoKinectReady; } sensor.AllFramesReady += new EventHandler<AllFramesReadyEventArgs>(recognitionCore.AllFramesReady); sensor.AllFramesReady += new EventHandler<AllFramesReadyEventArgs>(kinectSensor_AllFramesReady); recognitionCore.PoseReconized += new PoseRecognizedEventHandler(recognitionCore_PoseReconized); }
public bool Add(Core.Services.IDiagnosisProvider provider) { return provider.AddNewDrug(CreateDiagnosisFromProperties()); }
public void SetItem (Core.ShareItem item) { fileName = item.ImagePath; location = item.Location; }
public void Send(Core.Message message) { _messageServer.SendMessage(message); }
/// <summary> /// The customer service created. /// </summary> /// <param name="sender"> /// The sender. /// </param> /// <param name="args"> /// The args. /// </param> public void CustomerServiceCreated(ICustomerService sender, Core.Events.NewEventArgs<ICustomer> args) { IndexCustomer(args.Entity); }
public AppState(Scene scene, StateController controller, Core.State state) { this.scene = scene; this.controller = controller; this.state = state; this.name = state.name; }
private static void SearchFork() { var parsers = new List<Tuple<string, IParser>> { new Tuple<string, IParser>("Marathon", new MarathonParser(new List<GameParser>{ new FootballParser() }, new MarketsProviderManager(new List<IMarketsProvider> { new LocalMarketsProvider() }))), new Tuple<string, IParser>("Zenit", new ZenitBetParser(new WebPageProvider(new ZenitDomainProvider()), new List<IGameParser> { new FootballGameParser() })), }; var activeParsers = SelectParserMenu(parsers); var grouper = new GameGrouper(); var parserManager = new ParserManager(new StubParserProvider(activeParsers), grouper); var forkSearcherManager = new ForkSearcherManager(new ForkSearcher(new TextRulesProvider(File.ReadAllText(Settings.Default.PathToRules)))); var core = new Core(parserManager, forkSearcherManager); core.OnReceivedMainForks += ViewForks; core.Run(new List<SportType> { "Футбол" }); // .Where(x => x.ProfitRate > 1) // .OrderBy(x => x.ProfitRate) // .Reverse() // .ToList(); //if (forks.Count == 0) //{ // Console.WriteLine("The forks not found"); //} //else //{ // for (var i = 0; i < forks.Count; i++) // { // var fork = forks[i]; // const int BetToFirstOne = 100; // var betTosecondOne = BetToFirstOne * fork.CoefsOfFirstBets.ElementAt(0).Value.Get() // / fork.CoefsOfSecondBets.ElementAt(0).Value.Get(); // decimal sum; // Console.WriteLine($"{i + 1}. {fork.SportType} - Profit = {fork.ProfitRate}"); // if (fork.CoefsOfFirstBets.Count < 2 && (fork.CoefsOfSecondBets.Count < 2)) // { // Console.WriteLine( // $"Ставка в 1-ой конторе = {BetToFirstOne}; " + $"Во 2-ой конторе = {betTosecondOne: #0.###}"); // sum = (betTosecondOne + BetToFirstOne) / 100 * fork.ProfitRate; // } // else if ((fork.CoefsOfFirstBets.Count > 1) && (fork.CoefsOfSecondBets.Count < 2)) // { // var betTofirstTwo = BetToFirstOne * fork.CoefsOfFirstBets.ElementAt(0).Value.Get() // / fork.CoefsOfFirstBets.ElementAt(1).Value.Get(); // Console.WriteLine( // $"Cтавка в 1-ой конторе на 1-ое событие = {BetToFirstOne}, " // + $"на 2-ое событие = {betTofirstTwo: #0.###}; " // + $"Во 2-ой конторе = {betTosecondOne: #0.###}"); // sum = (betTofirstTwo + BetToFirstOne + betTosecondOne) / 100 * fork.ProfitRate; // } // else // { // var betTosecondTwo = BetToFirstOne * fork.CoefsOfFirstBets.ElementAt(0).Value.Get() // / fork.CoefsOfSecondBets.ElementAt(1).Value.Get(); // Console.WriteLine( // $"Cтавка в 1-ой конторе на 1-ое событие = {BetToFirstOne}" // + $"Во 2-ой конторе на 1-ое событие = {betTosecondOne: #0.###}, " // + $"на 2-ое событие = {betTosecondTwo: #0.###}"); // sum = (betTosecondTwo + betTosecondOne + BetToFirstOne) / 100 * fork.ProfitRate; // } // Console.WriteLine($"Cумма прибыли: {sum: #0.##}р."); // Console.WriteLine($"{fork.FirstGame.Info}"); // Console.WriteLine($"Имя конторы - {fork.FirstBetsName}:"); // foreach (var type in fork.CoefsOfFirstBets.Keys) // { // Console.WriteLine( // $"{string.Empty.PadRight(5)}Тип ставки: {type.ToString().PadRight(20)}| Коэффициент {fork.CoefsOfFirstBets[type]}"); // } // Console.WriteLine($"Имя конторы - {fork.SecondBetsName}:"); // foreach (var type in fork.CoefsOfSecondBets.Keys) // { // Console.WriteLine( // $"{string.Empty.PadRight(5)}Тип ставки: {type.ToString().PadRight(20)}| Коэффициент {fork.CoefsOfSecondBets[type]}"); // } // Console.WriteLine(); // } //} }
protected override object GenerateLog(Core.GeneratorSetting insetting = null) { var setting = insetting as GeneratorSetting; var ids = setting.ProfileID.Split(new char[] { ';', ',' }); foreach (var pid in ids) { var acts = Service.Activities.List(pid, setting.Collection); var step = setting.MaxResults / (double)100; string nextPage = string.Empty; if (loggers == null) loggers = new Dictionary<Visualizers.Types, Appender>(); foreach (var log in setting.LogFiles) { try { if (setting.VisLogs.HasFlag(log.Key) && (!loggers.ContainsKey(log.Key) || loggers[log.Key] == null)) loggers[log.Key] = Visualizers.Loggers[log.Key] .GetConstructor(new Type[] { typeof(string) }) .Invoke(new object[] { log.Value }) as Appender; } catch (Exception e) { WriteLog(e, this); } } while (step != 0) { var nextResults = 100; if (step-- < 1) { nextResults = (int)((step + 1) * 100); step = 0; } acts.MaxResults = nextResults; acts.PageToken = nextPage; if (haveStater) { Stater.MaxPosition = nextResults; Stater.SetState("Load feeds ..."); } Dictionary<Activity, ActivityCont> dicdate = null; try { var feed = acts.Fetch(); nextPage = feed.NextPageToken; if (string.IsNullOrWhiteSpace(nextPage)) { step = 0; Stater.Position = Stater.MaxPosition; } if (haveStater) { Stater.MaxPosition = feed.Items.Count; Stater.SetState("Parsing ..."); } if (dicdate == null) dicdate = new Dictionary<Activity, ActivityCont>(); dicdate.Clear(); if (feed.Items.Count > 0) { foreach (var item in feed.Items) { var ditem = dicdate[item] = new ActivityCont(); if (item.Object != null) { if (item.Verb == "share" && !string.IsNullOrWhiteSpace(item.Object.Id)) { try { ditem.Share = Service.Activities.Get(item.Object.Id).Fetch(); } catch (Exception e) { WriteLog(e, this); } } if (item.Object.Replies.TotalItems > 0) { var plser = Service.Comments.List(item.Id); plser.MaxResults = setting.MaxComments; try { var listpl = plser.Fetch(); ditem.Comments = listpl.Items; } catch (Exception e) { WriteLog(e, this); } } if (item.Object.Plusoners.TotalItems > 0) { var plser = Service.People.ListByActivity(item.Id, PeopleResource.Collection.Plusoners); plser.MaxResults = setting.MaxPluses; try { var listpl = plser.Fetch(); ditem.Plusers = listpl.Items; } catch (Exception e) { WriteLog(e, this); } } if (item.Object.Resharers.TotalItems > 0) { var plser = Service.People.ListByActivity(item.Id, PeopleResource.Collection.Resharers); plser.MaxResults = setting.MaxReshares; try { var listpl = plser.Fetch(); ditem.Sharers = listpl.Items; } catch (Exception e) { WriteLog(e, this); } } } if (haveStater) Stater.Inc(); } GenerateLogs(dicdate, setting, loggers); } } catch (Exception e) { WriteLog(e, this); e.ShowError(); step = 0; } } } return true; }
public PackageContent ExtractPackageInfo(Core.Package package) { string tempPath = Path.Combine(this.TempFolder, Guid.NewGuid().ToString("N").ToUpper()); package.Extract(tempPath); AppDomain tempDomain = ReflectionHelper.LoadAppDomain(tempPath, new Uri(this.GetType().Assembly.CodeBase).LocalPath); try { object handle; try { handle = tempDomain.CreateInstanceAndUnwrap(typeof (PackageScanner).Assembly.GetName().Name, typeof (PackageScanner).FullName); } catch (FileNotFoundException) { throw new AppServerException("Package does not contain required assembly " + typeof (PackageScanner).Assembly.Name()); } PackageScanner scanner = handle as PackageScanner; if (scanner == null) throw new Exception("Could not load package scanner"); PackageContent info = scanner.Run(); Logger.Info(this, "Scanner found " + info.Bootstrappers.Count + " bootstrapper(s) and " + info.Updaters.Count + " updater(s)"); string manifestFile = Path.Combine(tempPath, "manifest.xml"); if (File.Exists(manifestFile)) { Logger.Debug(this, "Loading package manifest " + manifestFile + "..."); try { using (FileStream stream = File.Open(manifestFile, FileMode.Open, FileAccess.Read)) { info.Manifest = XmlSerializer.Deserialize<Manifest>(stream); Logger.Debug(this, "Manifest loaded"); } } catch (Exception ex) { Logger.Error("Failed to load manifest: " + ex.Message); } } else Logger.Debug(this, "Package contains no manifest"); return (info); } finally { AppDomain.Unload(tempDomain); try { Directory.Delete(tempPath, true); } catch (Exception ex) { Logger.Warn(this, "Failed to remove temp folder " + tempPath + ": " + ex.Message); } } }
public DiagnosisViewModel(Core.Services.IDiagnosisProvider provider) { this.provider = provider; LoadDagnosisData(); }
public void SetState(Core.State state) { SetState(state.name); }
void multiBackgroundWorker1_ProgressChanged(object sender, Core.MultiProgressChangedEventArgs e) { UpdateListView((string)e.TaskID, e.ProgressPercentage, e.UserState); }
/// <summary> /// Adds or updates a product variant to the index if the product variant has an identity /// </summary> static void ProductVariantServiceCreated(IProductVariantService sender, Core.Events.NewEventArgs<IProductVariant> e) { if (e.Entity.HasIdentity) IndexProductVariant(e.Entity); }
void multiBackgroundWorker1_RunWorkerCompleted(object sender, Core.MultiRunWorkerCompletedEventArgs e) { //3步 //1.判断是否出现错误 //2.判断是否被取消 //3.已成功. FileData model = null; string taskId = e.TaskId.ToString(); if (e.Error != null) { model = UpdateListView(taskId, "Error"); } else if (e.Cancelled) { model = UpdateListView(taskId, "Cancelled"); } else { model = UpdateListView(taskId, e.Result.ToString()); } Debug.WriteLine(model == null); if (model != null) model.Tag = null; }
protected override object GenerateLog(Core.GeneratorSetting insetting = null) { var setting = insetting as GeneratorSetting; var ids = setting.ProfileID.Split(new char[] { ';', ',', '|' }); loggers = new Dictionary<Visualizers.Types, Appender>(); foreach (var log in setting.LogFiles) if (setting.VisLogs.HasFlag(log.Key) && (!loggers.ContainsKey(log.Key) || loggers[log.Key] == null)) loggers[log.Key] = Visualizers.Loggers[log.Key] .GetConstructor(new Type[] { typeof(string) }) .Invoke(new object[] { log.Value }) as Appender; foreach (var pid in ids) { doGenerate(setting, pid, setting.Deep); } return true; }
private void InsertMapInMapList(int insertIndex, Core.Maps.MaplistEntry mapEntry) { this.lsvMaplist.BeginUpdate(); ListViewItem lviMap = new ListViewItem(); lviMap.Tag = mapEntry; lviMap.Name = mapEntry.MapFileName; lviMap.Text = Convert.ToString(this.lsvMaplist.Items.Count + 1); if (mapEntry.Gamemode != null && mapEntry.Gamemode.Length > 0) { //lviMap.SubItems.Add(this.m_client.GetFriendlyGamemode(mapEntry.Gamemode)); CMap tmpMap = this.m_client.GetFriendlyMapByFilenamePlayList(mapEntry.MapFileName, mapEntry.Gamemode); lviMap.SubItems.Add(tmpMap != null ? tmpMap.GameMode : String.Empty); lviMap.SubItems.Add(tmpMap != null ? tmpMap.PublicLevelName : String.Empty); } else { lviMap.SubItems.Add(this.m_client.GetFriendlyGamemodeByMap(mapEntry.MapFileName)); lviMap.SubItems.Add(this.m_client.GetFriendlyMapname(mapEntry.MapFileName)); } //lviMap.SubItems.Add(this.m_client.GetFriendlyMapname(mapEntry.MapFileName)); lviMap.SubItems.Add(mapEntry.MapFileName); ListViewItem.ListViewSubItem lviRounds = new ListViewItem.ListViewSubItem(); lviRounds.Name = "rounds"; if (mapEntry.Rounds == 0) { lviRounds.Text = "2"; lviRounds.Tag = 0; } else { lviRounds.Text = mapEntry.Rounds.ToString(); lviRounds.Tag = mapEntry.Rounds; } lviMap.SubItems.Add(lviRounds); if (insertIndex >= 0) { this.lsvMaplist.Items.Insert(insertIndex, lviMap); } else { this.lsvMaplist.Items.Add(lviMap); } this.UpdateMaplistIndexes(); for (int i = 0; i < this.lsvMaplist.Columns.Count; i++) { this.lsvMaplist.Columns[i].Width = -2; } if (this.m_blSettingAppendingSingleMap == true) { this.OnSettingResponse("local.maplist.append", true); } this.lsvMaplist.EndUpdate(); }
public void AddItem(Core.MenuItem item) { menuItemsCollection.Add(item); this.ReIndexItems(); }
private void Game_MapListMapAppended(FrostbiteClient sender, Core.Maps.MaplistEntry mapEntry) { this.InsertMapInMapList(-1, mapEntry); }
public override void SetConnection(Core.Remote.PRoConClient prcClient) { base.SetConnection(prcClient); if (this.Client != null) { if (this.Client.Game != null) { this.m_prcClient_GameTypeDiscovered(prcClient); } else { this.Client.GameTypeDiscovered += new PRoConClient.EmptyParamterHandler(m_prcClient_GameTypeDiscovered); } } // override RoundStart minimum in case server is unranked if (this.Client.CurrentServerInfo.Ranked == false) { this.numSettingsRoundStartPlayerCount.Minimum = new decimal(new int[] { 1, 0, 0, 0 }); } }
/// <summary> /// Sets the image source. /// </summary> /// <param name="targetButton">The target button.</param> /// <param name="model">The model.</param> private void SetImageSource(Android.Widget.Button targetButton, Core.Helpers.Controls.ImageButton model) { var packageName = Context.PackageName; const int padding = 0; const string resourceType = "drawable"; var resId = Resources.GetIdentifier (model.Image, resourceType, packageName); if (resId > 0) { var scaledDrawable = GetScaleDrawableFromResourceId (resId, GetWidth (model.ImageWidthRequest), GetHeight (model.ImageHeightRequest)); Drawable left = null; Drawable right = null; Drawable top = null; Drawable bottom = null; targetButton.CompoundDrawablePadding = padding; switch (model.Orientation) { case (ImageOrientation.ImageToLeft): targetButton.Gravity = GravityFlags.Left | GravityFlags.CenterVertical; left = scaledDrawable; break; case (ImageOrientation.ImageToRight): targetButton.Gravity = GravityFlags.Right | GravityFlags.CenterVertical; right = scaledDrawable; break; case (ImageOrientation.ImageOnTop): top = scaledDrawable; break; case (ImageOrientation.ImageOnBottom): bottom = scaledDrawable; break; } targetButton.SetCompoundDrawables (left, top, right, bottom); } }