Esempio n. 1
0
 public IntPtr ModifyPointer(IntPtr ptr, MethodOperation op)
 {
     if (op != MethodOperation.PassThrough)
     {
         return(IntPtr.Add(ptr, 1));
     }
     return(ptr);
 }
        private void BuildChart(WinChartViewer winChartViewerResult, string[] titleXYZ, int chooseItem)
        {
            //Налаштування графіку

            // Create a ThreeDScatterChart object of size
            ThreeDScatterChart c = new ThreeDScatterChart(750, 550);

            // Add a title to the chart
            c.addTitle("3D Scatter Groups", "Times New Roman Italic", 14);

            // Set the center of the plot region at (350, 240),
            //and set width x depth x height to last three parameters
            c.setPlotRegion(300, 240, 350, 350, 350);

            // Set the elevation and rotation angles to 15 and 30 degrees
            c.setViewAngle(15, 30);

            // Add a legend box at
            c.addLegend(650, 20);


            MethodOperation methodOperation = GetDelegateOperation(chooseItem);

            double[] x;
            double[] y;
            double[] z;

            //Додавання группи для графіку по назві проекту
            foreach (KeyValuePair <string, List <BestResultGA> > group in _resultGAByNameProjectGroup)
            {
                //розмір групи
                int countElementsInGroup = group.Value.Count;
                x = new double[countElementsInGroup];
                y = new double[countElementsInGroup];
                z = new double[countElementsInGroup];
                int i = 0;
                //наповнити групу
                methodOperation(group.Value, ref x, ref y, ref z, ref i);

                //добавити групу точок
                c.addScatterGroup(x, y, z, group.Key, Chart.GlassSphere2Shape, 10);
            }

            // Set the x, y and z axis titles
            c.xAxis().setTitle(titleXYZ[0]);
            c.yAxis().setTitle(titleXYZ[1]);
            c.zAxis().setTitle(titleXYZ[2]);

            // Output the chart
            winChartViewerResult.Chart = c;

            winChartViewerResult.ImageMap = c.getHTMLImageMap("chart");//, "", "x={x}&y={y}&z={z}&dataSet={dataSet}&dataSetName={name}");
            // winChartViewerResult.ClickHotSpot += WinChartViewerResult_ClickHotSpot;
            //Зберегти графік в зображення
            //c.makeChart("chart.png");
        }
Esempio n. 3
0
        //protected abstract MethodResponse ValidateObject(T objToValidate, out bool objIsValid);

        /// <summary>
        /// Method to return response message
        /// </summary>
        /// <param name="rData"></param>
        /// <param name="operationPerformed"></param>
        /// <returns></returns>
        protected MethodResponse SetResponseObject(string rData, MethodOperation operationPerformed)
        {
            MethodResponse methodResponseObj = null;

            var result = Cast(SetMessage(rData), new { IsSuccess = false, Response = string.Empty });


            switch (operationPerformed)
            {
            case MethodOperation.Insert:
                methodResponseObj = new MethodResponse()
                {
                    ResponseMessage = result.IsSuccess ? "Record has been added successfully." : result.Response,
                    ResponseStatus  = result.IsSuccess
                };
                break;

            case MethodOperation.Update:
                methodResponseObj = new MethodResponse()
                {
                    ResponseMessage = result.IsSuccess ? "Record has been updated successfully." : result.Response,
                    ResponseStatus  = result.IsSuccess
                };
                break;

            case MethodOperation.Delete:
                methodResponseObj = new MethodResponse()
                {
                    ResponseMessage = result.IsSuccess ? "Record has been deleted successfully." : result.Response,
                    ResponseStatus  = result.IsSuccess
                };
                break;

            case MethodOperation.IsExist:
                methodResponseObj = new MethodResponse()
                {
                    ResponseMessage = result.Response,
                    ResponseStatus  = result.IsSuccess
                };
                break;
            }
            return(methodResponseObj);
        }