public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            if (obj == this)
            {
                return(true);
            }

            return(obj is CatalogCustomAttributeDefinition other &&
                   ((Type == null && other.Type == null) || (Type?.Equals(other.Type) == true)) &&
                   ((Name == null && other.Name == null) || (Name?.Equals(other.Name) == true)) &&
                   ((Description == null && other.Description == null) || (Description?.Equals(other.Description) == true)) &&
                   ((SourceApplication == null && other.SourceApplication == null) || (SourceApplication?.Equals(other.SourceApplication) == true)) &&
                   ((AllowedObjectTypes == null && other.AllowedObjectTypes == null) || (AllowedObjectTypes?.Equals(other.AllowedObjectTypes) == true)) &&
                   ((SellerVisibility == null && other.SellerVisibility == null) || (SellerVisibility?.Equals(other.SellerVisibility) == true)) &&
                   ((AppVisibility == null && other.AppVisibility == null) || (AppVisibility?.Equals(other.AppVisibility) == true)) &&
                   ((StringConfig == null && other.StringConfig == null) || (StringConfig?.Equals(other.StringConfig) == true)) &&
                   ((NumberConfig == null && other.NumberConfig == null) || (NumberConfig?.Equals(other.NumberConfig) == true)) &&
                   ((SelectionConfig == null && other.SelectionConfig == null) || (SelectionConfig?.Equals(other.SelectionConfig) == true)) &&
                   ((CustomAttributeUsageCount == null && other.CustomAttributeUsageCount == null) || (CustomAttributeUsageCount?.Equals(other.CustomAttributeUsageCount) == true)) &&
                   ((Key == null && other.Key == null) || (Key?.Equals(other.Key) == true)));
        }
Exemple #2
0
        public void CreateNewDoc(String path, AppVisibility visibility)
        {
            //создаем обьект приложения word
            _application = new Word.Application();
            // создаем путь к файлу
            Object templatePathObj = path;

            // если вылетим на этом этапе, приложение останется открытым
            try
            {
                _document = _application.Documents.Add(ref templatePathObj, ref _missingObj, ref _missingObj, ref _missingObj);
            }
            catch (Exception error)
            {
                _document.Close(ref _falseObj, ref _missingObj, ref _missingObj);
                _application.Quit(ref _missingObj, ref _missingObj, ref _missingObj);
                _document    = null;
                _application = null;
                throw error;
            }
            if (visibility == AppVisibility.Visible)
            {
                // делаем word видимым
                _application.Visible = true;
            }
            else
            {
                _application.Visible = false;
            }
        }
 internal ExcelApplication()
 {
     _app = new MsExcel.Application();
     _app.IgnoreRemoteRequests = true;
     _app.DisplayAlerts        = false;
     _children      = new List <IWorkbook>();
     Visibility     = AppVisibility.Hidden;
     _disposedValue = false;
 }
Exemple #4
0
 public ReportThursday(AppVisibility visibility)
 {
     word = new WorkWithWord();
     if (File.Exists(cleanThursdayPath))
     {
         word.CreateNewDoc(cleanThursdayPath, visibility);
     }
     else
     {
         throw new FileLoadException("Шаблон не найден по адресу: " + cleanThursdayPath);
     }
 }
 protected void ToString(List <string> toStringOutput)
 {
     toStringOutput.Add($"Type = {(Type == null ? "null" : Type.ToString())}");
     toStringOutput.Add($"Name = {(Name == null ? "null" : Name == string.Empty ? "" : Name)}");
     toStringOutput.Add($"Description = {(Description == null ? "null" : Description == string.Empty ? "" : Description)}");
     toStringOutput.Add($"SourceApplication = {(SourceApplication == null ? "null" : SourceApplication.ToString())}");
     toStringOutput.Add($"AllowedObjectTypes = {(AllowedObjectTypes == null ? "null" : $"[{ string.Join(", ", AllowedObjectTypes)} ]")}");
     toStringOutput.Add($"SellerVisibility = {(SellerVisibility == null ? "null" : SellerVisibility.ToString())}");
     toStringOutput.Add($"AppVisibility = {(AppVisibility == null ? "null" : AppVisibility.ToString())}");
     toStringOutput.Add($"StringConfig = {(StringConfig == null ? "null" : StringConfig.ToString())}");
     toStringOutput.Add($"NumberConfig = {(NumberConfig == null ? "null" : NumberConfig.ToString())}");
     toStringOutput.Add($"SelectionConfig = {(SelectionConfig == null ? "null" : SelectionConfig.ToString())}");
     toStringOutput.Add($"CustomAttributeUsageCount = {(CustomAttributeUsageCount == null ? "null" : CustomAttributeUsageCount.ToString())}");
     toStringOutput.Add($"Key = {(Key == null ? "null" : Key == string.Empty ? "" : Key)}");
 }
Exemple #6
0
        public GraphicGenerator(AppVisibility visibility, DateTime date)
        {
            curentDate = date;
            String path = SelectTemplateMonth();

            word = new WorkWithWord();
            if (File.Exists(path))
            {
                word.CreateNewDoc(path, visibility);
            }
            else
            {
                throw new FileLoadException("Шаблон не найден по адресу: " + path);
            }
        }
        public override int GetHashCode()
        {
            int hashCode = 1892852076;

            if (Type != null)
            {
                hashCode += Type.GetHashCode();
            }

            if (Name != null)
            {
                hashCode += Name.GetHashCode();
            }

            if (Description != null)
            {
                hashCode += Description.GetHashCode();
            }

            if (SourceApplication != null)
            {
                hashCode += SourceApplication.GetHashCode();
            }

            if (AllowedObjectTypes != null)
            {
                hashCode += AllowedObjectTypes.GetHashCode();
            }

            if (SellerVisibility != null)
            {
                hashCode += SellerVisibility.GetHashCode();
            }

            if (AppVisibility != null)
            {
                hashCode += AppVisibility.GetHashCode();
            }

            if (StringConfig != null)
            {
                hashCode += StringConfig.GetHashCode();
            }

            if (NumberConfig != null)
            {
                hashCode += NumberConfig.GetHashCode();
            }

            if (SelectionConfig != null)
            {
                hashCode += SelectionConfig.GetHashCode();
            }

            if (CustomAttributeUsageCount != null)
            {
                hashCode += CustomAttributeUsageCount.GetHashCode();
            }

            if (Key != null)
            {
                hashCode += Key.GetHashCode();
            }

            return(hashCode);
        }