Esempio n. 1
0
 public RtfDocument(PaperSize paper, PaperOrientation orientation, CultureInfo cultureInfo)
 {
     _paper       = paper;
     _orientation = orientation;
     _margins     = new Margins();
     if (_orientation == PaperOrientation.Portrait)
     {
         _margins[Direction.Top]    = DefaultValue.MarginSmall;
         _margins[Direction.Right]  = DefaultValue.MarginLarge;
         _margins[Direction.Bottom] = DefaultValue.MarginSmall;
         _margins[Direction.Left]   = DefaultValue.MarginLarge;
     }
     else     // landscape
     {
         _margins[Direction.Top]    = DefaultValue.MarginLarge;
         _margins[Direction.Right]  = DefaultValue.MarginSmall;
         _margins[Direction.Bottom] = DefaultValue.MarginLarge;
         _margins[Direction.Left]   = DefaultValue.MarginSmall;
     }
     _lcid            = (Lcid)cultureInfo.LCID;
     ReadingDirection = cultureInfo.TextInfo.IsRightToLeft
         ? ReadingDirection.RightToLeft
         : ReadingDirection.LeftToRight;
     _fontTable = new List <string>();
     _fontTable.Add(DefaultValue.Font);          // default font
     _colorTable = new List <RtfColor>();
     _colorTable.Add(new RtfColor());            // default color
     _header = null;
     _footer = null;
 }
Esempio n. 2
0
 public RtfDocument(PaperSize paper, PaperOrientation orientation, Lcid lcid)
 {
     _paper       = paper;
     _orientation = orientation;
     _margins     = new Margins();
     if (_orientation == PaperOrientation.Portrait)
     {
         _margins[Direction.Top]    = DefaultValue.MarginSmall;
         _margins[Direction.Right]  = DefaultValue.MarginLarge;
         _margins[Direction.Bottom] = DefaultValue.MarginSmall;
         _margins[Direction.Left]   = DefaultValue.MarginLarge;
     }
     else                 // landscape
     {
         _margins[Direction.Top]    = DefaultValue.MarginLarge;
         _margins[Direction.Right]  = DefaultValue.MarginSmall;
         _margins[Direction.Bottom] = DefaultValue.MarginLarge;
         _margins[Direction.Left]   = DefaultValue.MarginSmall;
     }
     _lcid      = lcid;
     _fontTable = new List <string>();
     _fontTable.Add(DefaultValue.Font);                          // default font
     _colorTable = new List <Color>();
     _colorTable.Add(new Color());                               // default color
     _header = null;
     _footer = null;
 }
Esempio n. 3
0
 public RtfDocument(PaperSize paper, PaperOrientation orientation, Lcid lcid)
 {
     _paper       = paper;
     _orientation = orientation;
     Margins      = new Margins();
     if (_orientation == PaperOrientation.Portrait)
     {
         Margins[Direction.Top]    = DefaultValue.MarginSmall;
         Margins[Direction.Right]  = DefaultValue.MarginLarge;
         Margins[Direction.Bottom] = DefaultValue.MarginSmall;
         Margins[Direction.Left]   = DefaultValue.MarginLarge;
     }
     else
     {
         // landscape
         Margins[Direction.Top]    = DefaultValue.MarginLarge;
         Margins[Direction.Right]  = DefaultValue.MarginSmall;
         Margins[Direction.Bottom] = DefaultValue.MarginLarge;
         Margins[Direction.Left]   = DefaultValue.MarginSmall;
     }
     _lcid      = lcid;
     _fontTable = new List <string>
     {
         DefaultValue.Font // default font
     };
     _colorTable = new List <RtfColor>
     {
         new RtfColor() // default color
     };
     _header = null;
     _footer = null;
 }
Esempio n. 4
0
		public RtfDocument(PaperSize paper, PaperOrientation orientation, Lcid lcid)
		{
			_paper = paper;
			_orientation = orientation;
			_margins = new Margins();
			if (_orientation == PaperOrientation.Portrait) {
				_margins[Direction.Top] = DefaultValue.MarginSmall;
				_margins[Direction.Right] = DefaultValue.MarginLarge;
				_margins[Direction.Bottom] = DefaultValue.MarginSmall;
				_margins[Direction.Left] = DefaultValue.MarginLarge;
			} else { // landscape
				_margins[Direction.Top] = DefaultValue.MarginLarge;
				_margins[Direction.Right] = DefaultValue.MarginSmall;
				_margins[Direction.Bottom] = DefaultValue.MarginLarge;
				_margins[Direction.Left] = DefaultValue.MarginSmall;
			}
			_lcid = lcid;
			_fontTable = new List<string>();
			_fontTable.Add(DefaultValue.Font);		// default font
			_colorTable = new List<Color>();
			_colorTable.Add(new Color());			// default color
			_header = null;
			_footer = null;
		}
Esempio n. 5
0
 public RtfDocument(PaperSize paper, PaperOrientation orientation, Lcid lcid)
     : this(paper, orientation, CultureInfo.GetCultureInfo(((int)lcid)))
 {
 }
Esempio n. 6
0
 public static TermCollection GetAllTerms(this CSOMOperation operation, string termSetName, Lcid lcid,
                                          params Expression <Func <Term, object> >[] keysToLoad)
 {
     return(operation.GetAllTerms(termSetName, (uint)lcid, keysToLoad));
 }
Esempio n. 7
0
 public static WebTemplateCollection GetWebTemplates(this CSOMOperation operation, Lcid lcid,
                                                     bool overrideCompatibilityLevel = false, Action <ClientContext, WebTemplateCollection> templatesLoader = null)
 {
     return(GetWebTemplates(operation, (uint)lcid, overrideCompatibilityLevel, templatesLoader));
 }
Esempio n. 8
0
        public List <ActionObjectPath> GetRequest(IIdProvider idProvider)
        {
            int createSiteId = idProvider.GetActionId();

            IdentityPath = idProvider.GetActionId();
            QueryIdPath  = idProvider.GetActionId();

            #region XML Payload generated

            /*
             * <Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName="pnp core sdk"
             *  xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009">
             *  <Actions>
             *      <Query Id="3" ObjectPathId="1">
             *          <Query SelectAllProperties="false">
             *              <Properties>
             *                  <Property Name="PollingInterval" ScalarProperty="true" />
             *                  <Property Name="IsComplete" ScalarProperty="true" />
             *              </Properties>
             *          </Query>
             *      </Query>
             *  </Actions>
             *  <ObjectPaths>
             *      <Constructor Id="2" TypeId="{268004ae-ef6b-4e9b-8425-127220d84719}" />
             *      <Method Id="1" ParentId="2" Name="CreateSite">
             *          <Parameters>
             *              <Parameter TypeId="{11f84fff-b8cf-47b6-8b50-34e692656606}">
             *                  <Property Name="CompatibilityLevel" Type="Int32">0</Property>
             *                  <Property Name="Lcid" Type="Int32">1033</Property>
             *                  <Property Name="Owner" Type="String">[email protected]</Property>
             *                  <Property Name="StorageMaximumLevel" Type="Int64">27487790694400</Property>
             *                  <Property Name="StorageWarningLevel" Type="Int64">27487790694400</Property>
             *                  <Property Name="Template" Type="String">STS#0</Property>
             *                  <Property Name="TimeZoneId" Type="Int32">3</Property>
             *                  <Property Name="Title" Type="String">PnP Core SDK Test</Property>
             *                  <Property Name="Url" Type="String">https://bertonline.sharepoint.com/sites/pnpcoresdktestclassicsitef03a62586d3e41658f8ad2ceb7e53acf</Property>
             *                  <Property Name="UserCodeMaximumLevel" Type="Double">0</Property>
             *                  <Property Name="UserCodeWarningLevel" Type="Double">0</Property>
             *              </Parameter>
             *          </Parameters>
             *      </Method>
             *  </ObjectPaths>
             * </Request>
             */
            #endregion

            List <ActionObjectPath> actions      = new List <ActionObjectPath>();
            ActionObjectPath        spoOperation = new ActionObjectPath()
            {
                Action = new QueryAction()
                {
                    Id           = QueryIdPath,
                    ObjectPathId = createSiteId.ToString(),
                    SelectQuery  = new SelectQuery()
                    {
                        SelectAllProperties = false,
                        Properties          = new List <Property>()
                        {
                            new Property()
                            {
                                Name = "PollingInterval"
                            },
                            new Property()
                            {
                                Name = "IsComplete"
                            },
                        }
                    }
                }
            };

            ActionObjectPath createSiteAction = new ActionObjectPath()
            {
                ObjectPath = new ObjectPathMethod()
                {
                    Id         = createSiteId,
                    ParentId   = IdentityPath,
                    Name       = "CreateSite",
                    Parameters = new MethodParameter()
                    {
                        Properties = new List <Parameter>()
                        {
                            new Parameter()
                            {
                                TypeId = "11f84fff-b8cf-47b6-8b50-34e692656606",
                                Value  = new List <NamedProperty>()
                                {
                                    new NamedProperty()
                                    {
                                        Name  = "CompatibilityLevel",
                                        Type  = "Int32",
                                        Value = "0"
                                    },
                                    new NamedProperty()
                                    {
                                        Name  = "Lcid",
                                        Type  = "Int32",
                                        Value = Lcid.ToString()
                                    },
                                    new NamedProperty()
                                    {
                                        Name  = "Owner",
                                        Type  = "String",
                                        Value = Owner
                                    },
                                    new NamedProperty()
                                    {
                                        Name  = "StorageMaximumLevel",
                                        Type  = "Int64",
                                        Value = "27487790694400"
                                    },
                                    new NamedProperty()
                                    {
                                        Name  = "StorageWarningLevel",
                                        Type  = "Int64",
                                        Value = "27487790694400"
                                    },
                                    new NamedProperty()
                                    {
                                        Name  = "Template",
                                        Type  = "String",
                                        Value = WebTemplate
                                    },
                                    new NamedProperty()
                                    {
                                        Name  = "TimeZoneId",
                                        Type  = "Int32",
                                        Value = TimeZoneId.ToString()
                                    },
                                    new NamedProperty()
                                    {
                                        Name  = "Title",
                                        Type  = "String",
                                        Value = Title
                                    },
                                    new NamedProperty()
                                    {
                                        Name  = "Url",
                                        Type  = "String",
                                        Value = SiteUrl.AbsoluteUri.ToString()
                                    },
                                    new NamedProperty()
                                    {
                                        Name  = "UserCodeMaximumLevel",
                                        Type  = "Double",
                                        Value = "0"
                                    },
                                    new NamedProperty()
                                    {
                                        Name  = "UserCodeWarningLevel",
                                        Type  = "Double",
                                        Value = "0"
                                    },
                                }
                            }
                        }
                    }
                }
            };


            ActionObjectPath spoOperationCollection = new ActionObjectPath()
            {
                ObjectPath = new ConstructorPath
                {
                    Id     = IdentityPath,
                    TypeId = PnPAdminConstants.CsomTenantObject
                }
            };

            actions.Add(spoOperation);
            actions.Add(spoOperationCollection);
            actions.Add(createSiteAction);

            return(actions);
        }