private void ProcessAllowedURLListData(IDnaDataReader dataReader, IAppContext context) { int currentSiteID = 1; int siteID = 1; _allowedURLsList.Clear(); //For each row/site in the database add it's details if (dataReader.Read()) { siteID = dataReader.GetInt32NullAsZero("SiteID"); currentSiteID = siteID; List<string> siteAllowedURLs = new List<string>(); string allowedURL = dataReader.GetStringNullAsEmpty("URL").ToLower(); siteAllowedURLs.Add(allowedURL); while (dataReader.Read()) { siteID = dataReader.GetInt32NullAsZero("SiteID"); if (siteID != currentSiteID) { _allowedURLsList.Add(currentSiteID, siteAllowedURLs); siteAllowedURLs.Clear(); currentSiteID = siteID; } allowedURL = dataReader.GetStringNullAsEmpty("URL").ToLower(); siteAllowedURLs.Add(allowedURL); } _allowedURLsList.Add(currentSiteID, siteAllowedURLs); } }
public AuthController(IRepository repository, IAppContext appContext, GoogleClient googleClient, FacebookClient facebookClient) { this.repository = repository; this.googleClient = googleClient; this.facebookClient = facebookClient; this.appContext = appContext; }
public SettingsViewModel( IScreen screen, ISettingsProvider settingsProvider, IFolderHelper folderHelper, IAppContext appContext) { HostScreen = screen; BackCommand = new ReactiveAsyncCommand(); BackCommand.RegisterAsyncAction(_ => HostScreen.Router.NavigateBack.Execute(null)); SelectFolder = new ReactiveAsyncCommand(); SelectFolder.RegisterAsyncAction(_ => { var result = folderHelper.SelectFolder(); if (result.Result == true) { UpdateLocation = result.Folder; } }, appContext.DispatcherScheduler); UpdateLocation = settingsProvider.UpdateLocation; _IsError = this.WhenAny(vm => vm.UpdateLocation, vm => vm.Value) .DistinctUntilChanged() .Throttle(TimeSpan.FromMilliseconds(500)) .ObserveOn(appContext.DispatcherScheduler) .Select(text => !IsUrlOrFolder(text)) .Do(error => { if (!error) { settingsProvider.UpdateLocation = UpdateLocation; } }) .ToProperty(this, vm => vm.IsError, setViaReflection: false); }
/// <summary> /// Starts the application asynchronously. /// </summary> /// <param name="appContext"> Context for the application.</param> /// <param name="cancellationToken">The cancellation token.</param> /// <returns> /// A Task. /// </returns> public virtual async Task StartAsync(IAppContext appContext, CancellationToken cancellationToken = default(CancellationToken)) { try { await Profiler.WithInfoStopwatchAsync( async () => { cancellationToken.ThrowIfCancellationRequested(); await this.BeforeStartAsync(appContext, cancellationToken).PreserveThreadContext(); cancellationToken.ThrowIfCancellationRequested(); await this.RunInitializersAsync(appContext, cancellationToken).PreserveThreadContext(); cancellationToken.ThrowIfCancellationRequested(); await this.AfterStartAsync(appContext, cancellationToken).PreserveThreadContext(); cancellationToken.ThrowIfCancellationRequested(); }, this.Logger).PreserveThreadContext(); } catch (OperationCanceledException) { this.Logger.Error(Strings.DefaultAppBootstrapper_StartCanceled_Exception, DateTimeOffset.Now); throw; } catch (Exception ex) { this.Logger.Error(ex, Strings.DefaultAppBootstrapper_StartFaulted_Exception, DateTimeOffset.Now); throw; } }
/// <summary> /// Initializes the application asynchronously. /// </summary> /// <param name="appContext">Context for the application.</param> /// <param name="cancellationToken">The cancellation token.</param> /// <returns> /// A Task. /// </returns> protected override Task InitializeCoreAsync(IAppContext appContext, CancellationToken cancellationToken) { new ThreadContextBuilder(appContext.AmbientServices) .WithStoreAction(StoreThreadCulture) .WithRestoreAction(RestoreThreadCulture); return TaskHelper.CompletedTask; }
/// <summary> /// Initializes the application asynchronously. /// </summary> /// <param name="appContext">Context for the application.</param> /// <param name="cancellationToken">The cancellation token.</param> /// <returns> /// A Task. /// </returns> protected override Task InitializeCoreAsync(IAppContext appContext, CancellationToken cancellationToken) { if (this.exception != null) { throw this.exception; } return TaskHelper.CompletedTask; }
public MainView(IAppContext appContext) { InitializeComponent(); _appContext = appContext; _conn = (IClientToServerModel)_appContext.GetObject<IConnectionModel>(); _conn.IP = "127.0.0.1"; _conn.Port = 51414; _conn.Username = "******"; }
public SocketListener(ITypeTranslator translator, IModuleHandler[] modules, IAppContext context, IConnTimeoutHandler timeout) { _modules = modules.ToList(); _translator = translator; _context = context; _timeouthandler = timeout; System.Timers.Timer _timer = new System.Timers.Timer(); Timer time = new Timer(); TimerCallback. }
/// <summary> /// Starts the application asynchronously. /// </summary> /// <param name="appContext"> Context for the application.</param> /// <param name="cancellationToken">The cancellation token.</param> /// <returns> /// A Task. /// </returns> public override Task StartAsync(IAppContext appContext, CancellationToken cancellationToken = default(CancellationToken)) { var owinAppContext = appContext as IOwinAppContext; if (owinAppContext == null) { throw new InvalidOperationException(string.Format(Strings.OwinAppBootstrapper_InvalidOwinAppContext_Exception, appContext?.GetType().FullName, typeof(IOwinAppContext).FullName)); } return base.StartAsync(appContext, cancellationToken); }
static void Main() { System.Windows.Forms.Application.EnableVisualStyles(); System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false); _context = new AppContext(); MainView view = new MainView(_context); _context.AddObject<IMessageOutput>(view); System.Windows.Forms.Application.Run(view); }
/// <summary> /// Allowed URL List Class /// </summary> /// <param name="context">The context</param> public void LoadAllowedURLLists(IAppContext context) { string getAllowedURLListData = "getallallowedurls"; using (IDnaDataReader dataReader = context.CreateDnaDataReader(getAllowedURLListData)) { dataReader.Execute(); if (dataReader.HasRows) { ProcessAllowedURLListData(dataReader, context); } } }
/// <summary> /// Initializes the application asynchronously. /// </summary> /// <param name="appContext">Context for the application.</param> /// <param name="cancellationToken">The cancellation token.</param> /// <returns> /// A Task. /// </returns> public async Task InitializeAsync(IAppContext appContext, CancellationToken cancellationToken = default(CancellationToken)) { this.InitializationMonitor.Start(); try { await this.InitializeCoreAsync(appContext, cancellationToken).PreserveThreadContext(); this.InitializationMonitor.Complete(); } catch (Exception ex) { this.InitializationMonitor.Fault(ex); throw; } }
static void Main() { System.Windows.Forms.Application.EnableVisualStyles(); System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false); System.Windows.Forms.Application.DoEvents(); using (var appContext = new AppContext()) { // Globaler Context AppContext = appContext; // Initialisierung using (var splash = new SplashForm()) { if (splash.ShowDialog() == DialogResult.OK) { System.Windows.Forms.Application.Run(new FrameForm()); } } } }
public SysUserRoleBase(IAppContext appContext) : base(appContext) { }
protected GenericRepository(IAppContext dbContext) { _dbContext = (DbContext)dbContext; _dbset = _dbContext.Set <TEntity>(); }
public QueryHandlerBase(IAppContext context) { Context = context ?? throw new ArgumentNullException(nameof(context)); }
public DeleteWorkshopCommandHandler(IAppContext context) : base(context) { }
/// <summary> /// Initializes a new instance of the <see cref="ImageRegistrationPresenter"/> class. /// </summary> public ImageRegistrationPresenter(IImageRegistrationView view, ILeastSquaresSolver solver, IAppContext context) : base(view) { if (solver == null) { throw new ArgumentNullException("solver"); } if (context == null) { throw new ArgumentNullException("context"); } _solver = solver; _context = context; View.RecalculationNeeded += () => Calculate(); View.AsForm.Shown += ViewShown; View.AsForm.FormClosing += OnFormClosing; }
public CmdViewFixedZoomOut(IAppContext context) { OnCreate(context); }
public static string SketchMouseMove(IPoint ipoint_0) { string str; double x; double y; double num; ISnappingResult snappingResult; string unit; if (SketchToolAssist.Map != null) { IMap map = SketchToolAssist.Map; string str1 = ""; bool flag = true; if (SketchToolAssist.LastPoint != null) { if (SketchToolAssist.IsFixDirection) { x = ipoint_0.X - SketchToolAssist.LastPoint.X; y = ipoint_0.Y - SketchToolAssist.LastPoint.Y; num = CommonHelper.azimuth(SketchToolAssist.LastPoint, ipoint_0); double num1 = Math.Sqrt(x * x + y * y); double num2 = num1 * Math.Cos(SketchToolAssist.FixDirection * 3.14159265358979 / 180); double num3 = num1 * Math.Sin(SketchToolAssist.FixDirection * 3.14159265358979 / 180); if (!(SketchToolAssist.FixDirection < 0 ? true : SketchToolAssist.FixDirection >= 90)) { if ((num < 90 + SketchToolAssist.FixDirection ? false : num < 270 + SketchToolAssist.FixDirection)) { num2 = -num2; num3 = -num3; } } else if (!(SketchToolAssist.FixDirection < 90 ? true : SketchToolAssist.FixDirection >= 270)) { if ((num < SketchToolAssist.FixDirection - 90 ? true : num >= SketchToolAssist.FixDirection + 90)) { num2 = -num2; num3 = -num3; } } else if ((num < SketchToolAssist.FixDirection - 270 ? false : num < SketchToolAssist.FixDirection - 90)) { num2 = -num2; num3 = -num3; } flag = false; x = SketchToolAssist.LastPoint.X + num2; y = SketchToolAssist.LastPoint.Y + num3; ipoint_0.PutCoords(x, y); } else if (SketchToolAssist.IsFixLength) { num = CommonHelper.azimuth(SketchToolAssist.LastPoint, ipoint_0); x = SketchToolAssist.FixLength * Math.Cos(num * 3.14159265358979 / 180); y = SketchToolAssist.FixLength * Math.Sin(num * 3.14159265358979 / 180); x = SketchToolAssist.LastPoint.X + x; y = SketchToolAssist.LastPoint.Y + y; flag = false; ipoint_0.PutCoords(x, y); } } SketchToolAssist.m_pAnchorPoint = ipoint_0; if (flag) { if (!Editor.UseOldSnap) { snappingResult = SketchToolAssist.m_psnaper.Snap(SketchToolAssist.m_pAnchorPoint); if (snappingResult == null) { if (SketchToolAssist.m_pAP == null) { SketchToolAssist.m_pAP = new AnchorPoint() { Symbol = SketchToolAssist.m_pSym as ISymbol }; } SketchToolAssist.m_pAP.MoveTo(SketchToolAssist.m_pAnchorPoint, (map as IActiveView).ScreenDisplay); } else { SketchToolAssist.m_pAnchorPoint = snappingResult.Location; if (SketchToolAssist.m_pAP == null) { SketchToolAssist.m_pAP = new AnchorPoint() { Symbol = SketchToolAssist.m_pSym as ISymbol }; } SketchToolAssist.m_pAP.MoveTo(SketchToolAssist.m_pAnchorPoint, (map as IActiveView).ScreenDisplay); } } else { IAppContext application = ApplicationRef.AppContext; snappingResult = SketchToolAssist.OldSnap(SketchToolAssist.m_pAnchorPoint, map as IActiveView, application.Config.EngineSnapEnvironment); if (snappingResult == null) { if (SketchToolAssist.m_pAP == null) { SketchToolAssist.m_pAP = new AnchorPoint() { Symbol = SketchToolAssist.m_pSym as ISymbol }; } SketchToolAssist.m_pAP.MoveTo(SketchToolAssist.m_pAnchorPoint, (map as IActiveView).ScreenDisplay); } else { SketchToolAssist.m_pAnchorPoint = snappingResult.Location; if (SketchToolAssist.m_pAP == null) { SketchToolAssist.m_pAP = new AnchorPoint() { Symbol = SketchToolAssist.m_pSym as ISymbol }; } SketchToolAssist.m_pAP.MoveTo(SketchToolAssist.m_pAnchorPoint, (map as IActiveView).ScreenDisplay); } } } if (SketchToolAssist.Feedback != null) { SketchToolAssist.Feedback.MoveTo(SketchToolAssist.m_pAnchorPoint); } if (SketchToolAssist.IsDrawTempLine == DrawTempGeometry.None) { if (SketchToolAssist.m_bShowVlaue) { if (SketchToolAssist.Feedback is INewLineFeedback) { unit = CommonHelper.GetUnit(map.MapUnits); double num4 = CommonHelper.measureLength(ipoint_0, 2, ref SketchToolAssist.m_pLastPoint1, ref SketchToolAssist.m_pEndPoint1, ref SketchToolAssist.m_totalLength); string[] strArrays = new string[] { "距离 = ", num4.ToString("0.###"), unit, ", 总长度 = ", SketchToolAssist.m_totalLength.ToString("0.###"), unit }; str1 = string.Concat(strArrays); } else if (SketchToolAssist.Feedback is INewPolygonFeedback) { unit = CommonHelper.GetUnit(map.MapUnits); double num5 = CommonHelper.measureArea(ipoint_0, 2, ref SketchToolAssist.m_pPointColn); double length = (SketchToolAssist.m_pPointColn as IPolygon).Length; if (num5 > 0) { str1 = string.Format("周长 = {0:0.###} {1} ,总面积 = {2:0.###} 平方{1}", length, unit, num5); } } } str = str1; } else { str = ""; } } else { str = ""; } return(str); }
public CmdUndo(IAppContext context) { OnCreate(context); }
public CmdDeleteMapFrame(IAppContext context, IMapLegendView view) { _context = context; _view = view; OnCreate(); }
public CmdPageZoomToWidth(IAppContext context) { OnCreate(context); }
public CmdStartVertSectAnalysis(IAppContext context, PipelineAnalysisPlugin plugin) { OnCreate(context); _plugin = plugin; }
public MenuUpdater(IAppContext context, PluginIdentity identity) : base(context, identity) { _map = context.Map; _legend = context.Legend; }
public CmdImportTables(IAppContext context) { OnCreate(context); }
public ToolSceneTargetZoom(IAppContext context, IScenePlugin plugin) { OnCreate(context); _plugin = plugin; }
/// <summary> /// 设置当前 app 信息 /// </summary> /// <param name="appctx"></param> public void setAppContext( IAppContext appctx ) { _appContext = appctx; appctx.setContext( this.ctx ); }
public DataCheckBase(IAppContext context, IPipelineConfig pipelineConfig, IDataCheckConfig dataCheckConfig) { _appContext = context; _pipelineConfig = pipelineConfig; _dataCheckConfig = dataCheckConfig; }
public static string CacheKey(IAppContext appContext) { return(appContext.OrganizationUniqueName + ":entitymaps"); }
public CmdSnapBoundary(IAppContext context) { OnCreate(context); }
public ConnectionHandler(IAppContext context) { _context = context; }
public ColonyInfoScreen(IAppContext appContext) { InitializeComponent(); _appContext = appContext; }
public CmdImportExcelData(IAppContext context, PipelineEditorPlugin plugin) { OnCreate(context); _plugin = plugin; }
public ViewPhotoViewModel( IAppContext appContext) { _appContext = appContext; Photo = _appContext.CurrentPhoto; }
/// <summary> /// Initializes the application asynchronously. /// </summary> /// <param name="appContext">Context for the application.</param> /// <param name="cancellationToken">The cancellation token.</param> /// <returns> /// A Task. /// </returns> public async Task InitializeAsync(IAppContext appContext, CancellationToken cancellationToken = default(CancellationToken)) { Console.ForegroundColor = ConsoleColor.Green; }
public NewUserInformHandler(IAppContext context) { _context = context; }
public ScaleBarFormatPropertyPage(IAppContext context) { this.InitializeComponent(); _context = context; this.m_pSG = _context.StyleGallery; }
/// <summary> /// Initializes the application asynchronously. /// </summary> /// <param name="appContext">Context for the application.</param> /// <param name="cancellationToken">The cancellation token.</param> /// <returns> /// A Task. /// </returns> protected override Task InitializeCoreAsync(IAppContext appContext, CancellationToken cancellationToken) { return this.modelSpaceProvider.InitializeAsync(appContext, cancellationToken); }
/// <summary> /// Creates new poll /// </summary> /// <returns>A poll</returns> public Poll CreatePoll(IAppContext context, IUser viewingUser) { return new PollContentRating(context, viewingUser); }
public OutgoingAppContextMutator(IBus bus, IAppContext appContext) { _appContext = appContext; _bus = bus; }
public Connector(IAppContext appcontext) { _appcontext = appcontext; }
public CmdGxObjectProperty(IAppContext context) { OnCreate(context); }
public CmdSelectNone(IAppContext context, ITableEditorView view) { _context = context; _view = view; OnCreate(); }
/// <summary> /// Gets the min and max ages for the current site /// </summary> public void GetSiteMinMaxAgeRangeFromSignInService(IAppContext context) { }
public CmdExportSingleToGDB(IAppContext context) { OnCreate(context); }
/// <summary> /// <see cref="IInputContext"/> /// </summary> public virtual void EnsureAllowedURLsExists(bool recacheData, IAppContext context) { throw new NotImplementedException(); }
public CmdQueryByMSTJ(IAppContext context, PipelineAnalysisPlugin plugin) { OnCreate(context); _plugin = plugin; }
public void Start(IAppContext aAppContext) { iXapp = new FormsApp(aAppContext.Services.UserList, Path.Combine(aAppContext.StaticPath, "http")); aAppContext.PublishXapp("forms", iXapp); aAppContext.Device.SetAttribute("Upnp.PresentationUrl", ":12921/forms/"); // TODO: Remove need for hard-coded port. }
public GetBlogInfosQueryHandler(IAppContext context, IMapper mapper) { _context = context; _mapper = mapper; }
public SysDataPrivilegeBase(IAppContext appContext) : base(appContext) { }
public CmdAddPointInGeometry(IAppContext context) { OnCreate(context); }
/// <summary> /// Ensures that the allowed url list data is created and loaded. Can be called to reload the data from the database /// with the recacheData flag set to true. /// </summary> /// <param name="context">The context</param> /// <param name="recacheData">Set to true will create a new list and replace the old. False will just ensure that there is a valid list to use</param> public void EnsureAllowedURLsExists(bool recacheData, IAppContext context) { Locking.InitialiseOrRefresh(_createAllowedURLsLock, InitialiseAllowedURLs, IsAllowedURLsInitialised, recacheData, context); }
public CmdSelectByMouse(IAppContext context) { _context = context as IAppContext; m_SelectionResultEnum = esriSelectionResultEnum.esriSelectionResultNew; }
public ServiceBase(IAppContext appContext) { AppContext = appContext; }
public CmdSnapEndPointt(IAppContext context) { OnCreate(context); }
public static void SetCurrentAppContext(IAppContext context) { AppContext = context; }
public CmdSnapOff(IAppContext context) { OnCreate(context); }
public SysUserInfoBase(IAppContext appContext) : base(appContext) { }
public CmdSnapVertexPoint(IAppContext context) { OnCreate(context); }