コード例 #1
0
 public void AppendComplexHeader(ComplexHeader header)
 {
     foreach (var item in header)
     {
         _report.Add(item);
     }
 }
コード例 #2
0
        internal static string GetHeaderParameter(ComplexHeader header, string parameterName, int lengthLimit)
        {
            if (header == null)
            {
                return(null);
            }
            MimeParameter mimeParameter = header[parameterName];

            if (mimeParameter == null)
            {
                return(null);
            }
            string text = null;

            try
            {
                text = mimeParameter.Value;
            }
            catch (InvalidCharsetException)
            {
                StorageGlobals.ContextTraceDebug <string, string>(ExTraceGlobals.CcInboundMimeTracer, "InboundMimeConverter::GetHeaderParameter: Header[{0},{1}].Value throws InvalidCharsetException", header.Name, parameterName);
                return(null);
            }
            if (text != null && text.Length > lengthLimit)
            {
                StorageGlobals.ContextTraceDebug <string, string, int>(ExTraceGlobals.CcInboundMimeTracer, "InboundMimeConverter::GetHeaderParameter: Header[{0},{1}].Value exceeds length limit ({2})", header.Name, parameterName, lengthLimit);
                return(null);
            }
            return(text);
        }
コード例 #3
0
 private static bool Render(ComplexHeader element, WordprocessingDocument document, Body body)
 {
     return(Render(new TextElement()
     {
         Style = new Campus.Report.Base.Style(),
         Value = "Rended for ComplexHeader not implemented."
     }, document, body));
 }
コード例 #4
0
ファイル: Utility.cs プロジェクト: YHZX2013/exchange_diff
        internal static string GetParameterValue(MimePart part, HeaderId headerId, string parameterName)
        {
            string        result        = null;
            ComplexHeader complexHeader = part.Headers.FindFirst(headerId) as ComplexHeader;

            if (complexHeader != null)
            {
                result = Utility.GetParameterValue(complexHeader, parameterName);
            }
            return(result);
        }
コード例 #5
0
ファイル: Utility.cs プロジェクト: YHZX2013/exchange_diff
        internal static string GetParameterValue(ComplexHeader header, string parameterName)
        {
            string        result        = null;
            MimeParameter mimeParameter = header[parameterName];

            if (mimeParameter != null)
            {
                DecodingResults decodingResults;
                mimeParameter.TryGetValue(Utility.DecodeOrFallBack, out decodingResults, out result);
                return(result);
            }
            return(result);
        }
コード例 #6
0
 private bool Render(ComplexHeader element, Document pdfDocument)
 {
     return(Render(new TextElement()
     {
         Style = new Style
         {
             FontColor = System.Drawing.Color.Red,
             TextStyle = new List <TextStyleType> {
                 TextStyleType.Bold
             }
         },
         Value = "Rended for ComplexHeader not implemented."
     }, pdfDocument, "arialuniTff"));
 }
コード例 #7
0
        internal void WriteHeaderParameter(string parameterName, string parameterValue)
        {
            if (this.hasAllHeaders)
            {
                return;
            }
            ComplexHeader complexHeader = (ComplexHeader)this.currentHeader;
            MimeParameter mimeParameter = complexHeader[parameterName];

            if (mimeParameter == null)
            {
                mimeParameter = new MimeParameter(parameterName);
                complexHeader.AppendChild(mimeParameter);
            }
            mimeParameter.Value = parameterValue;
        }
コード例 #8
0
ファイル: Utility.cs プロジェクト: YHZX2013/exchange_diff
        internal static void StoreFileNameInHeader(MimePart attachmentPart, HeaderId headerId, GetDefaultValue getDefaultValue, string parameterName, string value)
        {
            ComplexHeader complexHeader = attachmentPart.Headers.FindFirst(headerId) as ComplexHeader;

            if (complexHeader == null)
            {
                complexHeader       = (Header.Create(headerId) as ComplexHeader);
                complexHeader.Value = getDefaultValue();
                attachmentPart.Headers.AppendChild(complexHeader);
            }
            MimeParameter mimeParameter = complexHeader[parameterName];

            if (mimeParameter == null)
            {
                mimeParameter = new MimeParameter(parameterName);
                complexHeader.AppendChild(mimeParameter);
            }
            mimeParameter.Value = value;
        }
コード例 #9
0
ファイル: Utility.cs プロジェクト: YHZX2013/exchange_diff
        internal static void SetParameterValue(MimePart part, HeaderId headerId, string parameterName, string value)
        {
            ComplexHeader complexHeader = part.Headers.FindFirst(headerId) as ComplexHeader;

            if (complexHeader == null)
            {
                complexHeader = (Header.Create(headerId) as ComplexHeader);
                complexHeader.AppendChild(new MimeParameter(parameterName, value));
                part.Headers.AppendChild(complexHeader);
                return;
            }
            MimeParameter mimeParameter = complexHeader[parameterName];

            if (mimeParameter != null)
            {
                mimeParameter.Value = value;
                return;
            }
            complexHeader.AppendChild(new MimeParameter(parameterName, value));
        }
コード例 #10
0
            public static ComplexHeader RNPTableHeader(int columnOffset, int rowOffset, int kurs, int weekCount1, int weekCount2)
            {
                int semestr = kurs * 2 - 1; //первый семестр курса

                if (_RNPTableHeader == null)
                {
                    _RNPTableHeader = new ComplexHeader();

                    Style verticalCenter = new Style()
                    {
                        Aligment = new Aligment()
                        {
                            Rotation = 90, HorizontalAligment = HorizontalAligment.Center
                        }
                    };
                    Style generalCenter = new Style()
                    {
                        Aligment = new Aligment()
                        {
                            VerticalAligment = VerticalAligment.Center, HorizontalAligment = HorizontalAligment.Center
                        }
                    };
                    _RNPTableHeader.Add(new ComplexHeaderCell(GetColumn(1 + columnOffset) + (1 + rowOffset).ToString(), GetColumn(1 + columnOffset) + (7 + rowOffset).ToString(), "Назва дисципліни", generalCenter));
                    _RNPTableHeader.Add(new ComplexHeaderCell(GetColumn(2 + columnOffset) + (1 + rowOffset).ToString(), GetColumn(2 + columnOffset) + (7 + rowOffset).ToString(), "Назва кафедри", generalCenter));
                    _RNPTableHeader.Add(new ComplexHeaderCell(GetColumn(3 + columnOffset) + (1 + rowOffset).ToString(), GetColumn(4 + columnOffset) + (3 + rowOffset).ToString(), "Обсяг дисципліни", generalCenter));
                    _RNPTableHeader.Add(new ComplexHeaderCell(GetColumn(3 + columnOffset) + (4 + rowOffset).ToString(), GetColumn(3 + columnOffset) + (7 + rowOffset).ToString(), "Кредитів ЕКТС", verticalCenter));
                    _RNPTableHeader.Add(new ComplexHeaderCell(GetColumn(4 + columnOffset) + (4 + rowOffset).ToString(), GetColumn(4 + columnOffset) + (7 + rowOffset).ToString(), "Годин", verticalCenter));
                    _RNPTableHeader.Add(new ComplexHeaderCell(GetColumn(5 + columnOffset) + (1 + rowOffset).ToString(), GetColumn(5 + columnOffset) + (7 + rowOffset).ToString(), "Самостійна робота студентів", verticalCenter));
                    _RNPTableHeader.Add(new ComplexHeaderCell(GetColumn(6 + columnOffset) + (1 + rowOffset).ToString(), GetColumn(13 + columnOffset) + (3 + rowOffset).ToString(), "Контрольні заходи", generalCenter));
                    _RNPTableHeader.Add(new ComplexHeaderCell(GetColumn(6 + columnOffset) + (4 + rowOffset).ToString(), GetColumn(6 + columnOffset) + (7 + rowOffset).ToString(), "Екзамени", verticalCenter));
                    _RNPTableHeader.Add(new ComplexHeaderCell(GetColumn(7 + columnOffset) + (4 + rowOffset).ToString(), GetColumn(7 + columnOffset) + (7 + rowOffset).ToString(), "Заліки", verticalCenter));
                    _RNPTableHeader.Add(new ComplexHeaderCell(GetColumn(8 + columnOffset) + (4 + rowOffset).ToString(), GetColumn(8 + columnOffset) + (7 + rowOffset).ToString(), "МКР", verticalCenter));
                    _RNPTableHeader.Add(new ComplexHeaderCell(GetColumn(9 + columnOffset) + (4 + rowOffset).ToString(), GetColumn(9 + columnOffset) + (7 + rowOffset).ToString(), "Курсові проекти", verticalCenter));
                    _RNPTableHeader.Add(new ComplexHeaderCell(GetColumn(10 + columnOffset) + (4 + rowOffset).ToString(), GetColumn(10 + columnOffset) + (7 + rowOffset).ToString(), "Курсові роботи", verticalCenter));
                    _RNPTableHeader.Add(new ComplexHeaderCell(GetColumn(11 + columnOffset) + (4 + rowOffset).ToString(), GetColumn(11 + columnOffset) + (7 + rowOffset).ToString(), "РГР, РР", verticalCenter));
                    _RNPTableHeader.Add(new ComplexHeaderCell(GetColumn(12 + columnOffset) + (4 + rowOffset).ToString(), GetColumn(12 + columnOffset) + (7 + rowOffset).ToString(), "ДКР", verticalCenter));
                    _RNPTableHeader.Add(new ComplexHeaderCell(GetColumn(13 + columnOffset) + (4 + rowOffset).ToString(), GetColumn(13 + columnOffset) + (7 + rowOffset).ToString(), "Реферати", verticalCenter));
                    _RNPTableHeader.Add(new ComplexHeaderCell(GetColumn(14 + columnOffset) + (1 + rowOffset).ToString(), GetColumn(21 + columnOffset) + (2 + rowOffset).ToString(), kurs + " курс", generalCenter));
                    //_RNPTableHeader.Add(new ComplexHeaderCell(GetColumn(14 + columnOffset) + (2 + rowOffset).ToString(), GetColumn(21 + columnOffset) + (2 + rowOffset).ToString(), kurs + " курс", generalCenter));
                    _RNPTableHeader.Add(new ComplexHeaderCell(GetColumn(14 + columnOffset) + (3 + rowOffset).ToString(), GetColumn(21 + columnOffset) + (3 + rowOffset).ToString(), "Кількість годин", generalCenter));
                    _RNPTableHeader.Add(new ComplexHeaderCell(GetColumn(14 + columnOffset) + (4 + rowOffset).ToString(), GetColumn(17 + columnOffset) + (4 + rowOffset).ToString(), semestr + " семестр", generalCenter));
                    _RNPTableHeader.Add(new ComplexHeaderCell(GetColumn(14 + columnOffset) + (5 + rowOffset).ToString(), GetColumn(17 + columnOffset) + (5 + rowOffset).ToString(), weekCount1 + " тижнів", generalCenter));
                    _RNPTableHeader.Add(new ComplexHeaderCell(GetColumn(14 + columnOffset) + (6 + rowOffset).ToString(), GetColumn(14 + columnOffset) + (7 + rowOffset).ToString(), "Всього", verticalCenter));
                    _RNPTableHeader.Add(new ComplexHeaderCell(GetColumn(15 + columnOffset) + (6 + rowOffset).ToString(), GetColumn(17 + columnOffset) + (6 + rowOffset).ToString(), "У тому числі", generalCenter));
                    _RNPTableHeader.Add(new ComplexHeaderCell(GetColumn(15 + columnOffset) + (7 + rowOffset).ToString(), "", "Лекції", verticalCenter));
                    _RNPTableHeader.Add(new ComplexHeaderCell(GetColumn(16 + columnOffset) + (7 + rowOffset).ToString(), "", "Практичні", verticalCenter));
                    _RNPTableHeader.Add(new ComplexHeaderCell(GetColumn(17 + columnOffset) + (7 + rowOffset).ToString(), "", "Лабораторні", verticalCenter));

                    _RNPTableHeader.Add(new ComplexHeaderCell(GetColumn(18 + columnOffset) + (4 + rowOffset).ToString(), GetColumn(21 + columnOffset) + (4 + rowOffset).ToString(), ((semestr + 1) + " семестр"), generalCenter));
                    _RNPTableHeader.Add(new ComplexHeaderCell(GetColumn(18 + columnOffset) + (5 + rowOffset).ToString(), GetColumn(21 + columnOffset) + (5 + rowOffset).ToString(), weekCount2 + " тижнів", generalCenter));
                    _RNPTableHeader.Add(new ComplexHeaderCell(GetColumn(18 + columnOffset) + (6 + rowOffset).ToString(), GetColumn(18 + columnOffset) + (7 + rowOffset).ToString(), "Всього", verticalCenter));
                    _RNPTableHeader.Add(new ComplexHeaderCell(GetColumn(19 + columnOffset) + (6 + rowOffset).ToString(), GetColumn(21 + columnOffset) + (6 + rowOffset).ToString(), "У тому числі", generalCenter));
                    _RNPTableHeader.Add(new ComplexHeaderCell(GetColumn(19 + columnOffset) + (7 + rowOffset).ToString(), "", "Лекції", verticalCenter));
                    _RNPTableHeader.Add(new ComplexHeaderCell(GetColumn(20 + columnOffset) + (7 + rowOffset).ToString(), "", "Практичні", verticalCenter));
                    _RNPTableHeader.Add(new ComplexHeaderCell(GetColumn(21 + columnOffset) + (7 + rowOffset).ToString(), "", "Лабораторні", verticalCenter));

                    for (int i = 1; i < 22; i++)
                    {
                        _RNPTableHeader.Add(new ComplexHeaderCell(GetCellWithOffset(i, 8, columnOffset, rowOffset), "", i.ToString(), generalCenter));
                    }
                }

                return(_RNPTableHeader);
            }
コード例 #11
0
            public static ComplexHeader RNPHeader(int columnOffset, int rowOffset, int startYear, string napryam, string discipline, string okr, string cafedra, string faculty, string studyForm, string studyTerm, string qualification)
            {
                if (_RNPHeader == null)
                {
                    _RNPHeader = new ComplexHeader();

                    Style titleCenter = new Style()
                    {
                        Aligment = new Aligment()
                        {
                            VerticalAligment = VerticalAligment.Center, HorizontalAligment = HorizontalAligment.Center
                        }, FontSize = 20
                    };
                    titleCenter.TextStyle.Add(TextStyleType.Bold);
                    Style subTitleCenter = new Style()
                    {
                        Aligment = new Aligment()
                        {
                            VerticalAligment = VerticalAligment.Center, HorizontalAligment = HorizontalAligment.Center
                        }, FontSize = 16
                    };
                    subTitleCenter.TextStyle.Add(TextStyleType.Bold);
                    Style left = new Style()
                    {
                        Aligment = new Aligment()
                        {
                            VerticalAligment = VerticalAligment.Center, HorizontalAligment = HorizontalAligment.Left
                        }, FontSize = 11
                    };

                    Style leftItalicUnderLine = new Style()
                    {
                        Aligment = new Aligment()
                        {
                            VerticalAligment = VerticalAligment.Center, HorizontalAligment = HorizontalAligment.Left
                        }, FontSize = 11
                    };
                    leftItalicUnderLine.TextStyle.Add(TextStyleType.Italic);
                    leftItalicUnderLine.TextStyle.Add(TextStyleType.Underline);
                    _RNPHeader.Add(new ComplexHeaderCell(GetCellWithOffset(1, 1, columnOffset, rowOffset), GetCellWithOffset(21, 1, columnOffset, rowOffset), "Робочий навчальний план", titleCenter));
                    _RNPHeader.Add(new ComplexHeaderCell(GetCellWithOffset(1, 2, columnOffset, rowOffset), GetCellWithOffset(21, 2, columnOffset, rowOffset), string.Format("на {0}/{1} навчальний рік", startYear, (startYear + 1)), subTitleCenter));
                    _RNPHeader.Add(new ComplexHeaderCell(GetCellWithOffset(4, 3, columnOffset, rowOffset), GetCellWithOffset(7, 3, columnOffset, rowOffset), "Напрям підготовки (код і назва)", left));
                    _RNPHeader.Add(new ComplexHeaderCell(GetCellWithOffset(8, 3, columnOffset, rowOffset), GetCellWithOffset(13, 3, columnOffset, rowOffset), napryam, leftItalicUnderLine));
                    _RNPHeader.Add(new ComplexHeaderCell(GetCellWithOffset(4, 4, columnOffset, rowOffset), GetCellWithOffset(7, 4, columnOffset, rowOffset), "Програма професійного спрямування", left));
                    _RNPHeader.Add(new ComplexHeaderCell(GetCellWithOffset(8, 4, columnOffset, rowOffset), GetCellWithOffset(13, 4, columnOffset, rowOffset), discipline, leftItalicUnderLine));
                    _RNPHeader.Add(new ComplexHeaderCell(GetCellWithOffset(4, 5, columnOffset, rowOffset), GetCellWithOffset(7, 5, columnOffset, rowOffset), "Освітньо-кваліфікаційний рівень", left));
                    _RNPHeader.Add(new ComplexHeaderCell(GetCellWithOffset(8, 5, columnOffset, rowOffset), GetCellWithOffset(13, 5, columnOffset, rowOffset), okr, leftItalicUnderLine));
                    _RNPHeader.Add(new ComplexHeaderCell(GetCellWithOffset(4, 6, columnOffset, rowOffset), GetCellWithOffset(7, 6, columnOffset, rowOffset), "Випускова кафедра", left));
                    _RNPHeader.Add(new ComplexHeaderCell(GetCellWithOffset(8, 6, columnOffset, rowOffset), GetCellWithOffset(13, 6, columnOffset, rowOffset), cafedra, leftItalicUnderLine));
                    _RNPHeader.Add(new ComplexHeaderCell(GetCellWithOffset(14, 3, columnOffset, rowOffset), GetCellWithOffset(16, 3, columnOffset, rowOffset), "Факультет(інститут)", left));
                    _RNPHeader.Add(new ComplexHeaderCell(GetCellWithOffset(17, 3, columnOffset, rowOffset), GetCellWithOffset(21, 3, columnOffset, rowOffset), faculty, leftItalicUnderLine));
                    _RNPHeader.Add(new ComplexHeaderCell(GetCellWithOffset(14, 4, columnOffset, rowOffset), GetCellWithOffset(16, 4, columnOffset, rowOffset), "Форма навчання", left));
                    _RNPHeader.Add(new ComplexHeaderCell(GetCellWithOffset(17, 4, columnOffset, rowOffset), GetCellWithOffset(21, 4, columnOffset, rowOffset), studyForm, leftItalicUnderLine));
                    _RNPHeader.Add(new ComplexHeaderCell(GetCellWithOffset(14, 5, columnOffset, rowOffset), GetCellWithOffset(16, 5, columnOffset, rowOffset), "Термін навчання", left));
                    _RNPHeader.Add(new ComplexHeaderCell(GetCellWithOffset(17, 5, columnOffset, rowOffset), GetCellWithOffset(21, 5, columnOffset, rowOffset), studyTerm, leftItalicUnderLine));
                    _RNPHeader.Add(new ComplexHeaderCell(GetCellWithOffset(14, 6, columnOffset, rowOffset), GetCellWithOffset(16, 6, columnOffset, rowOffset), "Кваліфікація", left));
                    _RNPHeader.Add(new ComplexHeaderCell(GetCellWithOffset(17, 6, columnOffset, rowOffset), GetCellWithOffset(21, 6, columnOffset, rowOffset), qualification, leftItalicUnderLine));

                    //_RNPHeader.Add(new ComplexHeaderCell(Column(2 + columnOffset) + (1 + rowOffset).ToString(), Column(2 + columnOffset) + (7 + rowOffset).ToString(), "Назва кафедри", generalCenter));
                }

                return(_RNPHeader);
            }
コード例 #12
0
 internal static string GetHeaderParameter(ComplexHeader header, string parameterName, InboundConversionOptions options)
 {
     return(MimeHelpers.GetHeaderParameter(header, parameterName, options.Limits.MaxMimeTextHeaderLength));
 }