コード例 #1
0
        private static void CreateStateInstances(IApplicationController applicationController,
                                                 IItemFormatter itemFormatter,
                                                 IMargin labelMargin,
                                                 out IBackgroundState backgroundState,
                                                 out IGridState gridState,
                                                 out IScaleState scaleState,
                                                 out IDataDrawState graphState,
                                                 out IScalingState scalingState,
                                                 out IGraphControlFormState graphControlFormState)
        {
            backgroundState = new BackgroundState();
            applicationController.RegisterInstance <IBackgroundState>(backgroundState);

            gridState = new GridState();
            gridState.LabelPadding  = labelMargin;
            gridState.ItemFormatter = itemFormatter;
            applicationController.RegisterInstance <IGridState>(gridState);

            scaleState = new ScaleState();
            applicationController.RegisterInstance <IScaleState>(scaleState);

            graphState = new DataDrawState();
            applicationController.RegisterInstance <IDataDrawState>(graphState);

            scalingState = new ScalingState();
            applicationController.RegisterInstance <IScalingState>(scalingState);

            graphControlFormState = new GraphControlFormState();
            applicationController.RegisterInstance <IGraphControlFormState>(graphControlFormState);
        }
コード例 #2
0
 public ScaleService(IScaleState scaleState, IDataService dataService, IMargin margin)
 {
     if (scaleState == null)
     {
         throw new InvalidArgumentException("parameter is null");
     }
     this.scaleState        = scaleState;
     this.scaleState.Margin = margin;
     this.dataService       = dataService;
 }
コード例 #3
0
        private static void CreateServiceInstances(IApplicationController applicationController,
                                                   IMargin margin,
                                                   IScaleState scaleState,
                                                   out IDataService dataService,
                                                   out IScaleService scaleService,
                                                   out IBufferedDrawingService bufferedDrawingService)
        {
            dataService = new DataService();
            applicationController.RegisterInstance <IDataService>(dataService);

            scaleService = new ScaleService(scaleState, dataService, margin);
            applicationController.RegisterInstance <IScaleService>(scaleService);

            bufferedDrawingService = new BufferedDrawingService();
            applicationController.RegisterInstance <IBufferedDrawingService>(bufferedDrawingService);
        }
コード例 #4
0
 public ScaleState(IScaleState state)
 {
     if (state == null)
     {
         throw new InvalidArgumentException("parameter is null");
     }
     this.Margin = new Margin(state.Margin);
     this.X1     = state.X1;
     this.X2     = state.X2;
     this.Y1     = state.Y1;
     this.Y2     = state.Y2;
     this.ScaleX = state.ScaleX;
     this.ScaleY = state.ScaleY;
     this.StepX  = state.StepX;
     this.StepY  = state.StepY;
 }
コード例 #5
0
 public bool Equals(IScaleState other)
 {
     if (other == null)
     {
         return(false);
     }
     return(this.Margin.Equals(other.Margin) &&
            this.X1.Equals(other.X1) &&
            this.X2.Equals(other.X2) &&
            this.Y1.Equals(other.Y1) &&
            this.Y2.Equals(other.Y2) &&
            this.ScaleX.Equals(other.ScaleX) &&
            this.ScaleY.Equals(other.ScaleY) &&
            this.StepX.Equals(other.StepX) &&
            this.StepY.Equals(other.StepY));
     ////&& this.FitByX.Equals(other.FitByX) // TODO remove
     ////&& this.FitByY.Equals(other.FitByY);
 }
コード例 #6
0
ファイル: TestFactory.cs プロジェクト: serge4k/GraphControl
        private static void CreateStateInstancees(IApplicationController applicationController,
                                                  out IBackgroundState backgroundState, out IGridState gridState, out IScaleState scaleState, out IDataDrawState graphState, out IGraphControlFormState graphControlFormState)
        {
            backgroundState = new BackgroundState();
            applicationController.RegisterInstance <IBackgroundState>(backgroundState);

            gridState = new GridState();
            applicationController.RegisterInstance <IGridState>(gridState);

            scaleState = new ScaleState();
            applicationController.RegisterInstance <IScaleState>(scaleState);

            graphState = new DataDrawState();
            applicationController.RegisterInstance <IDataDrawState>(graphState);

            graphControlFormState = new GraphControlFormState();
            applicationController.RegisterInstance <IGraphControlFormState>(graphControlFormState);
        }