public SessionData( int idSession, bool bIsPreTaxOnlyOperation, AtCalculationSession acs, List<PpaCalendar> calendarEntries, IFeedback hLogger) { m_idSession = idSession; m_gcFeedback = hLogger; Utility.clearCalendarData(); m_pCalendar = Utility.m_calendar_data; FillCalendar(calendarEntries); m_pCalc = new CalcData(); m_pCalc.m_bPreTaxCalculationsOnly = bIsPreTaxOnlyOperation; m_pCalc.m_calculation_id = idSession; m_pCalc.m_calc_from_date = acs.AtCalcYearmonthStart; m_pCalc.m_calc_to_date = acs.AtCalcYearmonthEnd; m_pCalc.m_bDataFilled = FillData(acs); Debug.IndentSize = 4; Debug.AutoFlush = true; g_hSessionData = this; }
public BackupRestoreWindow(IFeedback<LogEntry> log, IEntityContextConnection entityContextConnection) { Log = log; EntityContextConnection = entityContextConnection; CancellationTokenSource = new CancellationTokenSource(); InitializeComponent(); }
public TickExecutor(TickRepository repository, IFeedback feedback) { this.repository = repository; this.feedback = feedback; this.timer = new Timer(OnTick); }
public ScheduledTaskRunner(IFeedback <LogEntry> log, ICommandProcessor commandProcessor, IEntityContextConnection entityContextConnection, ITimeProvider timeProvider) { if (log == null) { throw new ArgumentNullException(nameof(log)); } if (commandProcessor == null) { throw new ArgumentNullException(nameof(commandProcessor)); } if (entityContextConnection == null) { throw new ArgumentNullException(nameof(entityContextConnection)); } if (timeProvider == null) { throw new ArgumentNullException(nameof(timeProvider)); } EntityContextConnection = entityContextConnection; CommandProcessor = commandProcessor; Log = log; TimeProvider = timeProvider; Log.Source = "Scheduled Task Runner"; }
public BackupRestoreWindow(IFeedback <LogEntry> log, IEntityContextConnection entityContextConnection) { Log = log; EntityContextConnection = entityContextConnection; CancellationTokenSource = new CancellationTokenSource(); InitializeComponent(); }
public List <IFeedback> getAllFeedback() { List <IFeedback> FeedbackList = new List <IFeedback>(); try { dataset = new DataSet(); string sql = "SELECT * FROM FeedBack"; dataAdapter = new SqlDataAdapter(sql, connection); commandBuilder = new SqlCommandBuilder(dataAdapter); dataAdapter.Fill(dataset, "FeedbackData"); totFeedback = dataset.Tables["FeedbackData"].Rows.Count; for (int i = 0; i < totFeedback; i++) { DataRow dRow = dataset.Tables["FeedbackData"].Rows[i]; IFeedback feedback = UserFactory.GetFeedback(dRow.ItemArray.GetValue(2).ToString(), dRow.ItemArray.GetValue(1).ToString(), dRow.ItemArray.GetValue(0).ToString()); FeedbackList.Add(feedback); } } catch (System.Exception excep) { MessageBox.Show(excep.Message); if (connection.State.ToString() == "Open") { connection.Close(); } Application.Exit(); //Environment.Exit(0); //Force the application to close } return(FeedbackList); }
public PluginManager(IEnumerable <ZvsPlugin> plugins, IEntityContextConnection entityContextConnection, IFeedback <LogEntry> log, IAdapterManager adapterManager) { if (plugins == null) { throw new ArgumentNullException(nameof(plugins)); } if (entityContextConnection == null) { throw new ArgumentNullException(nameof(entityContextConnection)); } if (log == null) { throw new ArgumentNullException(nameof(log)); } if (adapterManager == null) { throw new ArgumentNullException(nameof(adapterManager)); } EntityContextConnection = entityContextConnection; Log = log; Plugins = plugins; AdapterManager = adapterManager; Log.Source = "Plugin Manager"; _pluginLookup = Plugins.ToDictionary(o => o.PluginGuid, o => o); }
public JavaScriptRunner(IFeedback<LogEntry> log, ICommandProcessor commandProcessor, IEntityContextConnection entityContextConnection) { if (log == null) throw new ArgumentNullException("log"); if (commandProcessor == null) throw new ArgumentNullException("commandProcessor"); if (entityContextConnection == null) throw new ArgumentNullException("entityContextConnection"); Log = log; CommandProcessor = commandProcessor; EntityContextConnection = entityContextConnection; log.Source = "JavaScript Runner"; JintEngine = new Jint.Engine(cfg => { cfg.AllowClr(); cfg.AllowDebuggerStatement(JavascriptDebugEnabled); }); //JintEngine.Step += async (s, info) => //{ // await Log.ReportInfoFormatAsync(CancellationToken.None, "{1} {2}", // info.CurrentStatement.Source.Start.Line, // info.CurrentStatement.Source.Code.Replace(Environment.NewLine, "")); //}; }
private AkismetComment ConvertToAkismetComment(IFeedback feedback) { System.Net.IPAddress ipAddress = System.Net.IPAddress.None; if (feedback.AuthorIPAddress != null) { try { ipAddress = System.Net.IPAddress.Parse(feedback.AuthorIPAddress); } catch(FormatException){} } AkismetComment comment = new AkismetComment(ipAddress, feedback.AuthorUserAgent); comment.Author = feedback.Author; comment.AuthorEmail = feedback.AuthorEmail; if (feedback.AuthorHomepage != null && feedback.AuthorHomepage.Length > 0) { try { comment.AuthorUrl = new Uri(feedback.AuthorHomepage); } catch(UriFormatException){} } comment.Content = feedback.Content; comment.Referer = feedback.Referer; if (feedback.TargetEntryId != null & feedback.TargetEntryId.Trim().Length > 0) { try { comment.Permalink = new Uri(SiteUtilities.GetPermaLinkUrl(feedback.TargetEntryId)); } catch(UriFormatException){} } comment.CommentType = feedback.FeedbackType; return comment; }
public void Init() { Cts = new CancellationTokenSource(); EntityContextConnection = new ZvsEntityContextConnection(); Log = new DatabaseFeedback(EntityContextConnection) { Source = "Zvs Gui" }; InitializeComponent(); }
public AdapterManager(IEnumerable <ZvsAdapter> adapters, IEntityContextConnection entityContextConnection, IFeedback <LogEntry> log) { if (adapters == null) { throw new ArgumentNullException(nameof(adapters)); } if (entityContextConnection == null) { throw new ArgumentNullException(nameof(entityContextConnection)); } if (log == null) { throw new ArgumentNullException(nameof(log)); } EntityContextConnection = entityContextConnection; Log = log; Adapters = adapters; Log.Source = "Adapter Manager"; _adapterLookup = Adapters.ToDictionary(o => o.AdapterGuid, o => o); }
/// <summary> /// Creates a new Feedback in a Board, based on user input. /// </summary> /// <param name="parameter">The name of the Feedback.</param> /// <returns>A string that reflects if the command was successful.</returns> public override string Execute(string parameter) { string title; string boardName; string description; int rating; FeedbackStatus status; try { title = this._validator.ValidateTitle(parameter); Console.Write("Board: "); boardName = Console.ReadLine().Trim(); var board = this._validator.ValidateExists(this._engine.Boards, boardName); board = this._validator.ValidateMoreThanOne(this._engine.Boards, boardName); Console.Write("Feedback Description(Single line.): "); description = this._validator.ValidateDescription(Console.ReadLine().Trim()); Console.Write("Feedback Rating(-10 to 10): "); rating = this._validator.ValidateRating(Console.ReadLine().Trim()); Console.Write("Feedback Status(New/Unscheduled/Scheduled/Done): "); status = this._validator.ValidateFeedbackStatus(Console.ReadLine().Trim()); IFeedback feedback = this._factory.CreateFeedback(title, description, rating, status); this._engine.WorkItems.Add(feedback); board.AddWorkItem(feedback); return($"Feedback with ID {this._engine.WorkItems.Count - 1}, Title {title} was created."); } catch (ArgumentException ex) { throw new ArgumentException($"{ex.Message} Unable to create feedback."); } }
public JavaScriptRunner(IFeedback <LogEntry> log, ICommandProcessor commandProcessor, IEntityContextConnection entityContextConnection) { if (log == null) { throw new ArgumentNullException(nameof(log)); } if (commandProcessor == null) { throw new ArgumentNullException(nameof(commandProcessor)); } if (entityContextConnection == null) { throw new ArgumentNullException(nameof(entityContextConnection)); } Log = log; CommandProcessor = commandProcessor; EntityContextConnection = entityContextConnection; log.Source = "JavaScript Runner"; JintEngine = new Engine(cfg => { cfg.AllowClr(); cfg.AllowDebuggerStatement(JavascriptDebugEnabled); }); //JintEngine.Step += async (s, info) => //{ // await Log.ReportInfoFormatAsync(CancellationToken.None, "{1} {2}", // info.CurrentStatement.Source.Start.Line, // info.CurrentStatement.Source.Code.Replace(Environment.NewLine, "")); //}; }
public void Add(IFeedback feedback) { if (feedback.Feedback == Feedback.Diegetic) { feedbackDiegetic.Add(feedback); if (type == Feedback.Diegetic) { feedback.Enable(); } else { feedback.Disable(); } } else { feedbackNoDiegetic.Add(feedback); if (type == Feedback.NoDiegetic) { feedback.Enable(); } else { feedback.Disable(); } } }
public HrApiController() { c = new HRController(); emailsend = new EmailSend(); feedInterface = new FeedbackRepository(); }
public void addNewFeedBackToDB(IFeedback thefb) { try { SqlDataReader rdr = null; SqlCommand cmd = new SqlCommand("dbo.CreateNewFeedBack", connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(new SqlParameter("@STDNAME", thefb.stdname)); cmd.Parameters.Add(new SqlParameter("@COURSNAME", thefb.CourseN)); cmd.Parameters.Add(new SqlParameter("@DESCRIP", thefb.Desc)); rdr = cmd.ExecuteReader(); rdr.Close(); } catch (System.Exception excep) { if (connection.State.ToString() == "Open") { connection.Close(); // MessageBox.Show("Error"); } //Application.Exit(); //Environment.Exit(0); //Force the application to close } }
public ZvsEngine(IFeedback<LogEntry> feedback, IAdapterManager adapterManager, IPluginManager pluginManager, IEntityContextConnection entityContextConnection, TriggerRunner triggerRunner, ScheduledTaskRunner scheduledTaskRunner) { if (entityContextConnection == null) throw new ArgumentNullException("entityContextConnection"); if (feedback == null) throw new ArgumentNullException("feedback"); if (adapterManager == null) throw new ArgumentNullException("adapterManager"); if (pluginManager == null) throw new ArgumentNullException("pluginManager"); if (triggerRunner == null) throw new ArgumentNullException("triggerRunner"); if (scheduledTaskRunner == null) throw new ArgumentNullException("scheduledTaskRunner"); EntityContextConnection = entityContextConnection; Log = feedback; AdapterManager = adapterManager; PluginManager = pluginManager; TriggerRunner = triggerRunner; ScheduledTaskRunner = scheduledTaskRunner; Log.Source = "Zvs Engine"; AppDomain.CurrentDomain.SetData("DataDirectory", Utils.AppDataPath); }
public JavaScriptEditor() { Context = new ZvsContext(_app.EntityContextConnection); Log = new DatabaseFeedback(_app.EntityContextConnection) { Source = "Javascript Editor" }; LogEntries = new ObservableCollection<LogEntry>(); InitializeComponent(); }
public Miner Create( BlockSigned signedBlock, IFeedback feedback) { var signedBlockHash = _cryptography.CalculateHash(signedBlock); return(new Miner(signedBlock.HashTargetBits, signedBlock, signedBlockHash, _cryptography, feedback)); }
public BlockValidationTests() { _address = new Address("test1".Hash()); _feedback = new NullFeedBack(); _cryptography = new Cryptography(); _minerFactory = new MinerFactory(_cryptography); _chainData = new ChainData(_feedback, _cryptography); }
public Engine( IFeedback feedback, IP2PNetwork network, IChainData chainData) { _feedback = feedback; _network = network; _chainData = chainData; }
public static async Task ReportInfoFormatAsync(this IFeedback <LogEntry> feedBack, CancellationToken cancellationToken, string message, params object[] args) { await feedBack.ReportAsync(new LogEntry(new CurrentTimeProvider()) { Message = string.Format(message, args), Level = LogEntryLevel.Info, Source = feedBack.Source }, cancellationToken); }
public Solver( BoardFactory boardFactory, ISolveStrategy solveStrategy, IFeedback feedback) { this.boardFactory = boardFactory; this.solveStrategy = solveStrategy; this.feedback = feedback; }
public ScenePropertiesWindow(int sceneId) { SceneId = sceneId; Log = new DatabaseFeedback(_app.EntityContextConnection) { Source = "Scene Properties" }; InitializeComponent(); }
public AdminController(IAdmin authProvider, IPosts blogRepository = null, IFeedback feedbackRepository = null, IUsligi services = null, IPhoto photo = null, ICategories cat = null) { _blogRepository = blogRepository; _authProvider = authProvider; _feedbackRepository = feedbackRepository; _servicesRepository = services; _photoRepository = photo; _catRepository = cat; }
public static async Task ReportWarningAsync(this IFeedback <LogEntry> feedBack, string message, CancellationToken cancellationToken) { await feedBack.ReportAsync(new LogEntry(new CurrentTimeProvider()) { Message = message, Level = LogEntryLevel.Warn, Source = feedBack.Source }, cancellationToken); }
public ChainData( IFeedback feedback, Cryptography cryptography) { _feedback = feedback; _cryptography = cryptography; Chain = new List <BlockHashed>(); PendingTransactions = new ConcurrentDictionary <Hash, TransactionSigned>(); }
public ScheduledTaskCreator() { _context = new ZvsContext(_app.EntityContextConnection); Log = new DatabaseFeedback(_app.EntityContextConnection) { Source = "Scheduled Task Editor" }; InitializeComponent(); NotifyEntityChangeContext.ChangeNotifications<ScheduledTask>.OnEntityAdded += ScheduledTaskCreator_onEntityAdded; NotifyEntityChangeContext.ChangeNotifications<ScheduledTask>.OnEntityDeleted += ScheduledTaskCreator_onEntityDeleted; NotifyEntityChangeContext.ChangeNotifications<ScheduledTask>.OnEntityUpdated += ScheduledTaskCreator_onEntityUpdated; }
private Handler() { #if UNITY_ANDROID feedback = new AndroidFeedback(); #endif #if UNITY_IOS feedback = new iOSFeedback(); #endif }
public void Init() { Cts = new CancellationTokenSource(); EntityContextConnection = new ZvsEntityContextConnection(); Log = new DatabaseFeedback(EntityContextConnection) { Source = "Zvs Gui" }; InitializeComponent(); }
public static Feedbacks Map(IFeedback feedbackModel) { return(new Feedbacks { Name = feedbackModel.Name, Email = feedbackModel.Email, Surname = feedbackModel.Surname, Text = feedbackModel.Text }); }
public JavaScriptEditor() { Context = new ZvsContext(_app.EntityContextConnection); Log = new DatabaseFeedback(_app.EntityContextConnection) { Source = "Javascript Editor" }; LogEntries = new ObservableCollection <LogEntry>(); InitializeComponent(); }
public TriggerGridUc() { _context = new ZvsContext(_app.EntityContextConnection); Log = new DatabaseFeedback(_app.EntityContextConnection) { Source = "Trigger Editor" }; InitializeComponent(); NotifyEntityChangeContext.ChangeNotifications<DeviceValueTrigger>.OnEntityAdded += TriggerGridUC_onEntityAdded; NotifyEntityChangeContext.ChangeNotifications<DeviceValueTrigger>.OnEntityDeleted += TriggerGridUC_onEntityDeleted; NotifyEntityChangeContext.ChangeNotifications<DeviceValueTrigger>.OnEntityUpdated += TriggerGridUC_onEntityUpdated; }
public GroupEditorUserControl() { Log = new DatabaseFeedback(_app.EntityContextConnection) { Source = "Group Editor" }; InitializeComponent(); NotifyEntityChangeContext.ChangeNotifications<Device>.OnEntityAdded += GroupEditor_onEntityAdded; NotifyEntityChangeContext.ChangeNotifications<Group>.OnEntityDeleted += ChangeNotificationsOnOnEntityDeleted; NotifyEntityChangeContext.ChangeNotifications<Group>.OnEntityUpdated += GroupEditorUserControl_OnEntityUpdated; }
/// <summary> /// Check if a element is controlled as an accessory. /// </summary> /// <param name="element">Element to check.</param> /// <returns><c>true</c> if the element can be controlled as an accesory or <c>false</c> in all other cases.</returns> public static int GetFeedbackStatus(ElementBase element) { IFeedback fbElement = element as IFeedback; if (fbElement != null) { return(fbElement.GetFeedbackStatus()); } return(ElementBase.STATUS_UNDEFINED); }
public ScheduledTaskCreator() { _context = new ZvsContext(_app.EntityContextConnection); Log = new DatabaseFeedback(_app.EntityContextConnection) { Source = "Scheduled Task Editor" }; InitializeComponent(); NotifyEntityChangeContext.ChangeNotifications <ScheduledTask> .OnEntityAdded += ScheduledTaskCreator_onEntityAdded; NotifyEntityChangeContext.ChangeNotifications <ScheduledTask> .OnEntityDeleted += ScheduledTaskCreator_onEntityDeleted; NotifyEntityChangeContext.ChangeNotifications <ScheduledTask> .OnEntityUpdated += ScheduledTaskCreator_onEntityUpdated; }
public ChangeListener(IFeedback<LogEntry> log, IEntityContextConnection entityContextConnection) { if (log == null) throw new ArgumentNullException(nameof(log)); if (entityContextConnection == null) throw new ArgumentNullException(nameof(entityContextConnection)); Log = log; EntityContextConnection = entityContextConnection; }
FeedbackEntry ConstructFeedbackEntry(IFeedback feedback) { var feedbackEntry = new FeedbackEntry { Feedback = feedback as Feedback, GameSession = _context.GameSessions.Find(feedback.GameSessionID), Gamer = _context.Players.Find(feedback.PlayerID) }; feedbackEntry.Game = _context.Games.Find(feedbackEntry.GameSession.GameID); return(feedbackEntry); }
public ChainSync( int syncBlockIndex, int syncBlockPageSize, PeerConnection[] peers, IChainData chainData, IFeedback feedback) { _syncBlockIndexCap = _syncBlockIndex = syncBlockIndex; _syncBlockPageSize = syncBlockPageSize; _peers = peers; _chainData = chainData; _feedback = feedback; }
public SceneCreator() { _context = new ZvsContext(_app.EntityContextConnection); Log = new DatabaseFeedback(_app.EntityContextConnection) { Source = "Scene Editor" }; InitializeComponent(); NotifyEntityChangeContext.ChangeNotifications<Scene>.OnEntityAdded += SceneCreator_onEntityAdded; NotifyEntityChangeContext.ChangeNotifications<Scene>.OnEntityDeleted += SceneCreator_onEntityDeleted; NotifyEntityChangeContext.ChangeNotifications<Scene>.OnEntityUpdated += SceneCreator_onEntityUpdated; NotifyEntityChangeContext.ChangeNotifications<JavaScriptCommand>.OnEntityAdded += SceneCreator_onEntityAdded; NotifyEntityChangeContext.ChangeNotifications<JavaScriptCommand>.OnEntityDeleted += SceneCreator_onEntityDeleted; NotifyEntityChangeContext.ChangeNotifications<JavaScriptCommand>.OnEntityUpdated += SceneCreator_onEntityUpdated; NotifyEntityChangeContext.ChangeNotifications<SceneStoredCommand>.OnEntityUpdated += SceneCreator_onEntityUpdated; }
public async Task Initialize(IFeedback<LogEntry> log, IEntityContextConnection entityContextConnection) { EntityContextConnection = entityContextConnection; Log = log; DeviceValueBuilder = new DeviceValueBuilder(entityContextConnection); DeviceCommandBuilder = new DeviceCommandBuilder(entityContextConnection); var dtb = new DeviceTypeBuilder(entityContextConnection); await OnDeviceTypesCreating(dtb); var sb = new AdapterSettingBuilder(entityContextConnection, CancellationToken); await OnSettingsCreating(sb); }
/// <summary> /// Executes a scene asynchronously and reports progress. /// </summary> public SceneRunner(IFeedback<LogEntry> log, ICommandProcessor commandProcessor, IEntityContextConnection entityContextConnection) { if (log == null) throw new ArgumentNullException("log"); if (commandProcessor == null) throw new ArgumentNullException("commandProcessor"); if (entityContextConnection == null) throw new ArgumentNullException("entityContextConnection"); CommandProcessor = commandProcessor; Log = log; EntityContextConnection = entityContextConnection; }
public async Task Initialize(IFeedback<LogEntry> log, IEntityContextConnection entityContextConnection,IAdapterManager adapterManager) { EntityContextConnection = entityContextConnection; Log = log; AdapterManager = adapterManager; var sb = new PluginSettingBuilder(entityContextConnection, CancellationToken); await OnSettingsCreating(sb); var ssb = new SceneSettingBuilder(EntityContextConnection); await OnSceneSettingsCreating(ssb); var dsb = new DeviceSettingBuilder(EntityContextConnection); await OnDeviceSettingsCreating(dsb); }
//Constructor public CommandProcessor(IAdapterManager adapterManager, IEntityContextConnection entityContextConnection, IFeedback<LogEntry> log) { if (entityContextConnection == null) throw new ArgumentNullException(nameof(entityContextConnection)); if (adapterManager == null) throw new ArgumentNullException(nameof(adapterManager)); if (log == null) throw new ArgumentNullException(nameof(log)); AdapterManager = adapterManager; EntityContextConnection = entityContextConnection; Log = log; }
public TriggerRunner(IFeedback<LogEntry> log, ICommandProcessor commandProcessor, IEntityContextConnection entityContextConnection) { if (log == null) throw new ArgumentNullException(nameof(log)); if (commandProcessor == null) throw new ArgumentNullException(nameof(commandProcessor)); if (entityContextConnection == null) throw new ArgumentNullException(nameof(entityContextConnection)); CommandProcessor = commandProcessor; Log = log; EntityContextConnection = entityContextConnection; Log.Source = "Trigger Runner"; }
public DeviceDataGridUc() { Context = new ZvsContext(_app.EntityContextConnection); Log = new DatabaseFeedback(_app.EntityContextConnection) { Source = "Device Grid" }; InitializeComponent(); NotifyEntityChangeContext.ChangeNotifications<Device>.OnEntityAdded += DeviceDataGridUC_onEntityAdded; NotifyEntityChangeContext.ChangeNotifications<Device>.OnEntityDeleted += DeviceDataGridUC_onEntityDeleted; NotifyEntityChangeContext.ChangeNotifications<Device>.OnEntityUpdated += DeviceDataGridUC_onEntityUpdated; NotifyEntityChangeContext.ChangeNotifications<Group>.OnEntityAdded += DeviceDataGridUC_onEntityAdded; NotifyEntityChangeContext.ChangeNotifications<Group>.OnEntityDeleted += DeviceDataGridUC_onEntityDeleted; NotifyEntityChangeContext.ChangeNotifications<Group>.OnEntityUpdated += DeviceDataGridUC_onEntityUpdated; //TODO: LISTEN FOR CHANGES TO THE DEVICE_GROUPS LINKING TABLE }
public AdapterManager(IEnumerable<ZvsAdapter> adapters, IEntityContextConnection entityContextConnection, IFeedback<LogEntry> log) { if (adapters == null) throw new ArgumentNullException(nameof(adapters)); if (entityContextConnection == null) throw new ArgumentNullException(nameof(entityContextConnection)); if (log == null) throw new ArgumentNullException(nameof(log)); EntityContextConnection = entityContextConnection; Log = log; Adapters = adapters; Log.Source = "Adapter Manager"; _adapterLookup = Adapters.ToDictionary(o => o.AdapterGuid, o => o); }
public ScheduledTaskRunner(IFeedback<LogEntry> log, ICommandProcessor commandProcessor, IEntityContextConnection entityContextConnection, ITimeProvider timeProvider) { if (log == null) throw new ArgumentNullException(nameof(log)); if (commandProcessor == null) throw new ArgumentNullException(nameof(commandProcessor)); if (entityContextConnection == null) throw new ArgumentNullException(nameof(entityContextConnection)); if (timeProvider == null) throw new ArgumentNullException(nameof(timeProvider)); EntityContextConnection = entityContextConnection; CommandProcessor = commandProcessor; Log = log; TimeProvider = timeProvider; Log.Source = "Scheduled Task Runner"; }
public PluginManager(IEnumerable<ZvsPlugin> plugins, IEntityContextConnection entityContextConnection, IFeedback<LogEntry> log, IAdapterManager adapterManager) { if (plugins == null) throw new ArgumentNullException("plugins"); if (entityContextConnection == null) throw new ArgumentNullException("entityContextConnection"); if (log == null) throw new ArgumentNullException("log"); if (adapterManager == null) throw new ArgumentNullException("adapterManager"); EntityContextConnection = entityContextConnection; Log = log; Plugins = plugins; AdapterManager = adapterManager; Log.Source = "Plugin Manager"; _pluginLookup = Plugins.ToDictionary(o => o.PluginGuid, o => o); }
public static bool CalculatePerformance( SessionData session, CalcData pCalc, IFeedback feedback) { var bComplete = false; //calculate the drift weights var objDriftCalculator = new DriftCalculator(feedback); if (objDriftCalculator.calculateDriftWeights(pCalc)) { var objCoreAccountsPerformance = new CoreAccountsPerformance(feedback); if (objCoreAccountsPerformance.calculateCoreAccountPerformance(pCalc)) { FixedIncome.PrepareFixedIncomeBenchPerformance(session); var objSimulatedBenchmark = new SimulatedBenchmark(feedback); if (objSimulatedBenchmark.calculateSimulatedBenchMarkData(session, pCalc)) { // Do after-tax calculations if needed if (!(pCalc.m_bPreTaxCalculationsOnly)) { var objATReturns = new Returns(feedback); bComplete = objATReturns.calculateATReturns(pCalc); } else { bComplete = true; } FixedIncome.PrepareFixedIncomeMonthReturns(session); } } } return bComplete; }
public bool IsSpam(IFeedback feedback) { IComment akismetFormattedComment = ConvertToAkismetComment(feedback); return akismetClient.CheckCommentForSpam(akismetFormattedComment); }
public void ReportSpam(IFeedback feedback) { IComment akismetFormattedComment = ConvertToAkismetComment(feedback); akismetClient.SubmitSpam(akismetFormattedComment); }
public Returns(IFeedback feedback) { _feedback = feedback; }
public SimulatedBenchmark(IFeedback feedback) { _feedback = feedback; }
public ScenePropertiesWindow(int sceneId) { SceneId = sceneId; Log = new DatabaseFeedback(_app.EntityContextConnection) { Source = "Scene Properties" }; InitializeComponent(); }
public MazeGenerator(int Width, int Height, IFeedback Handler) { // port from http://en.wikipedia.org/wiki/Image:Maze.png this.Width = Width; this.Height = Height; clip = new RectInt32 { Width = Width, Height = Height }; int x, y, n, d; int[] dx = { 0, 0, -1, 1 }; //int[] dy = { -1, 1, Convert.ToInt32(0), Convert.ToInt32(0) }; int[] dy = { -1, 1, 0, 0 }; int[] todo = new int[Width * Height]; int todonum = 0; /* We want to create a maze on a grid. */ maze = new int[Width][]; /* We start with a grid full of walls. */ for (x = 0; x < Width; x++) { maze[x] = new int[Height]; for (y = 0; y < Height; y++) { var p = new PointInt32 { X = x, Y = y }; if (clip.IsBorder(p)) { maze[x][y] = 32; } else { maze[x][y] = 63; } } } /* Select any square of the grid, to start with. */ x = ToInt32(1 + random() * (Width - 2)); y = ToInt32(1 + random() * (Height - 2)); /* Mark this square as connected to the maze. */ maze[x][y] &= ~48; /* Remember the surrounding squares, as we will */ for (d = 0; d < 4; d++) if ((maze[x + dx[d]][y + dy[d]] & 16) != 0) { /* want to connect them to the maze. */ /* alternately, you could use a struct to store the two integers * this would result in easier to read code, though not as speedy * of course, if you were worried about speed, you wouldn't be using Java * you could also use a single integer which represents (x + y * width) * this would actually be faster than the current approach * - quin/10-24-06 * Actually, the former wouldn't work in Java- there's no such thing as a * struct. It's a class or nothing, I'm afraid. * - Jae Armstrong/23-03-07 */ todo[todonum++] = ((x + dx[d]) << 16) | (y + dy[d]); maze[x + dx[d]][y + dy[d]] &= ~16; } /* We won't be finished until all is connected. */ while (todonum > 0) { if (Handler != null) Handler.Invoke("todonum = " + todonum); /* We select one of the squares next to the maze. */ n = ToInt32(random() * todonum); x = todo[n] >> 16; /* the top 2 bytes of the data */ y = todo[n] & 65535; /* the bottom 2 bytes of the data */ /* We will connect it, so remove it from the queue. */ todonum--; todo[n] = todo[todonum]; /* Select a direction, which leads to the maze. */ d = ToInt32(random() * 4); if ((maze[x + dx[d]][y + dy[d]] & 32) != 0) d = (d + 1) % dx.Length; if ((maze[x + dx[d]][y + dy[d]] & 32) != 0) d = (d + 1) % dx.Length; if ((maze[x + dx[d]][y + dy[d]] & 32) != 0) d = (d + 1) % dx.Length; /* Connect this square to the maze. */ maze[x][y] &= ~((1 << d) | 32); maze[x + dx[d]][y + dy[d]] &= ~(1 << (d ^ 1)); /* Remember the surrounding squares, which aren't */ for (d = 0; d < 4; d++) if ((maze[x + dx[d]][y + dy[d]] & 16) != 0) { /* connected to the maze, and aren't yet queued to be. */ todo[todonum++] = ((x + dx[d]) << 16) | (y + dy[d]); maze[x + dx[d]][y + dy[d]] &= ~16; } /* Repeat until finished. */ } /* One may want to add an entrance and exit. */ maze[1][1] &= ~1; maze[Width - 2][Height - 2] &= ~2; }
public Logging(IFeedback feedback) { _feedback = feedback; }
public CoreAccountsPerformance(IFeedback feedback) { _feedback = feedback; }