Menu

Clipboard

Vladimir
2018-05-08
2018-11-13
  • Vladimir

    Vladimir - 2018-05-08
     
  • Vladimir

    Vladimir - 2018-05-08

    using System.Collections.Generic;
    using System.Collections.ObjectModel;
    using System.Windows;
    using PMCPortfolio.ClientWorkspace.ComponentConfiguration.Hierarchies.ViewModel;

    namespace PMCPortfolio.ClientWorkspace.ComponentConfiguration.Hierarchies.Helpers
    {
    public static class MapRulesListViewHelper
    {
    public static readonly DependencyProperty MapRulesListProperty = DependencyProperty.RegisterAttached(
    "MapRulesList",
    typeof(ObservableCollection<rulemappingviewmodel>),
    typeof(MapRulesListViewHelper),
    new PropertyMetadata(null));</rulemappingviewmodel>

        public static ObservableCollection<RuleMappingViewModel> GetMapRulesList(FrameworkElement control)
        {
            return (ObservableCollection<RuleMappingViewModel>)control.GetValue(MapRulesListProperty);
        }
    
        public static void SetMapRulesList(FrameworkElement control, ObservableCollection<RuleMappingViewModel> value)
        {
            control.SetValue(MapRulesListProperty, value);
        }
    }
    

    }

     

    Last edit: Vladimir 2018-07-28
  • Vladimir

    Vladimir - 2018-07-28
    class DataComparer1 : IEqualityComparer<Data>
    {
        public bool Equals(Data x, Data y)
        {
            // Check whether the compared objects reference the same data. 
            if (ReferenceEquals(x, y)) return true;
    
            // Check whether any of the compared objects is null. 
            if (ReferenceEquals(x, null) || ReferenceEquals(y, null))
                return false;
    
            // Check whether the properties are equal
            return x.IsChecked == y.IsChecked && x.Priority == y.Priority && x.Name == y.Name;            
        }
    
        // If Equals() returns true for a pair of objects, 
        // GetHashCode must return the same value for these objects. 
        public int GetHashCode(Data record)
        {
            if (ReferenceEquals(record, null)) return 0;
    
            int hashName = record.Name == null ? 0 : record.Name.GetHashCode();
    
            int hashPriority = record.Priority.GetHashCode();
    
            int hashIsChecked = record.IsChecked.GetHashCode();
    
            return hashName ^ hashPriority ^ hashIsChecked;
        }
    }
    
     

    Last edit: Vladimir 2018-08-12
  • Vladimir

    Vladimir - 2018-08-21
     

    Last edit: Vladimir 2018-08-21
  • Vladimir

    Vladimir - 2018-08-30

    kJ4VMryQ:ALx86#rw:+6#2]w+j:ELS]AC5]:X42dk5[V:RRWko2+6

     
  • Vladimir

    Vladimir - 2018-08-30

    searchExp=%7B%22PolicyCd%22:%22RO_AMS_BSA%22%7D&page=1&results=100
    searchExp={"PolicyCd":"RO_AMS_BSA"}&page=1&results=100

     

    Last edit: Vladimir 2018-08-31
  • Vladimir

    Vladimir - 2018-10-29

    I unsuccessfully jumped from 3 meters onto the asphalt and broke my leg a little. Nothing particularly serious, but I was told that so far it is better not to load the leg.
    Therefore, in the next 2 weeks I will need to work from home.

     
  • Vladimir

    Vladimir - 2018-11-02
        /// <summary>
        /// SheetDataList have the next format:
        /// SheetDataList: List of SheetData
        /// SheetData: Sheet Name; List of Rows
        /// Row: List of Cells
        /// Cell: string value 
        /// </summary>
        /// <param name="fileName"></param>
        /// <param name="sheetDataList"></param>
        public static void WriteDataIntoXlsxFileAsync(string fileName, List<Tuple<string, List<List<string>>>> sheetDataList)
        {
            SpreadsheetDocument ssDoc = SpreadsheetDocument.Create(fileName, SpreadsheetDocumentType.Workbook);
            WorkbookPart workbookPart = ssDoc.AddWorkbookPart();
            workbookPart.Workbook = new Workbook();
            Sheets sheets = ssDoc.WorkbookPart.Workbook.AppendChild(new Sheets());
    
            uint sheetId = 0;
            foreach (var inputSheetData in sheetDataList)
            {
                sheetId++;
                WorksheetPart worksheetPart = workbookPart.AddNewPart<WorksheetPart>();
                Worksheet workSheet = new Worksheet();
                SheetData sheetData = new SheetData();
    
                foreach (var rowData in inputSheetData.Item2)
                {
                    Row row = new Row();
    
                    foreach (var cellData in rowData)
                    {
                        row.WriteCell(cellData);
                    }
    
                    sheetData.Append(row);
                }
    
                workSheet.AppendChild(sheetData);
                worksheetPart.Worksheet = workSheet;
    
                Sheet sheet = new Sheet
                {
                    Id = ssDoc.WorkbookPart.GetIdOfPart(worksheetPart),
                    SheetId = sheetId,
                    Name = inputSheetData.Item1
                };
    
                sheets.Append(sheet);
            }
    
            ssDoc.Close();
        }
    
     
  • Vladimir

    Vladimir - 2018-11-02
        public static void WriteCell(this Row row, string data)
        {
            var cell = new Cell
            {
                DataType = new EnumValue<CellValues>(CellValues.String),
                CellValue = new CellValue(data)
            };
    
            row.Append(cell);
        }
    
     
  • Vladimir

    Vladimir - 2018-11-02
        public static void WriteCell(this Row row, string data)
        {
            var cell = new Cell
            {
                DataType = new EnumValue<CellValues>(CellValues.String),
                CellValue = new CellValue(data)
            };
    
            row.Append(cell);
        }
    
     
  • Vladimir

    Vladimir - 2018-11-08
        <ControlTemplate x:Key="ce">
            <Grid Width="15" Height="15" VerticalAlignment="Center" HorizontalAlignment="Center">
                <Border Background="#7F2C2C2C" CornerRadius="64" VerticalAlignment="Center" HorizontalAlignment="Center" Width="13" Height="13"/>
                <Border Background="#FFFFFFFF" CornerRadius="64" VerticalAlignment="Center" HorizontalAlignment="Center" Width="11" Height="11"/>
                <Border Background="#FF222222" CornerRadius="64" VerticalAlignment="Center" HorizontalAlignment="Center" Width="7" Height="7" x:Name="checkedBorder" Visibility="Collapsed"/>
            </Grid>
            <ControlTemplate.Triggers>
                <DataTrigger Binding="{Binding Value}" Value="True">
                    <Setter Property="Visibility" Value="Visible" TargetName="checkedBorder"/>
                </DataTrigger>
    
            </ControlTemplate.Triggers>
        </ControlTemplate>
    
     
  • Vladimir

    Vladimir - 2018-11-13
     

Log in to post a comment.

MongoDB Logo MongoDB