Exemple #1
0
 static int IsWellFormedUriString(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         string         arg0 = ToLua.CheckString(L, 1);
         System.UriKind arg1 = (System.UriKind)ToLua.CheckObject(L, 2, typeof(System.UriKind));
         bool           o    = System.Uri.IsWellFormedUriString(arg0, arg1);
         LuaDLL.lua_pushboolean(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemple #2
0
    static int _CreateSystem_Uri(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 1)
            {
                string     arg0 = ToLua.CheckString(L, 1);
                System.Uri obj  = new System.Uri(arg0);
                ToLua.PushObject(L, obj);
                return(1);
            }
            else if (count == 2 && TypeChecker.CheckTypes <string, System.UriKind>(L, 1))
            {
                string         arg0 = ToLua.ToString(L, 1);
                System.UriKind arg1 = (System.UriKind)ToLua.ToObject(L, 2);
                System.Uri     obj  = new System.Uri(arg0, arg1);
                ToLua.PushObject(L, obj);
                return(1);
            }
            else if (count == 2 && TypeChecker.CheckTypes <System.Uri, string>(L, 1))
            {
                System.Uri arg0 = (System.Uri)ToLua.ToObject(L, 1);
                string     arg1 = ToLua.ToString(L, 2);
                System.Uri obj  = new System.Uri(arg0, arg1);
                ToLua.PushObject(L, obj);
                return(1);
            }
            else if (count == 2 && TypeChecker.CheckTypes <System.Uri, System.Uri>(L, 1))
            {
                System.Uri arg0 = (System.Uri)ToLua.ToObject(L, 1);
                System.Uri arg1 = (System.Uri)ToLua.ToObject(L, 2);
                System.Uri obj  = new System.Uri(arg0, arg1);
                ToLua.PushObject(L, obj);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: System.Uri.New"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Exemple #3
0
    static int TryCreate(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 3 && TypeChecker.CheckTypes <string, System.UriKind, LuaInterface.LuaOut <System.Uri> >(L, 1))
            {
                string         arg0 = ToLua.ToString(L, 1);
                System.UriKind arg1 = (System.UriKind)ToLua.ToObject(L, 2);
                System.Uri     arg2 = null;
                bool           o    = System.Uri.TryCreate(arg0, arg1, out arg2);
                LuaDLL.lua_pushboolean(L, o);
                ToLua.PushObject(L, arg2);
                return(2);
            }
            else if (count == 3 && TypeChecker.CheckTypes <System.Uri, string, LuaInterface.LuaOut <System.Uri> >(L, 1))
            {
                System.Uri arg0 = (System.Uri)ToLua.ToObject(L, 1);
                string     arg1 = ToLua.ToString(L, 2);
                System.Uri arg2 = null;
                bool       o    = System.Uri.TryCreate(arg0, arg1, out arg2);
                LuaDLL.lua_pushboolean(L, o);
                ToLua.PushObject(L, arg2);
                return(2);
            }
            else if (count == 3 && TypeChecker.CheckTypes <System.Uri, System.Uri, LuaInterface.LuaOut <System.Uri> >(L, 1))
            {
                System.Uri arg0 = (System.Uri)ToLua.ToObject(L, 1);
                System.Uri arg1 = (System.Uri)ToLua.ToObject(L, 2);
                System.Uri arg2 = null;
                bool       o    = System.Uri.TryCreate(arg0, arg1, out arg2);
                LuaDLL.lua_pushboolean(L, o);
                ToLua.PushObject(L, arg2);
                return(2);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: System.Uri.TryCreate"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
        public Image ReadImg(string uri, System.UriKind u, bool openedalert, bool process)
        {
            Process = process;
            Uri     = uri;

            Image       i  = new Image();
            BitmapImage bi = new BitmapImage();

            if (openedalert)
            {
                bi.ImageOpened += new EventHandler <RoutedEventArgs>(bi_ImageOpened);
            }
            bi.CreateOptions = BitmapCreateOptions.None;
            bi.UriSource     = new Uri(uri, u);
            i.Source         = bi;

            return(i);
        }
Exemple #5
0
        public static TOption Uri <TOption>(this TOption option, System.UriKind kind = System.UriKind.Absolute, bool httpOnly = true)
            where TOption : Option
        {
            option.Argument.AddValidator(r =>
            {
                var value = r.GetValueOrDefault <string>();
                if (value is null)
                {
                    return($"{r.Symbol.Name} value is null");
                }
                if (!System.Uri.TryCreate(value, kind, out System.Uri? uri))
                {
                    return($"{r.Symbol.Name} value is not a valid URI");
                }
                if (httpOnly && ((uri.Scheme.ToLower() != "http") && (uri.Scheme.ToLower() != "https")))
                {
                    return($"{r.Symbol.Name} schema value is not valid");
                }
                return(null);
            });

            return(option);
        }
 /// <summary>
 /// Inserts a hyperlink to a webpage.
 /// </summary>
 /// <param name="URL">The target webpage URL.</param>
 public void InsertUrlHyperlink(string URL)
 {
     this.HasUri = true;
     this.HyperlinkUri = URL;
     this.HyperlinkUriKind = UriKind.Absolute;
     this.IsHyperlinkExternal = true;
 }
 /// <summary>
 /// Inserts a hyperlink to a place in the spreadsheet document.
 /// </summary>
 /// <param name="DefinedName">A defined name in the spreadsheet.</param>
 public void InsertInternalHyperlink(string DefinedName)
 {
     this.HasUri = true;
     this.HyperlinkUri = string.Format("#{0}", DefinedName);
     this.HyperlinkUriKind = UriKind.Relative;
     this.IsHyperlinkExternal = false;
 }
 /// <summary>
 /// Inserts a hyperlink to a place in the spreadsheet document.
 /// </summary>
 /// <param name="SheetName">The name of the worksheet being referenced.</param>
 /// <param name="CellReference">The cell reference, such as "A1".</param>
 public void InsertInternalHyperlink(string SheetName, string CellReference)
 {
     this.HasUri = true;
     this.HyperlinkUri = string.Format("#{0}!{1}", SLTool.FormatWorksheetNameForFormula(SheetName), CellReference);
     this.HyperlinkUriKind = UriKind.Relative;
     this.IsHyperlinkExternal = false;
 }
        /// <summary>
        /// Inserts a hyperlink to a place in the spreadsheet document.
        /// </summary>
        /// <param name="SheetName">The name of the worksheet being referenced.</param>
        /// <param name="RowIndex">The row index of the referenced cell. If this is invalid, row 1 will be used.</param>
        /// <param name="ColumnIndex">The column index of the referenced cell. If this is invalid, column 1 will be used.</param>
        public void InsertInternalHyperlink(string SheetName, int RowIndex, int ColumnIndex)
        {
            int iRowIndex = RowIndex;
            int iColumnIndex = ColumnIndex;
            if (iRowIndex < 1 || iRowIndex > SLConstants.RowLimit) iRowIndex = 1;
            if (iColumnIndex < 1 || iColumnIndex > SLConstants.ColumnLimit) iColumnIndex = 1;

            this.HasUri = true;
            this.HyperlinkUri = string.Format("#{0}!{1}", SLTool.FormatWorksheetNameForFormula(SheetName), SLTool.ToCellReference(iRowIndex, iColumnIndex));
            this.HyperlinkUriKind = UriKind.Relative;
            this.IsHyperlinkExternal = false;
        }
 /// <summary>
 /// Inserts a hyperlink to a document on the computer.
 /// </summary>
 /// <param name="FilePath">The relative path to the file based on the location of the spreadsheet.</param>
 public void InsertFileHyperlink(string FilePath)
 {
     this.HasUri = true;
     this.HyperlinkUri = FilePath;
     this.HyperlinkUriKind = UriKind.Relative;
     this.IsHyperlinkExternal = true;
 }
 /// <summary>
 /// Inserts a hyperlink to an email address.
 /// </summary>
 /// <param name="EmailAddress">The email address, such as [email protected]</param>
 public void InsertEmailHyperlink(string EmailAddress)
 {
     this.HasUri = true;
     this.HyperlinkUri = string.Format("mailto:{0}", EmailAddress);
     this.HyperlinkUriKind = UriKind.Absolute;
     this.IsHyperlinkExternal = true;
 }
        private void InitialisePicture()
        {
            // should be true once we get *everyone* to stop using those confoundedly
            // hard to understand EMUs and absolute positionings...
            UseEasyPositioning = false;
            TopPosition = 0;
            LeftPosition = 0;

            UseRelativePositioning = true;
            AnchorRowIndex = 1;
            AnchorColumnIndex = 1;
            OffsetX = 0;
            OffsetY = 0;
            WidthInEMU = 0;
            HeightInEMU = 0;
            WidthInPixels = 0;
            HeightInPixels = 0;
            fHorizontalResolutionRatio = 1;
            fVerticalResolutionRatio = 1;

            this.bLockWithSheet = true;
            this.bPrintWithSheet = true;
            this.vCompressionState = A.BlipCompressionValues.Print;
            this.decBrightness = 0;
            this.decContrast = 0;
            //this.decRotationAngle = 0;

            this.ShapeProperties = new SLShapeProperties(new List<System.Drawing.Color>());

            this.HasUri = false;
            this.HyperlinkUri = string.Empty;
            this.HyperlinkUriKind = UriKind.Absolute;
            this.IsHyperlinkExternal = true;

            this.DataIsInFile = true;
            this.PictureFileName = string.Empty;
            this.PictureByteData = new byte[1];
            this.PictureImagePartType = ImagePartType.Bmp;
        }
Exemple #13
0
 public static System.Uri TryCreateSourceUri(string source, System.UriKind kind)
 {
     throw null;
 }
Exemple #14
0
 public static System.Uri CreateSourceUri(string source, System.UriKind kind = System.UriKind.Absolute)
 {
     throw null;
 }
Exemple #15
0
        private void InitialisePicture()
        {
            // should be true once we get *everyone* to stop using those confoundedly
            // hard to understand EMUs and absolute positionings...
            UseEasyPositioning = false;
            TopPosition = 0;
            LeftPosition = 0;

            UseRelativePositioning = true;
            AnchorRowIndex = 1;
            AnchorColumnIndex = 1;
            OffsetX = 0;
            OffsetY = 0;
            WidthInEMU = 0;
            HeightInEMU = 0;
            WidthInPixels = 0;
            HeightInPixels = 0;
            fHorizontalResolutionRatio = 1;
            fVerticalResolutionRatio = 1;

            this.bLockWithSheet = true;
            this.bPrintWithSheet = true;
            this.vCompressionState = A.BlipCompressionValues.Print;
            this.decBrightness = 0;
            this.decContrast = 0;
            //this.decRotationAngle = 0;

            this.vPictureShape = A.ShapeTypeValues.Rectangle;

            this.FillType = SLPictureFillType.None;
            this.FillClassInnerXml = string.Empty;

            this.HasOutline = false;
            this.PictureOutline = new A.Outline();
            this.HasOutlineFill = false;
            this.PictureOutlineFill = new A.SolidFill();

            this.HasGlow = false;
            this.GlowRadius = 0;
            this.GlowColorInnerXml = string.Empty;

            this.HasInnerShadow = false;
            this.PictureInnerShadow = new A.InnerShadow();
            this.HasOuterShadow = false;
            this.PictureOuterShadow = new A.OuterShadow();

            this.HasReflection = false;
            this.ReflectionBlurRadius = 0;
            this.ReflectionStartOpacity = 100000;
            this.ReflectionStartPosition = 0;
            this.ReflectionEndAlpha = 0;
            this.ReflectionEndPosition = 100000;
            this.ReflectionDistance = 0;
            this.ReflectionDirection = 0;
            this.ReflectionFadeDirection = 5400000;
            this.ReflectionHorizontalRatio = 100000;
            this.ReflectionVerticalRatio = 100000;
            this.ReflectionHorizontalSkew = 0;
            this.ReflectionVerticalSkew = 0;
            this.ReflectionAlignment = A.RectangleAlignmentValues.Bottom;
            this.ReflectionRotateWithShape = true;

            this.HasSoftEdge = false;
            this.SoftEdgeRadius = 0;

            this.HasScene3D = false;

            this.CameraLatitude = 0;
            this.CameraLongitude = 0;
            this.CameraRevolution = 0;
            this.CameraPreset = A.PresetCameraValues.OrthographicFront;
            this.CameraFieldOfView = 0;
            this.CameraZoom = 0;

            this.LightRigLatitude = 0;
            this.LightRigLongitude = 0;
            this.LightRigRevolution = 0;
            this.LightRigType = A.LightRigValues.ThreePoints;
            this.LightRigDirection = A.LightRigDirectionValues.Top;

            //this.HasBackdrop = false;
            //this.BackdropAnchorX = 0;
            //this.BackdropAnchorY = 0;
            //this.BackdropAnchorZ = 0;
            //this.BackdropNormalDx = 0;
            //this.BackdropNormalDy = 0;
            //this.BackdropNormalDz = 0;
            //this.BackdropUpVectorDx = 0;
            //this.BackdropUpVectorDy = 0;
            //this.BackdropUpVectorDz = 0;

            this.HasBevelTop = false;
            this.BevelTopPreset = A.BevelPresetValues.Circle;
            this.BevelTopWidth = 76200;
            this.BevelTopHeight = 76200;

            this.HasBevelBottom = false;
            this.BevelBottomPreset = A.BevelPresetValues.Circle;
            this.BevelBottomWidth = 76200;
            this.BevelBottomHeight = 76200;

            this.HasExtrusion = false;
            this.ExtrusionHeight = 0;
            this.ExtrusionColorInnerXml = string.Empty;

            this.HasContour = false;
            this.ContourWidth = 0;
            this.ContourColorInnerXml = string.Empty;

            this.HasMaterialType = false;
            this.MaterialType = A.PresetMaterialTypeValues.WarmMatte;

            this.HasZDistance = false;
            this.ZDistance = 0;

            this.HasUri = false;
            this.HyperlinkUri = string.Empty;
            this.HyperlinkUriKind = UriKind.Absolute;
            this.IsHyperlinkExternal = true;

            this.DataIsInFile = true;
            this.PictureFileName = string.Empty;
            this.PictureByteData = new byte[1];
            this.PictureImagePartType = ImagePartType.Bmp;
        }