Beispiel #1
0
        /// <summary>
        /// Constructs the parent NodeInfo based on the values in the supplied NodeInfo.
        /// </summary>
        public override NodeInfo GetParentNodeInfo(NodeInfo info)
        {
            NodeInfo newInfo = new NodeInfo(ParentSource.GetNodeType <ScenarioFileNodeType>(),
                                            info.Identifier.Remove(info.Identifier.IndexOf('|')));

            return(newInfo);
        }
        protected override void Act()
        {
            //wire up
            var section = base.GetMergedSection();

            ParentSource.DoSourceSectionChanged(base.SectionName);
        }
        /// <summary>
        /// Constructs the parent NodeInfo based on the values in the supplied NodeInfo.
        /// </summary>
        public override NodeInfo GetParentNodeInfo(NodeInfo info)
        {
            NodeInfo newInfo = new NodeInfo(
                ParentSource.GetNodeType <UnextractedFolderNodeType>(), Path.GetDirectoryName(info.Identifier));

            return(newInfo);
        }
        /// <summary>
        /// Returns an array of NodeInfo entries that exist beneath the specified NodeInfo.
        /// </summary>
        public override NodeInfo[] GetChildNodes(NodeInfo info)
        {
            List <NodeInfo> children = new List <NodeInfo>();

            children.Add(new NodeInfo(ParentSource.GetNodeType <EssentialTagsRoot>(), "Essential Tags"));
            return(children.ToArray());
        }
        private void SaveAction(object obj)
        {
            try
            {
                if (Helpers.ShowMessage("Yakin Menyimpan Data ? ", "Pilih", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
                {
                    if (IsBusy)
                    {
                        return;
                    }
                    IsBusy = true;
                    pti model = (pti)this;
                    model.FromId = SettingConfiguration.GetIntValue("CityId");
                    if (IsListValid(model.Collies))
                    {
                        context.SaveChange(model);
                        Saved = true;
                        PTI p = new PTI
                        {
                            ShiperID     = this.ShiperID,
                            RecieverId   = this.RecieverId,
                            CreatedDate  = this.CreatedDate,
                            Id           = this.Id,
                            PayType      = this.PayType,
                            Pcs          = this.Collies.Sum(O => O.Pcs),
                            Weight       = this.Collies.Sum(O => O.Weight),
                            RecieverName = this.Reciever.Name,
                            ShiperName   = this.Shiper.Name,
                            Biaya        = this.Collies.Sum(O => O.Biaya),
                            User         = Authorization.User.Name
                        };
                        ParentSource.Add(p);



                        Helpers.ShowMessage("PTI Berhasil Disimpan");
                        if (Helpers.ShowMessage("Input PTI Baru ? ", "Pilih", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
                        {
                            SetNew();
                        }
                        else
                        {
                            WindowClose();
                        }
                    }
                    else
                    {
                        Helpers.ShowErrorMessage("Item Data Tidak Lengkap, Periksa Kembali");
                    }
                }
            }
            catch (Exception ex)
            {
                MyMessage.Show(ex.Message, "Error", MessageBoxButton.OK);
            }
            finally
            {
                IsBusy = false;
            }
        }
Beispiel #6
0
        /// <summary>
        /// Constructs the parent NodeInfo based on the values in the supplied NodeInfo.
        /// </summary>
        public override NodeInfo GetParentNodeInfo(NodeInfo info)
        {
            TagArchiveObjectViewNodeSource source = (TagArchiveObjectViewNodeSource)ParentSource;
            string   groupName  = source.GetHLTGroupFromFilename(info.Identifier);
            NodeInfo parentInfo = new NodeInfo(ParentSource.GetNodeType <UnextractedHLTGroupNodeType>(), groupName);

            return(parentInfo);
        }
 protected override void Act()
 {
     //wire up
     var section = base.GetMergedSection();
     ParentSource.Remove(SectionName);
     ParentSource.Add(SectionName, new DummySectionWithCollections { Name = "parent", Value = 33 });
     ParentSource.DoSourceChanged(new []{base.SectionName});
 }
Beispiel #8
0
        /// <summary>
        /// Returns an array of NodeInfo entries that exist beneath the specified NodeInfo.
        /// </summary>
        public override NodeInfo[] GetChildNodes(NodeInfo info)
        {
            List <NodeInfo> children = new List <NodeInfo>();

            children.Add(new NodeInfo(ParentSource.GetNodeType <PropertiesRootNodeType>(), "properties"));
            children.AddRange(base.GetChildNodes(info));
            children.Add(new NodeInfo(ParentSource.GetNodeType <RecycleBinRootNodeType>(), "recyclebin"));
            return(children.ToArray());
        }
Beispiel #9
0
        protected override void Because_of()
        {
            var source = new ParentSource {
                Value = new Source {
                    Foo = "5",
                }
            };

            _result = Mapper.Map <ParentSource, ParentDestination>(source);
        }
Beispiel #10
0
        /// <summary>
        /// Constructs the parent NodeInfo based on the values in the supplied NodeInfo.
        /// </summary>
        public override NodeInfo GetParentNodeInfo(NodeInfo info)
        {
            string   parentPath = Path.GetDirectoryName(info.Identifier).Trim('\\');
            NodeInfo newInfo;

            if (parentPath == "")
            {
                newInfo = new NodeInfo(ParentSource.GetNodeType <RootNodeType>(), parentPath);
            }
            else
            {
                newInfo = new NodeInfo(ParentSource.GetNodeType <FolderNodeType>(), parentPath);
            }
            return(newInfo);
        }
Beispiel #11
0
        /// <summary>
        /// Returns an array of NodeInfo entries that exist beneath the specified NodeInfo.
        /// </summary>
        public override NodeInfo[] GetChildNodes(NodeInfo info)
        {
            List <NodeInfo>      children = new List <NodeInfo>();
            TagArchiveNodeSource source   = (TagArchiveNodeSource)ParentSource;

            TagPath tagPath = new TagPath(info.Identifier, source.Game.GameID, TagLocation.Archive);
            TagFile file    = Core.Prometheus.Instance.Pool.GetTagFile(tagPath);

            foreach (string attachment in file.Attachments)
            {
                NodeInfo attachmentInfo = new NodeInfo(ParentSource.GetNodeType <AttachedScriptNodeType>(),
                                                       info.Identifier + "|" + attachment);
                children.Add(attachmentInfo);
            }
            return(children.ToArray());
        }
Beispiel #12
0
            protected override void Establish_context()
            {
                Mapper.CreateMap <Source, Destination>().ConvertUsing(arg => new Destination {
                    Type = Convert.ToInt32(arg.Foo)
                });
                Mapper.CreateMap <ParentSource, ParentDestination>();

                var source = new ParentSource
                {
                    Value = new Source {
                        Foo = "5",
                    }
                };

                _result = Mapper.Map <ParentSource, ParentDestination>(source);
            }
    static void Main(string[] args)
    {
        AutoMapper.Mapper.CreateMap <ParentSource, ParentDestination>().ConvertUsing <CustomTypeConverter>();
        ParentSource ps = new ParentSource()
        {
            parentId = Guid.NewGuid()
        };

        for (int i = 0; i < 3; i++)
        {
            ps.children.Add(new ChildSource()
            {
                childId = Guid.NewGuid()
            });
        }
        var mappedObject = AutoMapper.Mapper.Map <ParentDestination>(ps);
    }
Beispiel #14
0
        /// <summary>
        /// Returns an array of NodeInfo entries that exist beneath the specified NodeInfo.
        /// </summary>
        public override NodeInfo[] GetChildNodes(NodeInfo info)
        {
            List <NodeInfo> children = new List <NodeInfo>();
            TagArchiveObjectViewNodeSource source = (TagArchiveObjectViewNodeSource)ParentSource;

            foreach (string group in source.Game.TypeTable.HighLevelTypeGroups)
            {
                foreach (TypeTableEntry entry in source.Game.TypeTable.GetHighLevelTypes(group))
                {
                    if (source.Library.MissingFilesArchive.FileTypeExists(entry.FullName))
                    {
                        children.Add(new NodeInfo(ParentSource.GetNodeType <UnextractedHLTGroupNodeType>(), "[" + group + "]"));
                        break;
                    }
                }
            }
            return(children.ToArray());
        }
Beispiel #15
0
        /// <summary>
        /// Returns an array of NodeInfo entries that exist beneath the specified NodeInfo.
        /// </summary>
        public override NodeInfo[] GetChildNodes(NodeInfo info)
        {
            List <NodeInfo> children = new List <NodeInfo>();
            TagArchiveObjectViewNodeSource source = (TagArchiveObjectViewNodeSource)ParentSource;

            string group = info.Identifier.Trim('[', ']');

            foreach (TypeTableEntry entry in source.Game.TypeTable.GetHighLevelTypes(group))
            {
                // Get a list of the tags that match the HLT supplied inside the brackets.
                string[] files = (source.Library.MissingFilesArchive.GetFileList("", entry.FullName, true));
                foreach (string file in files)
                {
                    NodeInfo child = new NodeInfo(ParentSource.GetNodeType <UnextractedHLTNodeType>(), file.Trim('\\'));
                    children.Add(child);
                }
            }
            return(children.ToArray());
        }
        /// <summary>
        /// Returns an array of NodeInfo entries that exist beneath the specified NodeInfo.
        /// </summary>
        public override NodeInfo[] GetChildNodes(NodeInfo info)
        {
            List <NodeInfo> children = new List <NodeInfo>();
            TagArchiveObjectViewNodeSource source = (TagArchiveObjectViewNodeSource)ParentSource;

            foreach (string group in source.Game.TypeTable.HighLevelTypeGroups)
            {
                bool itemExists = false;
                foreach (TypeTableEntry entry in source.Game.TypeTable.GetHighLevelTypes(group))
                {
                    if (source.Library.FileTypeExists(entry.FullName))
                    {
                        itemExists = true;
                    }
                }
                if (!itemExists)
                {
                    continue;
                }
                children.Add(new NodeInfo(ParentSource.GetNodeType <HLTGroupNodeType>(), "[" + group + "]"));
            }
            return(children.ToArray());
        }
Beispiel #17
0
 /// <summary>
 /// Constructs the parent NodeInfo based on the values in the supplied NodeInfo.
 /// </summary>
 public override NodeInfo GetParentNodeInfo(NodeInfo info)
 {
     return(new NodeInfo(ParentSource.GetNodeType <PropertiesRootNodeType>(), "Properties"));
 }
 /// <summary>
 /// Constructs the parent NodeInfo based on the values in the supplied NodeInfo.
 /// </summary>
 public override NodeInfo GetParentNodeInfo(NodeInfo info)
 {
     return(new NodeInfo(ParentSource.GetNodeType <EssentialTagsRoot>(), "Essential Tags"));
 }
Beispiel #19
0
 /// <summary>
 /// Constructs the parent NodeInfo based on the values in the supplied NodeInfo.
 /// </summary>
 public override NodeInfo GetParentNodeInfo(NodeInfo info)
 {
     return(new NodeInfo(ParentSource.GetNodeType <UnextractedObjectViewRootNodeType>(), ""));
 }