private GlobalParameters GetGlobalParameters(OpenXmlElement XML) { GlobalParameters globalParameters = new GlobalParameters(true); foreach (var parameter in XML) { if (parameter.LocalName == NameInXML.PageMargin) { var attributes = parameter.GetAttributes(); var top = attributes.First(a => a.LocalName == "top").Value.ToString(); globalParameters.AddParameter(NameForUsers.MarginTop, top, ValueManager.ValueTypes.Sm); var bottom = attributes.First(a => a.LocalName == "bottom").Value.ToString(); globalParameters.AddParameter(NameForUsers.MarginBottom, bottom, ValueManager.ValueTypes.Sm); var left = attributes.First(a => a.LocalName == "left").Value.ToString(); globalParameters.AddParameter(NameForUsers.MarginLeft, left, ValueManager.ValueTypes.Sm); var right = attributes.First(a => a.LocalName == "right").Value.ToString(); globalParameters.AddParameter(NameForUsers.MarginRight, right, ValueManager.ValueTypes.Sm); } } return(globalParameters); }
public CourseWork() { GlobalParameters = new GlobalParameters(false); GlobalParameters.AddParameter(NameForUsers.MarginTop, "2", ValueManager.ValueTypes.Sm); GlobalParameters.AddParameter(NameForUsers.MarginBottom, "2", ValueManager.ValueTypes.Sm); GlobalParameters.AddParameter(NameForUsers.MarginLeft, "3", ValueManager.ValueTypes.Sm); GlobalParameters.AddParameter(NameForUsers.MarginRight, "1,5", ValueManager.ValueTypes.Sm); TextParameters = new TextParameters(false); TextParameters.AddParameter(NameForUsers.FontFamily, "Times New Roman", ValueManager.ValueTypes.FontFamily); TextParameters.AddParameter(NameForUsers.FontSize, "14", ValueManager.ValueTypes.Pt); }