Esempio n. 1
0
 public void CopyFrom(ReceptionEquipment receptionEquip)
 {
     this.m_CIList.Clear();
     this.m_CIList.AddRange(receptionEquip.CIList);
     this.m_LinkType = receptionEquip.Link;
     this.m_Name = receptionEquip.Name;
 }
        public IQueryable<LinkObjectMaster> GetChildLinkObjectId(LinkType masterLinkType, int masterLinkId, LinkType childLinkType)
        {
            var linkObjectList = new List<LinkObjectMaster>();

            _dataEngine.InitialiseParameterList();
            _dataEngine.AddParameter("@MasterLinkTypeId", ((int)masterLinkType).ToString());
            _dataEngine.AddParameter("@MasterLinkId", masterLinkId.ToString());
            _dataEngine.AddParameter("@ChildLinkTypeId", ((int)childLinkType).ToString());

            _sqlToExecute = "SELECT * FROM [dbo].[LinkObjectMaster] ";
            _sqlToExecute += "WHERE MasterLinkTypeId = @MasterLinkTypeId ";
            _sqlToExecute += "AND MasterLinkId = @MasterLinkId ";
            _sqlToExecute += "AND ChildLinkTypeId = @ChildLinkTypeId ";

            if (!_dataEngine.CreateReaderFromSql(_sqlToExecute))
                throw new Exception("Link - GetLinkObject failed");

            while (_dataEngine.Dr.Read())
            {
                LinkObjectMaster linkObject = CreateLinkObjectFromData();
                linkObjectList.Add(linkObject);
            }

            return linkObjectList.AsQueryable();
        }
        /// <summary>
        /// Creates a symbolic link at the specified location to the specified destination
        /// </summary>
        /// <param name="linkPath">The path where the symbolic link will be created</param>
        /// <param name="destination">The path where the symbolic link will link to</param>
        /// <param name="overrideExisting">Whether an existing file/folder should be overridden</param>
        /// <param name="type">The LinkType, a file or a directory</param>
        /// <exception cref="TargetAlreadyExistsException">The given <paramref name="linkPath"/> already exists and <paramref name="overrideExisting"/> was false</exception>
        public static void Create(string linkPath, string destination, bool overrideExisting, LinkType type)
        {
            if (type == LinkType.DirectoryLink && Directory.Exists(linkPath)) {
                if (!overrideExisting) {
                    throw new TargetAlreadyExistsException("Directory already exists");
                }
            } else if (type == LinkType.FileLink && File.Exists(linkPath)) {
                if (!overrideExisting) {
                    throw new TargetAlreadyExistsException("File already exists");
                }
            }

            // Start process with privileges
            var process = new Process();
            process.StartInfo.FileName = Assembly.GetExecutingAssembly().CodeBase;
            process.StartInfo.Verb = "runas"; // Adminrights
            process.StartInfo.CreateNoWindow = true;
            process.StartInfo.Arguments = string.Join(" ", CommandLineArgs.ArgsFromDictionary(new Dictionary<string, string> {
                { ActionArgumentTitle, ActionArgumentCreate },
                //{ DebugArgumentTitle, "=True" },
                { CreateLinkPathArgumentTitle, linkPath },
                { CreateDestinationArgumentTitle, destination },
                { CreateLinkTypeArgumentTitle, type.ToString() }}));

            process.Start();
            process.WaitForExit();
        }
Esempio n. 4
0
 public ConnectionGroup(ConnectionManager manager, IPEndPoint remoteEP,LinkType link)
 {
     _link = link;
     _manager = manager;
     _remoteEP = remoteEP;
     _connections = new Queue<FdfsConnection>();
 }
Esempio n. 5
0
 /// <summary>
 /// Create a <see cref="Link"/> using the given parameters.
 /// </summary>
 /// <param name="type">The <see cref="Link.Type"/> to use.</param>
 /// <param name="id">The id to set (for artists, albums and tracks) or null.</param>
 /// <param name="user">The user to set (for playlists) or null.</param>
 /// <param name="query">The search query to set (for search) or null.</param>
 private Link(LinkType type, string id, string user, string query)
 {
     this._type = type;
     this._id = id;
     this._user = user;
     this._query = query;
 }
Esempio n. 6
0
 private void AddItem(Brick connection, LinkType linktype)
 {
     Button button = new Button();
     button.FlatStyle = FlatStyle.Flat;
     button.FlatAppearance.BorderColor = SystemColors.Control;
     button.FlatAppearance.BorderSize = 0;
     button.FlatAppearance.MouseOverBackColor = SystemColors.ControlLightLight;
     button.FlatAppearance.MouseDownBackColor = SystemColors.HotTrack;
     button.AutoEllipsis = false;
     if (linktype == LinkType.USB) { button.Image = global::NXTLibTesterGUI.Properties.Resources.usb2; }
     if (linktype == LinkType.Bluetooth) { button.Image = global::NXTLibTesterGUI.Properties.Resources.bluetooth; }
     button.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
     button.Location = new System.Drawing.Point(3, 0);
     if (linktype == LinkType.USB) { button.Name = "USB"; }
     if (linktype == LinkType.Bluetooth) { button.Name = "BLU" + Utils.AddressByte2String(connection.brickinfo.address, true); }
     button.Size = new System.Drawing.Size(259, 20);
     button.Margin = new System.Windows.Forms.Padding(0, 0, 0, 0);
     button.TabIndex = 1;
     button.Text = "       " + connection.brickinfo.name;
     button.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     button.MouseDown += Button_MouseDown;
     button.MouseClick += Item_Click;
     button.MouseUp += Button_MouseUp;
     List.Invoke(new MethodInvoker(delegate { List.Controls.Add(button); }));
 }
Esempio n. 7
0
 public ReactionLinkCommand(SpeciesReference speciesReference, Reaction reaction, LinkType linkType, bool adding)
 {
     this.speciesReference = speciesReference;
     this.reaction = reaction;
     this.linkType = linkType;
     this.adding = adding;
 }
Esempio n. 8
0
        public IEnumerable<LinkItem> GetData(LinkType type)
        {
            urn.items.items m_its_database = LoadData() as urn.items.items;

            if (m_its_database != null)
            {
                IList<LinkItem> itemsList = new List<LinkItem>();

                var items = from i in m_its_database.item
                            select i;

                foreach (var item in items)
                {
                    var linkItem = new LinkItem()
                    {
                        Link = item.url,
                        Title = item.title,
                        Description = item.description,
                        Date = item.date != DateTime.MinValue ? GetDate(item.date, item.type) : null,
                        Type = GetLinkType(item.type)

                    };

                    itemsList.Add(linkItem);
                }

                return itemsList.Where(c => c.Type == type);
            }

            return null;
        }
Esempio n. 9
0
 public LinkView(Guid mapUid, CompendiumNode originNode, XmlDocument doc, XmlElement parent, LinkType linkType)
     : this(doc, parent, linkType)
 {
     AddAttributeByKeyValue("id", mapUid.ToLongString());
     AddAttributeByKeyValue("created", originNode.Created);
     AddAttributeByKeyValue("lastModified", originNode.LastModified);
 }
Esempio n. 10
0
 /// <summary>
 /// 获取指定类型的链接
 /// </summary>
 /// <param name="type"></param>
 /// <returns></returns>
 public IEnumerable<Link> GetLinks(LinkType type)
 {
     foreach (Link link in GetAll())
     {
         if (link.Visible &&link.Type == (int)type) yield return link;
     }
 }
Esempio n. 11
0
        public static MvcHtmlString CreateLink(this HtmlHelper htmlHelper, string text, LinkType linkType, object htmlAttributes = null, params object[] args)
        {
            string urlPattern = null;
            string anchorHtml, url;

            switch (linkType)
            {
                case LinkType.CategoryDetail:
                    urlPattern = configurationManager.GetConfigValue(SystemConstants.CategoryLinkPatternConfigKey) as string;
                    break;
                case LinkType.ProductDetail:
                    urlPattern = configurationManager.GetConfigValue(SystemConstants.ProductLinkPatternConfigKey) as string;
                    break;
                case LinkType.ManufacturerDetail:
                    urlPattern = configurationManager.GetConfigValue(SystemConstants.ManufacturerLinkPatternConfigKey) as string;
                    break;
                case LinkType.ReviewReadMore:
                    urlPattern = configurationManager.GetConfigValue(SystemConstants.ReviewReadMorePatternConfigKey) as string;
                    break;
            }

            if (!string.IsNullOrEmpty(urlPattern))
            {
                url = urlPattern.FormatWith(args);
                anchorHtml = SystemConstants.AnchorTemplate.FormatWith(url, text, "");
            }
            else
            {
                anchorHtml = "";
            }

            return new MvcHtmlString(anchorHtml);
        }
Esempio n. 12
0
		public ItemTab(Item item, LinkType type, ProductionGraphViewer parent)
			: base(parent)
		{
			this.Item = item;
			this.Type = type;
			centreFormat.Alignment = centreFormat.LineAlignment = StringAlignment.Center;
		}
Esempio n. 13
0
        private TorrentLink(string path, LinkType linkType)
        {
            if (path == null)
                throw new ArgumentNullException(nameof(path));

            this.path = path;
            this.linkType = linkType;
        }
Esempio n. 14
0
 public LinkView(Guid mapUid, IGlymaRelationship relationship, XmlDocument doc, XmlElement parent, LinkType linkType)
     : this(doc, parent, linkType)
 {
     AddAttributeByKeyValue("id", mapUid.ToLongString());
     AddAttributeByKeyValue("created", relationship.Created);
     AddAttributeByKeyValue("lastModified", relationship.LastModified);
     
 }
Esempio n. 15
0
 public MenuItem(string text, LinkType linkType, Action executeAction)
 {
     LinkType = linkType;
     ExecuteAction = executeAction;
     FadeEffect = new FadeImageEffect{FadeSpeed = 1.0f};
     Image = new ImageFile{Text = text};
     Image.ActivateEffect(FadeEffect);
 }
Esempio n. 16
0
 /// <summary>
 /// コンストラクタ。
 /// </summary>
 /// <param name="lipId">口形状種別ID。</param>
 /// <param name="linkType">前の音からの繋ぎ方を表す列挙値。</param>
 /// <param name="lengthPercent">
 /// フレーム長の基準値に対するパーセント値。
 /// </param>
 public LipSyncUnit(
     LipId lipId,
     LinkType linkType,
     int lengthPercent)
 {
     this.LipId = lipId;
     this.LinkType = linkType;
     this.LengthPercent = lengthPercent;
 }
Esempio n. 17
0
 /// <summary>
 /// Initializes a new instance of LinkRequest.
 /// </summary>
 /// <param name="linkType">Type of the link.</param>
 /// <param name="symbolName">The method whose code is being patched.</param>
 /// <param name="methodOffset">The method offset.</param>
 /// <param name="methodRelativeBase">The method relative base.</param>
 /// <param name="targetSymbolName">The linker symbol to link against.</param>
 /// <param name="offset">An offset to apply to the link target.</param>
 public LinkRequest(LinkType linkType, string symbolName, int methodOffset, int methodRelativeBase, string targetSymbolName, IntPtr offset)
 {
     this.symbolName = symbolName;
     this.methodOffset = methodOffset;
     this.linkType = linkType;
     this.methodRelativeBase = methodRelativeBase;
     this.targetSymbolName = targetSymbolName;
     this.offset = offset;
 }
        /// <summary>
        /// Creates a chain from start to end points containing the specified number of links.
        /// </summary>
        /// <param name="physicsSimulator"><see cref="PhysicsSimulator"/> to add the chain to.</param>
        /// <param name="start">Starting point of the chain.</param>
        /// <param name="end">Ending point of the chain.</param>
        /// <param name="links">Number of links desired in the chain.</param>
        /// <param name="height">Height of each link.</param>
        /// <param name="mass">Mass of each link.</param>
        /// <param name="type">The joint/spring type.</param>
        /// <returns>Path</returns>
        public Path CreateChain(PhysicsSimulator physicsSimulator, Vector2 start, Vector2 end, int links, float height,
                                float mass, LinkType type)
        {
            Path p = CreateChain(start, end, (Vector2.Distance(start, end) / links), height, mass, type);

            p.AddToPhysicsSimulator(physicsSimulator);

            return p;
        }
Esempio n. 19
0
 public static string GetHrefContent(this AtomLinkCollection links, LinkType feedType = LinkType.listfeed)
 {
     foreach (var link in links)
     {
         if (link.Rel.EndsLike(feedType.ToString()))
             return link.HRef.Content;
     }
     return null;
 }
Esempio n. 20
0
        /// <summary>Assigns all needed attributes to the tag</summary>
        /// <returns>This instance downcasted to base class</returns>
        public virtual IndexedTag attr(
            Charset charset = null,
            string href = null,
            LangCode hreflang = null,
            Target target = null,
            MimeType type = null,
            LinkType? rel = null,
            LinkType? rev = null,
            Media? media = null,
            string id = null,
            string @class = null,
            string style = null,
            string title = null,
            LangCode lang = null,
            string xmllang = null,
            Dir? dir = null,
            string onclick = null,
            string ondblclick = null,
            string onmousedown = null,
            string onmouseup = null,
            string onmouseover = null,
            string onmousemove = null,
            string onmouseout = null,
            string onkeypress = null,
            string onkeydown = null,
            string onkeyup = null
        )
        {
            Charset = charset;
            Href = href;
            HrefLang = hreflang;
            Target = target;
            Type = type;
            Rel = rel;
            Rev = rev;
            Media = media;
            Id = id;
            Class = @class;
            Style = style;
            Title = title;
            Lang = lang;
            XmlLang = xmllang;
            Dir = dir;
            OnClick = onclick;
            OnDblClick = ondblclick;
            OnMouseDown = onmousedown;
            OnMouseUp = onmouseup;
            OnMouseOver = onmouseover;
            OnMouseMove = onmousemove;
            OnMouseOut = onmouseout;
            OnKeyPress = onkeypress;
            OnKeyDown = onkeydown;
            OnKeyUp = onkeyup;

            return this;
        }
Esempio n. 21
0
 /// <summary>
 /// Initializes a new instance of LinkRequest.
 /// </summary>
 /// <param name="linkType">Type of the link.</param>
 /// <param name="patches">The patches.</param>
 /// <param name="symbolName">The symbol that is being patched.</param>
 /// <param name="symbolOffset">The symbol offset.</param>
 /// <param name="relativeBase">The base virtualAddress, if a relative link is required.</param>
 /// <param name="targetSymbol">The linker symbol to link against.</param>
 /// <param name="targetOffset">An offset to apply to the link target.</param>
 public LinkRequest(LinkType linkType, Patch[] patches, string symbolName, int symbolOffset, int relativeBase, string targetSymbol, long targetOffset)
 {
     this.SymbolName = symbolName;
     this.SymbolOffset = symbolOffset;
     this.LinkType = linkType;
     this.SymbolRelativeBase = relativeBase;
     this.TargetSymbol = targetSymbol;
     this.TargetOffset = targetOffset;
     this.Patches = patches;
 }
Esempio n. 22
0
File: MCS.cs Progetto: xiaoyj/Space
 public void CopyFrom(MCS mcs)
 {
     this.m_BearEfficiency = mcs.BearEfficiency;
     this.m_CodingRate = mcs.CodingRate;
     this.m_Name = mcs.Name;
     this.m_MCSLINKTYPE = mcs.MCSLINKTYPE;
     this.m_Modulation = mcs.Modulation;
     this.m_ModulationOrder = mcs.ModulationOrder;
     this.m_TBSIndex = mcs.TBSIndex;
 }
Esempio n. 23
0
 public float GetFastFadingdB(ISimCellBase carrier, ISimUser user, LinkType type)
 {
     float speed = user.TrafficUser.Mobility.MeanSpeed;            
     float frequency = (float)(carrier.Cell.FreqBand.DLFrequency * 1e6);
     //ChannelTypeManage CTManage = new ChannelTypeManage();
     //CTManage.GetChannelTypeInfo();
     ChannelType CT = m_CTManage.SpeedChannelDic[speed];
     ChannelModel CM = new ChannelModel(CT.ChannelPath, speed, frequency);
     CalcFastFading calc = new CalcFastFading(10);
     return  calc.GetFastFadingdB(CM, m_TimeSpan);            
 }      
Esempio n. 24
0
        private LinkBase(LinkType linkType, string propertyName, ModelItem sourceVertex, ModelItem destinationVertex)
        {
            Fx.Assert(linkType != LinkType.Item || propertyName == null, "propertyName should be null when linkType is LinkType.Item");
            Fx.Assert(sourceVertex != null, "sourceVertex should not be null");
            Fx.Assert(destinationVertex != null, "destinationVertex should not be null");

            this.LinkType = linkType;
            this.PropertyName = propertyName;
            this.SourceVertex = sourceVertex;
            this.DestinationVertex = destinationVertex;
        }
Esempio n. 25
0
        public FdfsConnection GetConnection(LinkType link)
        {
            if (link == LinkType.Tracker)
            {
                int i = 0;
                IPEndPoint endPoint = null;
                int trackerSeq = 0;
                lock (_syncTracker)
                {
                    _trackerSeq++;
                    if (_trackerSeq >= _trackerNum)
                        _trackerSeq = 0;
                    trackerSeq = _trackerSeq;
                }

                foreach (IPEndPoint ip in _groupsTracker.Keys)
                {
                    if (i == trackerSeq)
                    {
                        endPoint = ip;
                        break;
                    }
                        i++;
                }

                return GetConnection(link, endPoint);
            }
            else
            {
                int i = 0;
                IPEndPoint endPoint = null;
                int storagesSeq = 0;
                lock (_syncStorages)
                {
                    _storagesSeq++;
                    if (_storagesSeq >= _storagesNum)
                        _storagesSeq = 0;
                    storagesSeq = _storagesSeq;
                }

                foreach (IPEndPoint ip in _groupsStorages.Keys)
                {
                    if (i == storagesSeq)
                    {
                        endPoint = ip;
                        break;
                    }
                    i++;
                }

                return GetConnection(link, endPoint);
            }
        }
Esempio n. 26
0
        private static string typeToString(LinkType type)
        {
            switch (type)
            {
                case LinkType.Magnet:return "magnet";
                case LinkType.OnlineFile:return "online";
                case LinkType.LocalFile:return "local";

                default:
                    throw new ArgumentOutOfRangeException(nameof(type));
            }
        }
Esempio n. 27
0
 /// <summary>
 /// 对时隙按照指定的优先级排序
 /// </summary>
 /// <param name="cell"></param>
 /// <param name="slots"></param>
 /// <param name="direction"></param>
 private void SortSlot(TDSimCell cell, LinkType direction)
 {
     ISlotSort sort = GetSlotSortMethod();
     foreach (TimeSlot slot in cell.Slots)
     {
         if (direction == slot.LinkDirection && slot.TsNum != TS.TS0)
         {
             m_Slots.Add(slot);
         }
     }
     m_Slots.Sort(sort);
 }
 public static string GetValue(LinkType linkType)
 {
     switch (linkType)
     {
         case LinkType.Inner:
             return "inner";
         case LinkType.Outer:
             return "outer";
         default:
             return string.Empty;
     }
 }
Esempio n. 29
0
        public static IRelatedObjects GetLinkRelatedRectangles(LinkType link)
        {
            switch (link)
            {
                case LinkType.Hard:
                    return new HardRelatedRectangles();

                case LinkType.Flexible:
                    return new FlexibleRelatedRectangles();

                default: return new HardRelatedRectangles();
            }
        }
Esempio n. 30
0
 public static string GetURL(LinkType type, string input)
 {
     string returnstr = "";
     switch (type)
     {
         case LinkType.Bird:
             returnstr = "http://www.rspb.org.uk/wildlife/birdguide/name/"+input.ToLower()[0]+"/"+input.ToLower().Replace(" ","").Replace("-","")+"/index.aspx";
             break;
         default:
             break;
     }
     return returnstr;
 }
Esempio n. 31
0
        internal override void Export(string table)
        {
            base.Export(table);

            table = GetType().Name;

            var vals = new List <object>
            {
                Id,
                EntityId.DBExport(),
                HfId.DBExport(),
                LinkType.DBExport(HFEntityLink.LinkTypes),
                Position.DBExport(HFEntityLink.Positions)
            };

            Database.ExportWorldItem(table, vals);
        }
Esempio n. 32
0
        public static string Create(LinkType type, long id, string title)
        {
            var name = Regex.Replace(title.IsNeu(""), "\\W", "-");

            name = title.IsNeu() ? "" : $"-{name}";
            switch (type)
            {
            case LinkType.Category:
                return($"/{Lang}/search?categoryId={id}");

            case LinkType.Product:
                return($"/{Lang}/product/{id}{name}");

            default:
                return(AppConst.Ui.JsVoid);
            }
        }
Esempio n. 33
0
        public async void Get()
        {
            var mock   = new ServiceMockFacade <ILinkTypeRepository>();
            var record = new LinkType();

            mock.RepositoryMock.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult(record));
            var service = new LinkTypeService(mock.LoggerMock.Object,
                                              mock.RepositoryMock.Object,
                                              mock.ModelValidatorMockFactory.LinkTypeModelValidatorMock.Object,
                                              mock.BOLMapperMockFactory.BOLLinkTypeMapperMock,
                                              mock.DALMapperMockFactory.DALLinkTypeMapperMock);

            ApiLinkTypeResponseModel response = await service.Get(default(int));

            response.Should().NotBeNull();
            mock.RepositoryMock.Verify(x => x.Get(It.IsAny <int>()));
        }
Esempio n. 34
0
        private static string GetLinkStr(this LinkType linkType)
        {
            switch (linkType)
            {
            case LinkType.And:
                return(" AND ");

            case LinkType.Exisit:
                return(" EXISIT( ");

            case LinkType.UnExisit:
                return(" UN EXISIT( ");

            default:
                throw new ArgumentOutOfRangeException("linkType", linkType, null);
            }
        }
Esempio n. 35
0
        private static string LinkAppend(this LinkType linkType)
        {
            switch (linkType)
            {
            case LinkType.And:
                return("");

            case LinkType.Exisit:
                return(" )");

            case LinkType.UnExisit:
                return(" )");

            default:
                throw new ArgumentOutOfRangeException("linkType", linkType, null);
            }
        }
Esempio n. 36
0
        //获取与RowNode相连的RowLink的集合,集合数组的下标为对端RowNode的urlId
        public RawLink[] GetConnectedLink(LinkType linkType, RawNode node)
        {
            RawLink[] resultLinks = new RawLink[NodeArray.Length];

            for (int i = 0; i < NodeArray.Length; i++)
            {
                if ((i != node.UrlId) && (NodeArray[i].Type != EndType.VPX))
                {//对端端点不能为自己,且不能为vpx端点
                    RawLink rLink = GetLinkValue(linkType, node.UrlId, i);
                    if (rLink != null)
                    {
                        resultLinks[i] = rLink;
                    }
                }
            }
            return(resultLinks);
        }
Esempio n. 37
0
 public Point GetInterfacePoint(LinkType type)
 {
     try
     {
         var vpxEndView = this.PlaneVpxArray[_bp.VirtualSlotsNum - 2];
         //找到对应示意区的矩形
         var areaRect = (type == LinkType.EtherNet) ? vpxEndView._infoAreaRects[0] : vpxEndView._infoAreaRects[1];
         int pointX   = areaRect.X + areaRect.Width / 2;
         int pointY   = areaRect.Y + areaRect.Height / 2;
         return(new Point(pointX, pointY));
     }
     catch (NullReferenceException ex)
     {
         MessageBox.Show("GetInterfacePoint:" + ex.Message);
         return(new Point(0, 0));
     }
 }
Esempio n. 38
0
        private RawLink GetLinkValue(LinkType type, int urlId1, int urlId2)
        {
            switch (type)
            {
            case LinkType.EtherNet:
                return(_ethLinksMatrix[urlId1, urlId2]);

            case LinkType.RapidIO:
                return(_rioLinksMatrix[urlId1, urlId2]);

            case LinkType.GTX:
                return(GtxLinksMatrix[urlId1, urlId2]);

            default:    //LinkType.LVDS
                return(LvdsLinksMatrix[urlId1, urlId2]);
            }
        }
Esempio n. 39
0
        internal override void Export(string table)
        {
            base.Export(table);

            table = GetType().Name;
            var vals = new List <object>
            {
                Id,
                SiteId.DBExport(),
                HfId.DBExport(),
                EntityId.DBExport(),
                StructureId.DBExport(),
                LinkType.DBExport(HFSiteLink.LinkTypes)
            };

            Database.ExportWorldItem(table, vals);
        }
Esempio n. 40
0
        public UniLink[] GetLinks(UniNode other, LinkType linkType)
        {
            if (m_links == null)
            {
                return(null);
            }
            List <UniLink> linksWithOther = new List <UniLink>();

            foreach (UniLink link in m_links)
            {
                if ((link.other == other) && (link.type == linkType))
                {
                    linksWithOther.Add(link);
                }
            }
            return(linksWithOther.ToArray());
        }
Esempio n. 41
0
        public UniNode[] GetLinkedNodes(LinkType linkType, out TLink[] linkValues)
        {
            List <UniNode> linkedNodes     = new List <UniNode>();
            List <TLink>   linksValuesList = new List <TLink>();

            for (int i = 0; i < m_links.Count; i++)
            {
                if (m_links[i].type == linkType)
                {
                    linkedNodes.Add(m_links[i].other);
                    linksValuesList.Add(m_links[i].value);
                }
            }

            linkValues = linksValuesList.ToArray();
            return(linkedNodes.ToArray());
        }
Esempio n. 42
0
        public IQueryable <LinkObjectMaster> GetChildLinkObjectId(LinkType masterLinkType, int masterLinkId, LinkType childLinkType)
        {
            try
            {
                var a = from b in _db.Links
                        where b.MasterLinkType == masterLinkType &&
                        b.MasterLinkId == masterLinkId &&
                        b.ChildLinkType == childLinkType
                        select b;

                return(a);
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
        }
Esempio n. 43
0
        private String getIconString(Item item, LinkType linkType)
        {
            String line1Format = "{0:0.##}{1}";
            String line2Format = "\n({0:0.##}{1})";
            String finalString = "";

            String unit = "";

            var actualAmount   = 0.0;
            var suppliedAmount = 0.0;

            if (linkType == LinkType.Input)
            {
                actualAmount   = DisplayedNode.GetConsumeRate(item);
                suppliedAmount = DisplayedNode.GetSuppliedRate(item);
            }
            else
            {
                actualAmount = DisplayedNode.GetSupplyRate(item);
            }
            if (Parent.Graph.SelectedAmountType == AmountType.Rate && Parent.Graph.SelectedUnit == RateUnit.PerSecond)
            {
                unit = "/s";
            }
            else if (Parent.Graph.SelectedAmountType == AmountType.Rate && Parent.Graph.SelectedUnit == RateUnit.PerMinute)
            {
                unit            = "/m";
                actualAmount   *= 60;
                suppliedAmount *= 60;
            }

            if (linkType == LinkType.Input)
            {
                finalString = String.Format(line1Format, actualAmount, unit);
                if (DisplayedNode.OverSupplied(item))
                {
                    finalString += String.Format(line2Format, suppliedAmount, unit);
                }
            }
            else
            {
                finalString = String.Format(line1Format, actualAmount, unit);
            }

            return(finalString);
        }
Esempio n. 44
0
        private static string getUrl(LinkType type, Card card, string language)
        {
            var title = card.Title.ToUrlSafeString();

            switch (type)
            {
                case LinkType.Dor_Cuarthol:
                    return string.Format("https://dorcuarthol.wordpress.com/?s={0}", title);
                case LinkType.Encyclopedia_of_Arda:
                    return string.Format("http://www.glyphweb.com/arda/search.asp?search={0}", title);
                case LinkType.Expecting_Mischief:
                    return string.Format("https://expectingmischief.wordpress.com/?s={0}", title);
                case LinkType.Hall_of_Beorn:
                    return string.Format("http://hallofbeorn.wordpress.com/?s={0}", title);
                case LinkType.Lord_of_the_Rings_Wiki:
                    return string.Format("http://lotr.wikia.com/wiki/{0}", title);
                case LinkType.Master_of_Lore:
                    return string.Format("http://masteroflore.wordpress.com/?s={0}", title);
                case LinkType.Second_Hand_Took:
                    return string.Format("http://secondhandtook.wordpress.com/?s={0}", title);
                case LinkType.Tales_from_the_Cards:
                    return string.Format("http://talesfromthecards.wordpress.com/?s={0}", title);
                case LinkType.Tolkien_Gateway:
                    return string.Format("http://tolkiengateway.net/wiki/{0}", title);
                case LinkType.Wikipedia:
                    return string.Format("https://en.wikipedia.org/wiki/{0}", title);

                case LinkType.The_Mirkwood_Runner:
                    return string.Format("http://mirkwoodrunner.blogspot.com/search/label/{0}", title.ToLowerSafe());
                case LinkType.Warden_of_Arnor:
                    return string.Format("http://wardenofarnor.wordpress.com/?s={0}", title);
                case LinkType.Heroes_of_the_Rings:
                    return string.Format("http://heroesoftherings.blogspot.com/search/label/{0}", title.ToLowerSafe());
                case LinkType.Very_Late_Adventurer:
                    return string.Format("https://verylateadventurer.wordpress.com/?s={0}", title);
                case LinkType.Susurros_del_Bosque_Viejo:
                    return string.Format("http://susurrosdelbosqueviejo.blogspot.com/search/label/{0}", title.ToLowerSafe());
                case LinkType.El_Libro_Rojo_de_Bolson_Cerrado:
                    return string.Format("https://ellibrorojodebolsoncerrado.wordpress.com/?s={0}", title);
                case LinkType.Die_Manner_von_Gondor:
                    return string.Format("https://menofgondor.wordpress.com/?s={0}", title);
                default:
                    return string.Empty;
            }
        }
Esempio n. 45
0
    private void RefreshDetailInfos(List <DetailInfo> detailInfos, List <int> eventIds)
    {
        if (detailInfos == null || detailInfos.get_Count() == 0 || eventIds == null || eventIds.get_Count() == 0)
        {
            return;
        }
        int num = 0;

        while (num < detailInfos.get_Count() && num < eventIds.get_Count())
        {
            DetailInfo detailInfo = detailInfos.get_Item(num);
            if (eventIds.get_Item(num) > 0)
            {
                GuangBoLianJie guangBoLianJie = DataReader <GuangBoLianJie> .Get(eventIds.get_Item(num));

                if (guangBoLianJie != null)
                {
                    detailInfo.type = LinkType.GetDetailType(guangBoLianJie.type);
                    if (detailInfo.type == DetailType.DT.UI)
                    {
                        detailInfo.cfgId = guangBoLianJie.link;
                        detailInfo.label = GameDataUtils.GetChineseContent(guangBoLianJie.name, false);
                    }
                    else if (detailInfo.type == DetailType.DT.Interface)
                    {
                        detailInfo.cfgId = guangBoLianJie.hitEventId;
                        detailInfo.label = GameDataUtils.GetChineseContent(guangBoLianJie.name, false);
                    }
                    else if (detailInfo.type == DetailType.DT.Equipment && eventIds.get_Item(num) == 66)
                    {
                        detailInfo.label = GameDataUtils.GetItemName(detailInfo.cfgId, false, 0L);
                    }
                    if (guangBoLianJie.click == 0)
                    {
                        detailInfo.type = DetailType.DT.Default;
                    }
                }
            }
            else
            {
                detailInfo.type = DetailType.DT.Default;
            }
            num++;
        }
    }
Esempio n. 46
0
        /// <summary>
        /// Generates a http(s) url to the repository in the remote server, optionally
        /// pointing to a specific file and specific line range in it.
        /// </summary>
        /// <param name="linkType">Type of link to generate</param>
        /// <param name="path">The file to generate an url to. Optional.</param>
        /// <param name="startLine">A specific line, or (if specifying the <paramref name="endLine"/> as well) the start of a range</param>
        /// <param name="endLine">The end of a line range on the specified file.</param>
        /// <returns>An UriString with the generated url, or null if the repository has no remote server configured or if it can't be found locally</returns>
        public async Task <UriString> GenerateUrl(LinkType linkType, string path = null, int startLine = -1, int endLine = -1)
        {
            if (CloneUrl == null)
            {
                return(null);
            }

            var sha = await GitService.GitServiceHelper.GetLatestPushedSha(path ?? LocalPath);

            // this also incidentally checks whether the repo has a valid LocalPath
            if (String.IsNullOrEmpty(sha))
            {
                return(CloneUrl.ToRepositoryUrl().AbsoluteUri);
            }

            if (path != null && Path.IsPathRooted(path))
            {
                // if the path root doesn't match the repository local path, then ignore it
                if (!path.StartsWith(LocalPath, StringComparison.OrdinalIgnoreCase))
                {
                    Debug.Assert(false, String.Format(CultureInfo.CurrentCulture, "GenerateUrl: path {0} doesn't match repository {1}", path, LocalPath));
                    path = null;
                }
                else
                {
                    path = path.Substring(LocalPath.Length + 1);
                }
            }

            if (startLine > 0 && endLine > 0 && startLine > endLine)
            {
                // if startLine is greater than endLine and both are set, swap them
                var temp = startLine;
                startLine = endLine;
                endLine   = temp;
            }

            if (startLine == endLine)
            {
                // if startLine is the same as endLine don't generate a range link
                endLine = -1;
            }

            return(new UriString(GenerateUrl(linkType, CloneUrl.ToRepositoryUrl().AbsoluteUri, sha, path, startLine, endLine)));
        }
Esempio n. 47
0
        public static ValidateLinkResult ValidateLink(Serialization.Node outNode, string outName, Serialization.Node inNode, string inName)
        {
            LinkType linkOut = GetLinkType(outNode, outName);
            LinkType linkIn  = GetLinkType(inNode, inName);

            EB.Debug.Log(string.Format("ValidateLink: ({0}:{1} => {2}:{3})", linkOut, outName, linkIn, inName));

            switch (linkOut)
            {
            case LinkType.Trigger:
            {
                if (ValidateTrigger(outNode, outName))
                {
                    if (linkIn == Utils.LinkType.Entry && ValidateEntry(inNode, inName))
                    {
                        return(ValidateLinkResult.Ok);
                    }
                }
            }

            break;

            case LinkType.Variable:
            {
                if (ValidateVariable(outNode, outName))
                {
                    if (linkIn == Utils.LinkType.Variable && ValidateVariable(inNode, inName))
                    {
                        if (ValidateVariableTypes(outNode, outName, inNode, inName))
                        {
                            return(ValidateLinkResult.Ok);
                        }
                        else
                        {
                            EB.Debug.LogWarning("Invalid Variable Type: " + inName);
                            return(ValidateLinkResult.InvalidType);
                        }
                    }
                }
            }
            break;
            }

            return(ValidateLinkResult.InvalidLink);
        }
Esempio n. 48
0
        //按照深度优先的方式搜索所有节点
        private void DFS_Node(LinkType linkType, RawNode node, int[] visitedNodes, List <RawNode> nodeList)
        {
            visitedNodes[node.UrlId] = 1;
            nodeList.Add(node);

            for (int i = 0; i < NodeArray.Length; i++)
            {
                //访问该顶点互联的其他顶点(不能是vpx端点,且端点没被访问过)
                if ((NodeArray[i].Type != EndType.VPX) && (visitedNodes[NodeArray[i].UrlId] == 0))
                {
                    RawLink gLink = GetLinkValue(linkType, node.UrlId, i);
                    if (gLink != null)
                    {
                        DFS_Node(linkType, NodeArray[i], visitedNodes, nodeList);
                    }
                }
            }
        }
Esempio n. 49
0
        /// <summary>
        /// Gets host name of a URL/Email address.
        /// </summary>
        /// <param name="value"></param>
        /// <param name="type"></param>
        /// <returns></returns>
        internal static string GetHostName(this string value, LinkType type)
        {
            if (!string.IsNullOrEmpty(value))
            {
                if (type == LinkType.Url)
                {
                    var urlPartMatchRegex = new Regex(Constant.PartsOfAUrlRegexPattern, RegexOptions.IgnoreCase);
                    return(urlPartMatchRegex.Match(value).Groups["host"].Value);
                }
                else if (type == LinkType.Email)
                {
                    var mailAddress = new MailAddress(value);
                    return(mailAddress.Host);
                }
            }

            return("");
        }
        public void GetLinkTypeTest(string linkUri, bool isReceiver, LinkType expectedLinkType, IDictionary <string, string> expectedBoundVariables)
        {
            // Arrange
            var messageConverter       = Mock.Of <IMessageConverter <AmqpMessage> >();
            var twinMessageConverter   = Mock.Of <IMessageConverter <AmqpMessage> >();
            var methodMessageConverter = Mock.Of <IMessageConverter <AmqpMessage> >();
            var linkHandlerProvider    = new LinkHandlerProvider(messageConverter, twinMessageConverter, methodMessageConverter);

            var amqpLink = Mock.Of <IAmqpLink>(l => l.IsReceiver == isReceiver);
            var uri      = new Uri(linkUri);

            // Act
            (LinkType LinkType, IDictionary <string, string> BoundVariables)match = linkHandlerProvider.GetLinkType(amqpLink, uri);

            // Assert
            Assert.Equal(expectedLinkType, match.LinkType);
            Assert.Equal(expectedBoundVariables, match.BoundVariables);
        }
Esempio n. 51
0
        public static LinksCollection <U> Create <U>(
            string sourceId,
            string partitionId,
            EntityType sourceType,
            LinkType linkType,
            IEnumerable <U> links,
            int sequenceNumber = 0) where U : Entry
        {
            DefaultLinksCollection <U> result = new DefaultLinksCollection <U>();

            result.LinkType       = linkType;
            result.SourceId       = sourceId;
            result.SourceType     = sourceType;
            result.PartitionId    = partitionId;
            result.SequenceNumber = sequenceNumber;
            result.TargetEntities = new List <U>(links);
            return(result);
        }
        private void AddChannelNodeRelation(LinkType linkType,
                                            StructureEntity structureEntity,
                                            Entity entity)
        {
            var addedRelationName = _catalogCodeGenerator.GetRelationName(entity.Id, structureEntity.ParentId);

            if (_epiElementContainer.HasRelation(addedRelationName))
            {
                return;
            }

            var relationElement = _catalogElementFactory.CreateNodeEntryRelation(structureEntity.ParentId, structureEntity.EntityId, structureEntity.SortOrder);

            _epiElementContainer.AddRelation(relationElement, addedRelationName);

            IntegrationLogger.Write(LogLevel.Debug,
                                    $"Added Relation for Source {structureEntity.ParentId} and Target {structureEntity.EntityId} for LinkTypeId {linkType.Id}");
        }
Esempio n. 53
0
        public void OpenURL(string url, LinkType linkType)
        {
            if (Application.isEditor)
            {
                linkType = LinkType.WebView;
            }

            if (linkType == LinkType.WebView)
            {
                WebView.Load(url);
                WebView.Show();
            }
            else
            {
                //external authorisation
                Application.OpenURL(url);
            }
        }
        private void AddAssociationElements(LinkType linkType,
                                            StructureEntity structureEntity,
                                            string itemCode)
        {
            if (!IsAssociationLinkType(linkType))
            {
                return;
            }

            if (!_config.UseThreeLevelsInCommerce && _config.ItemsToSkus && structureEntity.IsItem())
            {
                AddItemToSkusAssociations(linkType, structureEntity, itemCode);
            }
            else
            {
                AddNormalAssociations(structureEntity);
            }
        }
Esempio n. 55
0
        /// <summary>
        /// Assign an available customer to a prefix.
        /// </summary>
        /// <param name="selectedPrefix">Prefix that availble customer will assign.</param>
        /// <param name="customerId">Selected prefix which customer data exists.</param>
        /// <param name="user">User that modifies this prefix.</param>
        /// <param name="link">Link type of prefix.</param>
        internal void AssignPrefix(string[] prefixes, long customerId, string user, LinkType link, LinkDirection dir)
        {
            var sub = context.NumberingPools.Find(customerId);
            var q   = context.NumberingPools.Where(x => prefixes.Contains(x.Prefix) && x.Status == NumberingStatus.Reserved).ToArray();

            foreach (var prefix in q)
            {
                prefix.Abb       = sub.Abb.ToUpper();
                prefix.Direction = dir;
                prefix.NormalizedSubscriberName = sub.NormalizedSubscriberName;
                prefix.SubscriberName           = sub.SubscriberName;
                prefix.Status     = NumberingStatus.Used;
                prefix.ModifiedOn = DateTime.Now;
                prefix.Username   = user;
                prefix.Link       = link;
            }
            context.SaveChanges();
        }
Esempio n. 56
0
        public static int DeleteLinkType(LinkType linkType)
        {
            int result;

            using (var conn = new SqlConnection(GetConnectionString()))
                using (var cmd = new SqlCommand("DeleteLinkType", conn)
                {
                    CommandType = CommandType.StoredProcedure
                })
                {
                    conn.Open();

                    cmd.Parameters.Add(new SqlParameter("@Id", linkType.Id));

                    result = cmd.ExecuteNonQuery();
                }
            return(result);
        }
        /// <summary>
        /// A LinkType is a relation if it represents a product-item, bundle, package or dynamic package in Episerver
        /// </summary>
        public bool IsRelation(LinkType linkType)
        {
            IntegrationLogger.Write(LogLevel.Debug, "SourceEntityTypeId is: " + linkType.SourceEntityTypeId);
            IntegrationLogger.Write(LogLevel.Debug, "TargetEntityTypeId is: " + linkType.TargetEntityTypeId);
            if (linkType.SourceEntityTypeId.Equals("Item") && linkType.TargetEntityTypeId.Equals("Item"))
            {
                return(false);
            }

            if ((_config.BundleEntityTypes.Contains(linkType.SourceEntityTypeId) && !_config.BundleEntityTypes.Contains(linkType.TargetEntityTypeId)) ||
                (_config.PackageEntityTypes.Contains(linkType.SourceEntityTypeId) && !_config.PackageEntityTypes.Contains(linkType.TargetEntityTypeId)) ||
                (_config.DynamicPackageEntityTypes.Contains(linkType.SourceEntityTypeId) && !_config.DynamicPackageEntityTypes.Contains(linkType.TargetEntityTypeId)))
            {
                return(true);
            }

            return(linkType.SourceEntityTypeId.Equals("Product") && linkType.TargetEntityTypeId.Equals("Item") && linkType.Index == FirstProductItemLinkType);
        }
Esempio n. 58
0
        public virtual List <ILink> GetLinks(
            IArtifact sourceArtifact,
            LinkType linkType)
        {
            string id;
            bool   idExtractionRslt = TryExtractArtifactId(sourceArtifact, out id);

            Debug.Assert(idExtractionRslt);

            int      workItemId             = int.Parse(id);
            WorkItem workItem               = m_migrationSource.WorkItemStore.WorkItemStore.GetWorkItem(workItemId);
            var      sourceArtifactWorkItem = new TfsMigrationWorkItem(m_migrationSource.WorkItemStore.Core, workItem);

            var perWorkItemlinkChangeGroups = new List <LinkChangeGroup>();

            ExtractLinkChangeActionsCallback(sourceArtifactWorkItem, perWorkItemlinkChangeGroups, null);

            var links = new List <ILink>();

            foreach (LinkChangeGroup group in perWorkItemlinkChangeGroups)
            {
                foreach (LinkChangeAction action in group.Actions)
                {
                    if (!action.Link.LinkType.ReferenceName.Equals(linkType.ReferenceName))
                    {
                        continue;
                    }

                    string mappedLinkType = m_linkTranslationService.LinkConfigurationLookupService.FindMappedLinkType(
                        m_configurationService.SourceId, action.Link.LinkType.ReferenceName);
                    if (!m_linkTranslationService.LinkTypeSupportedByOtherSide(mappedLinkType))
                    {
                        continue;
                    }

                    if (!links.Contains(action.Link))
                    {
                        links.Add(action.Link);
                    }
                }
            }

            return(links);
        }
Esempio n. 59
0
        public override string ConstructLink(LinkType linkType, object linkObject, ref string extras)
        {
            if (linkType == LinkType.Topic)
            {
                return(GetHtmlFilename(linkObject));
            }

            else if (linkType == LinkType.ExternalTopic)
            {
                string[] parameters = (string[])linkObject;
                string   filename   = Path.GetFileNameWithoutExtension(parameters[1]) + Constants.TopicOutputExtension;
                return(String.Format("../{0}/{1}", parameters[0], filename));
            }

            else // LinkType.Other
            {
                return((string)linkObject);
            }
        }
Esempio n. 60
0
 public TargetDirectory(string directory, XPathExpression urlExpression, XPathExpression textExpression, LinkType type)
 {
     if (directory == null)
     {
         throw new ArgumentNullException("directory");
     }
     if (urlExpression == null)
     {
         throw new ArgumentNullException("urlExpression");
     }
     if (textExpression == null)
     {
         throw new ArgumentNullException("textExpression");
     }
     this.directory      = directory;
     this.urlExpression  = urlExpression;
     this.textExpression = textExpression;
     this.type           = type;
 }