Ver código fonte

Changed string.Empty to ""

Kenric Nugteren 2 anos atrás
pai
commit
f4e1f35de3

+ 1 - 1
InABox.Client.RPC/Transports/Socket/RPCClientSocketTransport.cs

@@ -135,7 +135,7 @@ namespace InABox.Rpc
                 {
                     openEvent.Wait(ct);
                 }
-                catch (TaskCanceledException)
+                catch (OperationCanceledException)
                 {
                     client.Dispose();
                     return null;

+ 1 - 1
InABox.Core/Classes/Document/Document.cs

@@ -29,7 +29,7 @@ namespace InABox.Core
         [NullEditor]
         public string AsBase64
         {
-            get => Data == null ? string.Empty : Convert.ToBase64String(Data);
+            get => Data == null ? "" : Convert.ToBase64String(Data);
             set => Data = Convert.FromBase64String(value);
         }*/
 

+ 2 - 2
InABox.Core/CoreAttribute.cs

@@ -5,9 +5,9 @@ namespace InABox.Core
     [Caption("Attributes")]
     public class CoreAttribute : BaseObject, ISequenceable, IPackable
     {
-        public string Name { get; set; } = string.Empty;
+        public string Name { get; set; } = "";
 
-        public string Value { get; set; } = string.Empty;
+        public string Value { get; set; } = "";
 
         public void Pack(BinaryWriter writer)
         {

+ 3 - 3
InABox.Core/CoreUtils.cs

@@ -604,7 +604,7 @@ namespace InABox.Core
         public static string RandomHexString(int length)
         {
             var rdm = new Random((int)DateTime.Now.Ticks);
-            var hexValue = string.Empty;
+            var hexValue = "";
             int num;
             for (var i = 0; i < length; i++)
             {
@@ -626,7 +626,7 @@ namespace InABox.Core
             try
             {
                 if (!TryFindMemberExpression(exp.Body, out var memberExp))
-                    return string.Empty;
+                    return "";
 
                 return GetFullPropertyName(memberExp, separator);
             }
@@ -1949,7 +1949,7 @@ namespace InABox.Core
             // type. 
             if (type.IsArray)
             {
-                var basename = type.FullName.Replace("[]", string.Empty);
+                var basename = type.FullName.Replace("[]", "");
 
                 var typeElement = Type.GetType(basename);
                 if (typeElement == null)

+ 1 - 1
InABox.Core/DigitalForms/Forms/DigitalFormLink.cs

@@ -14,7 +14,7 @@ namespace InABox.Core
 
         [EditorSequence(3)]
         [TextBoxEditor(Editable = Editable.Hidden)]
-        public string Description { get; set; } = string.Empty;
+        public string Description { get; set; } = "";
 
         [EditorSequence(4)]
         [TextBoxEditor(Editable = Editable.Hidden)]

+ 1 - 1
InABox.Core/DigitalForms/Forms/EntityForm.cs

@@ -32,7 +32,7 @@ namespace InABox.Core
         public String Number { get; set; }
 
         [EditorSequence(2)]
-        public string Description { get; set; } = string.Empty;
+        public string Description { get; set; } = "";
 
         [NullEditor]
         [EntityRelationship(DeleteAction.Cascade)]

+ 1 - 1
InABox.Core/DigitalForms/Layouts/Controls/DFLayoutHeader/DFLayoutHeader.cs

@@ -17,7 +17,7 @@ namespace InABox.Core
     {
         [TextBoxEditor]
         [EditorSequence(-1)]
-        public string Header { get; set; } = string.Empty;
+        public string Header { get; set; } = "";
 
         [CheckBoxEditor]
         [EditorSequence(0)]

+ 1 - 1
InABox.Core/DigitalForms/Layouts/Controls/DFLayoutLabel/DFLayoutLabel.cs

@@ -10,7 +10,7 @@ namespace InABox.Core
     {
         [EditorSequence(0)]
         [MemoEditor]
-        public string Caption { get; set; } = string.Empty;
+        public string Caption { get; set; } = "";
 
         [EditorSequence("Style", 0)]
         public DFLayoutTextStyle Style { get; set; }

+ 2 - 2
InABox.Core/DigitalForms/Layouts/Controls/DFLayoutLabel/DFLayoutTextStyle.cs

@@ -45,12 +45,12 @@ namespace InABox.Core
         [EditorSequence(4)]
         [Caption("Text Colour", IncludePath = false)]
         [ColorEditor]
-        public string Foreground { get; set; } = string.Empty;
+        public string Foreground { get; set; } = "";
 
         [EditorSequence(5)]
         [Caption("Background Colour", IncludePath = false)]
         [ColorEditor]
-        public string Background { get; set; } = string.Empty;
+        public string Background { get; set; } = "";
 
         [EditorSequence(6)]
         [Caption("Horz Alignment", IncludePath = false)]

+ 1 - 1
InABox.Core/Postable/PostableSettings.cs

@@ -11,7 +11,7 @@ namespace InABox.Core
     public class PostableSettings : BaseObject, IGlobalConfigurationSettings
     {
         [NullEditor]
-        public string PostableType { get; set; } = string.Empty;
+        public string PostableType { get; set; } = "";
 
         /// <summary>
         /// What kind of <see cref="IPoster{TEntity, TSettings}"/> is to be used, globally; this will be a type name.

+ 1 - 1
InABox.Core/Postable/PosterSettings.cs

@@ -19,7 +19,7 @@ namespace InABox.Core
         public bool ScriptEnabled { get; set; } = false;
 
         [ScriptEditor]
-        public string Script { get; set; } = string.Empty;
+        public string Script { get; set; } = "";
 
         public abstract string DefaultScript(Type TPostable);
         public string DefaultScript<TPostable>() where TPostable : Entity, IPostable

+ 1 - 1
InABox.Core/Script.cs

@@ -28,7 +28,7 @@ namespace InABox.Core
 
         [ScriptEditor]
         [EditorSequence(3)]
-        public string Code { get; set; } = string.Empty;
+        public string Code { get; set; } = "";
 
         private string NameSpace()
         {

+ 0 - 20
InABox.Core/Security/SecurityGroup.cs

@@ -14,26 +14,6 @@
         [EditorSequence(3)]
         public ImageDocumentLink Image { get; set; }
 
-        //[CheckListEditor(typeof(TokenLookups))]
-        //public PackableBooleanDictionary Tokens { get; set; }
-
-        //private class TokenLookups : LookupGenerator
-        //{
-        //    public TokenLookups() : base()
-        //    {               
-        //        foreach (var token in SecurityFactory.Descriptors)
-        //            this[String.Format("{0}: {1}", token.Section, token.Code)] = token.Description;
-        //    }
-        //}
-
-        protected override void Init()
-        {
-            base.Init();
-            //Tokens = new PackableBooleanDictionary();
-            //foreach (var token in SecurityFactory.Descriptors)
-            //    Tokens[String.Format("{0}: {1}",token.Section,token.Code)] = true;
-        }
-
         public override string ToString()
         {
             return string.Format("{0}: {1}", Code, Description);

+ 2 - 2
inabox.database.sqlite/SQLiteProvider.cs

@@ -1340,7 +1340,7 @@ namespace InABox.Database.SQLite
             if ((value is string) || (value is Enum) || (value is Guid))
                 return string.Format("\'" + "{0}" + "\'", value.ToString()?.Replace("\'", "\'\'"));
             if (value is string[])
-                return string.Format("hex({0})", BitConverter.ToString(Encoding.ASCII.GetBytes(value.ToString() ?? "")).Replace("-", string.Empty));
+                return string.Format("hex({0})", BitConverter.ToString(Encoding.ASCII.GetBytes(value.ToString() ?? "")).Replace("-", ""));
             if (value is IColumn col)
                 return $"[{col.Property}]";
             return value.ToString() ?? "";
@@ -1502,7 +1502,7 @@ namespace InABox.Database.SQLite
                                 if (filter.Expression.Type == typeof(string[]))
                                 {
                                     var bytes = Encoding.ASCII.GetBytes(value.ToString() ?? "");
-                                    value = BitConverter.ToString(bytes).Replace("-", string.Empty);
+                                    value = BitConverter.ToString(bytes).Replace("-", "");
                                     result = string.Format("(" + operators[filter.Operator] + ")", string.Format("hex({0})", prop), sParam);
                                 }
                                 else

+ 1 - 1
inabox.databaseproxy/Proxy.cs

@@ -158,7 +158,7 @@ namespace InABox.DatabaseProxy
                 return value;
 
             if (value is string)
-                return string.Empty;
+                return "";
 
             return Activator.CreateInstance(value.GetType());
         }

+ 2 - 2
inabox.wpf/DynamicGrid/DynamicTabControl.cs

@@ -216,10 +216,10 @@ namespace InABox.DynamicGrid
                     {
                         Header = "Rename Tab", Command = new ActionCommand(() =>
                         {
-                            String tabname = Header.ToString() ?? string.Empty;
+                            String tabname = Header.ToString() ?? "";
                             if (TextEdit.Execute("Rename Tab", ref tabname))
                             {
-                                var args = new DynamicTabItemRenamedEventArgs() { OldName = Header.ToString() ?? string.Empty, NewName = tabname };
+                                var args = new DynamicTabItemRenamedEventArgs() { OldName = Header.ToString() ?? "", NewName = tabname };
                                 OnTabRenamed?.Invoke(this, args);
                                 Header = args.NewName;
                                 var parent = Parent as DynamicTabControl;

+ 1 - 1
inabox.wpf/DynamicGrid/Editors/RichTextEditor/ExtendedRichTextEditor.cs

@@ -16,7 +16,7 @@ namespace InABox.DynamicGrid
         ///     Using as a backing store for Text dependency property to enable styling, animation etc.
         /// </summary>
         public static readonly DependencyProperty TextProperty = DependencyProperty.Register("Text", typeof(string), typeof(ExtendedRichTextEditor),
-            new PropertyMetadata(string.Empty, OnTextChanged));
+            new PropertyMetadata("", OnTextChanged));
 
         #endregion
 

+ 1 - 1
inabox.wpf/DynamicGrid/PDF/PDFEditorControl.xaml.cs

@@ -429,7 +429,7 @@ namespace InABox.DynamicGrid
             var gv = new GhostscriptVersionInfo(
                 new Version(0, 0, 0),
                 "gsdll64.dll",
-                string.Empty,
+                "",
                 GhostscriptLicense.GPL
             );
 

+ 6 - 6
inabox.wpf/Reports/ReportUtils.cs

@@ -498,7 +498,7 @@ namespace InABox.Wpf.Reports
         {
             var doc = new XmlDocument();
 
-            var root = doc.CreateElement(string.Empty, type.Name.ToLower() + "s", string.Empty);
+            var root = doc.CreateElement("", type.Name.ToLower() + "s", "");
             doc.AppendChild(root);
 
             //var properties = CoreUtils.PropertyList(type, x => true, true);
@@ -508,10 +508,10 @@ namespace InABox.Wpf.Reports
                 {
                     foreach (var datarow in table.Rows)
                     {
-                        var row = doc.CreateElement(string.Empty, type.Name.ToLower(), string.Empty);
+                        var row = doc.CreateElement("", type.Name.ToLower(), "");
                         foreach (var column in table.Columns)
                         {
-                            var field = doc.CreateElement(string.Empty, column.ColumnName.Replace('.', '_'), string.Empty);
+                            var field = doc.CreateElement("", column.ColumnName.Replace('.', '_'), "");
                             var oVal = datarow[column.ColumnName];
                             var value = doc.CreateTextNode(oVal != null ? oVal.ToString() : "");
                             field.AppendChild(value);
@@ -523,10 +523,10 @@ namespace InABox.Wpf.Reports
                 }
                 else
                 {
-                    var row = doc.CreateElement(string.Empty, type.Name.ToLower(), string.Empty);
+                    var row = doc.CreateElement("", type.Name.ToLower(), "");
                     foreach (var column in table.Columns)
                     {
-                        var field = doc.CreateElement(string.Empty, column.ColumnName.Replace('.', '_'), string.Empty);
+                        var field = doc.CreateElement("", column.ColumnName.Replace('.', '_'), "");
                         var value = doc.CreateTextNode("");
                         field.AppendChild(value);
                         row.AppendChild(field);
@@ -699,7 +699,7 @@ namespace InABox.Wpf.Reports
         //        GhostscriptVersionInfo gv = new GhostscriptVersionInfo(
         //            new Version(0, 0, 0),
         //            "gsdll32.dll",
-        //            string.Empty,
+        //            "",
         //            GhostscriptLicense.GPL
         //        );