public SheetCopierViewHost(SheetCopierManager scopy)
 {
     this.scopy  = scopy ?? throw new ArgumentNullException(nameof(scopy));
     this.number = @"<N/A>";
     this.title  = "<Independent Views(no sheet) are itemized here>";
     SourceSheet = null;
     Type        = ViewHostType.Model;
     PrimaryCustomSheetParameter = null;
     /////userCreatedSheetCategory = null;
     DestinationSheet = null;
     childViews       = new ObservableCollection <SheetCopierView>();
 }
Exemple #2
0
 public SheetCopierSheet(string number, string title, SheetCopierManager scopy, ViewSheet sourceSheet)
 {
     this.scopy               = scopy ?? throw new ArgumentNullException(nameof(scopy));
     this.number              = number;
     this.title               = title;
     SourceSheet              = sourceSheet ?? throw new ArgumentNullException(nameof(sourceSheet));
     sheetCategory            = GetSheetCategory(SheetCopierConstants.SheetCategory);
     userCreatedSheetCategory = sheetCategory;
     DestinationSheet         = null;
     viewsOnSheet             = new ObservableCollection <SheetCopierViewOnSheet>();
     foreach (var id in sourceSheet.GetAllPlacedViews())
     {
         Element element = sourceSheet.Document.GetElement(id);
         var     v       = element as View;
         if (v == null)
         {
             continue;
         }
         viewsOnSheet.Add(new SheetCopierViewOnSheet(v.Name, v, scopy));
     }
     SheetCategories = new ObservableCollection <string>(scopy.SheetCategories.ToList());
 }
 public SheetCopierViewHost(string number, string title, SheetCopierManager scopy, ViewSheet sourceSheet)
 {
     this.scopy    = scopy ?? throw new ArgumentNullException(nameof(scopy));
     this.number   = number;
     this.title    = title;
     SourceSheet   = sourceSheet ?? throw new ArgumentNullException(nameof(sourceSheet));
     sheetCategory = GetSheetCategory(SheetCopierConstants.SheetCategory);
     PrimaryCustomSheetParameter   = GetSheetCategory(Settings.Default.CustomSheetParameterOne);
     SecondaryCustomSheetParameter = GetSheetCategory(Settings.Default.CustomSheetParameterTwo);
     TertiaryCustomSheetParameter  = GetSheetCategory(Settings.Default.CustomSheetParameterThree);
     DestinationSheet = null;
     Type             = ViewHostType.Sheet;
     childViews       = new ObservableCollection <SheetCopierView>();
     foreach (var id in sourceSheet.GetAllPlacedViews())
     {
         Element element = sourceSheet.Document.GetElement(id);
         var     v       = element as View;
         if (v == null)
         {
             continue;
         }
         childViews.Add(new SheetCopierView(v.Name, v, scopy));
     }
 }
        public SheetCopierView(string title, View view, SheetCopierManager scopy)
        {
            if (scopy == null)
            {
                throw new ArgumentNullException(nameof(scopy));
            }
            this.scopy = scopy;
            if (view == null)
            {
                throw new ArgumentNullException(nameof(view));
            }
            oldView       = view;
            oldId         = view.Id;
            originalTitle = title;
            SetDefualtCreationMode();
            newTitle =
                title + @"(" + (DateTime.Now.TimeOfDay.Ticks / 100000).ToString(CultureInfo.InvariantCulture) + @")";

            ////remove invalid chars before continuing
            newTitle               = string.Join("_", newTitle.Split(System.IO.Path.GetInvalidFileNameChars()));
            associatedLevelName    = SheetCopierConstants.MenuItemCopy;
            viewTemplateName       = SheetCopierConstants.MenuItemCopy;
            duplicateWithDetailing = true;
        }