Esempio n. 1
0
        // Deserialization of string encoding format.
        static WorkflowSymbol ParseStringRepresentation(string symbolString, byte[] checksum)
        {
            string[] s          = symbolString.Split(';');
            int      numSymbols = s.Length - 1;

            ActivitySymbol[] symbols = new ActivitySymbol[numSymbols];
            for (int i = 0; i < numSymbols; ++i)
            {
                string[] symbolSegments = s[i + 1].Split(',');
                Fx.Assert(symbolSegments.Length == 5, "Invalid activity symbol");
                symbols[i] = new ActivitySymbol
                {
                    QualifiedId = QualifiedId.Parse(symbolSegments[0]).AsByteArray(),
                    StartLine   = int.Parse(symbolSegments[1], CultureInfo.InvariantCulture),
                    StartColumn = int.Parse(symbolSegments[2], CultureInfo.InvariantCulture),
                    EndLine     = int.Parse(symbolSegments[3], CultureInfo.InvariantCulture),
                    EndColumn   = int.Parse(symbolSegments[4], CultureInfo.InvariantCulture)
                };
            }

            return(new WorkflowSymbol
            {
                FileName = s[0],
                Symbols = symbols,
                checksum = checksum
            });
        }
        // Deserialization of string encoding format.
        static WorkflowSymbol ParseStringRepresentation(string symbolString, byte[] checksum)
        {
            string[] s = symbolString.Split(';');
            int numSymbols = s.Length - 1;
            ActivitySymbol[] symbols = new ActivitySymbol[numSymbols];
            for (int i = 0; i < numSymbols; ++i)
            {
                string[] symbolSegments = s[i + 1].Split(',');
                Fx.Assert(symbolSegments.Length == 5, "Invalid activity symbol");
                symbols[i] = new ActivitySymbol
                {
                    QualifiedId = QualifiedId.Parse(symbolSegments[0]).AsByteArray(),
                    StartLine = int.Parse(symbolSegments[1], CultureInfo.InvariantCulture),
                    StartColumn = int.Parse(symbolSegments[2], CultureInfo.InvariantCulture),
                    EndLine = int.Parse(symbolSegments[3], CultureInfo.InvariantCulture),
                    EndColumn = int.Parse(symbolSegments[4], CultureInfo.InvariantCulture)
                };
            }

            return new WorkflowSymbol
            {
                FileName = s[0],
                Symbols = symbols,
                checksum = checksum
            };

        }