コード例 #1
0
ファイル: ExportSlide.cs プロジェクト: AlexSneg/VIRD-1.0
        public void Export(string fileName, PresentationInfo presentationInfo,
            TechnicalServices.Persistence.SystemPersistence.Presentation.Slide[] slideToExport)
        {
            try
            {
                if (slideToExport == null || slideToExport.Length == 0) return;
                _continue = _exportSlideController.GetUserInterActive(slideToExport.Length == 1);

                // загружаем сцены
                TechnicalServices.Persistence.SystemPersistence.Presentation.Slide[] slideArr =
                    LoadSlides(presentationInfo, slideToExport);

                // формируем балк для выгрузки
                SlideBulk slideBulk = ComposeSlideBulk(presentationInfo, slideArr);
                // сохраняем на диск
                SaveToDisk(fileName, slideBulk);
                //_exportSlideController.SuccessMessage("Экспорт сцен успешно завершен");
            }
            catch (InterruptOperationException)
            {
                if (slideToExport.Length > 1)
                    _exportSlideController.ErrorMessage(string.Format("Экспорт сцен был прерван пользователем"));
            }
            catch (Exception ex)
            {
                _exportSlideController.ErrorMessage(string.Format("При экспорте сцен произошла неизвестная ошибка: {0}", ex));
            }
        }
コード例 #2
0
 public bool DeepEquals(DestinyRecordDefinition?other)
 {
     return(other is not null &&
            (DisplayProperties is not null ? DisplayProperties.DeepEquals(other.DisplayProperties) : other.DisplayProperties is null) &&
            Scope == other.Scope &&
            (PresentationInfo is not null ? PresentationInfo.DeepEquals(other.PresentationInfo) : other.PresentationInfo is null) &&
            LoreHash == other.LoreHash &&
            ObjectiveHashes.DeepEqualsListNaive(other.ObjectiveHashes) &&
            RecordValueStyle == other.RecordValueStyle &&
            ForTitleGilding == other.ForTitleGilding &&
            (TitleInfo is not null ? TitleInfo.DeepEquals(other.TitleInfo) : other.TitleInfo is null) &&
            (CompletionInfo is not null ? CompletionInfo.DeepEquals(other.CompletionInfo) : other.CompletionInfo is null) &&
            (StateInfo is not null ? StateInfo.DeepEquals(other.StateInfo) : other.StateInfo is null) &&
            (Requirements is not null ? Requirements.DeepEquals(other.Requirements) : other.Requirements is null) &&
            (ExpirationInfo is not null ? ExpirationInfo.DeepEquals(other.ExpirationInfo) : other.ExpirationInfo is null) &&
            (IntervalInfo is not null ? IntervalInfo.DeepEquals(other.IntervalInfo) : other.IntervalInfo is null) &&
            RewardItems.DeepEqualsList(other.RewardItems) &&
            PresentationNodeType == other.PresentationNodeType &&
            TraitIds.DeepEqualsListNaive(other.TraitIds) &&
            TraitHashes.DeepEqualsListNaive(other.TraitHashes) &&
            ParentNodeHashes.DeepEqualsListNaive(other.ParentNodeHashes) &&
            Hash == other.Hash &&
            Index == other.Index &&
            Redacted == other.Redacted);
 }
コード例 #3
0
 public bool DeepEquals(DestinyRecordDefinition other)
 {
     return(other != null &&
            DisplayProperties.DeepEquals(other.DisplayProperties) &&
            CompletionInfo.DeepEquals(other.CompletionInfo) &&
            ExpirationInfo.DeepEquals(other.ExpirationInfo) &&
            IntervalInfo.DeepEquals(other.IntervalInfo) &&
            StateInfo.DeepEquals(other.StateInfo) &&
            TitleInfo.DeepEquals(other.TitleInfo) &&
            Objectives.DeepEqualsReadOnlyCollections(other.Objectives) &&
            ParentNodes.DeepEqualsReadOnlyCollections(other.ParentNodes) &&
            PresentationNodeType == other.PresentationNodeType &&
            RecordValueStyle == other.RecordValueStyle &&
            Requirements.DeepEquals(other.Requirements) &&
            RewardItems.DeepEqualsReadOnlyCollections(other.RewardItems) &&
            Scope == other.Scope &&
            Traits.DeepEqualsReadOnlyCollections(other.Traits) &&
            TraitIds.DeepEqualsReadOnlySimpleCollection(other.TraitIds) &&
            Lore.DeepEquals(other.Lore) &&
            PresentationInfo.DeepEquals(other.PresentationInfo) &&
            ForTitleGilding == other.ForTitleGilding &&
            Blacklisted == other.Blacklisted &&
            Hash == other.Hash &&
            Index == other.Index &&
            Redacted == other.Redacted);
 }
コード例 #4
0
        internal virtual void Setup(TypeLibrary typeLib,
                                    TYPEKIND typeKind,
                                    int index,
                                    UCOMITypeInfo typeInfo,
                                    Guid guid)
        {
            _typeLib  = typeLib;
            _iTypeLib = typeLib.ITypeLib;
            if (typeInfo != null)
            {
                _typeInfo = typeInfo;
            }
            else
            {
                _iTypeLib.GetTypeInfo(index, out _typeInfo);
            }
            if (!guid.Equals(Guid.Empty))
            {
                InitGuid(guid);
            }
            else
            {
                InitGuid(GuidFromTypeInfo(_typeInfo));
            }

            _typeKind = typeKind;
            _presInfo = PresentationMap.GetInfo(_typeKind);
            GetDocumentation(index);
            if (TraceUtil.If(this, TraceLevel.Info))
            {
                Trace.WriteLine(this, "Basic: " + typeKind + " " + this);
            }
        }
コード例 #5
0
ファイル: ExportSlide.cs プロジェクト: AlexSneg/VIRD-1.0
        private static SlideBulk ComposeSlideBulk(PresentationInfo presentationInfo,
            IEnumerable<TechnicalServices.Persistence.SystemPersistence.Presentation.Slide> slideArr)
        {
            XmlSerializableDictionary<int, SlideLinkList> linkDic = new XmlSerializableDictionary<int, SlideLinkList>();
            XmlSerializableDictionary<int, Point> positionDic = new XmlSerializableDictionary<int, Point>();
            SlideBulk slideBulk = new SlideBulk();
            foreach (TechnicalServices.Persistence.SystemPersistence.Presentation.Slide slide in slideArr)
            {
                slideBulk.SlideList.Add(slide);
                positionDic[slide.Id] = presentationInfo.SlidePositionList[slide.Id];
                IList<LinkInfo> linkInfoList;
                if (!presentationInfo.SlideLinkInfoList.TryGetValue(slide.Id, out linkInfoList)) continue;
                foreach (LinkInfo linkInfo in linkInfoList)
                {
                    if (!slideArr.Any(sl => sl.Id == linkInfo.NextSlideId)) continue;
                    SlideLinkList slideLinkList;
                    if (!linkDic.TryGetValue(slide.Id, out slideLinkList))
                    {
                        linkDic[slide.Id] = slideLinkList = new SlideLinkList();
                    }
                    slideLinkList.LinkList.Add(linkInfo.CreateLinkStub());
                }
            }

            slideBulk.LinkDictionary = linkDic;
            slideBulk.SlidePositionList = positionDic;
            return slideBulk;
        }
コード例 #6
0
        IEnumerable <IBasicShape> IBar.Render(int currentPosition, PresentationInfo presentationInfo)
        {
            List <IBasicShape> shapes = new List <IBasicShape>();
            int slidesCount           = presentationInfo.SlidesCount;

            if (presentationInfo.DisableOnFirstSlide && currentPosition == 1)
            {
                return(shapes);
            }

            if (presentationInfo.DisableOnFirstSlide)
            {
                currentPosition -= 1;
                slidesCount     -= 1;
            }

            for (int i = 0; i < slidesCount; i++)
            {
                IBasicShape shape = new BasicShape();
                shape.Height = shape.Width = presentationInfo.UserSize;

                if (_positionOptions.Top.Selected)
                {
                    shape.Top = _gap;
                }
                else
                {
                    shape.Top = presentationInfo.Height - presentationInfo.UserSize - _gap;
                }

                shape.Left = _gap + (i * (presentationInfo.UserSize + _gap));


                if (_positionOptions.Right.Selected)
                {
                    float leftConstant = slidesCount * presentationInfo.UserSize;
                    leftConstant = presentationInfo.Width - leftConstant - (slidesCount * _gap) - _gap;

                    // Add constant to left margin
                    shape.Left = leftConstant + shape.Left;
                }

                shape.Type = MsoAutoShapeType.msoShapeRectangle;

                // Slides are NOT indexed from 0!
                if ((i + 1) == currentPosition)
                {
                    shape.ColorType = ShapeType.Active;
                }
                else
                {
                    shape.ColorType = ShapeType.Inactive;
                }

                shapes.Add(shape);
            }

            return(shapes);
        }
コード例 #7
0
 internal void SetPresInfo(PresentationInfo presInfo)
 {
     if (presInfo != null)
     {
         _nodeOrder         = presInfo._sortOrder;
         ImageIndex         = presInfo._iconIndex;
         SelectedImageIndex = ImageIndex;
     }
 }
コード例 #8
0
 protected override bool IsPresentationExists(PresentationInfo presentationInfo)
 {
     bool isExists = base.IsPresentationExists(presentationInfo);
     if (!isExists)
     {
         _presentationStorage.Remove(presentationInfo.UniqueName);
         _presentationStorageByName.Remove(presentationInfo.Name);
     }
     return isExists;
 }
コード例 #9
0
        private IBasicShape MakeShapeStub(PresentationInfo presentation)
        {
            IBasicShape shapeStub = new BasicShape();

            shapeStub.Height = presentation.UserSize;

            shapeStub.Top  = 0;
            shapeStub.Left = 0;
            shapeStub.Type = MsoAutoShapeType.msoShapeRectangle;

            return(shapeStub);
        }
コード例 #10
0
 public void Export(PresentationInfo[] presentationInfos)
 {
     ExportPresentation exportPresentation = new ExportPresentation(
         DesignerClient.Instance.ClientConfiguration,
         DesignerClient.Instance.PresentationWorker,
         DesignerClient.Instance.StandalonePresentationWorker,
         this);
     using (SimpleClient<IDesignerService> client = new SimpleClient<IDesignerService>())
     {
         client.Open();
         exportPresentation.Export(presentationInfos, client.Channel);
     }
 }
コード例 #11
0
        private PresentationInfo CreateInfo(IEnumerable <Slide> visibleSlides)
        {
            var presentationInfo = new PresentationInfo
            {
                Height              = _powerpointAdapter.PresentationHeight(),
                Width               = _powerpointAdapter.PresentationWidth(),
                SlidesCount         = visibleSlides.Count(),
                UserSize            = BarSize(),
                DisableOnFirstSlide = checkBox1.Checked
            };

            return(presentationInfo);
        }
コード例 #12
0
        private void model_BarCreated(IBar createdBar)
        {
            int          slideCounter  = 1;
            List <Slide> visibleSlides = _powerpointAdapter.VisibleSlides();

            PresentationInfo presentationInfo = CreateInfo(visibleSlides);

            foreach (Slide slide in visibleSlides)
            {
                foreach (IBasicShape shape in createdBar.Render(slideCounter, presentationInfo))
                {
                    Shape addedShape = slide.Shapes.AddShape(
                        shape.Type,
                        shape.Left,
                        shape.Top,
                        shape.Width,
                        shape.Height
                        );

                    switch (shape.ColorType)
                    {
                    case ShapeType.Inactive:
                        addedShape.Fill.ForeColor.RGB = GetSelectedBackgroundColor();
                        addedShape.Name = _nameHelper.GetBackgroundShapeName();
                        break;

                    case ShapeType.Active:
                        addedShape.Fill.ForeColor.RGB = GetSelectedForegroundColor();
                        addedShape.Name = _nameHelper.GetForegroundShapeName();
                        break;

                    default:
                        string message = String.Format("Unknown shape type \"{0}\".", shape.ColorType);
                        _log.Fatal(message);

                        throw new InvalidStateException(message);
                    }

                    addedShape.Line.Weight  = 0;
                    addedShape.Line.Visible = MsoTriState.msoFalse;
                }

                slideCounter++;
            }

            _hasBar = true;
        }
コード例 #13
0
ファイル: PresentationExt.cs プロジェクト: AlexSneg/VIRD-1.0
        //[Obsolete]
        //public static Presentation SavePresentationLevelChanges(this Presentation presentation, Presentation other)
        //{
        //    presentation.Name = other.Name;
        //    presentation.StartSlide = other.StartSlide;
        //    presentation.Author = other.Author;
        //    presentation.Comment = other.Comment;
        //    // и раскладку слайдов
        //    foreach (Slide slide in presentation.SlideList)
        //    {
        //        if (slide.State == SlideState.New)
        //        {
        //            slide.State = SlideState.Normal;
        //            continue;
        //        }
        //        slide.LinkList.Clear();
        //        Slide otherSlide = other.SlideList.Find(sl => sl.Id == slide.Id);
        //        foreach (Link otherLink in otherSlide.LinkList)
        //        {
        //            slide.LinkList.Add(
        //                new Link()
        //                {IsDefault = otherLink.IsDefault,
        //                 NextSlide = presentation.SlideList.Find (sl => sl.Id == otherLink.NextSlide.Id)
        //                });
        //        }
        //    }
        //    // группы дисплеев
        //    presentation.DisplayGroupList.Clear();
        //    presentation.DisplayGroupList.AddRange(other.DisplayGroupList);
        //    // позиции слайдов
        //    presentation.SlidePositionList.Clear();
        //    foreach (KeyValuePair<int, Point> keyValuePair in other.SlidePositionList)
        //    {
        //        presentation.SlidePositionList.Add(keyValuePair.Key, keyValuePair.Value);
        //    }
        //    return presentation;
        //}

        //public static void ChangeResourceContentPathWithNewName(this Presentation presentation,
        //    string oldName, string newName)
        //{
        //    foreach (Slide slide in presentation.SlideList)
        //    {
        //        slide.ChangeResourceContentPathWithNewName(oldName,newName);            
        //    }
        //}
       
        public static Presentation SavePresentationLevelChanges(this Presentation presentation,
            PresentationInfo presentationInfoOther)
        {
            presentation.Name = presentationInfoOther.Name;
            presentation.StartSlide = presentation.SlideList.Find(
                sl => sl.Id == presentationInfoOther.StartSlideId);
            if (presentation.StartSlide == null)
                throw new Exception(String.Format("Slide {0} not exists",
                    presentationInfoOther.StartSlideId));
            presentation.Author = presentationInfoOther.Author;
            presentation.Comment = presentationInfoOther.Comment;

            // группы дисплеев
            presentation.DisplayGroupList.Clear();
            presentation.DisplayGroupList.AddRange(presentationInfoOther.DisplayGroupList);

            // позиции слайдов
            presentation.SlidePositionList.Clear();
            foreach (KeyValuePair<int, Point> keyValuePair in presentationInfoOther.SlidePositionList)
            {
                presentation.SlidePositionList.Add(keyValuePair.Key, keyValuePair.Value);
            }
            presentation.DisplayPositionList.Clear();
            foreach (KeyValuePair<string, int> keyValuePair in presentationInfoOther.DisplayPositionList)
            {
                presentation.DisplayPositionList.Add(keyValuePair.Key, keyValuePair.Value);
            }

            // линки
            presentation.LinkDictionary.Clear();
            foreach (KeyValuePair<int, IList<LinkInfo>> pair in presentationInfoOther.SlideLinkInfoList)
            {
                SlideLinkList slideLinkList = new SlideLinkList();
                foreach (LinkInfo linkInfo in pair.Value)
                {
                    Link link = new Link();
                    link.IsDefault = linkInfo.IsDefault;
                    link.NextSlide = presentation.SlideList.Find(
                        sl => sl.Id == linkInfo.NextSlideId);
                    if (link.NextSlide == null) throw new Exception(
                        String.Format("Slide {0} not exists", linkInfo.NextSlideId));
                    slideLinkList.LinkList.Add(link);
                }
                presentation.LinkDictionary.Add(pair.Key, slideLinkList);
            }
            return presentation;
        }
コード例 #14
0
 public ExportPresentationCommand(string commandName, PresentationInfo presentationInfo,
     string newPresentationName,
     IPresentationClient remotePresentationClient, IPresentationClient standalonePresentationClient,
     Func<string, bool> delegateForDeletedPresentation)
     : base(commandName)
 {
     _remotePresentationClient = remotePresentationClient;
     _standalonePresentationClient = standalonePresentationClient;
     _standaloneClientResourceCRUD = _standalonePresentationClient.GetResourceCrud();
     _clientPresentationCRUD = _remotePresentationClient.GetPresentationExportCrud();
     _presentationInfo = presentationInfo;
     _newPresentationName = newPresentationName;
     //_presentationService = presentationService;
     _delegateForDeletedPresentation = delegateForDeletedPresentation;
     //_clientPresentationCRUD = new ClientSidePresentationTransfer(directory, presentationClient);
     //_clientSourceStandalone = new ClientSideStandAloneSourceTransfer(standaloneResourceEx);
 }
コード例 #15
0
            public int Compare(Object o1, Object o2)
            {
                MemberInfo       m1  = (MemberInfo)o1;
                MemberInfo       m2  = (MemberInfo)o2;
                PresentationInfo mt1 = PresentationMap.GetInfo(m1.MemberType);
                PresentationInfo mt2 = PresentationMap.GetInfo(m2.MemberType);

                if (mt1._sortOrder > mt2._sortOrder)
                {
                    return(1);
                }
                if (mt1._sortOrder < mt2._sortOrder)
                {
                    return(-1);
                }

                return(m1.Name.CompareTo(m2.Name));
            }
コード例 #16
0
        public bool AddPersentation(PresentationInfo presentationInfo)
        {
            var presentations = GetAllPresentations();

            if (presentations != null && presentations.Any())
            {
                if (presentations.Where(p => p.Name == presentationInfo.Name && p.DemoType == presentationInfo.DemoType).Any())
                {
                    return(true);
                }
            }
            if (presentations.Where(item => item.DemoType == presentationInfo.DemoType).Count() >= _maximumSavedEntry)
            {
                presentations.Remove(presentations.Where(item => item.DemoType == presentationInfo.DemoType).OrderBy(item => item.CreateTime).First());
            }
            presentationInfo.ID = Guid.NewGuid().ToString();
            presentations.Add(presentationInfo);
            return(Save(presentations));
        }
コード例 #17
0
 public bool DeepEquals(DestinyCollectibleDefinition?other)
 {
     return(other is not null &&
            (DisplayProperties is not null ? DisplayProperties.DeepEquals(other.DisplayProperties) : other.DisplayProperties is null) &&
            Scope == other.Scope &&
            SourceString == other.SourceString &&
            SourceHash == other.SourceHash &&
            ItemHash == other.ItemHash &&
            (AcquisitionInfo is not null ? AcquisitionInfo.DeepEquals(other.AcquisitionInfo) : other.AcquisitionInfo is null) &&
            (StateInfo is not null ? StateInfo.DeepEquals(other.StateInfo) : other.StateInfo is null) &&
            (PresentationInfo is not null ? PresentationInfo.DeepEquals(other.PresentationInfo) : other.PresentationInfo is null) &&
            PresentationNodeType == other.PresentationNodeType &&
            TraitIds.DeepEqualsListNaive(other.TraitIds) &&
            TraitHashes.DeepEqualsListNaive(other.TraitHashes) &&
            ParentNodeHashes.DeepEqualsListNaive(other.ParentNodeHashes) &&
            Hash == other.Hash &&
            Index == other.Index &&
            Redacted == other.Redacted);
 }
コード例 #18
0
        internal ObjectTypeTreeNode(bool comNode,
                                    ObjectInfo objInfo,
                                    MemberInfo member,
                                    bool useIntermediates) : this(comNode, objInfo)
        {
            PresentationInfo pi = PresentationMap.GetInfo(member.MemberType);


            // Needs an intermediate node for the base class type
            if (useIntermediates &&
                ComponentInspectorProperties.ShowBaseCategories &&
                !_objInfo.ObjParentType.Equals(member.DeclaringType))
            {
                PresentationInfo basePi = PresentationMap.GetInfo(PresentationMap.BASE_CLASS);
                _intermediateNodeTypes = new ArrayList();
                _intermediateNodeTypes.Add(basePi._intermediateNodeType);
            }
            else if (ComponentInspectorProperties.ShowObjectAsBaseClass &&
                     (ReflectionHelper.TypeEqualsObject(member.DeclaringType) ||
                      ReflectionHelper.TypeEqualsMarshalByRef(member.DeclaringType) ||
                      NoGoop.Win32.ActiveX.TypeEqualsComRoot(member.DeclaringType)))
            {
                PresentationInfo basePi = PresentationMap.GetInfo(PresentationMap.BASE_CLASS);
                _intermediateNodeTypes = new ArrayList();
                _intermediateNodeTypes.Add(basePi._intermediateNodeType);
            }

            if (useIntermediates && ComponentInspectorProperties.ShowMemberCategories)
            {
                if (_intermediateNodeTypes == null)
                {
                    _intermediateNodeTypes = new ArrayList();
                }
                _intermediateNodeTypes.Add(pi._intermediateNodeType);
            }

            // We can cast a member which can be permanently remembered
            _castInfo = CastInfo.GetCastInfo(member);

            ImageIndex         = pi._iconIndex;
            SelectedImageIndex = ImageIndex;
            _nodeOrder         = pi._sortOrder;
        }
コード例 #19
0
 public bool DeepEquals(DestinyCollectibleDefinition other)
 {
     return(other != null &&
            AcquisitionInfo.DeepEquals(other.AcquisitionInfo) &&
            (PresentationInfo != null ? PresentationInfo.DeepEquals(other.PresentationInfo) : other.PresentationInfo == null) &&
            DisplayProperties.DeepEquals(other.DisplayProperties) &&
            Item.DeepEquals(other.Item) &&
            ParentNodes.DeepEqualsReadOnlyCollections(other.ParentNodes) &&
            PresentationNodeType == other.PresentationNodeType &&
            Scope == other.Scope &&
            SourceHash == other.SourceHash &&
            SourceString == other.SourceString &&
            StateInfo.DeepEquals(other.StateInfo) &&
            Traits.DeepEqualsReadOnlyCollections(other.Traits) &&
            TraitIds.DeepEqualsReadOnlySimpleCollection(other.TraitIds) &&
            Blacklisted == other.Blacklisted &&
            Hash == other.Hash &&
            Index == other.Index &&
            Redacted == other.Redacted);
 }
コード例 #20
0
        public PresentationPropertiesForm(PresentationInfo AInfo, bool creatingNew)
        {
            InitializeComponent();
            _isCreateNew = creatingNew;
            DestInfo = new PresentationInfo(AInfo);
            info = AInfo;

            nameText.Text = DestInfo.Name;
            authorText.Text = DestInfo.Author;
            commentText.Text = DestInfo.Comment;
            //nameText.DataBindings.Add("Text", DestInfo, "Name");
            //authorText.DataBindings.Add("Text", DestInfo, "Author");
            createdLabel.DataBindings.Add("Text", DestInfo, "CreationDate");
            modifiedLabel.DataBindings.Add("Text", DestInfo, "LastChangeDate");
            //commentText.DataBindings.Add("Text", DestInfo, "Comment");
            slideCountLabel.DataBindings.Add("Text", DestInfo, "SlideCount");

            if (creatingNew)
            {
                this.Text = "Создание нового сценария";
                this.modifiedLabel.Visible = false;
                this.label8.Visible = false;
                this.slideCountLabel.Visible = false;
                this.label6.Visible = false;
                this.createdLabel.Visible = false;
                this.label4.Visible = false;
                authorText.ReadOnly = false;
            }
            else
            {
                //https://sentinel2.luxoft.com/sen/issues/browse/PMEDIAINFOVISDEV-1302
                //authorText.ReadOnly = true;
                this.Text = String.Concat(DestInfo.Name, " - Свойства");
            }

        }
コード例 #21
0
        IEnumerable <IBasicShape> IBar.Render(int currentPosition, PresentationInfo presentationInfo)
        {
            _presentationInfo = presentationInfo;

            List <IBasicShape> shapes = new List <IBasicShape>();

            if (presentationInfo.DisableOnFirstSlide && currentPosition == 1)
            {
                return(shapes);
            }

            shapes.Add(MakeBackground());
            shapes.Add(MakeProgressBar(currentPosition));

            if (_positionInfo.Bottom.Selected)
            {
                foreach (IBasicShape basicShape in shapes)
                {
                    basicShape.Top = presentationInfo.Height - presentationInfo.UserSize;
                }
            }

            return(shapes);
        }
コード例 #22
0
 protected virtual void ObjectChanged(UserIdentity userIdentity, IList<ObjectInfo> objectInfoList,
                                       PresentationInfo presentationInfo, bool presentationLevel)
 {
     PresentationChange(presentationInfo);
     if (!presentationLevel)
         SlideChanged(presentationInfo,
                      objectInfoList.Select(oi => oi.ObjectKey).OfType<SlideKey>().Select(sk => sk.Id));
 }
コード例 #23
0
        protected Presentation Merge(UserIdentity identity,
                                     PresentationInfo presentationInfo,
                                     Slide[] newSlideArr,
                                     Presentation presentationStored,
                                     out LockingInfo[] lockedSlides,
                                     out Slide[] slideAlreadyExists)
        {
            IEnumerable<Slide> existedSlides = presentationStored.SlideList.Where(
                sl => newSlideArr.Any(newsl=>newsl.Id == sl.Id));
            if (existedSlides.Count() != 0)
            {
                slideAlreadyExists = existedSlides.ToArray();
                lockedSlides = new LockingInfo[] {};
                return null;
            }

            foreach (Slide slide in newSlideArr)
            {
                //Slide slideStored = presentationStored.SlideList.Find(
                //    sl => sl.Id == slide.Id);
                //if (slideStored != null) return null;
                slide.State = SlideState.Normal;
                presentationStored.SlideList.Add(slide);
            }
            // анализ удаленных слайдов
            List<Slide> slideListDeleted = presentationStored.SlideList.FindAll(
                sl => !presentationInfo.SlideInfoList.Exists(sli => sli.Id == sl.Id));
            if (!IsStandAlone)
            {
                IEnumerable<LockingInfo> lockedSl = slideListDeleted.Select(
                    sl => _lockService.GetLockInfo(ObjectKeyCreator.CreateSlideKey(presentationInfo.UniqueName, sl.Id))).Where(
                    li=>li != null);

                if (lockedSl.Count() != 0)
                {
                    lockedSlides = lockedSl.ToArray();
                    slideAlreadyExists = new Slide[] {};
                    return null;
                }
            }
            // удаляем слайды
            presentationStored.SlideList.RemoveAll(slideListDeleted.Contains);
            presentationStored.SavePresentationLevelChanges(presentationInfo);
            slideAlreadyExists = new Slide[] { };
            lockedSlides = new LockingInfo[] { };
            return presentationStored;
        }
コード例 #24
0
 public SavePresentationResult SavePresentationChanges(PresentationInfo presentationInfo, Slide[] slides, out ResourceDescriptor[] notExistedResources, out DeviceResourceDescriptor[] notExistedDeviceResources, out int[] labelNotExists,
     out UserIdentity[] whoLock, out int[] slidesAlreadyExistsId)
 {
     return _presentationClient.Channel.SavePresentationChanges(UserIdentity, presentationInfo, slides, out notExistedResources, out notExistedDeviceResources, out labelNotExists,
         out whoLock, out slidesAlreadyExistsId);
 }
コード例 #25
0
 public PreparePresentationController(PresentationInfo info, int slideId)
 {
     _info = info;
     _slideId = slideId;
 }
コード例 #26
0
        public PresentationDesignerForm(PresentationInfo aPresentationInfo)
        {
            m_PresentationInfo = aPresentationInfo;
            m_Presentation = aPresentationInfo.CreatePresentationStub();
            PresentationController.CreatePresentationController();
            PresentationController.Instance.PresentationChanged = false;
            PresentationChanged = new Changed(() =>
            {
                this.saveMenuButton.Enabled = PresentationController.Instance.PresentationChanged;
                this.savePresentationToolButton.Enabled = PresentationController.Instance.PresentationChanged;
                this.ChangedStatus.Visible = PresentationController.Instance.PresentationChanged;
                this.ChangedStatus.Text = PresentationController.Instance.ChangedTextStatus;
            });
            PresentationController.Instance.OnChanged += PresentationChanged;
            PresentationController.Instance.OnPresentationLockChanged += new PresentationLockChanged(Instance_OnPresentationLockChanged);
            PresentationController.Instance.OnPresentationRemoved += new Changed(Instance_OnPresentationRemoved);
            PresentationController.Instance.OnPresentationLockedExternally += new PresentationLockedExternally(Instance_OnPresentationLockedExternally);
            PresentationController.Instance.OnPresentationUnlockedExternally += new PresentationUnlockedExternally(Instance_OnPresentationUnlockedExternally);
            PresentationController.Instance.OnSlideSelectionChanged += new SlideSelectionChanged(Instance_OnSlideSelectionChanged);
            PresentationController.Instance.OnOtherUserLockForShow += new SlideChanged(Instance_OnOtherUserLockForShow);
            UndoService.CreateUndoService();
            PresentationController.Instance.AssignPresentation(m_Presentation, m_PresentationInfo);
            InitializeComponent();

            RefreshTitle();
            this.statusStrip.ContextMenuStrip = null;
            this.ChangedStatus.Visible = false;

            this.WindowState = FormWindowState.Maximized;
            UndoService.Instance.OnHistoryChanged += new HistoryChanged(OnHistoryChanged);

            identity = Thread.CurrentPrincipal as UserIdentity;
            slideDiagram.SwitchPlayerMode(false);

            toolStripEx2.Enabled = false;
            PresentationController.Instance.RefreshLockingInfo();


            LockingInfo li = ((PresentationInfoExt)m_PresentationInfo).LockingInfo;
            if (li != null)
            {
                string info = String.Format(lockedByUser, 
                    string.IsNullOrEmpty(li.UserIdentity.User.FullName) ? li.UserIdentity.User.Name : li.UserIdentity.User.FullName,
                    li.RequireLock == RequireLock.ForShow ? "для показа" :  "для редактирования");
                this.LockingStatus.Visible = true;
                this.LockingStatus.Text = info;
                if (li.RequireLock == RequireLock.ForShow)
                {
                    layoutPreviewMenuButton.Enabled = false;
                    previewToolButton.Enabled = false;
                }
            }

            if (layoutPreviewMenuButton.Enabled || previewToolButton.Enabled)
            {
                layoutPreviewMenuButton.Enabled = previewToolButton.Enabled = !LayoutController.Instance.IsShownByPlayer();
            }

            SlideGraphController.Instance.OnSlideHover += new EventHandler<SlideEventArgs>(Instance_OnSlideHover);

            updateMenuButton.Enabled = !DesignerClient.Instance.IsStandAlone;
            refreshDisplayMenuButton.Enabled = !DesignerClient.Instance.IsStandAlone;
            refreshSlidesMenuButton.Enabled = !DesignerClient.Instance.IsStandAlone;
            commonSourcesRefreshMenuButton.Enabled = !DesignerClient.Instance.IsStandAlone;
            equipmentRefreshMenuButton.Enabled = !DesignerClient.Instance.IsStandAlone;
            toXmlMenuButton.Enabled = !DesignerClient.Instance.IsStandAlone;

            LayoutController.Instance.OnShownStatusChanged += new Action<bool>(Instance_OnShownStatusChanged);
            layoutPreviewMenuButton.Visible = previewToolButton.Visible = !DesignerClient.Instance.IsStandAlone;
        }
コード例 #27
0
 public bool SaveSlideChanges(UserIdentity userIdentity, string presentationUniqueName,
     Slide[] slideToSave, out int[] slideIdNotLocked,
     out ResourceDescriptor[] resourcesNotExists,
     out DeviceResourceDescriptor[] deviceResourcesNotExists,
     out int[] labelNotExists)
 {
     resourcesNotExists = new ResourceDescriptor[] { };
     deviceResourcesNotExists = new DeviceResourceDescriptor[] {};
     labelNotExists =
         slideToSave.Select(sl => sl.LabelId).Where(id=>id>0).Distinct().Except(
             _configuration.LabelStorageAdapter.GetLabelStorage().Select(lb => lb.Id)).ToArray();
     List<int> slideNotLocked = new List<int>(slideToSave.Length);
     slideIdNotLocked = slideNotLocked.ToArray();
     if (labelNotExists.Length != 0) return false;
     if (slideToSave.Length == 0) return true;
     if (!IsStandAlone)
     {
         //Presentation pres = BinarySerializer.Deserialize<Presentation>(presentation);
         // проверка что слайды залочены данным пользователем
         foreach (Slide slide in slideToSave)
         {
             LockingInfo info =
                 _lockService.GetLockInfo(ObjectKeyCreator.CreateSlideKey(presentationUniqueName, slide.Id));
             if (info == null || !info.UserIdentity.Equals(userIdentity))
                 slideNotLocked.Add(slide.Id);
         }
     }
     slideIdNotLocked = slideNotLocked.ToArray();
     string[] deletedEquipment;
     Presentation presentation = _presentationDAL.GetPresentation(presentationUniqueName,
         _sourceDAL, _deviceSourceDAL, out deletedEquipment);
     if (presentation == null) return false;
     PresentationInfo presentationInfo = new PresentationInfo(presentation);
     resourcesNotExists = GetNotExistedResource(slideToSave);
     deviceResourcesNotExists = GetNotExistedDeviceResource(slideToSave, presentationInfo);
     if (slideIdNotLocked.Length != 0 || resourcesNotExists.Length != 0 || deviceResourcesNotExists.Length != 0)
         return false;
     presentation = Merge(presentation, slideToSave);
     if (presentation == null) return false;
     bool isSuccess = _presentationDAL.SavePresentation(userIdentity, presentation);
     if (isSuccess)
     {
         List<ObjectInfo> objectInfoList = new List<ObjectInfo>();
         foreach (Slide slide in slideToSave)
         {
             objectInfoList.Add(new ObjectInfo(userIdentity,
                                               ObjectKeyCreator.CreateSlideKey(presentationUniqueName, slide.Id)));
         }
         PresentationKey presentationKey = ObjectKeyCreator.CreatePresentationKey(presentationUniqueName);
         ObjectChanged(userIdentity, objectInfoList, new PresentationInfo(presentation), false);
     }
     return isSuccess;
 }
コード例 #28
0
        public CreatePresentationResult CreatePresentation(UserIdentity sender,
            PresentationInfo presentationInfo,
            out int[] labelNotExists)
        {
            labelNotExists = presentationInfo.GetUsedLabels().Except(
                _configuration.LabelStorageAdapter.GetLabelStorage().Select(lb => lb.Id)).ToArray();
            if (labelNotExists.Length != 0) return CreatePresentationResult.LabelNotExists;
            if (null != _presentationDAL.GetPresentationInfo(presentationInfo.UniqueName)) return CreatePresentationResult.SameUniqueNameExists;
            if (null != _presentationDAL.GetPresentationInfoByPresentationName(presentationInfo.Name))
                return CreatePresentationResult.SameNameExists;

            bool isSuccess = _presentationDAL.SavePresentation(sender,
                                                     presentationInfo.CreatePresentationStub());
            if (isSuccess) return CreatePresentationResult.Ok;
            else return CreatePresentationResult.SameNameExists;
        }
コード例 #29
0
ファイル: Service.svc.cs プロジェクト: LucioC/class_share
        public PresentationInfo GetPresentationInfo()
        {
            PresentationInfo info = new PresentationInfo();

            if (PresentationControl.IsActive())
            {
                info.SlidesNumber = PresentationControl.TotalSlides();
                info.CurrentSlide = PresentationControl.CurrentSlide();
                info.FileName = CurrentSlidePresentation;
            }
            else
            {
                info.SlidesNumber = 0;
                info.CurrentSlide = 0;
                info.FileName = "";
            }

            Log("Get presentation info");

            return info;
        }
コード例 #30
0
        public bool Equals(DestinyCollectibleDefinition input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     DisplayProperties == input.DisplayProperties ||
                     (DisplayProperties != null && DisplayProperties.Equals(input.DisplayProperties))
                     ) &&
                 (
                     Scope == input.Scope ||
                     (Scope != null && Scope.Equals(input.Scope))
                 ) &&
                 (
                     SourceString == input.SourceString ||
                     (SourceString != null && SourceString.Equals(input.SourceString))
                 ) &&
                 (
                     SourceHash == input.SourceHash ||
                     (SourceHash.Equals(input.SourceHash))
                 ) &&
                 (
                     ItemHash == input.ItemHash ||
                     (ItemHash.Equals(input.ItemHash))
                 ) &&
                 (
                     AcquisitionInfo == input.AcquisitionInfo ||
                     (AcquisitionInfo != null && AcquisitionInfo.Equals(input.AcquisitionInfo))
                 ) &&
                 (
                     StateInfo == input.StateInfo ||
                     (StateInfo != null && StateInfo.Equals(input.StateInfo))
                 ) &&
                 (
                     PresentationInfo == input.PresentationInfo ||
                     (PresentationInfo != null && PresentationInfo.Equals(input.PresentationInfo))
                 ) &&
                 (
                     PresentationNodeType == input.PresentationNodeType ||
                     (PresentationNodeType != null && PresentationNodeType.Equals(input.PresentationNodeType))
                 ) &&
                 (
                     TraitIds == input.TraitIds ||
                     (TraitIds != null && TraitIds.SequenceEqual(input.TraitIds))
                 ) &&
                 (
                     TraitHashes == input.TraitHashes ||
                     (TraitHashes != null && TraitHashes.SequenceEqual(input.TraitHashes))
                 ) &&
                 (
                     ParentNodeHashes == input.ParentNodeHashes ||
                     (ParentNodeHashes != null && ParentNodeHashes.SequenceEqual(input.ParentNodeHashes))
                 ) &&
                 (
                     Hash == input.Hash ||
                     (Hash.Equals(input.Hash))
                 ) &&
                 (
                     Index == input.Index ||
                     (Index.Equals(input.Index))
                 ) &&
                 (
                     Redacted == input.Redacted ||
                     (Redacted != null && Redacted.Equals(input.Redacted))
                 ));
        }
コード例 #31
0
        public void Export(PresentationInfo[] presentationInfos,
            IDesignerService designerService)
        {
            if (presentationInfos == null || presentationInfos.Length == 0) return;
            try
            {
                //if (!ExportPresentationController.Instanse.ConfirmExport(presentationInfos.Select(pi => pi.Name)))
                //    return;
                string newPresentationName;
                if (!_exportPresentationController.ConfirmExport(_config.ScenarioFolder, "*.xml", presentationInfos.Select(pi => pi.Name), out newPresentationName))
                    return;

                CommandInvoker invoker = new CommandInvoker();

                //IContinue isContinue =
                //    ExportPresentationController.Instanse.GetUserInteractive(presentationInfos.Length == 1);
                IContinue isContinue =
                    _exportPresentationController.GetUserInteractive(presentationInfos.Length == 1);

                // сначала экспортируем схемы для презентации
                ExportPresentationSchemaFilesCommand exportPresentationSchemaFilesCommand =
                    new ExportPresentationSchemaFilesCommand(string.Format("экспорт файлов-схем для сценария"),
                                                             _remotePresentationClient, _config.ScenarioFolder);

                invoker.AddCommand(exportPresentationSchemaFilesCommand);

                // теперь для каждой презентации своя команда
                //List<TechnicalServices.Common.Command> presentationExportCommandList =
                //    new List<TechnicalServices.Common.Command>(presentationInfos.Length);
                foreach (PresentationInfo presentationInfo in presentationInfos)
                {
                    //presentationExportCommandList.Add(
                    Command exportPresentationCommand =
                    new ExportPresentationCommand(string.Format("Экспорт сценария {0}", presentationInfo.Name),
                                                      presentationInfo,
                                                      presentationInfos.Length == 1 ? newPresentationName : null,
                                                      _remotePresentationClient,
                                                      _standalonePresentationClient,
                                                      new Func<string, bool>(isContinue.Continue));
                    invoker.AddCommand(exportPresentationCommand);
                }

                // экспорт глобальных сорсов
                ExportGlobalSourcesCommand exportGlobalSourcesCommand = new
                    ExportGlobalSourcesCommand("Экспорт глобальных источников",
                                               _remotePresentationClient,
                                               _standalonePresentationClient);

                invoker.AddCommand(exportGlobalSourcesCommand);

                // выполняем
                bool isSuccess = CommandInvoker.Execute(invoker);

                //ExportPresentationController.Instanse.SuccessMessage("Экспорт презентаций успешно завершен");
                if (isSuccess)
                    _exportPresentationController.SuccessMessage("Экспорт сценариев успешно завершен");
            }
            catch (InterruptOperationException)
            {
                _exportPresentationController.ErrorMessage(string.Format("Экспорт сценариев был прерван пользователем"));
                //ExportPresentationController.Instanse.ErrorMessage(
                //    string.Format("Экспорт сценариев был прерван пользователем"));
            }
            catch (Exception ex)
            {
                _exportPresentationController.ErrorMessage(string.Format("При экспорте сценариев произошла неизвестная ошибка: {0}", ex));
                //ExportPresentationController.Instanse.ErrorMessage(
                //    string.Format("При экспорте сценариев произошла неизвестная ошибка: {0}", ex));
            }

        }
コード例 #32
0
        public bool Equals(DestinyRecordDefinition input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     DisplayProperties == input.DisplayProperties ||
                     (DisplayProperties != null && DisplayProperties.Equals(input.DisplayProperties))
                     ) &&
                 (
                     Scope == input.Scope ||
                     (Scope != null && Scope.Equals(input.Scope))
                 ) &&
                 (
                     PresentationInfo == input.PresentationInfo ||
                     (PresentationInfo != null && PresentationInfo.Equals(input.PresentationInfo))
                 ) &&
                 (
                     LoreHash == input.LoreHash ||
                     (LoreHash.Equals(input.LoreHash))
                 ) &&
                 (
                     ObjectiveHashes == input.ObjectiveHashes ||
                     (ObjectiveHashes != null && ObjectiveHashes.SequenceEqual(input.ObjectiveHashes))
                 ) &&
                 (
                     RecordValueStyle == input.RecordValueStyle ||
                     (RecordValueStyle != null && RecordValueStyle.Equals(input.RecordValueStyle))
                 ) &&
                 (
                     ForTitleGilding == input.ForTitleGilding ||
                     (ForTitleGilding != null && ForTitleGilding.Equals(input.ForTitleGilding))
                 ) &&
                 (
                     TitleInfo == input.TitleInfo ||
                     (TitleInfo != null && TitleInfo.Equals(input.TitleInfo))
                 ) &&
                 (
                     CompletionInfo == input.CompletionInfo ||
                     (CompletionInfo != null && CompletionInfo.Equals(input.CompletionInfo))
                 ) &&
                 (
                     StateInfo == input.StateInfo ||
                     (StateInfo != null && StateInfo.Equals(input.StateInfo))
                 ) &&
                 (
                     Requirements == input.Requirements ||
                     (Requirements != null && Requirements.Equals(input.Requirements))
                 ) &&
                 (
                     ExpirationInfo == input.ExpirationInfo ||
                     (ExpirationInfo != null && ExpirationInfo.Equals(input.ExpirationInfo))
                 ) &&
                 (
                     IntervalInfo == input.IntervalInfo ||
                     (IntervalInfo != null && IntervalInfo.Equals(input.IntervalInfo))
                 ) &&
                 (
                     RewardItems == input.RewardItems ||
                     (RewardItems != null && RewardItems.SequenceEqual(input.RewardItems))
                 ) &&
                 (
                     PresentationNodeType == input.PresentationNodeType ||
                     (PresentationNodeType != null && PresentationNodeType.Equals(input.PresentationNodeType))
                 ) &&
                 (
                     TraitIds == input.TraitIds ||
                     (TraitIds != null && TraitIds.SequenceEqual(input.TraitIds))
                 ) &&
                 (
                     TraitHashes == input.TraitHashes ||
                     (TraitHashes != null && TraitHashes.SequenceEqual(input.TraitHashes))
                 ) &&
                 (
                     ParentNodeHashes == input.ParentNodeHashes ||
                     (ParentNodeHashes != null && ParentNodeHashes.SequenceEqual(input.ParentNodeHashes))
                 ) &&
                 (
                     Hash == input.Hash ||
                     (Hash.Equals(input.Hash))
                 ) &&
                 (
                     Index == input.Index ||
                     (Index.Equals(input.Index))
                 ) &&
                 (
                     Redacted == input.Redacted ||
                     (Redacted != null && Redacted.Equals(input.Redacted))
                 ));
        }
コード例 #33
0
ファイル: ObjectKeyCreator.cs プロジェクト: AlexSneg/VIRD-1.0
 public static PresentationKey CreatePresentationKey(PresentationInfo presentationInfo)
 {
     return new PresentationKey(presentationInfo.UniqueName);
 }
コード例 #34
0
 public CreatePresentationResult CreatePresentation(PresentationInfo presentationInfo, out int[] labelNotExists)
 {
     return _presentationClient.Channel.CreatePresentation(UserIdentity, presentationInfo, out labelNotExists);
 }
コード例 #35
0
 protected void PresentationChange(PresentationInfo info)
 {
     if (OnPresentationChanged != null)
     {
         OnPresentationChanged.Invoke(this, new PresentationChangedEventArgs(info));
     }
 }
コード例 #36
0
ファイル: SourcesControl.cs プロジェクト: AlexSneg/VIRD-1.0
 public void Init()
 {
     m_presentationInfo = PresentationController.Instance.PresentationInfo;
     SourcesController.CreateSourceController(this, m_presentationInfo);
     m_controller = SourcesController.Instance;
     PresentationController.Instance.OnPresentationLockChanged += new PresentationLockChanged(Instance_OnPresentationLockChanged);
 }
コード例 #37
0
 protected void SlideChanged(PresentationInfo info, IEnumerable<int> slideIds)
 {
     if (OnSlideChanged != null)
     {
         OnSlideChanged.Invoke(this, new SlideChangedEventArgs(info.UniqueName, slideIds));
     }
 }
コード例 #38
0
 public void Update(DestinyCollectibleDefinition?other)
 {
     if (other is null)
     {
         return;
     }
     if (!DisplayProperties.DeepEquals(other.DisplayProperties))
     {
         DisplayProperties.Update(other.DisplayProperties);
         OnPropertyChanged(nameof(DisplayProperties));
     }
     if (Scope != other.Scope)
     {
         Scope = other.Scope;
         OnPropertyChanged(nameof(Scope));
     }
     if (SourceString != other.SourceString)
     {
         SourceString = other.SourceString;
         OnPropertyChanged(nameof(SourceString));
     }
     if (SourceHash != other.SourceHash)
     {
         SourceHash = other.SourceHash;
         OnPropertyChanged(nameof(SourceHash));
     }
     if (ItemHash != other.ItemHash)
     {
         ItemHash = other.ItemHash;
         OnPropertyChanged(nameof(ItemHash));
     }
     if (!AcquisitionInfo.DeepEquals(other.AcquisitionInfo))
     {
         AcquisitionInfo.Update(other.AcquisitionInfo);
         OnPropertyChanged(nameof(AcquisitionInfo));
     }
     if (!StateInfo.DeepEquals(other.StateInfo))
     {
         StateInfo.Update(other.StateInfo);
         OnPropertyChanged(nameof(StateInfo));
     }
     if (!PresentationInfo.DeepEquals(other.PresentationInfo))
     {
         PresentationInfo.Update(other.PresentationInfo);
         OnPropertyChanged(nameof(PresentationInfo));
     }
     if (PresentationNodeType != other.PresentationNodeType)
     {
         PresentationNodeType = other.PresentationNodeType;
         OnPropertyChanged(nameof(PresentationNodeType));
     }
     if (!TraitIds.DeepEqualsListNaive(other.TraitIds))
     {
         TraitIds = other.TraitIds;
         OnPropertyChanged(nameof(TraitIds));
     }
     if (!TraitHashes.DeepEqualsListNaive(other.TraitHashes))
     {
         TraitHashes = other.TraitHashes;
         OnPropertyChanged(nameof(TraitHashes));
     }
     if (!ParentNodeHashes.DeepEqualsListNaive(other.ParentNodeHashes))
     {
         ParentNodeHashes = other.ParentNodeHashes;
         OnPropertyChanged(nameof(ParentNodeHashes));
     }
     if (Hash != other.Hash)
     {
         Hash = other.Hash;
         OnPropertyChanged(nameof(Hash));
     }
     if (Index != other.Index)
     {
         Index = other.Index;
         OnPropertyChanged(nameof(Index));
     }
     if (Redacted != other.Redacted)
     {
         Redacted = other.Redacted;
         OnPropertyChanged(nameof(Redacted));
     }
 }
コード例 #39
0
 public SavePresentationResult SavePresentationChanges(UserIdentity userIdentity, PresentationInfo presentationInfo,
     Slide[] newSlideArr, out ResourceDescriptor[] resourcesNotExists,
     out DeviceResourceDescriptor[] deviceResourcesNotExists, out int[] labelNotExists,
     out UserIdentity[] whoLock,
     out int[] slidesAlreadyExistsId)
 {
     resourcesNotExists = new ResourceDescriptor[] { };
     deviceResourcesNotExists = new DeviceResourceDescriptor[] {};
     whoLock = new UserIdentity[] { };
     slidesAlreadyExistsId = new int[] { };
     labelNotExists = presentationInfo.GetUsedLabels().Except(
         _configuration.LabelStorageAdapter.GetLabelStorage().Select(lb => lb.Id)).ToArray();
     if (labelNotExists.Length != 0) return SavePresentationResult.LabelNotExists;
     if (!IsStandAlone)
     {
         // необходим лок уровня презентации
         LockingInfo info = _lockService.GetLockInfo(ObjectKeyCreator.CreatePresentationKey(presentationInfo));
         if (info == null || !info.UserIdentity.Equals(userIdentity)) return SavePresentationResult.PresentationNotLocked;
     }
     string[] deletedEquipment;
     Presentation presentationStored = _presentationDAL.GetPresentation(
         presentationInfo.UniqueName, _sourceDAL, _deviceSourceDAL, out deletedEquipment);
     if (presentationStored == null) return SavePresentationResult.PresentationNotExists;
     resourcesNotExists = GetNotExistedResource(newSlideArr);
     deviceResourcesNotExists = GetNotExistedDeviceResource(newSlideArr, presentationInfo);
     if (resourcesNotExists.Length != 0 || deviceResourcesNotExists.Length != 0) return SavePresentationResult.ResourceNotExists;
     LockingInfo[] lockedSlides;
     Slide[] slideAlreadyExists;
     presentationStored = Merge(userIdentity, presentationInfo, newSlideArr, presentationStored,
         out lockedSlides, out slideAlreadyExists);
     if (presentationStored == null)
     {
         SavePresentationResult result = SavePresentationResult.Unknown;
         if (lockedSlides.Length != 0)
         {
             whoLock = lockedSlides.Select(li => li.UserIdentity).ToArray();
             result = SavePresentationResult.SlideLocked;
         }
         if (slideAlreadyExists.Length != 0)
         {
             slidesAlreadyExistsId = slideAlreadyExists.Select(sl => sl.Id).ToArray();
             result = SavePresentationResult.SlideAlreadyExists;
         }
         return result;
     }
     bool isSuccess = _presentationDAL.SavePresentation(userIdentity, presentationStored);
     if (isSuccess)
     {
         PresentationKey presentationKey = ObjectKeyCreator.CreatePresentationKey(presentationStored);
         ObjectChanged(userIdentity, new List<ObjectInfo> { new ObjectInfo(userIdentity, presentationKey) },
                       new PresentationInfo(presentationStored), true);
     }
     else
     {
         return SavePresentationResult.Unknown;
     }
     return SavePresentationResult.Ok;
 }
コード例 #40
0
 public PresentationChangedEventArgs(PresentationInfo info)
 {
     _info = info;
 }
コード例 #41
0
 protected DeviceResourceDescriptor[] GetNotExistedDeviceResource(
     IEnumerable<Slide> slideArr, PresentationInfo presentationInfo)
 {
     List<DeviceResourceDescriptor> resourcesAbsent = new List<DeviceResourceDescriptor>();
     foreach (Slide slide in slideArr)
     {
         foreach (DeviceResourceDescriptor descriptor in slide.GetDeviceResource(presentationInfo))
         {
             if (!_deviceSourceDAL.IsExists(descriptor))
                 resourcesAbsent.Add(descriptor);
         }
     }
     return resourcesAbsent.ToArray();
 }
コード例 #42
0
 public static string GetPresentationStatusDescr(PresentationInfo info)
 {
     return GetPresentationStatusDescr(info.UniqueName, info.Name);
 }
コード例 #43
0
 public PreparePresentationController(PresentationInfo info)
 {
     _info = info;
 }
コード例 #44
0
 public static string GetPresentationStatusDescr(PresentationInfo info, PresentationStatus status, UserIdentity id)
 {
     return GetPresentationStatusDescr(info.Name, status, id);
 }
コード例 #45
0
 public void Update(DestinyRecordDefinition?other)
 {
     if (other is null)
     {
         return;
     }
     if (!DisplayProperties.DeepEquals(other.DisplayProperties))
     {
         DisplayProperties.Update(other.DisplayProperties);
         OnPropertyChanged(nameof(DisplayProperties));
     }
     if (Scope != other.Scope)
     {
         Scope = other.Scope;
         OnPropertyChanged(nameof(Scope));
     }
     if (!PresentationInfo.DeepEquals(other.PresentationInfo))
     {
         PresentationInfo.Update(other.PresentationInfo);
         OnPropertyChanged(nameof(PresentationInfo));
     }
     if (LoreHash != other.LoreHash)
     {
         LoreHash = other.LoreHash;
         OnPropertyChanged(nameof(LoreHash));
     }
     if (!ObjectiveHashes.DeepEqualsListNaive(other.ObjectiveHashes))
     {
         ObjectiveHashes = other.ObjectiveHashes;
         OnPropertyChanged(nameof(ObjectiveHashes));
     }
     if (RecordValueStyle != other.RecordValueStyle)
     {
         RecordValueStyle = other.RecordValueStyle;
         OnPropertyChanged(nameof(RecordValueStyle));
     }
     if (ForTitleGilding != other.ForTitleGilding)
     {
         ForTitleGilding = other.ForTitleGilding;
         OnPropertyChanged(nameof(ForTitleGilding));
     }
     if (!TitleInfo.DeepEquals(other.TitleInfo))
     {
         TitleInfo.Update(other.TitleInfo);
         OnPropertyChanged(nameof(TitleInfo));
     }
     if (!CompletionInfo.DeepEquals(other.CompletionInfo))
     {
         CompletionInfo.Update(other.CompletionInfo);
         OnPropertyChanged(nameof(CompletionInfo));
     }
     if (!StateInfo.DeepEquals(other.StateInfo))
     {
         StateInfo.Update(other.StateInfo);
         OnPropertyChanged(nameof(StateInfo));
     }
     if (!Requirements.DeepEquals(other.Requirements))
     {
         Requirements.Update(other.Requirements);
         OnPropertyChanged(nameof(Requirements));
     }
     if (!ExpirationInfo.DeepEquals(other.ExpirationInfo))
     {
         ExpirationInfo.Update(other.ExpirationInfo);
         OnPropertyChanged(nameof(ExpirationInfo));
     }
     if (!IntervalInfo.DeepEquals(other.IntervalInfo))
     {
         IntervalInfo.Update(other.IntervalInfo);
         OnPropertyChanged(nameof(IntervalInfo));
     }
     if (!RewardItems.DeepEqualsList(other.RewardItems))
     {
         RewardItems = other.RewardItems;
         OnPropertyChanged(nameof(RewardItems));
     }
     if (PresentationNodeType != other.PresentationNodeType)
     {
         PresentationNodeType = other.PresentationNodeType;
         OnPropertyChanged(nameof(PresentationNodeType));
     }
     if (!TraitIds.DeepEqualsListNaive(other.TraitIds))
     {
         TraitIds = other.TraitIds;
         OnPropertyChanged(nameof(TraitIds));
     }
     if (!TraitHashes.DeepEqualsListNaive(other.TraitHashes))
     {
         TraitHashes = other.TraitHashes;
         OnPropertyChanged(nameof(TraitHashes));
     }
     if (!ParentNodeHashes.DeepEqualsListNaive(other.ParentNodeHashes))
     {
         ParentNodeHashes = other.ParentNodeHashes;
         OnPropertyChanged(nameof(ParentNodeHashes));
     }
     if (Hash != other.Hash)
     {
         Hash = other.Hash;
         OnPropertyChanged(nameof(Hash));
     }
     if (Index != other.Index)
     {
         Index = other.Index;
         OnPropertyChanged(nameof(Index));
     }
     if (Redacted != other.Redacted)
     {
         Redacted = other.Redacted;
         OnPropertyChanged(nameof(Redacted));
     }
 }
コード例 #46
0
ファイル: LayoutController.cs プロジェクト: AlexSneg/VIRD-1.0
        public void InitLayoutController()
        {
            m_presentation = PresentationController.Instance.Presentation;
            m_presentationInfo = PresentationController.Instance.PresentationInfo;
            PresentationController.Instance.OnSlideLockChanged += new SlideLockChanged(OnSlideLockChanged);
            PresentationController.Instance.OnSlideLayoutChanged += new SlideLayoutChanged(Instance_OnSlideLayoutChanged);
            PresentationController.Instance.OnSavePresentation += new SavePresentation(Instance_OnSavePresentation);
            UndoService.Instance.OnHistoryChanged += new HistoryChanged(OnHistoryChanged);
            this.Model.HistoryManager.RecordComplete += new EventHandler(HistoryManager_CommandCompleted);
            DesignerClient.Instance.PresentationNotifier.OnResourceAdded += new EventHandler<NotifierEventArg<ResourceDescriptor>>(PresentationNotifier_OnResourceAdded);
            DesignerClient.Instance.PresentationNotifier.OnResourceDeleted += new EventHandler<NotifierEventArg<ResourceDescriptor>>(PresentationNotifier_OnResourceDeleted);
            backProvider = new BackgroundProvider();
            //load background sources
            Dictionary<string, IList<ResourceDescriptor>> _rd = DesignerClient.Instance.PresentationWorker.GetLocalSources(m_presentation.UniqueName);
            foreach (var resource in _rd)
            {
                foreach (ResourceDescriptor r in resource.Value)
                    if (r is BackgroundImageDescriptor)
                    {
                        backgrounds.Add(r.ResourceInfo.Id, (BackgroundImageDescriptor)r);
                    }
            }

            Instance_OnSlideLayoutChanged(PresentationController.Instance.CurrentSlideLayout);
        }
コード例 #47
0
 static void importPresentation_OnPresentationDeleted(PresentationInfo presentationInfo)
 {
     DesignerClient.Instance.PresentationNotifier.PresentationDeleted(
         Thread.CurrentPrincipal as UserIdentity,
         new PresentationInfoExt(presentationInfo, null));
 }
コード例 #48
0
 public PresentationPropertiesForm(PresentationInfo info)
     : this(info, false)
 { }