Esempio n. 1
0
        /// <summary>
        /// Perform the actual expansion of the macro
        /// </summary>
        /// <param name="macro">The macro.</param>
        /// <returns></returns>
        protected override Statement DoExpand(MacroStatement macro)
        {
            if (macro.Arguments.Count != 0)
            {
                Errors.Add(CompilerErrorFactory.CustomError(macro.LexicalInfo, "No arguments allowed for action statement"));
                return(null);
            }

            Method mergeRowsMethod = new Method("MergeRows");

            mergeRowsMethod.Modifiers = TypeMemberModifiers.Override;
            mergeRowsMethod.Parameters.Add(new ParameterDeclaration("left", new SimpleTypeReference(typeof(Row).FullName)));
            mergeRowsMethod.Parameters.Add(new ParameterDeclaration("right", new SimpleTypeReference(typeof(Row).FullName)));
            CodeBuilder.DeclareLocal(mergeRowsMethod, "row", TypeSystemServices.Map(typeof(Row)));
            mergeRowsMethod.Body.Add(
                new BinaryExpression(BinaryOperatorType.Assign,
                                     new ReferenceExpression("row"),
                                     new MethodInvocationExpression(
                                         AstUtil.CreateReferenceExpression(typeof(Row).FullName))
                                     )
                );
            mergeRowsMethod.Body.Add(macro.Body);
            mergeRowsMethod.Body.Add(new ReturnStatement(new ReferenceExpression("row")));

            ParentMethods.Add(mergeRowsMethod);
            return(null);
        }
Esempio n. 2
0
        /// <summary>
        /// Perform the actual expansion of the macro
        /// </summary>
        /// <param name="macro">The macro.</param>
        /// <returns></returns>
        protected override Statement DoExpand(MacroStatement macro)
        {
            List <string> columns = new List <string>();

            if (!macro.Body.IsEmpty)
            {
                Errors.Add(CompilerErrorFactory.CustomError(macro.LexicalInfo, "GroupBy cannot contain statements"));
                return(null);
            }
            foreach (Expression argument in macro.Arguments)
            {
                ReferenceExpression expr = argument as ReferenceExpression;
                if (expr == null)
                {
                    Errors.Add(CompilerErrorFactory.CustomError(macro.LexicalInfo, "GroupBy arguments must be refernce expressions. Example: groupBy name, surname"));
                    return(null);
                }
                columns.Add(expr.Name);
            }

            Method method = CreateGetColumnsToGroupByMethod(macro, columns);

            ParentMethods.Add(method);

            return(null);
        }
Esempio n. 3
0
        /// <summary>
        /// Perform the actual expansion of the macro
        /// </summary>
        /// <param name="macro">The macro.</param>
        /// <returns></returns>
        protected override Statement DoExpand(MacroStatement macro)
        {
            Method accumulate = new Method("FinishAggregation");

            accumulate.Modifiers = TypeMemberModifiers.Override;
            accumulate.Parameters.Add(new ParameterDeclaration("aggregate", CodeBuilder.CreateTypeReference(typeof(Row))));

            accumulate.Body = macro.Body;

            ParentMethods.Add(accumulate);

            return(null);
        }
        /// <summary>
        /// Perform the actual expansion of the macro
        /// </summary>
        /// <param name="macro">The macro.</param>
        /// <returns></returns>
        protected override Statement DoExpand(MacroStatement macro)
        {
            Method rowProcessed = new Method("OnFinishedProcessing");

            rowProcessed.Modifiers = TypeMemberModifiers.Override;
            rowProcessed.Parameters.Add(new ParameterDeclaration("op", CodeBuilder.CreateTypeReference(typeof(IOperation))));

            rowProcessed.Body = macro.Body;

            ParentMethods.Add(rowProcessed);

            return(null);
        }
Esempio n. 5
0
        public static Tuple <StructureValueForClient, string> GetParamatersForClientReady(List <string> ListNameOfValue) // Для запроса по нажатию, получает уже готовый результат
        {
            StructureValueForClient           ReturnStruct = default;
            ProgressOfUpdateAtStructAttribute Progress     = (ProgressOfUpdateAtStructAttribute)ParentMethods.GetStandart().Clone_Full();

            Progress.NonSerializedConfig.IsInTask = false;
            Progress.NonSerializedConfig.Method   = new Action(() =>
            {
                DateTime Start = DateTime.Now;

                try
                {
                    ReturnStruct = AutoRefresh_ServerPart.GetParamatersForClientReady(ListNameOfValue);
                }
                catch (Exception ex)
                {
                    try
                    {
                        ReturnStruct = AutoRefresh_ServerPart.GetParamatersForClientReady(ListNameOfValue);
                    }
                    catch (Exception exx)
                    {
                    }
                }

                TimeSpan TimeSpend = DateTime.Now - Start;
                ReturnStruct.TimeServerOnGetProperties   = TimeSpend;
                ReturnStruct.TimeServerWhenGetProperties = DateTime.Now.TimeOfDay;
            });
            Progress.Start();

            return(new Tuple <StructureValueForClient, string>(ReturnStruct, Progress.ExceptionMessage));
        }
Esempio n. 6
0
        public static Tuple <StructureValueForClient, string> CheckAutoRefresh(StructureValueForClient StructureValueForClient)
        {
            StructureValueForClient           Text     = default;
            ProgressOfUpdateAtStructAttribute Progress = (ProgressOfUpdateAtStructAttribute)ParentMethods.GetStandart().Clone_Full();

            Progress.NonSerializedConfig.IsInTask = false;
            Progress.NonSerializedConfig.Method   = new Action(() =>
            {
                Text = AutoRefresh_ServerPart.CheckAutoRefresh(StructureValueForClient);
            });
            Progress.Start();

            return(new Tuple <StructureValueForClient, string>(Text, Progress.ExceptionMessage));
        }
Esempio n. 7
0
        public static Tuple <string, string> SetToServer(StructureValueForClient Obj)
        {
            string Text = ParentMethods.SetToServer(Obj, Program.Progress);

            return(new Tuple <string, string>(null, Text));
        }
Esempio n. 8
0
        static void Main(string[] args)
        {
            //Helper.CheckDirectories();
            var CurrentDomain    = AppDomain.CurrentDomain.BaseDirectory;
            var GetDirectoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

            Console.WriteLine("AppDomain.CurrentDomain.BaseDirectory: {0}", CurrentDomain);
            Console.WriteLine("Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location): {0}", GetDirectoryName);
            ManualResetEvent manualResetEvent = new ManualResetEvent(true);

            manualResetEvent.WaitOne();

            ConsoleWriteLine.WriteInConsole(null, null, null, "Project started", ConsoleColor.White);
            Process.GetCurrentProcess().PriorityClass        = ProcessPriorityClass.RealTime;
            Process.GetCurrentProcess().PriorityBoostEnabled = true;

            Helper_WINWORD.Clear();
            Helper_EXCEL.Clear();
            ClearNormal();

            ProgressOfUpdateAtStructAttribute Standart = (ProgressOfUpdateAtStructAttribute)ParentMethods.GetStandart().Clone_Full();

            ValueForClient.DeserializeConfig(new TimeSpan(0, 5, 0)); // Deserialization data'es

            if (ValueForClient.ReadyStructure.ProgressOfUpdate is null ? true : ValueForClient.ReadyStructure.ProgressOfUpdate.List_ProgressOfUpdateAtStructAttribute.Count != 1)
            {
                Progress = Standart;
                ValueForClient.ReadyStructure.ProgressOfUpdate = new ProgressOfUpdate()
                {
                    List_ProgressOfUpdateAtStructAttribute = new List <ProgressOfUpdateAtStructAttribute>()
                    {
                        Progress
                    }
                };
            }